/* ============================================================
   DGmoe POS - Main Stylesheet
   Responsive-first, consolidated
   Optimized for: Desktop, Tablet, Mobile, XAMPP, Hosting, Subdomain
   ============================================================ */

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
    /* LIGHT MODE (DEFAULT) */
    --bg-dark: #f0f2f5;
    --bg-panel: #ffffff;
    --gold-primary: #b8860b;
    --gold-hover: #996515;
    --gold-light: rgba(184, 134, 11, 0.1);
    --border-glass: rgba(0, 0, 0, 0.1);
    --border-gold: rgba(184, 134, 11, 0.3);
    --text-main: #1f2937;
    --text-muted: #4b5563;
    --danger-text: #dc2626;
    --success-text: #059669;
    --warning-text: #d97706;
    --danger: #ef4444;       
    --success: #10b981;      
    --sidebar-bg: rgba(255, 255, 255, 0.98);
    --topbar-bg: rgba(255, 255, 255, 0.85);
    --table-header: rgba(0, 0, 0, 0.05);
    --table-hover: rgba(0, 0, 0, 0.03);
    --input-bg: #ffffff;
    --input-focus-bg: #f9fafb;
    --btn-glass-bg: rgba(0, 0, 0, 0.03);
    --btn-glass-hover: rgba(0, 0, 0, 0.08);
    --panel-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    --sidebar-shadow: 2px 0 15px rgba(0, 0, 0, 0.05);
    --sidebar-width: 270px;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body.dark-mode {
    /* DARK MODE */
    --bg-dark: #0f1115;
    --bg-panel: #13151a;
    --gold-primary: #d4af37;
    --gold-hover: #b8962e;
    --gold-light: rgba(212, 175, 55, 0.15);
    --text-main: #ffffff;
    --text-muted: #9ca3af;
    --danger-text: #fca5a5;
    --success-text: #34d399;
    --warning-text: #fbbf24;
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-gold: rgba(212, 175, 55, 0.2);
    --sidebar-bg: rgba(15, 17, 21, 0.98);
    --topbar-bg: rgba(15, 17, 21, 0.7);
    --table-header: rgba(0, 0, 0, 0.3);
    --table-hover: rgba(255, 255, 255, 0.03);
    --input-bg: rgba(0, 0, 0, 0.4);
    --input-focus-bg: rgba(0, 0, 0, 0.5);
    --btn-glass-bg: rgba(255, 255, 255, 0.05);
    --btn-glass-hover: rgba(255, 255, 255, 0.1);
    --panel-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    --sidebar-shadow: 2px 0 20px rgba(0, 0, 0, 0.4);
}

/* ── Reset ─────────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* ── Typography ────────────────────────────────────────────── */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-main);
    font-weight: 500;
}

a {
    color: var(--gold-primary);
    text-decoration: none;
    transition: 0.3s;
}

a:hover {
    color: var(--gold-hover);
}

.text-gold {
    color: var(--gold-primary);
}

.text-danger {
    color: var(--danger);
}

.text-success {
    color: var(--success);
}

/* ── Glassmorphism Panel ───────────────────────────────────── */
.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    box-shadow: var(--panel-shadow);
}

.glass-panel-gold {
    border: 1px solid var(--border-gold);
    box-shadow: 0 8px 32px 0 rgba(212, 175, 55, 0.08);
}

/* ── Form Controls ─────────────────────────────────────────── */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    background: var(--input-bg);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s;
}

/* Base style untuk dropdown option agar solid, tidak tembus pandang (mencegah bentrok OS default putih) */
select.form-control option {
    background-color: var(--bg-panel);
    color: var(--text-main);
}


.form-control:focus {
    outline: none;
    border-color: var(--gold-primary);
    box-shadow: 0 0 10px var(--border-gold);
    background: var(--input-focus-bg);
}

/* Fix Date Picker Icon Color in Dark Mode */
body.dark-mode input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(1.5);
    cursor: pointer;
    opacity: 0.8;
}
body.dark-mode input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0.7rem 1.4rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 0.9rem;
    text-align: center;
    white-space: nowrap;
}

