/* Printer View Toggle Buttons */

/* Redesigned Printer View Toggle Buttons */
.view-toggle-group {
    display: inline-flex;
    gap: 0.3em;
    margin-left: 1em;
    vertical-align: middle;
    background: var(--bg-tertiary);
    border-radius: 10px;
    box-shadow: var(--shadow-inset);
    padding: 0.15em 0.25em;
}
.view-toggle {
    display: flex;
    align-items: center;
    gap: 0.45em;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 1.08em;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.38em 1.1em 0.38em 0.9em;
    transition: background 0.16s, color 0.16s, box-shadow 0.16s, transform 0.13s;
    outline: none;
    position: relative;
}
.view-toggle .toggle-icon {
    font-size: 1.25em;
    display: flex;
    align-items: center;
    margin-right: 0.1em;
}
.view-toggle .toggle-label {
    font-size: 1em;
    font-weight: 500;
    letter-spacing: 0.01em;
}
.view-toggle.active, .view-toggle:hover, .view-toggle:focus {
    background: linear-gradient(90deg, var(--main-color) 70%, #60a5fa 100%);
    color: #fff;
    box-shadow: 0 2px 8px 0 var(--primary-glow);
    transform: translateY(-1px) scale(1.04);
}
.view-toggle.active .toggle-icon, .view-toggle:hover .toggle-icon, .view-toggle:focus .toggle-icon {
    color: #fff;
}
.view-toggle:not(.active) {
    background: transparent;
    color: var(--text-secondary);
    box-shadow: none;
    transform: none;
}
.view-toggle:active {
    transform: scale(0.98);
}

/* Printer Box/Card View */
#printersBoxView {
    margin-top: 1.2em;
}
.printer-box-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 1em 1.2em;
}
.printer-box {
    background: var(--card-bg);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 1.3em 1.5em 1.1em 1.5em;
    min-width: 360px;
    max-width: 560px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.55em;
    border: 1.5px solid var(--border-color);
    position: relative;
}
.printer-box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 0.2em;
}
.printer-box-name {
    color: var(--text-primary);
    font-weight: 700;
}
.printer-box-status {
    padding: 0.2em 0.7em;
    border-radius: 7px;
    font-size: 0.98em;
    font-weight: 600;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1.2px solid var(--border-color);
}
.printer-box-status.status-online {
    background: #10b98122;
    color: #10b981;
    border-color: #10b981;
}
.printer-box-status.status-warning {
    background: #f59e0b22;
    color: #f59e0b;
    border-color: #f59e0b;
}
.printer-box-status.status-offline {
    background: #ef444422;
    color: #ef4444;
    border-color: #ef4444;
}
.printer-box-meta {
    font-size: 0.98em;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 0.8em 1.2em;
    margin-bottom: 0.1em;
}
.printer-box-ip {
    font-weight: 500;
}
.printer-box-model {
    font-style: italic;
}
.printer-box-lastseen {
    font-size: 0.95em;
    color: var(--text-secondary);
}
.printer-box-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4em 0.5em;
    margin-top: 0.15em;
}
.printer-box-empty {
    color: var(--text-muted);
    font-size: 1.1em;
    padding: 2em 0;
    text-align: center;
}
/* Printer Table Action Buttons UI/UX */
.table-actions-uiux {
    display: flex;
    gap: 0.5em;
    align-items: center;
    justify-content: flex-start;
}
.action-btn {
    display: flex;
    align-items: center;
    gap: 0.3em;
    padding: 0.35em 0.8em;
    border: none;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 500;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    box-shadow: var(--shadow-inset);
    transition: background 0.18s, color 0.18s, box-shadow 0.18s, transform 0.12s;
    outline: none;
}
.action-btn .action-icon {
    font-size: 1.05em;
    display: flex;
    align-items: center;
}
.action-btn.metrics {
    background: linear-gradient(90deg, #1976d2 60%, #42a5f5 100%);
    color: #fff;
}
.action-btn.metrics:hover, .action-btn.metrics:focus {
    background: linear-gradient(90deg, #1565c0 60%, #1976d2 100%);
    color: #fff;
    transform: translateY(-2px) scale(1.04);
    box-shadow: var(--shadow-glow);
}
.action-btn.history {
    background: linear-gradient(90deg, #7c3aed 60%, #a78bfa 100%);
    color: #fff;
}
.action-btn.history:hover, .action-btn.history:focus {
    background: linear-gradient(90deg, #6d28d9 60%, #7c3aed 100%);
    color: #fff;
    transform: translateY(-2px) scale(1.04);
    box-shadow: var(--shadow-glow);
}
.action-btn.readings {
    background: linear-gradient(90deg, #f59e0b 60%, #fbbf24 100%);
    color: #fff;
}
.action-btn.readings:hover, .action-btn.readings:focus {
    background: linear-gradient(90deg, #d97706 60%, #f59e0b 100%);
    color: #fff;
    transform: translateY(-2px) scale(1.04);
    box-shadow: var(--shadow-glow);
}
.action-btn.delete {
    background: linear-gradient(90deg, #ef4444 60%, #f87171 100%);
    color: #fff;
}
.action-btn.delete:hover, .action-btn.delete:focus {
    background: linear-gradient(90deg, #b91c1c 60%, #ef4444 100%);
    color: #fff;
    transform: translateY(-2px) scale(1.04);
    box-shadow: var(--shadow-glow);
}
.action-btn .action-label {
    font-size: 0.95em;
    font-weight: 500;
    letter-spacing: 0.01em;
}

@media (max-width: 900px) {
    .printer-box-grid {
        grid-template-columns: 1fr;
    }
    .printer-box {
        min-width: 0;
        max-width: none;
    }
}
#printerAlertsList .alert {
    display: flex;
    align-items: flex-start;
    gap: 1em;
}
#printerAlertsList .alert-icon {
    font-size: 2em;
    margin-top: 0.1em;
    flex-shrink: 0;
}
#printerAlertsList .alert-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2em;
}
#printerAlertsList .alert-title {
    font-weight: 700;
    font-size: 1.1em;
    color: var(--text-primary);
}
#printerAlertsList .alert-type {
    font-size: 0.95em;
    font-weight: 600;
    color: var(--danger);
    margin-bottom: 0.1em;
}
#printerAlertsList .alert-warning .alert-type {
    color: var(--warning);
}
#printerAlertsList .alert-ok .alert-type {
    color: var(--success);
}
#printerAlertsList .alert-meta {
    font-size: 0.95em;
    color: var(--text-muted);
    margin-bottom: 0.1em;
}
#printerAlertsList .alert-meta-label {
    font-weight: 500;
    margin-right: 0.2em;
}
#printerAlertsList .alert-meta-value {
    margin-right: 0.7em;
}
#printerAlertsList .alert-desc {
    font-size: 0.98em;
    color: var(--text-secondary);
    margin-top: 0.1em;
}
/* Printer Status Widget Styles */
#printerStatusWidget .printer-status-grid {
    display: flex;
    gap: 1.5em;
    margin-bottom: 1em;
    flex-wrap: wrap;
}
#printerStatusWidget .stat-card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 1.2em 2em;
    display: flex;
    align-items: center;
    gap: 1em;
    min-width: 160px;
    flex: 1 1 160px;
}
#printerStatusWidget .stat-icon {
    font-size: 2.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5em;
    height: 2.5em;
}
#printerStatusWidget .stat-icon.blue { color: #1976d2; }
#printerStatusWidget .stat-icon.green { color: #10b981; }
#printerStatusWidget .stat-icon.orange { color: #f59e0b; }
#printerStatusWidget .stat-icon.red { color: #ef4444; }
#printerStatusWidget .stat-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
#printerStatusWidget .stat-value {
    font-size: 1.7em;
    font-weight: 700;
    color: var(--text-primary);
}
#printerStatusWidget .stat-label {
    font-size: 1em;
    color: var(--text-secondary);
}

/* Printer Alerts Widget Styles */
#printerAlertsWidget {
    margin-bottom: 1.5em;
}
#printerAlertsList {
    list-style: none;
    padding: 0;
    margin: 0;
}
#printerAlertsList .alert {
    padding: 1em 1.2em;
    border-radius: 8px;
    margin-bottom: 0.7em;
    font-size: 1.05em;
    background: var(--bg-tertiary);
    border-left: 5px solid var(--border-color);
    color: var(--text-primary);
    box-shadow: var(--shadow-inset);
}
#printerAlertsList .alert-offline {
    border-left-color: var(--danger);
    background: rgba(239, 68, 68, 0.08);
}
#printerAlertsList .alert-warning {
    border-left-color: var(--warning);
    background: rgba(245, 158, 11, 0.08);
}
#printerAlertsList .alert-ok {
    border-left-color: var(--success);
    background: rgba(16, 185, 129, 0.08);
}
#printerAlertsList .alert-none {
    border-left-color: var(--border-color);
    color: var(--text-muted);
    background: var(--bg-secondary);
}
/* assets/style.css */
/* Printora - Dark Professional Theme with Neumorphic Design */

