/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4a90e2;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --sidebar-bg: #2c3e50;
    --sidebar-text: #ecf0f1;
    --border-color: #dee2e6;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background-color: #f4f6f9;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 8px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: var(--primary-color);
    font-size: 28px;
    margin-bottom: 5px;
}

.login-header p {
    color: var(--secondary-color);
    font-size: 14px;
}

.login-form {
    margin-bottom: 20px;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.login-footer p {
    margin: 5px 0;
    font-size: 13px;
}

/* Layout */
.wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 210px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    padding: 15px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    font-size: 17px;
    margin-bottom: 4px;
}

.sidebar-header p {
    font-size: 12px;
    margin-bottom: 4px;
    opacity: 0.9;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    margin: 0;
}

.sidebar-nav li.nav-section {
    padding: 10px 14px 5px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.6;
    font-weight: 600;
    margin-top: 6px;
}

.sidebar-nav a {
    display: block;
    padding: 8px 14px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s;
}

.sidebar-nav a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    padding-left: 18px;
}

.sidebar-nav li.active a {
    background-color: var(--primary-color);
    border-left: 4px solid #fff;
}

/* Collapsible Navigation Groups */
.sidebar-nav .nav-group {
    margin: 0;
}

.sidebar-nav .nav-group-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}

.sidebar-nav .nav-group-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-nav .nav-group-toggle .chevron {
    transition: transform 0.3s;
    opacity: 0.7;
}

.sidebar-nav .nav-group.expanded .nav-group-toggle .chevron {
    transform: rotate(180deg);
}

.sidebar-nav .nav-group-items {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background-color: rgba(0, 0, 0, 0.1);
}

.sidebar-nav .nav-group-items li a {
    padding-left: 34px;
    font-size: 12px;
}

.sidebar-nav .nav-group-items li a:hover {
    padding-left: 38px;
}

.sidebar-nav .nav-group-items li.active a {
    background-color: var(--primary-color);
    border-left: 4px solid #fff;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.page-header h1 {
    font-size: 28px;
    color: var(--dark-color);
    margin: 0;
}

.page-actions {
    display: flex;
    gap: 10px;
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 15px 20px;
    background-color: var(--light-color);
    border-top: 1px solid var(--border-color);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--dark-color);
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.col-md-6 {
    flex: 0 0 50%;
}

.col-md-4 {
    flex: 0 0 33.333%;
}

.col-md-3 {
    flex: 0 0 25%;
}

.form-actions {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-info {
    background-color: var(--info-color);
    color: white;
}

.btn-warning {
    background-color: var(--warning-color);
    color: var(--dark-color);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    background-color: var(--light-color);
}

.table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--dark-color);
    border-bottom: 2px solid var(--border-color);
}

.table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

.table .actions {
    white-space: nowrap;
}

.table .actions .btn {
    margin-right: 5px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 12px;
    text-transform: capitalize;
}

.badge-admin {
    background-color: #e74c3c;
    color: white;
}

.badge-manager {
    background-color: #3498db;
    color: white;
}

.badge-staff {
    background-color: #95a5a6;
    color: white;
}

.badge-active {
    background-color: #27ae60;
    color: white;
}

.badge-inactive {
    background-color: #95a5a6;
    color: white;
}

.badge-paid {
    background-color: var(--success-color);
    color: white;
}

.badge-unpaid {
    background-color: var(--danger-color);
    color: white;
}

.badge-partial {
    background-color: var(--warning-color);
    color: var(--dark-color);
}

.badge-pending {
    background-color: var(--warning-color);
    color: var(--dark-color);
}

.badge-confirmed {
    background-color: var(--success-color);
    color: white;
}

.badge-cancelled {
    background-color: var(--danger-color);
    color: white;
}

.badge-available {
    background-color: var(--success-color);
    color: white;
}

.badge-sold {
    background-color: var(--danger-color);
    color: white;
}

.badge-reserved {
    background-color: var(--warning-color);
    color: var(--dark-color);
}

/* Alerts */
.alert {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 4px;
    border-left: 4px solid;
}

.alert ul {
    margin: 0;
    padding-left: 20px;
}

.alert-success {
    background-color: #d4edda;
    border-color: var(--success-color);
    color: #155724;
}

.alert-error {
    background-color: #f8d7da;
    border-color: var(--danger-color);
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: var(--warning-color);
    color: #856404;
}

.alert-info {
    background-color: #d1ecf1;
    border-color: var(--info-color);
    color: #0c5460;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.pagination a {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s;
}

.pagination a:hover {
    background-color: var(--primary-color);
    color: white;
}

.pagination a.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Search Form */
.search-form {
    display: flex;
    gap: 10px;
}

.search-form .form-control {
    flex: 1;
    max-width: 400px;
}

/* Dashboard */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    border-left: 4px solid var(--primary-color);
}