.btn-gold {
    background: linear-gradient(135deg, #d4af37 0%, #a6841b 100%);
    color: #111;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2);
}

.btn-gold:hover {
    background: linear-gradient(135deg, #eadd89 0%, #b4952e 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.3);
}

.btn-glass {
    background: var(--btn-glass-bg);
    color: var(--text-main);
    border: 1px solid var(--border-glass);
}

.btn-glass:hover {
    background: var(--btn-glass-hover);
}

.btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.82rem;
}

/* ── Alert Boxes ───────────────────────────────────────────── */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger-text);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success-text);
}

/* ── Badges ────────────────────────────────────────────────── */
.badge {
    padding: 0.35rem 0.75rem;
    border-radius: 50px;
    font-size: 0.73rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-text);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning-text);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-text);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ── App Layout Wrapper ────────────────────────────────────────── */
.wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    height: 100vh; /* fallback */
    height: 100dvh;
    flex-shrink: 0;
    z-index: 200;
    box-shadow: var(--sidebar-shadow);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: sidebarFadeIn 0.5s ease forwards;
}

/* ── Sidebar Collapsed (Desktop) ───────────────────────────── */
.sidebar.collapsed {
    width: 80px;
    min-width: 80px;
}

.sidebar.collapsed .sidebar-header h2 {
    font-size: 0;
}

.sidebar.collapsed .sidebar-header h2 span {
    display: none;
}

.sidebar.collapsed .menu-item span {
    display: none;
}

.sidebar.collapsed .sidebar-heading {
    display: none !important;
}