:root {
    /* Dark Theme Colors */
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --primary-glow: rgba(59, 130, 246, 0.4);
    --secondary: #0f172a;
    --accent: #8b5cf6;
    --accent-glow: rgba(139, 92, 246, 0.4);
    
    /* Status Colors */
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.4);
    --warning: #f59e0b;
    --warning-glow: rgba(245, 158, 11, 0.4);
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.4);
    
    /* Alert Color Aliases */
    --alert-green: #10b981;
    --alert-yellow: #f59e0b;
    --alert-red: #ef4444;
    
    /* Dark Background Palette */
    --bg-color: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --card-bg: #1e293b;
    --card-bg-hover: #263548;
    
    /* Text Colors */
    --text-primary: #f1f5f9;
    --text-dark: #f1f5f9;
    --text-color: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Main/Brand Colors */
    --main-color: #3b82f6;
    --main-dark: #2563eb;
    
    /* Borders & Shadows */
    --border-color: #334155;
    --border-light: rgba(255, 255, 255, 0.1);
    --card-border: #334155;
    
    /* Form Input Colors */
    --input-bg: #1e293b;
    --input-border: #334155;
    
    /* Neumorphic Shadows */
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
    --shadow-inset: inset 4px 4px 8px rgba(0, 0, 0, 0.4), inset -4px -4px 8px rgba(255, 255, 255, 0.05);
    --shadow-raised: 6px 6px 12px rgba(0, 0, 0, 0.4), -6px -6px 12px rgba(255, 255, 255, 0.03);
    --shadow-glow: 0 0 20px var(--primary-glow);
    
    /* Radius */
    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 20px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition: 0.25s ease;
    --transition-slow: 0.4s ease;
}

/* ========== LIGHT THEME ========== */
[data-theme="light"] {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --primary-glow: rgba(59, 130, 246, 0.2);
    --secondary: #f8fafc;
    --accent: #8b5cf6;
    --accent-glow: rgba(139, 92, 246, 0.2);
    
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.2);
    --warning: #f59e0b;
    --warning-glow: rgba(245, 158, 11, 0.2);
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.2);
    
    /* Alert Color Aliases */
    --alert-green: #10b981;
    --alert-yellow: #f59e0b;
    --alert-red: #ef4444;
    
    --bg-color: #f1f5f9;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e2e8f0;
    --card-bg: #ffffff;
    --card-bg-hover: #f8fafc;
    
    --text-primary: #1e293b;
    --text-dark: #0f172a;
    --text-color: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    
    /* Main/Brand Colors */
    --main-color: #3b82f6;
    --main-dark: #2563eb;
    
    --border-color: #e2e8f0;
    --border-light: rgba(0, 0, 0, 0.08);
    --card-border: #e2e8f0;
    
    /* Form Input Colors */
    --input-bg: #ffffff;
    --input-border: #e2e8f0;
    
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-inset: inset 4px 4px 8px rgba(0, 0, 0, 0.05), inset -4px -4px 8px rgba(255, 255, 255, 0.8);
    --shadow-raised: 6px 6px 12px rgba(0, 0, 0, 0.08), -6px -6px 12px rgba(255, 255, 255, 0.9);
    --shadow-glow: 0 0 20px var(--primary-glow);
}

[data-theme="light"] header {
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    color: var(--text-dark);
    border-bottom: 1px solid var(--border-color);
}

[data-theme="light"] .logo,
[data-theme="light"] .logo a {
    color: var(--text-dark);
}

[data-theme="light"] nav a {
    color: var(--text-secondary);
}

[data-theme="light"] nav a:hover,
[data-theme="light"] nav a.active {
    color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

/* ========== THEME TOGGLE ========== */
.theme-toggle {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all var(--transition);
    margin-right: 0.5rem;
}

.theme-toggle:hover {
    background: var(--primary);
    transform: rotate(30deg);
}

.theme-icon-light { display: none; }
.theme-icon-dark { display: block; }

[data-theme="light"] .theme-icon-light { display: block; }
[data-theme="light"] .theme-icon-dark { display: none; }

.lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem;
    border-radius: 999px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    margin-right: 0.75rem;
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    cursor: pointer;
    letter-spacing: 0.4px;
}

