/**
 * Thai 2D3D Online VIP
 * Modern Dashboard Styles - Mobile First Design
 */

/* CSS Variables */
:root {
    /* Base Colors */
    --bg-dark: #0f0f14;
    --bg-card: #1a1a24;
    --bg-card-hover: #22222e;
    --bg-input: #14141c;
    --border-color: #2a2a3a;
    
    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #6a6a7a;
    
    /* Theme Colors */
    --admin-primary: #dc2626;
    --admin-gradient: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    
    --seller-primary: #059669;
    --seller-gradient: linear-gradient(135deg, #059669 0%, #047857 100%);
    
    --user-primary: #7c3aed;
    --user-gradient: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
    
    /* Status Colors */
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    /* Spacing - Mobile First */
    --sidebar-width: 260px;
    --header-height: 60px;
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Theme-specific accent colors */
.admin-theme { --accent-color: var(--admin-primary); --accent-gradient: var(--admin-gradient); }
.seller-theme { --accent-color: var(--seller-primary); --accent-gradient: var(--seller-gradient); }
.user-theme { --accent-color: var(--user-primary); --accent-gradient: var(--user-gradient); }

/* ==================== LOGIN PAGE ==================== */
.login-page {
    min-height: 100vh;
    min-height: -webkit-fill-available;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    position: relative;
    overflow: hidden;
}

.login-background {
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(circle at 30% 20%, rgba(var(--accent-color), 0.15) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(var(--accent-color), 0.1) 0%, transparent 40%),
        var(--bg-dark);
    z-index: 0;
}

.bg-shapes {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: var(--accent-gradient);
    opacity: 0.05;
    animation: float 20s infinite ease-in-out;
}

.shape-1 {
    width: 300px;
    height: 300px;
    top: -80px;
    left: -80px;
    animation-delay: 0s;
}

.shape-2 {
    width: 200px;
    height: 200px;
    bottom: -40px;
    right: -40px;
    animation-delay: -7s;
}

.shape-3 {
    width: 150px;
    height: 150px;
    top: 50%;
    left: 50%;
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(20px, -20px) scale(1.05); }
    50% { transform: translate(-15px, 15px) scale(0.95); }
    75% { transform: translate(10px, 10px) scale(1.02); }
}

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 380px;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 28px 24px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
}

.login-header {
    text-align: center;
    margin-bottom: 24px;
}

.logo-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    font-size: 28px;
    color: white;
    background: var(--accent-gradient);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.login-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-group label i {
    font-size: 0.75rem;
    opacity: 0.7;
}

.form-group input,
.form-select {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    font-size: 1rem;
    color: var(--text-primary);
    font-family: inherit;
    transition: var(--transition-fast);
    -webkit-appearance: none;
}

.form-group input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(var(--accent-color), 0.1);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group input.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.password-input {
    position: relative;
}

.password-input input {
    width: 100%;
    padding-right: 46px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    transition: var(--transition-fast);
}

.toggle-password:hover {
    color: var(--text-secondary);
}

.form-hint {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.required {
    color: var(--danger);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.btn-block {
    width: 100%;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.login-footer p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Alerts */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.alert i {
    margin-top: 2px;
    flex-shrink: 0;
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.alert-success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
}

/* ==================== DASHBOARD ==================== */
.dashboard-container {
    display: flex;
    min-height: 100vh;
    min-height: -webkit-fill-available;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    height: -webkit-fill-available;
    z-index: 1000;
    transition: transform var(--transition-normal);
    transform: translateX(-100%);
}

.sidebar.active {
    transform: translateX(0);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 600;
}

.logo i {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    color: white;
    font-size: 0.9rem;
}

.sidebar-nav {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: var(--transition-fast);
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.nav-item:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-gradient);
    color: white;
    box-shadow: var(--shadow-sm);
}

.nav-item i {
    width: 18px;
    text-align: center;
    font-size: 0.9rem;
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    font-size: 0.85rem;
}

.user-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-name {
    font-weight: 500;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.logout-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.25);
}

/* Main Content */
.main-content {
    flex: 1;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.content-header {
    height: var(--header-height);
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 12px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.menu-toggle {
    display: flex;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.menu-toggle:active {
    background: var(--bg-card-hover);
}

.content-header h1 {
    font-size: 1.15rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.header-right .btn {
    padding: 10px 14px;
    font-size: 0.8rem;
}

.header-right .btn span {
    display: none;
}

.date-display {
    display: none;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.content-body {
    flex: 1;
    padding: 16px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: var(--transition-fast);
}

.stat-card:hover {
    border-color: var(--accent-color);
}

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: white;
}

.stat-icon.sellers { background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%); }
.stat-icon.active-sellers { background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%); }
.stat-icon.users { background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%); }
.stat-icon.active-users { background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%); }
.stat-icon.balance { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }

.stat-info h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.stat-info p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Section Card */
.section-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    overflow: hidden;
}