.sidebar.collapsed .menu-item {
    font-size: 0;
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

.sidebar.collapsed .menu-item i {
    font-size: 1.2rem;
    margin: 0;
}

.sidebar.collapsed .menu-item.active {
    padding-left: 0;
    border-left: none;
    border-bottom: 3px solid var(--gold-primary);
    border-radius: 8px;
}

.sidebar.collapsed .btn {
    font-size: 0;
    padding: 0.78rem 0;
}

.sidebar.collapsed .btn i {
    font-size: 1.2rem;
    margin: 0 !important;
}

.sidebar-footer {
    padding: 1.5rem 1.4rem;
}

.sidebar.collapsed .sidebar-footer {
    padding: 1.5rem 0.8rem;
}

.btn-logout {
    width: 100%;
    border-color: rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    justify-content: center;
}

.btn-logout i {
    margin-right: 8px;
}

.sidebar.collapsed .btn-logout span {
    display: none;
}

@keyframes sidebarFadeIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.sidebar-header {
    padding: 1.6rem 1.4rem 1.2rem;
    text-align: center;
    border-bottom: 1px solid var(--border-glass);
    flex-shrink: 0;
}

.sidebar-header h2 {
    color: var(--gold-primary);
    letter-spacing: 1.5px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.sidebar-header img {
    max-width: 36px;
    max-height: 36px;
    border-radius: 6px;
}

.sidebar-menu {
    flex: 1 1 0%;
    min-height: 0;
    overflow-y: auto;
    padding: 1.2rem 0;
    scrollbar-width: thin;
    scrollbar-color: var(--border-glass) transparent;
}

.sidebar-menu::-webkit-scrollbar {
    width: 4px;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: var(--border-glass);
    border-radius: 4px;
}

.menu-item {
    padding: 0.78rem 1.4rem;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    transition: all 0.25s;
    text-decoration: none;
    font-size: 0.93rem;
    margin: 0 0.6rem 0.1rem;
    border-radius: 8px;
}

.menu-item i {
    width: 22px;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.menu-item:hover {
    color: var(--gold-primary);
    background: var(--gold-light);
}

.menu-item.active {
    background: var(--gold-light);
    color: var(--gold-primary);
    border-left: 3px solid var(--gold-primary);
    padding-left: calc(1.4rem - 3px);
}

/* ── Sidebar Overlay (mobile backdrop) ─────────────────────── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 150;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    animation: overlayIn 0.25s ease;
}

.sidebar-overlay.active {
    display: block;
}

@keyframes overlayIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ── Main Content Area ─────────────────────────────────────────── */
.main-content {
    display: flex;
    flex-direction: column;
    background: var(--bg-dark);
    flex: 1;
    min-width: 0;
    height: 100vh;
    overflow: hidden;
    animation: mainFadeIn 0.5s ease forwards;
}

@keyframes mainFadeIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Topbar ────────────────────────────────────────────────── */
.topbar {
    height: 68px;
    padding: 0 1.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--topbar-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-glass);
    position: sticky;
    top: 0;
    z-index: 10;
    gap: 1rem;
    flex-shrink: 0;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

/* Hamburger toggle — visible on all devices now */
.sidebar-toggle {
    display: flex;
    background: transparent;
    border: 1px solid var(--border-gold);
    color: var(--gold-primary);
    width: 38px;
    height: 38px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
    margin: 0;
    padding: 0;
}

.sidebar-toggle:hover {
    background: var(--gold-light);
}

.topbar-date {
    font-size: 0.9rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.user-meta {
    text-align: right;
    line-height: 1.3;
}

.user-meta .user-name {
    font-weight: 500;
    color: var(--text-main);
    font-size: 0.9rem;
    white-space: nowrap;
}

.user-meta .user-role {
    font-size: 0.72rem;
    color: var(--gold-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d4af37 0%, #a6841b 100%);
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.3);
    flex-shrink: 0;
    margin: 0;
    padding: 0;
}

/* ── Content Area (scrollable body) ───────────────────────── */
.content-area {
    padding: 1rem;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
}

.content-area::-webkit-scrollbar {
    width: 6px;
}

.content-area::-webkit-scrollbar-thumb {
    background: var(--border-glass);
    border-radius: 4px;
}

/* ── Page Header ───────────────────────────────────────────── */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-title {
    font-size: 1.6rem;
    font-weight: 600;
}

/* ── Dashboard Card Grid ───────────────────────────────────── */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    padding: 1.6rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    border: none;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
}

/* ── Tables ────────────────────────────────────────────────── */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: 8px;
    -webkit-overflow-scrolling: touch;
}

.lux-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 480px;
}

.lux-table th,
.lux-table td {
    padding: 1rem 1.1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-glass);
    color: var(--text-main);
    white-space: nowrap;
}

.lux-table th {
    color: var(--gold-primary);
    font-weight: 500;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: var(--table-header);
    white-space: nowrap;
}

.lux-table tbody tr {
    transition: background 0.2s;
}

.lux-table tbody tr:hover {
    background: var(--table-hover);
}

/* ── Login / Register Page ─────────────────────────────────── */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 0%, #f9fafb 0%, #e5e7eb 100%);
    padding: 0; /* Fullscreen edge-to-edge */
}

body.dark-mode .login-container {
    background: radial-gradient(circle at 50% 0%, #1e222a 0%, #0f1115 100%);
}

.login-box {
    width: 100%;
    min-height: 100vh !important;
    max-width: none !important;
    border-radius: 0 !important;
    border: none;
    box-shadow: none;
    padding: 2rem;
    animation: mainFadeIn 0.5s ease forwards;
    background: transparent !important; /* Let container background fill the screen */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.login-box > form,
.login-box > div,
.login-logo {
    width: 100%;
    max-width: 430px; /* Keep the form neat in the center of the giant screen */
    margin-left: auto;
    margin-right: auto;
}

.login-logo {
    text-align: center;
    margin-bottom: 1.25rem;
}

.login-logo h1 {
    font-size: 2.2rem;
    letter-spacing: 2px;
    color: var(--gold-primary);
    text-transform: uppercase;
}

.login-logo p {
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-size: 0.9rem;
}


/* ============================================================
   RESPONSIVE BREAKPOINTS - Optimized for all devices
   ============================================================ */

/* ── Extra Large Desktop (≥ 1400px) ────────────────────────── */
@media (min-width: 1400px) {
    .content-area {
        padding: 1.25rem;
    }
    
    .card-grid {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        gap: 1.5rem;
    }
    
    .page-title {
        font-size: 1.8rem;
    }
    
    .lux-table th,
    .lux-table td {
        padding: 1.1rem 1.2rem;
    }
}

/* ── Large Desktop (≥ 1200px) ─────────────────────────────── */
@media (min-width: 1200px) and (max-width: 1399px) {
    .content-area {
        padding: 1.15rem;
    }
    
    .card-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }
}

/* ── Desktop (≥ 992px) ────────────────────────────────────── */
@media (min-width: 992px) and (max-width: 1199px) {
    .content-area {
        padding: 1rem;
    }
    
    .card-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1.25rem;
    }
    
    .sidebar {
        width: 250px;
        min-width: 250px;
    }
}