.lang-btn.active {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 0 12px var(--primary-glow);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

.ambient-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.ambient-bg-enabled > *:not(.ambient-bg) {
    position: relative;
    z-index: 1;
}

.ambient-bg .float-icon {
    position: absolute;
    font-size: 2.5rem;
    opacity: 0.12;
    filter: blur(0.2px);
    --float-x: 12px;
    --float-y: 22px;
    animation: floaty 18s ease-in-out infinite;
}

.ambient-bg .float-icon[data-index="1"] { left: 6%; top: 16%; animation-duration: 22s; animation-delay: -6s; font-size: 2.9rem; opacity: 0.16; --float-x: 10px; --float-y: 24px; }
.ambient-bg .float-icon[data-index="2"] { left: 14%; top: 72%; animation-duration: 26s; animation-delay: -12s; font-size: 2.4rem; opacity: 0.1; --float-x: 14px; --float-y: 18px; }
.ambient-bg .float-icon[data-index="3"] { left: 36%; top: 10%; animation-duration: 20s; animation-delay: -8s; font-size: 3.1rem; opacity: 0.14; --float-x: 18px; --float-y: 26px; }
.ambient-bg .float-icon[data-index="4"] { left: 54%; top: 64%; animation-duration: 24s; animation-delay: -4s; font-size: 2.5rem; opacity: 0.12; --float-x: 12px; --float-y: 20px; }
.ambient-bg .float-icon[data-index="5"] { left: 76%; top: 20%; animation-duration: 28s; animation-delay: -10s; font-size: 2.7rem; opacity: 0.13; --float-x: 16px; --float-y: 22px; }
.ambient-bg .float-icon[data-index="6"] { left: 88%; top: 58%; animation-duration: 21s; animation-delay: -14s; font-size: 2.3rem; opacity: 0.1; --float-x: 14px; --float-y: 16px; }
.ambient-bg .float-icon[data-index="7"] { left: 24%; top: 44%; animation-duration: 19s; animation-delay: -2s; font-size: 2.6rem; opacity: 0.12; --float-x: 20px; --float-y: 24px; }
.ambient-bg .float-icon[data-index="8"] { left: 66%; top: 40%; animation-duration: 23s; animation-delay: -9s; font-size: 2.4rem; opacity: 0.1; --float-x: 12px; --float-y: 18px; }
.ambient-bg .float-icon[data-index="9"] { left: 8%; top: 48%; animation-duration: 27s; animation-delay: -16s; font-size: 2.8rem; opacity: 0.14; --float-x: 18px; --float-y: 26px; }
.ambient-bg .float-icon[data-index="10"] { left: 48%; top: 78%; animation-duration: 25s; animation-delay: -7s; font-size: 2.3rem; opacity: 0.11; --float-x: 10px; --float-y: 18px; }
.ambient-bg .float-icon[data-index="11"] { left: 62%; top: 14%; animation-duration: 29s; animation-delay: -11s; font-size: 3rem; opacity: 0.15; --float-x: 16px; --float-y: 28px; }
.ambient-bg .float-icon[data-index="12"] { left: 92%; top: 30%; animation-duration: 23s; animation-delay: -5s; font-size: 2.5rem; opacity: 0.12; --float-x: 14px; --float-y: 20px; }

@keyframes floaty {
    0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
    50% { transform: translate3d(var(--float-x), calc(var(--float-y) * -1), 0) rotate(4deg); }
}

/* ========== NAVIGATION - Dark Sleek Style ========== */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(180deg, var(--secondary), var(--bg-color));
    color: #fff;
    padding: 0 2rem;
    height: 70px;
    box-shadow: 
        var(--shadow-lg),
        0 1px 0 rgba(59, 130, 246, 0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #fff;
    text-decoration: none;
    min-width: 0;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
}

.logo span:last-child {
    background: linear-gradient(135deg, var(--text-primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo img,
.logo-image {
    max-height: 50px;
    max-width: 200px;
    height: auto;
    width: auto;
    object-fit: contain;
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    display: block;
}

nav {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    height: 100%;
}

nav a {
    color: var(--text-secondary);
    padding: 0.6rem 1rem;
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: all var(--transition);
    transform: translateX(-50%);
}

nav a:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.05);
}

nav a:hover::after {
    width: 60%;
}

nav a[style*="background"], nav a.active {
    color: #fff !important;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
    box-shadow: 0 0 15px var(--primary-glow);
}

nav a.active::after {
    width: 0;
}

.nav-user {
    color: var(--text-secondary);
    font-size: 0.875rem;
    padding: 0.5rem 1.25rem;
    border-right: 1px solid var(--border-color);
    margin-right: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-user .user-avatar {
    font-size: 1rem;
}

.nav-user .user-role {
    background: rgba(255,255,255,0.15);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-divider {
    width: 1px;
    height: 24px;
    background: rgba(255,255,255,0.15);
    margin: 0 0.5rem;
}

nav a .nav-icon {
    font-size: 1rem;
}

nav a .nav-text {
    font-size: 0.8125rem;
}

nav a.active {
    background: var(--primary) !important;
    color: #fff !important;
}

.nav-status {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.nav-status .status-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.nav-logout {
    color: #f87171 !important;
}

.nav-logout:hover {
    background: rgba(248, 113, 113, 0.15) !important;
}

/* Navigation Dropdown Menus */
.nav-dropdown {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.nav-dropdown-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.6rem 1rem;
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition);
    white-space: nowrap;
}

.nav-dropdown-btn:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.05);
}

.nav-dropdown.active .nav-dropdown-btn {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 0 15px var(--primary-glow);
}

.dropdown-arrow {
    font-size: 0.65rem;
    transition: transform 0.2s ease;
    opacity: 0.7;
}

.nav-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg), 0 8px 32px rgba(0,0,0,0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1001;
    padding: 0.5rem;
}

.nav-dropdown:hover .nav-dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-content a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.nav-dropdown-content a:hover {
    color: var(--text-primary);
    background: rgba(59, 130, 246, 0.15);
}

.nav-dropdown-content a.active {
    color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

.nav-dropdown-content a .nav-icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.nav-dropdown-content::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 20px;
    width: 12px;
    height: 12px;
    background: var(--card-bg);
    border-left: 1px solid var(--card-border);
    border-top: 1px solid var(--card-border);
    transform: rotate(45deg);
}

/* Navbar for alternate style */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--secondary);
    padding: 0 2rem;
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-brand {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-links a {
    color: #94a3b8;
    padding: 0.5rem 0.875rem;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.nav-links a:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.nav-links a.active {
    color: #fff;
    background: var(--primary);
}

/* ========== MAIN CONTENT ========== */
main {
    padding: 1.5rem 2rem;
    max-width: 1600px;
    margin: 0 auto;
    min-height: calc(100vh - 64px);
}

/* ========== TYPOGRAPHY ========== */
h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 0.5rem 0;
}

h2 {
    color: var(--text-dark);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

h2::before {
    content: '';
    width: 4px;
    height: 1.1em;
    background: var(--primary);
    border-radius: 2px;
}

h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
}

/* ========== CARDS - Dark Neumorphic Style ========== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-raised);
    border: 1px solid var(--border-color);
    transition: all var(--transition);
}

.card:hover {
    background: var(--card-bg-hover);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

/* ========== BUTTONS - Premium Neon Style ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.025em;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

/* Primary - Vibrant Blue/Purple */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    box-shadow: 
        0 4px 15px rgba(102, 126, 234, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    box-shadow: 
        0 6px 25px rgba(102, 126, 234, 0.5),
        0 0 30px rgba(118, 75, 162, 0.3);
    transform: translateY(-3px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

/* Secondary - Sleek Gray */
.btn-secondary {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #5a6878 0%, #3d4858 100%);
    color: #fff;
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.4),
        0 0 15px rgba(255, 255, 255, 0.05);
    transform: translateY(-3px);
}

/* Success - Fresh Green/Teal */
.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: #fff;
    box-shadow: 
        0 4px 15px rgba(56, 239, 125, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-success:hover {
    background: linear-gradient(135deg, #38ef7d 0%, #11998e 100%);
    box-shadow: 
        0 6px 25px rgba(56, 239, 125, 0.4),
        0 0 30px rgba(17, 153, 142, 0.3);
    transform: translateY(-3px);
}

/* Danger - Bold Red/Orange */
.btn-danger {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
    color: #fff;
    box-shadow: 
        0 4px 15px rgba(245, 87, 108, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 
        0 6px 25px rgba(245, 87, 108, 0.5),
        0 0 30px rgba(240, 147, 251, 0.3);
    transform: translateY(-3px);
}

/* Warning - Warm Orange/Yellow */
.btn-warning {
    background: linear-gradient(135deg, #f2994a 0%, #f2c94c 100%);
    color: #1a1a2e;
    box-shadow: 
        0 4px 15px rgba(242, 153, 74, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);
    font-weight: 700;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #f2c94c 0%, #f2994a 100%);
    box-shadow: 
        0 6px 25px rgba(242, 201, 76, 0.5),
        0 0 30px rgba(242, 153, 74, 0.3);
    transform: translateY(-3px);
}

/* Info - Electric Cyan */
.btn-info {
    background: linear-gradient(135deg, #00d2d3 0%, #54a0ff 100%);
    color: #fff;
    box-shadow: 
        0 4px 15px rgba(0, 210, 211, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-info:hover {
    background: linear-gradient(135deg, #54a0ff 0%, #00d2d3 100%);
    box-shadow: 
        0 6px 25px rgba(84, 160, 255, 0.5),
        0 0 30px rgba(0, 210, 211, 0.3);
    transform: translateY(-3px);
}

/* Ghost/Outline Button */
.btn-ghost {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
    box-shadow: none;
}

.btn-ghost:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #a78bfa;
    border-color: #a78bfa;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
    transform: translateY(-3px);
}

/* Dark Button */
.btn-dark {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.btn-dark:hover {
    background: linear-gradient(135deg, #16213e 0%, #0f3460 100%);
    box-shadow: 
        0 6px 25px rgba(0, 0, 0, 0.6),
        0 0 15px rgba(255, 255, 255, 0.05);
    transform: translateY(-3px);
}

/* Accent - Purple Glow */
.btn-accent {
    background: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
    color: #fff;
    box-shadow: 
        0 4px 15px rgba(168, 85, 247, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-accent:hover {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    box-shadow: 
        0 6px 25px rgba(168, 85, 247, 0.5),
        0 0 30px rgba(99, 102, 241, 0.3);
    transform: translateY(-3px);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-sm);
}

.btn-icon:hover {
    transform: translateY(-2px) scale(1.05);
}

/* Button Group */
.btn-group {
    display: flex;
    gap: 0.5rem;
}

/* ========== FORMS - Dark Neumorphic Style ========== */
input, select, textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all var(--transition);
    box-shadow: var(--shadow-inset);
}

input::placeholder, textarea::placeholder {
    color: var(--text-muted);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 
        var(--shadow-inset),
        0 0 0 3px var(--primary-glow);
}

input:hover:not(:focus), select:hover:not(:focus), textarea:hover:not(:focus) {
    border-color: var(--text-muted);
}

/* Custom Select Styling */
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
    cursor: pointer;
}

select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 0.5rem;
}

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    letter-spacing: 0.025em;
}

.form-group {
    margin-bottom: 1.25rem;
}

/* Checkbox & Radio - Custom Style */
input[type="checkbox"], input[type="radio"] {
    width: 18px;
    height: 18px;
    padding: 0;
    cursor: pointer;
    accent-color: var(--primary);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
    background: var(--bg-tertiary);
    border-radius: 13px;
    cursor: pointer;
    transition: background var(--transition);
    box-shadow: var(--shadow-inset);
}

.toggle-switch.active {
    background: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--text-primary);
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: transform var(--transition);
    box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
}

.toggle-switch.active::after {
    transform: translateX(24px);
}

/* ========== TABLES - Dark Theme ========== */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
}

th, td {
    padding: 1rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

th:first-child {
    border-radius: var(--radius-sm) 0 0 0;
}

th:last-child {
    border-radius: 0 var(--radius-sm) 0 0;
}

tr {
    transition: all var(--transition);
}

tbody tr:hover {
    background: var(--card-bg-hover);
}

.data-table {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.data-table th {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-light);
    border-bottom: 2px solid var(--primary);
}

/* Table Action Buttons */

.table-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
}

.table-actions .btn {
    min-width: 90px;
    font-size: 0.85rem;
    padding: 0.4rem 0.9rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.13s, box-shadow 0.13s;
}
.table-actions .btn:active {
    transform: scale(0.97);
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.table-actions .btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    color: #fff;
    border: none;
}
.table-actions .btn-primary:hover {
    background: linear-gradient(135deg, #6366f1 0%, #3b82f6 100%);
    box-shadow: 0 0 12px var(--primary-glow);
}
.table-actions .btn-danger {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    color: #fff;
    border: none;
}
.table-actions .btn-danger:hover {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    box-shadow: 0 0 12px var(--danger-glow);
}

.table-actions .btn-icon {
    width: 32px;
    height: 32px;
    font-size: 0.875rem;
}

/* ========== BADGES - Dark Glow Style ========== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    letter-spacing: 0.025em;
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
}

.badge-info {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

.badge-purple {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.3);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.2);
}

/* ========== STATS GRID - Dark Glassmorphism ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(145deg, var(--card-bg), var(--bg-tertiary));
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-raised);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0;
    transition: opacity var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg), 0 0 30px rgba(59, 130, 246, 0.1);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    flex-shrink: 0;
    box-shadow: var(--shadow-inset);
}

.stat-icon.blue { 
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}
.stat-icon.green { 
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.stat-icon.yellow { 
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}
.stat-icon.red { 
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.stat-icon.purple { 
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    font-weight: 500;
}

.stat-change {
    font-size: 0.8rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-change.positive { 
    color: var(--success);
}
.stat-change.negative { 
    color: var(--danger);
}


#alerts {
    margin-bottom: 1.5em;
}

.alert-box {
    padding: 1em 1.25em;
    border-radius: 10px;
    margin-bottom: 0.75em;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.75em;
    font-weight: 500;
    box-shadow: var(--shadow);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-box::before {
    content: '⚠';
    font-size: 1.2em;
}

.alert-box.red { 
    background: linear-gradient(135deg, #e53935, #c62828); 
}
.alert-box.red::before { content: '🔴'; }

.alert-box.yellow { 
    background: linear-gradient(135deg, #fdd835, #f9a825); 
    color: #333; 
}
.alert-box.yellow::before { content: '🟡'; }

.alert-box.green { 
    background: linear-gradient(135deg, #43a047, #2e7d32); 
}
.alert-box.green::before { content: '🟢'; }

/* Alert System Styles */
.alerts-section {
    background: var(--card-bg);
    padding: 1.5em;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 1.5em;
}

.alerts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1em;
    flex-wrap: wrap;
    gap: 1em;
}

.alerts-header h2 {
    margin: 0;
}

.alert-badge {
    background: var(--alert-red);
    color: #fff;
    font-size: 0.75em;
    padding: 0.2em 0.6em;
    border-radius: 10px;
    margin-left: 0.5em;
    font-weight: 600;
}

.alert-filters {
    display: flex;
    gap: 0.5em;
}

.alert-filter-btn {
    padding: 0.4em 0.8em;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all var(--transition);
    color: var(--text-secondary);
}

.alert-filter-btn:hover {
    border-color: var(--main-color);
}

.alert-filter-btn.active {
    background: var(--main-color);
    color: #fff;
    border-color: var(--main-color);
}

#alertsList {
    max-height: 400px;
    overflow-y: auto;
}

.alert-item {
    padding: 1em;
    border-radius: 8px;
    margin-bottom: 0.75em;
    border-left: 4px solid var(--border-color);
    background: var(--bg-tertiary);
    transition: all var(--transition);
}

.alert-item.unread {
    background: var(--card-bg);
    box-shadow: var(--shadow);
}

.alert-item.alert-critical {
    border-left-color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.alert-item.alert-warning {
    border-left-color: var(--warning);
    background: rgba(245, 158, 11, 0.1);
}

.alert-item.alert-info {
    border-left-color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

.alert-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5em;
}

.alert-level {
    font-weight: 600;
    font-size: 0.85em;
}

.alert-time {
    color: var(--text-muted);
    font-size: 0.8em;
}

.alert-body {
    margin-bottom: 0.5em;
}

.alert-actions {
    display: flex;
    gap: 0.5em;
}

.btn-sm {
    padding: 0.3em 0.6em;
    font-size: 0.8em;
    background: var(--main-color);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-sm:hover {
    background: var(--main-dark);
}

.resolved {
    color: var(--alert-green);
    font-size: 0.85em;
}

.no-alerts {
    text-align: center;
    padding: 2em;
    color: var(--text-muted);
}

/* Settings Tabs */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.5em;
}

.tab-btn {
    padding: 0.75em 1.5em;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.95em;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--main-color);
}

.tab-btn.active {
    color: var(--main-color);
    border-bottom-color: var(--main-color);
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1em;
    margin-bottom: 1em;
}

.form-group {
    margin-bottom: 1em;
}

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

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.65em 1em;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95em;
    transition: all var(--transition);
    background: var(--bg-secondary);
    color: var(--text-primary);
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--main-color);
}

.form-group small {
    display: block;
    margin-top: 0.3em;
    color: var(--text-muted);
    font-size: 0.8em;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75em;
    margin-top: 1.5em;
    padding-top: 1em;
    border-top: 1px solid var(--border-color);
}

.btn-secondary {
    background: #6c757d;
    color: #fff;
    padding: 0.65em 1.5em;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-right: 0.5em;
}

.btn-secondary:hover {
    background: #5a6268;
}

#printers {
    margin-bottom: 2em;
    background: var(--card-bg);
    padding: 1.75em;
    border-radius: var(--radius);
    box-shadow: var(--shadow-raised);
    border: 1px solid var(--border-color);
}

#printerFilter {
    padding: 0.75em 1.25em;
    width: 300px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95em;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all var(--transition);
    box-shadow: var(--shadow-inset);
}

#printerFilter:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--shadow-inset), 0 0 0 3px var(--primary-glow);
}