.stat-card h3 {
    font-size: 14px;
    color: var(--secondary-color);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .stat-value {
    font-size: 32px;
    font-weight: bold;
    color: var(--dark-color);
}

.stat-card.success {
    border-left-color: var(--success-color);
}

.stat-card.warning {
    border-left-color: var(--warning-color);
}

.stat-card.danger {
    border-left-color: var(--danger-color);
}

/* Utilities */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--secondary-color);
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* ========================================
   RESPONSIVE DESIGN (MOBILE FRIENDLY)
   EXCLUDES: POS Module (remains desktop only)
   ======================================== */

/* Hide mobile elements by default (desktop) */
.mobile-menu-toggle {
    display: none;
}

.sidebar-overlay {
    display: none;
}

/* Tablet and Mobile (max-width: 768px) */
@media (max-width: 768px) {
    /* Sidebar - Hamburger menu */
    .sidebar {
        width: 260px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    /* Mobile menu toggle button */
    .mobile-menu-toggle {
        display: block !important;
        position: fixed;
        top: 15px;
        left: 15px;
        z-index: 1001;
        background: var(--primary-color);
        color: white;
        border: none;
        padding: 10px 15px;
        border-radius: 5px;
        cursor: pointer;
        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    }

    /* Overlay for mobile menu */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .sidebar-overlay.active {
        display: block;
    }

    /* Main content adjustments */
    .main-content {
        margin-left: 0;
        padding: 70px 15px 20px;
        width: 100%;
    }

    /* Page header mobile */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .page-header h1 {
        font-size: 22px;
    }

    .page-actions {
        width: 100%;
        flex-direction: column;
    }

    .page-actions .btn {
        width: 100%;
        text-align: center;
    }

    /* Form layout mobile */
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .form-group {
        width: 100% !important;
        margin-right: 0 !important;
    }

    /* Tables - Horizontal scroll */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table {
        min-width: 600px;
        font-size: 13px;
    }

    .table th,
    .table td {
        padding: 10px 8px;
    }

    /* Stats grid mobile */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .stat-card {
        padding: 15px;
    }

    /* Cards mobile */
    .card {
        margin-bottom: 15px;
    }

    .card-header,
    .card-body {
        padding: 15px;
    }

    /* Filter section mobile */
    .filter-section {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
        margin-bottom: 10px;
    }

    /* Modal adjustments */
    .modal-content {
        width: 95%;
        max-width: 95%;
        margin: 20px auto;
        max-height: 90vh;
        overflow-y: auto;
    }

    /* Buttons mobile */
    .btn {
        padding: 10px 15px;
        font-size: 14px;
    }

    .btn-sm {
        padding: 6px 10px;
        font-size: 12px;
    }

    /* Tabs mobile */
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
    }

    .tab {
        white-space: nowrap;
    }

    /* Action buttons in tables */
    .action-buttons {
        display: flex;
        flex-direction: column;
        gap: 5px;
    }

    .action-buttons .btn-sm {
        width: 100%;
    }

    /* Dashboard adjustments */
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    /* Hide less important columns on mobile */
    .hide-mobile {
        display: none;
    }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
    body {
        font-size: 13px;
    }

    .main-content {
        padding: 60px 10px 15px;
    }

    .page-header h1 {
        font-size: 20px;
    }

    .card-header h2 {
        font-size: 18px;
    }

    .table {
        font-size: 12px;
    }

    .table th,
    .table td {
        padding: 8px 5px;
    }

    .form-group label {
        font-size: 13px;
    }

    .form-control {
        font-size: 14px;
        padding: 8px 12px;
    }

    .btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .modal-content {
        width: 98%;
        padding: 15px;
    }

    /* Stack stat card content vertically on very small screens */
    .stat-card {
        text-align: center;
    }

    .stat-card h3 {
        font-size: 22px;
    }
}

/* ========================================
   POS MODULE - DESKTOP ONLY
   Force POS to remain in desktop mode
   ======================================== */

/* POS pages excluded from mobile responsiveness */
.pos-page,
.pos-container,
body.pos-view {
    min-width: 1024px !important;
    overflow-x: auto !important;
}

/* POS specific elements */
@media (max-width: 768px) {
    .pos-page .sidebar,
    .pos-page .main-content,
    .pos-container {
        transform: none !important;
        width: auto !important;
        margin-left: 260px !important;
    }

    .pos-page .mobile-menu-toggle {
        display: none !important;
    }

    /* Show warning message for POS on mobile */
    .pos-mobile-warning {
        display: block !important;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        background: var(--warning-color);
        color: #000;
        padding: 10px;
        text-align: center;
        z-index: 9999;
        font-size: 13px;
        font-weight: 600;
    }
}

/* Landscape mode optimization for tablets */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        width: 200px;
    }

    .main-content {
        margin-left: 200px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-row {
        flex-wrap: wrap;
    }

    .form-group {
        flex: 1 1 calc(50% - 10px);
    }
}