/* ── Tablet (768px - 991px) ─────────────────────────────── */
@media (max-width: 991px) {
    .wrapper {
        flex-direction: column;
    }
    
    .sidebar {
        position: fixed;
        transform: translateX(-100%);
        animation: none;
        width: 260px;
        min-width: 260px;
        top: 0;
        left: 0;
    }
    
    /* Main content takes full width */
    .main-content {
        margin-left: 0;
    }
    
    /* Show hamburger in topbar */
    .sidebar-toggle {
        display: flex !important;
    }
    
    /* Topbar adjustments */
    .topbar {
        padding: 0 1.2rem;
        height: 64px;
    }
    
    .topbar-date {
        font-size: 0.85rem;
    }
    
    .user-meta .user-name {
        font-size: 0.85rem;
    }
    
    /* Content area padding */
    .content-area {
        padding: 0.875rem;
    }
    
    /* Page title */
    .page-title {
        font-size: 1.4rem;
    }
    
    /* Card grid - 2 cols on tablet */
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.2rem;
    }
    
    .stat-card {
        padding: 1.4rem;
    }
    
    /* Section header */
    .section-header {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    /* Table adjustments */
    .lux-table th,
    .lux-table td {
        padding: 0.9rem 0.9rem;
        font-size: 0.9rem;
    }
}

/* ── Mobile Landscape & Small Tablet (576px - 767px) ─────── */
@media (max-width: 767px) {
    html {
        font-size: 15px;
    }
    
    .topbar {
        padding: 0 1rem;
        height: 60px;
    }
    
    .topbar-date {
        font-size: 0.8rem;
        max-width: 120px;
    }
    
    .user-meta .user-role {
        display: none;
    }
    
    .user-avatar {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }
    
    .content-area {
        padding: 0.75rem;
    }
    
    /* Page title */
    .page-title {
        font-size: 1.25rem;
    }
    
    /* Card grid - 2 cols on landscape mobile */
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1.2rem;
    }
    
    .stat-card h3 {
        font-size: 0.85rem !important;
    }
    
    .stat-card div {
        font-size: 1.8rem !important;
    }
    
    /* Section header */
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }
    
    .section-header .btn {
        width: auto;
    }
    
    /* Tables */
    .lux-table {
        min-width: 360px;
    }
    
    .lux-table th,
    .lux-table td {
        padding: 0.75rem 0.7rem;
        font-size: 0.85rem;
    }
    
    /* Forms - prevent zoom on iOS */
    .form-control {
        font-size: 16px;
        padding: 0.7rem 0.9rem;
    }
    
    .btn {
        font-size: 0.9rem;
        padding: 0.7rem 1.2rem;
        min-height: 44px; /* Touch-friendly */
    }
    
    /* Modal */
    .modal-content {
        margin: 0.5rem;
        max-height: 95vh;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }
}