.printer-actions {
    display: flex;
    gap: 1em;
    margin-bottom: 1.5em;
    flex-wrap: wrap;
    align-items: center;
}

/* ---- Add Printer & Scan Network Modal Layout ---- */
.modal-add-printer,
.modal-scan-network {
    max-width: 520px;
    padding: 0;
    overflow: hidden;
}

.modal-icon-header {
    text-align: center;
    padding: 2em 2em 1.25em;
    background: linear-gradient(135deg, rgba(25,118,210,0.08), rgba(25,118,210,0.02));
    border-bottom: 1px solid var(--border-color);
}

.modal-icon-header .modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 0.75em;
}

.modal-icon-header .modal-icon.green {
    background: linear-gradient(135deg, rgba(76,175,80,0.18), rgba(76,175,80,0.06));
    box-shadow: 0 0 20px rgba(76,175,80,0.15);
}

.modal-icon-header .modal-icon.blue {
    background: linear-gradient(135deg, rgba(25,118,210,0.18), rgba(25,118,210,0.06));
    box-shadow: 0 0 20px rgba(25,118,210,0.15);
}

.modal-icon-header h2 {
    margin: 0 0 0.25em;
    font-size: 1.35rem;
}

.modal-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

.modal-form {
    padding: 1.5em 2em;
}

.modal-form .form-group {
    margin-bottom: 1.25em;
}

.modal-form .form-group label {
    display: block;
    margin-bottom: 0.35em;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    letter-spacing: 0.01em;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: stretch;
    width: 100%;
    margin-bottom: 0.2em;
}

.input-with-icon .input-icon {
    position: absolute;
    left: 0.85em;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.15rem;
    pointer-events: none;
    z-index: 1;
    color: var(--primary-light);
}

.input-with-icon input {
    width: 100%;
    min-width: 0;
    padding: 1em 1.2em 1em 2.8em; /* Increased left padding for icon */
    border: 1.5px solid var(--border-color);
    border-radius: 0.6em;
    font-size: 1.08em;
    background: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: var(--shadow-inset);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    outline: none;
    font-family: inherit;
    letter-spacing: 0.01em;
    position: relative;
    z-index: 2;
}

.input-with-icon input:focus {
    border-color: var(--primary);
    background: var(--bg-tertiary);
    box-shadow: var(--shadow-inset), 0 0 0 3px var(--primary-glow);
}

.form-hint {
    display: block;
    margin-top: 0.35em;
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 0.01em;
}

.modal-actions {
    display: flex;
    gap: 0.75em;
    justify-content: flex-end;
    padding: 1.25em 2em;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.modal-form + .modal-actions {
    padding-top: 0;
    border-top: none;
    background: none;
}

.modal-form .modal-actions {
    padding: 0;
    margin-top: 0.5em;
    border-top: none;
    background: none;
}

/* Scan Info Box */
.scan-info-box {
    margin: 1.25em 2em 0;
    padding: 1em 1.25em;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

.scan-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.35em 0;
}

.scan-info-row + .scan-info-row {
    border-top: 1px solid var(--border-color);
    margin-top: 0.35em;
    padding-top: 0.6em;
}

.scan-info-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.scan-info-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    background: var(--bg-tertiary);
    padding: 0.2em 0.6em;
    border-radius: 4px;
}

.scan-range-input {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    background: var(--bg-tertiary);
    padding: 0.4em 0.7em;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    width: 180px;
    text-align: center;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.scan-range-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.scan-range-hint {
    display: block;
    margin-top: 0.6em;
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Scan Status Box */
.scan-status-box {
    text-align: center;
    padding: 1.5em 2em;
    color: var(--text-muted);
}

.scan-status-box .scan-status-icon {
    font-size: 2rem;
    margin-bottom: 0.5em;
    opacity: 0.7;
}

.scan-status-box p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

.scan-status-box.scanning {
    color: var(--primary-light);
}

.scan-status-box.scanning .scan-status-icon {
    animation: pulse 1.5s infinite;
    opacity: 1;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.15); opacity: 1; }
}

.scan-status-box.scan-done {
    color: var(--alert-green);
}

.scan-status-box.scan-error {
    color: var(--danger);
}

/* Scan Results List */
#addPrinterResult {
    margin: 0;
    padding: 1em 2em 1.5em;
}

#addPrinterResult:empty {
    display: none;
}