.section-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.section-header h2 {
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.section-header h2 i {
    color: var(--accent-color);
    font-size: 0.9rem;
}

.view-all {
    font-size: 0.8rem;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.view-all:hover {
    gap: 8px;
}

/* Quick Actions */
.quick-actions {
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.action-btn:hover,
.action-btn:active {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
}

.action-btn i {
    font-size: 1.3rem;
}

.action-btn span {
    font-size: 0.8rem;
    font-weight: 500;
    text-align: center;
}

/* Data Table - Mobile Optimized */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.data-table th,
.data-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: var(--bg-input);
    white-space: nowrap;
}

.data-table td {
    font-size: 0.85rem;
}

.data-table tbody tr:hover {
    background: var(--bg-card-hover);
}

.data-table tbody tr:active {
    background: var(--bg-input);
}

.data-table code {
    background: var(--bg-input);
    padding: 3px 6px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-family: 'SF Mono', 'Consolas', monospace;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 500;
    white-space: nowrap;
}

.status-badge.active {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.status-badge.inactive {
    background: rgba(156, 163, 175, 0.15);
    color: #9ca3af;
}

.status-badge.suspended {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 500;
    background: var(--bg-input);
    color: var(--text-secondary);
    white-space: nowrap;
}

.badge.admin { background: rgba(220, 38, 38, 0.15); color: #f87171; }
.badge.seller { background: rgba(5, 150, 105, 0.15); color: #34d399; }
.badge.user { background: rgba(124, 58, 237, 0.15); color: #a78bfa; }

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    font-size: 0.85rem;
}

.btn-icon.edit {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.btn-icon.edit:hover, .btn-icon.edit:active {
    background: rgba(59, 130, 246, 0.25);
}

.btn-icon.info {
    background: rgba(6, 182, 212, 0.15);
    color: #22d3ee;
}

.btn-icon.info:hover, .btn-icon.info:active {
    background: rgba(6, 182, 212, 0.25);
}

.btn-icon.success {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.btn-icon.success:hover, .btn-icon.success:active {
    background: rgba(34, 197, 94, 0.25);
}

.btn-icon.warning {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.btn-icon.warning:hover, .btn-icon.warning:active {
    background: rgba(245, 158, 11, 0.25);
}

.btn-icon.danger {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.btn-icon.danger:hover, .btn-icon.danger:active {
    background: rgba(239, 68, 68, 0.25);
}

/* Form Grid */
.form-grid {
    padding: 16px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: 14px;
}

.form-row:last-child {
    margin-bottom: 0;
}

.form-actions {
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    margin-top: 20px;
}

.form-actions .btn {
    width: 100%;
}

/* Welcome Card */
.welcome-card {
    background: var(--accent-gradient);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    color: white;
}

.welcome-content h2 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.welcome-content p {
    opacity: 0.9;
    font-size: 0.85rem;
}

.welcome-icon {
    font-size: 2rem;
    opacity: 0.5;
}

/* Balance Card */
.balance-card-large {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    text-align: center;
    margin-bottom: 16px;
}

.balance-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.balance-header i {
    color: var(--accent-color);
    font-size: 1.1rem;
}

.balance-amount-large {
    font-size: 2.2rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}

.balance-info {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.seller-info {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    color: var(--text-secondary);
}

/* Info Grid */
.info-grid {
    padding: 16px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.info-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-color);
    flex-shrink: 0;
    font-size: 0.9rem;
}

.info-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.info-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Profile Card */
.profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
}

.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.profile-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.75rem;
}

.profile-info h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.profile-info p {
    color: var(--text-muted);
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.profile-balance {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
}

.balance-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.balance-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
}

/* User Balance Info */
.user-balance-info {
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.balance-display {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: center;
}

.balance-display .balance-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.balance-display .balance-amount {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-color);
}

.user-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.user-meta p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ==================== TABLET (768px+) ==================== */
@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
    
    .login-card {
        padding: 36px 32px;
    }
    
    .logo-icon {
        width: 80px;
        height: 80px;
        font-size: 32px;
    }
    
    .content-header {
        padding: 0 24px;
    }
    
    .content-header h1 {
        font-size: 1.35rem;
    }
    
    .header-right .btn span {
        display: inline;
    }
    
    .content-body {
        padding: 24px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .stat-card {
        flex-direction: row;
        align-items: center;
        padding: 20px;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .stat-info h3 {
        font-size: 1.5rem;
    }
    
    .quick-actions {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .form-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .form-actions {
        flex-direction: row;
        justify-content: flex-end;
    }
    
    .form-actions .btn {
        width: auto;
    }
    
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .profile-header {
        flex-direction: row;
        text-align: left;
    }
    
    .profile-balance {
        flex-direction: row;
        justify-content: space-between;
    }
    
    .user-balance-info {
        flex-direction: row;
        align-items: center;
    }
    
    .balance-display {
        text-align: left;
    }
}

/* ==================== DESKTOP (1024px+) ==================== */
@media (min-width: 1024px) {
    .sidebar {
        transform: translateX(0);
    }
    
    .sidebar-overlay {
        display: none !important;
    }
    
    .main-content {
        margin-left: var(--sidebar-width);
    }
    
    .menu-toggle {
        display: none;
    }
    
    .content-header {
        padding: 0 32px;
        height: 70px;
    }
    
    .content-header h1 {
        font-size: 1.5rem;
    }
    
    .date-display {
        display: flex;
    }
    
    .content-body {
        padding: 32px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
        margin-bottom: 28px;
    }
    
    .stat-card {
        padding: 24px;
    }
    
    .stat-icon {
        width: 56px;
        height: 56px;
        font-size: 1.5rem;
    }
    
    .stat-info h3 {
        font-size: 1.75rem;
    }
    
    .section-header {
        padding: 18px 24px;
    }
    
    .section-header h2 {
        font-size: 1.05rem;
    }
    
    .quick-actions {
        padding: 24px;
        display: flex;
        flex-wrap: wrap;
    }
    
    .action-btn {
        padding: 24px 32px;
    }
    
    .form-grid {
        padding: 24px;
    }
    
    .info-grid {
        padding: 24px;
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .balance-card-large {
        padding: 32px;
    }
    
    .balance-amount-large {
        font-size: 3rem;
    }
}

/* ==================== LARGE DESKTOP (1280px+) ==================== */
@media (min-width: 1280px) {
    .info-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ==================== SAFE AREA (iPhone X+) ==================== */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .sidebar-footer {
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }
    
    .content-body {
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }
}

/* ==================== TOUCH OPTIMIZATIONS ==================== */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
    }
    
    .nav-item {
        min-height: 48px;
    }
    
    .btn-icon {
        min-width: 36px;
        min-height: 36px;
    }
    
    .form-group input,
    .form-select {
        min-height: 48px;
    }
}

/* ==================== MOBILE LIST VIEW ==================== */
.mobile-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.desktop-only {
    display: none;
}

.list-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
}

.list-item-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.list-item-info {
    min-width: 0;
    flex: 1;
}

.list-item-name {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.list-item-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.list-item-stats {
    display: flex;
    gap: 16px;
    padding: 10px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 10px;
}

.mini-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.mini-stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-color);
}

.mini-stat-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.list-item-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.action-btn-sm {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: var(--transition-fast);
}

.action-btn-sm.edit {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.action-btn-sm.success {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.action-btn-sm.warning {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.action-btn-sm.danger {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.empty-state i {
    font-size: 2.5rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-size: 0.9rem;
}

/* Desktop View */
@media (min-width: 768px) {
    .mobile-list {
        display: none;
    }
    
    .desktop-only {
        display: block;
    }
}

/* ==================== PRINT ==================== */
@media print {
    .sidebar,
    .menu-toggle,
    .header-right,
    .action-buttons,
    .quick-actions,
    .form-actions,
    .mobile-cards {
        display: none !important;
    }
    
    .desktop-table {
        display: block !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .content-body {
        padding: 0 !important;
    }
}