/* ── Small Mobile (≤ 575px) ───────────────────────────────── */
@media (max-width: 575px) {
    html {
        font-size: 14px;
    }
    
    .topbar {
        padding: 0 0.75rem;
        height: 56px;
    }
    
    .topbar-date {
        display: none;
    }
    
    .user-meta {
        display: none;
    }
    
    .content-area {
        padding: 0.5rem;
    }
    
    /* Page title */
    .page-title {
        font-size: 1.15rem;
    }
    
    /* Card grid - single column */
    .card-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-card h3 {
        font-size: 0.8rem !important;
    }
    
    .stat-card div {
        font-size: 1.6rem !important;
    }
    
    .stat-card i {
        font-size: 3.5rem !important;
    }
    
    /* Section header */
    .section-header {
        margin-bottom: 1rem;
    }
    
    .section-header .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Tables */
    .table-responsive {
        border-radius: 6px;
        margin: 0 -0.25rem;
        width: calc(100% + 0.5rem);
    }
    
    .lux-table {
        min-width: 320px;
    }
    
    .lux-table th,
    .lux-table td {
        padding: 0.65rem 0.6rem;
        font-size: 0.8rem;
    }
    
    /* Glass panel */
    .glass-panel {
        padding: 0.875rem !important;
    }
    
    /* Forms */
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-control {
        font-size: 16px;
        padding: 0.65rem 0.8rem;
    }
    
    .btn {
        font-size: 0.85rem;
        padding: 0.65rem 1rem;
        min-height: 44px;
    }
    
    /* Modal - full screen on small mobile */
    .modal-content {
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
        height: 100%;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-footer {
        padding: 0.875rem 1rem;
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
    
    /* Pagination */
    .pagination {
        gap: 0.2rem;
    }
    
    .pagination a,
    .pagination span {
        padding: 0.35rem 0.6rem;
        font-size: 0.8rem;
    }
}

/* ── Extra Small Mobile (≤ 375px) ─────────────────────────── */
@media (max-width: 375px) {
    html {
        font-size: 13px;
    }
    
    .sidebar {
        width: 240px;
        min-width: 240px;
    }
    
    .sidebar-header h2 {
        font-size: 1.1rem;
    }
    
    .menu-item {
        padding: 0.7rem 1.1rem;
        font-size: 0.88rem;
        margin: 0 0.4rem 0.1rem;
    }
    
    .content-area {
        padding: 0.5rem;
    }
    
    .page-title {
        font-size: 1.1rem;
    }
    
    .stat-card div {
        font-size: 1.4rem !important;
    }
    
    .lux-table th,
    .lux-table td {
        padding: 0.55rem 0.5rem;
        font-size: 0.78rem;
    }
}

/* ── Login/Register Responsive ────────────────────────────── */
@media (max-width: 480px) {
    .login-container {
        align-items: flex-start;
        justify-content: flex-start;
        min-height: 100vh;
        padding: 0;
    }
    
    .login-box {
        max-width: 100% !important;
        width: 100%;
        min-height: 100vh !important;
        border-radius: 0 !important;
        box-shadow: none;
        padding: 1.5rem 1rem;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
    
    .login-logo h1 {
        font-size: 1.6rem;
    }
    
    .login-logo img {
        max-width: 60px;
        max-height: 60px;
    }
}

@media (max-width: 360px) {
    .login-box {
        padding: 0.75rem;
    }
    
    .login-logo h1 {
        font-size: 1.4rem;
    }
    
    .login-logo p {
        font-size: 0.85rem;
    }
}

/* ── Print Styles ───────────────────────────────────────────── */
@media print {
    .sidebar,
    .topbar,
    .sidebar-toggle,
    .sidebar-overlay,
    .btn {
        display: none !important;
    }
    
    .wrapper {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .content-area {
        padding: 0;
        overflow: visible;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .glass-panel {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ── Safe Area for Notch Phones ───────────────────────────── */
@supports (padding: max(0px)) {
    .topbar {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
    
    .content-area {
        padding-left: max(0.5rem, env(safe-area-inset-left));
        padding-right: max(0.5rem, env(safe-area-inset-right));
        padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
    }
}

/* ── Reduced Motion ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .sidebar {
        animation: none;
    }
    
    .main-content {
        animation: none;
    }
}