.result-success {
    display: flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.85em 1em;
    background: linear-gradient(135deg, rgba(76,175,80,0.12), rgba(76,175,80,0.04));
    border: 1px solid rgba(76,175,80,0.25);
    border-radius: var(--radius-sm);
    color: var(--alert-green);
    font-weight: 500;
}

.result-error {
    display: flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.85em 1em;
    background: linear-gradient(135deg, rgba(239,68,68,0.12), rgba(239,68,68,0.04));
    border: 1px solid rgba(239,68,68,0.25);
    border-radius: var(--radius-sm);
    color: var(--danger);
    font-weight: 500;
}

#scanResults {
    margin: 0 2em 1.5em;
    padding: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    border: none;
}

#scanResults:empty {
    display: none;
}

#scanResults .scan-results-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

#scanResults .scan-results-list li {
    display: flex;
    align-items: center;
    gap: 0.75em;
    padding: 0.75em 1em;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5em;
    transition: background 0.2s;
}

#scanResults .scan-results-list li:hover {
    background: var(--bg-tertiary);
}

#scanResults .scan-results-list .printer-ip {
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-weight: 600;
    color: var(--primary-light);
    min-width: 120px;
}

#scanResults .scan-results-list .printer-info {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.scan-progress {
    color: var(--primary-light);
    font-weight: 600;
}

#scanStatus {
    margin-bottom: 0;
    color: var(--text-muted);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
}

thead {
    background: linear-gradient(135deg, var(--main-color), var(--main-dark));
    color: #fff;
}

th {
    padding: 1em 1.25em;
    text-align: left;
    font-weight: 600;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 1em 1.25em;
    border-bottom: 1px solid var(--border-color);
}

tbody tr {
    transition: background var(--transition);
}

tbody tr:hover {
    background: var(--card-bg-hover);
}

tbody tr:last-child td {
    border-bottom: none;
}

.status-online,
.status-offline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-online { 
    color: #fff;
    background: linear-gradient(135deg, #43a047, #66bb6a);
    box-shadow: 0 2px 8px rgba(67, 160, 71, 0.4);
}

.status-online::before {
    content: '✓';
    font-size: 0.9em;
}

.status-online::after {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
    margin-left: 4px;
    box-shadow: 0 0 10px var(--success-glow);
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.9); }
}

.status-offline { 
    color: #fff;
    background: linear-gradient(135deg, #e53935, #ef5350);
    box-shadow: 0 2px 8px rgba(229, 57, 53, 0.4);
}

.status-offline::before {
    content: '✕';
    font-size: 0.9em;
}

canvas {
    max-width: 100%;
    margin-top: 1.5em;
    background: var(--card-bg);
    padding: 1em;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

/* Live Metrics Panel */
#liveMetricsPanel {
    background: var(--card-bg);
    padding: 2em;
    border-radius: 16px;
    margin-bottom: 1.5em;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

#liveMetricsPanel h3 {
    margin: 0 0 1.5em 0;
    font-size: 1.2em;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.75em;
}

#liveMetricsPanel h3::before {
    content: '🖨️';
    font-size: 1.3em;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.25em;
    margin-bottom: 2em;
}

.metric-card {
    background: var(--card-bg);
    padding: 1.25em;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--card-border);
    transition: transform 0.2s, box-shadow 0.2s;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.metric-card h4 {
    margin: 0 0 0.5em 0;
    color: var(--text-muted);
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.metric-value {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--main-color);
}

/* Health Score Gauge */
.health-gauge {
    width: 120px;
    height: 120px;
    margin: 0 auto 1em;
    position: relative;
}

.health-gauge-circle {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(
        var(--alert-green) var(--health-percent, 0%),
        #e0e0e0 var(--health-percent, 0%)
    );
    display: flex;
    align-items: center;
    justify-content: center;
}

.health-gauge-inner {
    width: 80%;
    height: 80%;
    background: var(--card-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.health-score-value {
    font-size: 1.8em;
    font-weight: 700;
    color: var(--text-dark);
}

.health-score-label {
    font-size: 0.75em;
    color: var(--text-muted);
    text-transform: uppercase;
}

.toner-bars {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1.25em;
    margin-bottom: 1.5em;
}

.toner-bar {
    background: var(--card-bg);
    padding: 1em;
    border-radius: 12px;
    border: 1px solid var(--card-border);
}

.toner-bar-label {
    font-size: 0.85em;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.toner-bar-container {
    height: 32px;
    background: var(--bg-tertiary);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-inset);
}

.toner-bar-fill {
    height: 100%;
    transition: width 0.5s ease;
    border-radius: 16px;
}

.toner-bar-fill.black { 
    background: linear-gradient(90deg, #333, #555); 
}
.toner-bar-fill.cyan { 
    background: linear-gradient(90deg, #00acc1, #26c6da); 
}
.toner-bar-fill.magenta { 
    background: linear-gradient(90deg, #d81b60, #ec407a); 
}
.toner-bar-fill.yellow { 
    background: linear-gradient(90deg, #ffb300, #ffd54f); 
}
.toner-bar-fill.other { 
    background: linear-gradient(90deg, #757575, #9e9e9e); 
}

.toner-bar-text {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9em;
    font-weight: 700;
    color: #000;
    text-shadow: 0 0 3px #fff, 0 0 5px #fff;
}

.toner-bar-low {
    animation: lowPulse 1.5s infinite;
}

@keyframes lowPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(229, 57, 53, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(229, 57, 53, 0); }
}

#suppliesList {
    margin-top: 1.5em;
}

#suppliesList table {
    width: 100%;
    font-size: 0.9em;
}

.supply-low { background: rgba(239, 68, 68, 0.15); }
.supply-warning { background: rgba(245, 158, 11, 0.15); }
.supply-ok { background: rgba(34, 197, 94, 0.15); }

/* Paper Trays Section */
.paper-trays-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1em;
    margin: 1em 0;
}

.tray-card {
    background: var(--card-bg);
    padding: 1.25em;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    text-align: center;
}

.tray-card h5 {
    margin: 0 0 0.75em 0;
    font-size: 0.95em;
    color: var(--text-dark);
}

.tray-icon {
    font-size: 2em;
    margin-bottom: 0.5em;
}

.tray-level {
    height: 60px;
    width: 80px;
    margin: 0 auto;
    background: var(--bg-tertiary);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    border: 2px solid var(--border-color);
}

.tray-paper {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, #fff, #f5f5f5);
    transition: height 0.5s ease;
    border-top: 2px solid #ddd;
}

.tray-percentage {
    font-size: 1.1em;
    font-weight: 600;
    margin-top: 0.5em;
    color: var(--text-dark);
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 200;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.2s ease;
    /* Flex centering */
    justify-content: center;
    align-items: center;
    padding: 1em;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: linear-gradient(145deg, var(--card-bg), var(--bg-tertiary));
    padding: 2em;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 
        var(--shadow-lg),
        0 0 60px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    animation: slideUp 0.3s ease;
}

.modal-content.modal-large {
    max-width: 650px;
    max-height: 85vh;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-content h2 {
    margin-top: 0;
    color: var(--text-primary);
}

.close {
    position: absolute;
    right: 1.25em; top: 1em;
    font-size: 1.5em;
    cursor: pointer;
    color: var(--text-muted);
    transition: all var(--transition);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-tertiary);
}

.close:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.2);
    box-shadow: 0 0 15px var(--danger-glow);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.7em 1.5em;
    background: linear-gradient(135deg, var(--main-color), var(--main-dark));
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.95em;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.3);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.4);
}

.btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, var(--alert-green), #2e7d32);
    box-shadow: 0 2px 8px rgba(67, 160, 71, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, var(--alert-red), #c62828);
    box-shadow: 0 2px 8px rgba(229, 57, 53, 0.3);
}

button.btn {
    font-family: inherit;
}

/* Section Cards */
section {
    margin-bottom: 1.5em;
}

#metrics {
    background: var(--card-bg);
    padding: 1.5em;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

#export {
    background: var(--card-bg);
    padding: 1.5em;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

/* Responsive */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 1em;
        padding: 1em;
        height: auto;
    }
    
    nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.25rem;
    }
    
    .nav-user {
        width: 100%;
        justify-content: center;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        margin-right: 0;
        margin-bottom: 0.5rem;
        padding-bottom: 0.75rem;
    }
    
    .nav-divider {
        display: none;
    }
    
    .nav-text {
        display: none;
    }
    
    nav a .nav-icon,
    .nav-dropdown-btn .nav-icon {
        font-size: 1.25rem;
    }
    
    .nav-dropdown-btn .nav-text,
    .dropdown-arrow {
        display: none;
    }
    
    .nav-dropdown-btn {
        padding: 0.6rem 0.75rem;
    }
    
    .nav-dropdown-content {
        left: 50%;
        transform: translateX(-50%) translateY(-10px);
        min-width: 180px;
    }
    
    .nav-dropdown:hover .nav-dropdown-content {
        transform: translateX(-50%) translateY(0);
    }
    
    .nav-dropdown-content::before {
        left: 50%;
        transform: translateX(-50%) rotate(45deg);
    }
    
    main {
        padding: 1em;
    }
    
    .printer-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    #printerFilter {
        width: 100%;
    }
    
    .modal {
        padding: 0.5em;
    }
    
    .modal-content {
        width: 100%;
        max-height: 94vh;
        padding: 1.5em;
    }
    
    .modal-content.modal-large {
        max-width: 100%;
    }
    
    .modal-add-printer,
    .modal-scan-network {
        width: 100%;
        max-width: 100%;
    }
    
    .modal-icon-header {
        padding: 1.5em 1.25em 1em;
    }
    
    .modal-form {
        padding: 1.25em;
    }
    
    .modal-actions {
        padding: 1em 1.25em;
        flex-direction: column;
    }
    
    .modal-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .scan-info-box {
        margin: 1em 1.25em 0;
    }
    
    .scan-status-box {
        padding: 1.25em;
    }
    
    #addPrinterResult {
        padding: 0.75em 1.25em 1.25em;
    }
    
    #scanResults {
        margin: 0 1.25em 1.25em;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .tabs {
        flex-wrap: wrap;
        gap: 0.5em;
    }
    
    .tab-btn {
        padding: 0.5em 1em;
        font-size: 0.9em;
    }
    
    .form-actions {
        display: flex;
        flex-direction: column;
        gap: 0.5em;
    }
    
    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Page Counter Styles */
.counter-bw .metric-value {
    color: var(--text-primary);
}

.counter-color .metric-value {
    color: #ec4899;
}

.counter-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    margin: 0.75em 0 0.5em;
    overflow: hidden;
    box-shadow: var(--shadow-inset);
}

.counter-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.counter-bar-fill.bw {
    background: linear-gradient(90deg, #333, #666);
}

.counter-bar-fill.color {
    background: linear-gradient(90deg, #e91e63, #ff5722, #ffc107);
}

.counter-percent {
    font-size: 0.75em;
    color: var(--text-muted);
    margin-bottom: 0.5em;
}

.counter-breakdown {
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
    color: var(--text-muted);
    padding-top: 0.75em;
    border-top: 1px dashed var(--border-color);
    margin-top: 0.5em;
}

.counter-breakdown span {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25em;
}

/* ==========================================
   Admin & User Role Styles
   ========================================== */

/* Nav user display */
.nav-user {
    color: rgba(255,255,255,0.9);
    padding: 0.5em 1em;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.nav-user small {
    opacity: 0.7;
    font-size: 0.85em;
}

.nav-admin {
    background: rgba(255,255,255,0.15);
    border-radius: 6px;
    font-weight: 500;
}

.nav-admin:hover {
    background: rgba(255,255,255,0.25) !important;
}

/* Role badges */
.role-badge {
    padding: 0.25em 0.6em;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
}

.role-badge.admin {
    background: linear-gradient(135deg, #e53935, #c62828);
    color: #fff;
}

.role-badge.user {
    background: linear-gradient(135deg, #43a047, #2e7d32);
    color: #fff;
}

/* Users table */
.users-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1em;
}

.users-table th,
.users-table td {
    padding: 0.75em;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.users-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    font-size: 0.85em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.users-table tr:hover {
    background: var(--card-bg-hover);
}

/* Danger button */
.btn-danger {
    background: linear-gradient(135deg, #e53935, #c62828) !important;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c62828, #b71c1c) !important;
}

/* Text muted */
.text-muted {
    color: var(--text-muted);
}

/* User list header */
.user-list-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1em;
}

/* Admin modal h4 */
#adminSettingsModal h4 {
    margin: 0 0 0.5em 0;
    font-weight: 600;
}

/* =====================================================
   PRINT TRACKING STYLES
   ===================================================== */

/* Print Tracking Section */
#printTracking {
    background: var(--card-bg);
    padding: 1.5em;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

/* Print Stats Grid */
.print-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1em;
    margin-bottom: 1.5em;
}

.print-stat-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.2em;
    display: flex;
    align-items: center;
    gap: 1em;
    box-shadow: var(--shadow);
    border: 1px solid var(--card-border);
    transition: transform 0.2s, box-shadow 0.2s;
}

.print-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.print-stat-card .stat-icon {
    font-size: 2em;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--main-color), var(--main-dark));
    border-radius: 12px;
    color: #fff;
}

.print-stat-card .stat-content {
    flex: 1;
}

.print-stat-card .stat-value {
    font-size: 1.8em;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1.2;
}

.print-stat-card .stat-label {
    font-size: 0.85em;
    color: var(--text-muted);
    margin-top: 0.2em;
}

.print-stat-card.admin-stat {
    background: var(--card-bg);
    border-color: rgba(76, 175, 80, 0.3);
}

.print-stat-card.admin-stat .stat-icon {
    background: linear-gradient(135deg, #4caf50, #2e7d32);
}

/* Quota Display */
.quota-display {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 1em;
    margin-bottom: 1.5em;
    border: 1px solid var(--border-color);
}

.quota-item {
    display: flex;
    align-items: center;
    gap: 1em;
    margin-bottom: 0.8em;
}

.quota-item:last-child {
    margin-bottom: 0;
}

.quota-label {
    font-weight: 600;
    min-width: 80px;
    color: var(--text-muted);
}

.quota-bar-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1em;
}

.quota-bar {
    flex: 1;
    height: 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: var(--shadow-inset);
}

.quota-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.3s ease;
}

.quota-bar-fill.quota-ok {
    background: linear-gradient(90deg, #66bb6a, #43a047);
}

.quota-bar-fill.quota-warning {
    background: linear-gradient(90deg, #ffca28, #ffa000);
}

.quota-bar-fill.quota-danger {
    background: linear-gradient(90deg, #ef5350, #e53935);
}

.quota-text {
    font-size: 0.85em;
    color: var(--text-muted);
    min-width: 120px;
    text-align: right;
}

/* Print Charts Row */
.print-charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5em;
    margin-top: 1.5em;
}

.chart-container {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5em;
    box-shadow: var(--shadow-raised);
    border: 1px solid var(--border-color);
}

.chart-container h3 {
    margin: 0 0 1em 0;
    font-size: 1em;
    color: var(--text-muted);
    font-weight: 600;
}

/* Cost Badge */
.cost-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--main-color), var(--main-dark));
    color: #fff;
    padding: 0.25em 0.6em;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9em;
}

/* Status badges for invoices */
.status-badge {
    display: inline-block;
    padding: 0.25em 0.7em;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: capitalize;
}

.status-badge.draft { background: rgba(100, 116, 139, 0.2); color: #94a3b8; }
.status-badge.pending { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.status-badge.sent { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.status-badge.paid { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.status-badge.overdue { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.status-badge.cancelled { background: rgba(100, 116, 139, 0.15); color: #64748b; }

/* Responsive adjustments for print tracking */
@media (max-width: 768px) {
    .print-stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .print-charts-row {
        grid-template-columns: 1fr;
    }
    
    .quota-item {
        flex-wrap: wrap;
    }
    
    .quota-label {
        min-width: 100%;
        margin-bottom: 0.3em;
    }
}

@media (max-width: 480px) {
    .print-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .print-stat-card {
        flex-direction: column;
        text-align: center;
    }
    
    .print-stat-card .stat-icon {
        margin-bottom: 0.5em;
    }
}

/* ========== ENHANCED DASHBOARD STYLES ========== */
.page-title {
    margin-bottom: 2rem;
    position: relative;
}

.page-title h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.page-title h1::before {
    content: '';
    width: 4px;
    height: 1.5em;
    background: linear-gradient(180deg, var(--primary), var(--accent));
    border-radius: 2px;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    margin: 0.5rem 0 0 1.25rem;
}

.quick-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

@media (max-width: 1200px) {
    .quick-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .quick-stats { grid-template-columns: 1fr; }
}

.quick-stats .stat-card {
    background: linear-gradient(145deg, var(--card-bg), var(--bg-tertiary));
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-raised);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.quick-stats .stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, var(--primary-glow), transparent 70%);
    opacity: 0;
    transition: opacity var(--transition);
}

.quick-stats .stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg), 0 0 40px rgba(59, 130, 246, 0.15);
}

.quick-stats .stat-card:hover::after {
    opacity: 1;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.dashboard-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-raised);
    border: 1px solid var(--border-color);
    transition: all var(--transition);
}

.dashboard-card:hover {
    box-shadow: var(--shadow-lg);
}

.dashboard-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.dashboard-card .card-header h2 {
    margin: 0;
}

.dashboard-card .card-header h2::before {
    display: none;
}

/* ========== RESPONSIVE NAVIGATION ========== */
@media (max-width: 1400px) {
    nav a {
        padding: 0.5rem 0.625rem;
        font-size: 0.8125rem;
    }
}

@media (max-width: 1200px) {
    header {
        padding: 0 1rem;
    }
    
    nav {
        gap: 0.125rem;
    }
    
    nav a {
        padding: 0.4rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .nav-user {
        display: none;
    }
}

@media (max-width: 992px) {
    header {
        flex-direction: column;
        height: auto;
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }
    
    nav {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    nav a {
        padding: 0.375rem 0.625rem;
        font-size: 0.8125rem;
    }
}

/* ========== MODAL SHARED PARTS ========== */
.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2, .modal-header h3 {
    margin: 0;
    font-size: 1.125rem;
}

.modal-header h2::before, .modal-header h3::before {
    display: none;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-dark);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(90vh - 140px);
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background: var(--bg-color);
}

/* ========== EMPTY STATES ========== */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}

.empty-state i, .empty-state .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-dark);
}

.empty-state p {
    margin: 0;
    font-size: 0.9rem;
}

/* ========== LOADING STATES ========== */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-muted);
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 0.75rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== TOAST NOTIFICATIONS - Dark Style ========== */
.toast-container {
    position: fixed;
    top: 85px;
    right: 1.5rem;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    background: linear-gradient(145deg, var(--card-bg), var(--bg-tertiary));
    border-radius: var(--radius-sm);
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-lg), 0 0 30px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    animation: toastSlide 0.3s ease;
    color: var(--text-primary);
}

.toast.success { 
    border-left-color: var(--success);
    box-shadow: var(--shadow-lg), 0 0 20px var(--success-glow);
}
.toast.error { 
    border-left-color: var(--danger);
    box-shadow: var(--shadow-lg), 0 0 20px var(--danger-glow);
}
.toast.warning { 
    border-left-color: var(--warning);
    box-shadow: var(--shadow-lg), 0 0 20px var(--warning-glow);
}

@keyframes toastSlide {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========== 2FA PAGE STYLES ========== */
.two-factor-setup {
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
}

.qr-code-container {
    background: var(--bg-tertiary);
    padding: 2rem;
    border-radius: var(--radius);
    margin: 1.5rem 0;
    border: 1px solid var(--border-color);
}

.qr-code-container img {
    border-radius: var(--radius-sm);
}

.backup-codes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin: 1rem 0;
}

.backup-codes code {
    background: var(--bg-tertiary);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
    color: var(--primary-light);
    border: 1px solid var(--border-color);
}

/* ========== API DOCS STYLES ========== */
.api-section {
    margin-bottom: 2rem;
}

.api-endpoint {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}

.api-method {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 0.5rem;
}

.api-method.get { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.api-method.post { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.api-method.put { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.api-method.delete { background: rgba(239, 68, 68, 0.2); color: #f87171; }

/* ========== UTILITY CLASSES ========== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

.w-100 { width: 100%; }
.rounded { border-radius: var(--radius); }
.shadow { box-shadow: var(--shadow); }
/* ========== DARK THEME SCROLLBAR ========== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 5px;
    border: 2px solid var(--bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--bg-tertiary) var(--bg-secondary);
}

/* ========== GLOBAL ANIMATIONS ========== */
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 5px var(--primary-glow); }
    50% { box-shadow: 0 0 20px var(--primary-glow), 0 0 30px var(--primary-glow); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.animate-pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

/* ========== GLOW EFFECTS ========== */
.glow-primary {
    box-shadow: 0 0 20px var(--primary-glow);
}

.glow-success {
    box-shadow: 0 0 20px var(--success-glow);
}

.glow-warning {
    box-shadow: 0 0 20px var(--warning-glow);
}

.glow-danger {
    box-shadow: 0 0 20px var(--danger-glow);
}

.glow-accent {
    box-shadow: 0 0 20px var(--accent-glow);
}

/* ========== ENHANCED HOVER EFFECTS ========== */
.hover-lift {
    transition: transform var(--transition), box-shadow var(--transition);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.hover-glow:hover {
    box-shadow: var(--shadow-glow);
}

/* ========== TEXT GRADIENTS ========== */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-success {
    background: linear-gradient(135deg, #34d399, #10b981);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========== GLASS MORPHISM ========== */
.glass {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ========== STATUS INDICATORS ========== */
.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.online {
    background: var(--success);
    box-shadow: 0 0 10px var(--success-glow);
    animation: pulse-glow 2s ease-in-out infinite;
}

.status-dot.offline {
    background: var(--danger);
    box-shadow: 0 0 10px var(--danger-glow);
}

.status-dot.warning {
    background: var(--warning);
    box-shadow: 0 0 10px var(--warning-glow);
    animation: pulse-glow 1.5s ease-in-out infinite;
}

/* ========== DIVIDERS ========== */
.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
    margin: 1.5rem 0;
}

.divider-vertical {
    width: 1px;
    background: linear-gradient(180deg, transparent, var(--border-color), transparent);
    margin: 0 1rem;
}

/* ========== PROGRESS BARS ========== */
.progress-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: var(--shadow-inset);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 4px;
    transition: width 0.5s ease;
    position: relative;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

/* ========== TOOLTIPS ========== */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: var(--secondary);
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    z-index: 100;
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-4px);
}

/* ========== SKELETON LOADING ANIMATIONS ========== */
.skeleton {
    background: linear-gradient(90deg, 
        var(--bg-tertiary) 25%, 
        var(--card-bg-hover) 50%, 
        var(--bg-tertiary) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

.skeleton-text {
    height: 1rem;
    width: 100%;
    margin-bottom: 0.5rem;
}

.skeleton-text-sm {
    height: 0.75rem;
    width: 60%;
}

.skeleton-title {
    height: 1.5rem;
    width: 40%;
    margin-bottom: 1rem;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.skeleton-card {
    height: 120px;
    width: 100%;
}

.skeleton-chart {
    height: 300px;
    width: 100%;
}

.skeleton-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.skeleton-row .skeleton {
    flex: 1;
    height: 3rem;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ========== TOAST NOTIFICATIONS ========== */
.toast-container {
    position: fixed;
    top: 90px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
}

.toast {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    animation: toast-slide-in 0.3s ease;
    backdrop-filter: blur(10px);
}

.toast.toast-exit {
    animation: toast-slide-out 0.3s ease forwards;
}

.toast-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.toast-message {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
    line-height: 1;
    transition: color var(--transition-fast);
}

.toast-close:hover {
    color: var(--text-primary);
}

.toast-success {
    border-left: 4px solid var(--success);
}

.toast-success .toast-icon {
    color: var(--success);
}

.toast-error {
    border-left: 4px solid var(--danger);
}

.toast-error .toast-icon {
    color: var(--danger);
}

.toast-warning {
    border-left: 4px solid var(--warning);
}

.toast-warning .toast-icon {
    color: var(--warning);
}

.toast-info {
    border-left: 4px solid var(--primary);
}

.toast-info .toast-icon {
    color: var(--primary);
}

@keyframes toast-slide-in {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toast-slide-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* ========== KEYBOARD SHORTCUTS MODAL ========== */
.shortcuts-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10001;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.shortcuts-modal.show {
    display: flex;
}

.shortcuts-content {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}

.shortcuts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.shortcuts-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.shortcuts-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.shortcut-group {
    margin-bottom: 1.5rem;
}

.shortcut-group h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-light);
}

.shortcut-item:last-child {
    border-bottom: none;
}

.shortcut-keys {
    display: flex;
    gap: 0.25rem;
}

.key {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    min-width: 28px;
    text-align: center;
    color: var(--text-secondary);
}

/* ========== COMMAND PALETTE ========== */
.command-palette {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10002;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    backdrop-filter: blur(4px);
}

.command-palette.show {
    display: flex;
}

.command-content {
    background: var(--card-bg);
    border-radius: var(--radius);
    width: 100%;
    max-width: 550px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.command-input-wrapper {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    gap: 0.75rem;
}

.command-input-wrapper .search-icon {
    color: var(--text-muted);
    font-size: 1.25rem;
}

.command-input {
    flex: 1;
    background: transparent;
    border: none;
    font-size: 1.1rem;
    color: var(--text-primary);
    outline: none;
}

.command-input::placeholder {
    color: var(--text-muted);
}

.command-results {
    max-height: 400px;
    overflow-y: auto;
}

.command-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.command-item:hover,
.command-item.selected {
    background: var(--bg-tertiary);
}

.command-item-icon {
    font-size: 1.2rem;
    width: 28px;
    text-align: center;
}

.command-item-info {
    flex: 1;
}

.command-item-title {
    font-weight: 500;
    color: var(--text-primary);
}

.command-item-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.command-item-shortcut {
    display: flex;
    gap: 0.25rem;
}

.command-empty {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
}

/* ========== PWA INSTALL BANNER ========== */
.pwa-install-banner {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    max-width: 400px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow-lg);
    z-index: 9999;
}

.pwa-install-banner.show {
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: slide-up 0.3s ease;
}

.pwa-banner-icon {
    font-size: 2rem;
}

.pwa-banner-text {
    flex: 1;
}

.pwa-banner-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.pwa-banner-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.pwa-banner-actions {
    display: flex;
    gap: 0.5rem;
}

.pwa-banner-actions button {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    cursor: pointer;
    border: none;
}

.pwa-install-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.pwa-dismiss-btn {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   Cloud Agents Widget Styles
   ========================================== */

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.widget-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.widget-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    border-radius: 6px;
    border: none;
    background: var(--main-color);
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-sm:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Cloud Agents Section Redesign */
.cloud-agents-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.cloud-agents-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.75rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
}

.cloud-agents-header .header-title h2 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cloud-agents-header .header-icon {
    font-size: 1.6rem;
    display: inline-flex;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

.cloud-agents-header .header-actions {
    display: flex;
    gap: 0.75rem;
}

.btn-new-agent, .btn-manage-all {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-new-agent {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-new-agent:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-manage-all {
    background: var(--bg-tertiary);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

.btn-manage-all:hover {
    background: var(--bg-quaternary);
    transform: translateY(-2px);
}

.btn-icon {
    font-size: 1rem;
}

.cloud-agents-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    padding: 1.75rem;
    background: var(--bg-secondary);
}

.cloud-agents-stats-grid .stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.cloud-agents-stats-grid .stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    transition: width 0.3s ease;
}

.cloud-agents-stats-grid .stat-card.stat-total::before {
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
}

.cloud-agents-stats-grid .stat-card.stat-online::before {
    background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
}

.cloud-agents-stats-grid .stat-card.stat-printers::before {
    background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
}

.cloud-agents-stats-grid .stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.cloud-agents-stats-grid .stat-card:hover::before {
    width: 100%;
    opacity: 0.05;
}

.cloud-agents-stats-grid .stat-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    font-size: 1.75rem;
    flex-shrink: 0;
}

.stat-card.stat-total .stat-icon-wrapper {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.15));
}

.stat-card.stat-online .stat-icon-wrapper {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(22, 163, 74, 0.15));
}

.stat-card.stat-printers .stat-icon-wrapper {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.15));
}

.cloud-agents-stats-grid .stat-info {
    flex: 1;
}

.cloud-agents-stats-grid .stat-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.35rem;
    background: linear-gradient(135deg, var(--main-color) 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card.stat-online .stat-value {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card.stat-printers .stat-value {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cloud-agents-stats-grid .stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Cloud Agents Grid */
.cloud-agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
    padding: 1.75rem;
}

.loading-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1rem;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 1rem;
    border: 4px solid var(--border-color);
    border-top-color: var(--main-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-state p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.cloud-agents-grid .empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Agent Card */
.agent-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.agent-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--main-color), #764ba2);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.agent-card:hover::before {
    transform: translateX(0);
}

.agent-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    border-color: rgba(102, 126, 234, 0.3);
}

.agent-card.offline {
    opacity: 0.85;
}

.agent-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.agent-card-title {
    flex: 1;
}

.agent-card-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.agent-card-company {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

.agent-status-badge {
    padding: 0.3rem 0.65rem;
    border-radius: 18px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.agent-status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.agent-status-badge.online {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(22, 163, 74, 0.2));
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.agent-status-badge.online::before {
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
    animation: pulse 2s ease-in-out infinite;
}

.agent-status-badge.offline {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(220, 38, 38, 0.2));
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.agent-status-badge.offline::before {
    background: #ef4444;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.agent-card-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.agent-detail-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
}

.agent-detail-icon {
    font-size: 1rem;
    opacity: 0.8;
}

.agent-detail-text {
    color: var(--text-secondary);
    font-weight: 500;
}

.agent-detail-text strong {
    color: var(--text-dark);
    font-weight: 700;
}

.agent-card-footer {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    padding: 0.6rem;
    border-radius: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

.agent-action-btn {
    padding: 0.65rem 0.9rem;
    border: 1px solid transparent;
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-dark);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 38px;
}

.agent-action-btn span {
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
}

.agent-action-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.agent-action-btn:hover {
    transform: translateY(-2px);
}

.agent-action-btn.btn-view {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
}

.agent-action-btn.btn-view:hover {
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.35);
}

.agent-action-btn.btn-enable {
    border-color: rgba(34, 197, 94, 0.4);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(22, 163, 74, 0.2));
    color: #22c55e;
}

.agent-action-btn.btn-enable:hover {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 6px 16px rgba(34, 197, 94, 0.3);
}

.agent-action-btn.btn-disable {
    border-color: rgba(239, 68, 68, 0.4);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(220, 38, 38, 0.2));
    color: #ef4444;
}

.agent-action-btn.btn-disable:hover {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.3);
}

@media (max-width: 768px) {
    .cloud-agents-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .cloud-agents-header .header-actions {
        width: 100%;
    }
    
    .btn-new-agent, .btn-manage-all {
        flex: 1;
        justify-content: center;
    }
    
    .cloud-agents-stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .cloud-agents-grid {
        grid-template-columns: 1fr;
    }
    
    .agent-card-details {
        grid-template-columns: 1fr;
    }
}

/* Modal for creating agent */
#cloudAgentModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

#cloudAgentModal.show {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 1rem;
}

.close {
    cursor: pointer;
    font-size: 1.5rem;
    float: right;
    color: var(--text-muted);
    transition: color 0.2s;
}

.close:hover {
    color: var(--text-dark);
}

/* ==========================================
   Printer Analytics Integration Styles
   ========================================== */

.print-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 1200px) {
    .print-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .print-stats-grid {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.blue {
    background: rgba(25, 118, 210, 0.1);
}

.stat-icon.green {
    background: rgba(40, 167, 69, 0.1);
}

.stat-icon.orange {
    background: rgba(255, 152, 0, 0.1);
}

.stat-icon.purple {
    background: rgba(156, 39, 176, 0.1);
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.printer-analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin: 1.5rem 0;
}

@media (max-width: 1024px) {
    .printer-analytics-grid {
        grid-template-columns: 1fr;
    }
}

.analytics-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.analytics-card h3 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    color: var(--text-dark);
}

.leaderboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}

@media (max-width: 1024px) {
    .leaderboard-grid {
        grid-template-columns: 1fr;
    }
}

.leaderboard-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.leaderboard-card h3 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.leaderboard-item-row {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.leaderboard-rank-badge {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--main-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.leaderboard-rank-badge.gold {
    background: #ffd700;
    color: #1a1a1a;
}

.leaderboard-rank-badge.silver {
    background: #c0c0c0;
    color: #1a1a1a;
}

.leaderboard-rank-badge.bronze {
    background: #cd7f32;
    color: white;
}

.leaderboard-info {
    flex: 1;
}

.leaderboard-name {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.leaderboard-detail {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.leaderboard-value {
    font-weight: 600;
    color: var(--main-color);
    white-space: nowrap;
    margin-left: 0.5rem;
}

.loading-placeholder {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

/* Print History Section Styles */
.history-filter-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-top: 2rem;
}

.history-filter-section h3 {
    margin: 0 0 1.5rem 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
}

.filter-section {
    background: var(--bg-tertiary);
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.filter-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.filter-row:last-child {
    margin-bottom: 0;
}

.filter-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.filter-group input,
.filter-group select {
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--main-color);
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

.filter-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.filter-actions .btn {
    padding: 0.65rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
}

/* History Summary Grid */
.history-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.summary-card {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-tertiary) 100%);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.summary-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
}

.summary-content {
    flex: 1;
}

.summary-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--main-color);
}

.summary-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

/* Report Actions */
.report-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.report-btn {
    flex: 1;
    min-width: 150px;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.report-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.report-btn:active {
    transform: translateY(0);
}

.report-btn.csv {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.report-btn.pdf {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.report-btn.json {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
}

.report-btn.print {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

/* History Table */
.history-table-wrapper {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: auto;
    margin-bottom: 1rem;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.history-table thead {
    background: var(--bg-tertiary);
    border-bottom: 2px solid var(--border-color);
}

.history-table th {
    padding: 0.85rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-dark);
    white-space: nowrap;
}

.history-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s;
}

.history-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.history-table td {
    padding: 0.75rem 1rem;
    color: var(--text-primary);
}

.history-table td:first-child {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Pagination */
.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
}

.pagination-controls .btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
}

#dashPageInfo {
    font-weight: 600;
    color: var(--text-secondary);
}

@media (max-width: 1024px) {
    .history-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .report-actions {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .report-btn {
        min-width: 120px;
        padding: 0.6rem 0.75rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    .filter-row {
        gap: 0.5rem;
    }
    
    .filter-group {
        min-width: 160px;
    }
    
    .history-summary-grid {
        grid-template-columns: 1fr;
    }
    
    .report-actions {
        grid-template-columns: 1fr;
    }
    
    .report-btn {
        min-width: 100%;
        padding: 0.6rem 0.75rem;
    }
    
    .history-table {
        font-size: 0.85rem;
    }
    
    .history-table th,
    .history-table td {
        padding: 0.6rem 0.75rem;
    }
}

