/* ============================================
   ScholarStock — Main Stylesheet
   Glassmorphism + Elegant Dark/Light Mode
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&display=swap');

/* ---- CSS Variables ---- */
:root {
    --font-display: 'Syne', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    --transition: 0.2s ease;
    --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.15);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.2);
    --shadow-lg: 0 16px 48px rgba(0,0,0,0.25);
    --accent: #6366f1;
    --accent-light: #818cf8;
    --accent-dark: #4f46e5;
    --accent-glow: rgba(99, 102, 241, 0.3);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
}

/* Dark Theme (default) */
[data-theme="dark"] {
    --bg-primary: #0a0a0f;
    --bg-secondary: #111118;
    --bg-tertiary: #16161f;
    --bg-card: #13131c;
    --glass-bg: rgba(255, 255, 255, 0.04);
    --glass-bg-hover: rgba(255, 255, 255, 0.07);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-hover: rgba(255, 255, 255, 0.15);
    --text-primary: #f0f0ff;
    --text-secondary: #a8a8c0;
    --text-muted: #6060a0;
    --border-color: rgba(255, 255, 255, 0.08);
    --input-bg: rgba(255, 255, 255, 0.05);
    --scrollbar-track: #111118;
    --scrollbar-thumb: #2a2a40;
    --sidebar-bg: rgba(10, 10, 20, 0.95);
    --navbar-bg: rgba(10, 10, 20, 0.9);
    --table-stripe: rgba(255,255,255,0.02);
    --table-hover: rgba(99, 102, 241, 0.08);
    --badge-bg: rgba(99, 102, 241, 0.15);
}

/* Light Theme */
[data-theme="light"] {
    --bg-primary: #f5f5fa;
    --bg-secondary: #eeeef5;
    --bg-tertiary: #e8e8f0;
    --bg-card: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-bg-hover: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(0, 0, 0, 0.08);
    --glass-border-hover: rgba(0, 0, 0, 0.15);
    --text-primary: #0f0f1a;
    --text-secondary: #4a4a6a;
    --text-muted: #8888aa;
    --border-color: rgba(0, 0, 0, 0.08);
    --input-bg: rgba(0, 0, 0, 0.03);
    --scrollbar-track: #e8e8f0;
    --scrollbar-thumb: #c0c0d8;
    --sidebar-bg: rgba(245, 245, 250, 0.98);
    --navbar-bg: rgba(245, 245, 250, 0.92);
    --table-stripe: rgba(0,0,0,0.02);
    --table-hover: rgba(99, 102, 241, 0.06);
    --badge-bg: rgba(99, 102, 241, 0.1);
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background var(--transition), color var(--transition);
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-light); }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ============================================
   LAYOUT
   ============================================ */

.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
    width: 260px;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
    transition: transform var(--transition-slow);
}

.sidebar-logo {
    padding: 1.5rem 1.75rem;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--glass-border);
}

.sidebar-logo-icon {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, #6366f1, #06b6d4);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.sidebar-logo-text {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.2rem;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-logo-version {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 400;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.nav-section-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    padding: 0.75rem 1.75rem 0.4rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.65rem 1.75rem;
    margin: 2px 0.75rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    text-decoration: none;
}

.nav-item:hover {
    background: var(--glass-bg-hover);
    color: var(--text-primary);
    transform: translateX(2px);
}

.nav-item.active {
    background: var(--badge-bg);
    color: var(--accent-light);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: -0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--accent);
    border-radius: 2px;
}

.nav-icon {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    min-width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--glass-border);
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.65rem 0.75rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
}

.user-chip:hover { background: var(--glass-bg-hover); }

.user-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #f59e0b);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: capitalize;
}

/* ---- Main Content ---- */
.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---- Navbar ---- */
.navbar {
    height: 64px;
    background: var(--navbar-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    padding: 0 2rem;
    gap: 1rem;
}

.navbar-left { flex: 1; }

.navbar-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.5rem 1rem;
    max-width: 360px;
    transition: all var(--transition);
}

.navbar-search:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.navbar-search input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.875rem;
    width: 200px;
}

.navbar-search input::placeholder { color: var(--text-muted); }
.search-icon { color: var(--text-muted); font-size: 0.9rem; }

.navbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-btn {
    width: 38px; height: 38px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--glass-bg);
    color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    font-size: 1rem;
    position: relative;
}

.navbar-btn:hover {
    background: var(--glass-bg-hover);
    color: var(--text-primary);
    border-color: var(--glass-border-hover);
}

.navbar-btn .badge-dot {
    position: absolute;
    top: 6px; right: 6px;
    width: 8px; height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--bg-primary);
}

.page-content {
    flex: 1;
    padding: 2rem;
}

/* ============================================
   COMPONENTS
   ============================================ */

/* ---- Page Header ---- */
.page-header {
    margin-bottom: 2rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-header-left {}

.page-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

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

.page-header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

/* ---- Cards ---- */
.card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(12px);
    transition: all var(--transition);
    overflow: hidden;
}

.card:hover {
    border-color: var(--glass-border-hover);
    box-shadow: var(--shadow-md);
}

.card-body {
    padding: 1.5rem;
}

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

.card-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ---- Stats Cards ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    animation: stat-appear 0.5s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--stat-color, var(--accent));
    opacity: 0;
    transition: opacity var(--transition);
}

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

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

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.15s; }
.stat-card:nth-child(3) { animation-delay: 0.2s; }
.stat-card:nth-child(4) { animation-delay: 0.25s; }

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

.stat-icon {
    width: 44px; height: 44px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem;
    background: var(--stat-bg, rgba(99, 102, 241, 0.15));
}

.stat-trend {
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 20px;
    font-weight: 600;
}

.stat-trend.up { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.stat-trend.down { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

.stat-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 0.4rem;
}

.stat-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    border: 1px solid transparent;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: white;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--accent-glow);
    color: white;
}

.btn-secondary {
    background: var(--glass-bg);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: var(--glass-bg-hover);
    color: var(--text-primary);
    border-color: var(--glass-border-hover);
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
}

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

/* ---- Table ---- */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-xl);
}

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

.table thead tr {
    background: var(--glass-bg);
}

.table th {
    padding: 1rem 1.25rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--glass-border);
    white-space: nowrap;
}

.table td {
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-secondary);
    vertical-align: middle;
}

.table tbody tr:nth-child(even) td {
    background: var(--table-stripe);
}

.table tbody tr:hover td {
    background: var(--table-hover);
    color: var(--text-primary);
}

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

/* ---- Badges ---- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-primary { background: rgba(99,102,241,0.15); color: #818cf8; }
.badge-success { background: rgba(16,185,129,0.15); color: #34d399; }
.badge-warning { background: rgba(245,158,11,0.15); color: #fbbf24; }
.badge-danger { background: rgba(239,68,68,0.15); color: #f87171; }
.badge-info { background: rgba(6,182,212,0.15); color: #22d3ee; }
.badge-muted { background: var(--glass-bg); color: var(--text-muted); }

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

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

.form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: all var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-control::placeholder { color: var(--text-muted); }

select.form-control {
    cursor: pointer;
    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='%236060a0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 2.5rem;
}

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

.form-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

/* ---- Modal ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95) translateY(20px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 10;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.modal-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    width: 32px; height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--glass-bg);
    color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    font-size: 1rem;
}

.modal-close:hover {
    background: rgba(239,68,68,0.1);
    border-color: rgba(239,68,68,0.3);
    color: #ef4444;
}

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

/* ---- Alert/Toast ---- */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 280px;
    max-width: 400px;
    animation: toast-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

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

.toast::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--toast-color);
}

.toast-success { --toast-color: var(--success); }
.toast-danger { --toast-color: var(--danger); }
.toast-warning { --toast-color: var(--warning); }
.toast-info { --toast-color: var(--info); }

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

.toast-icon { font-size: 1.2rem; flex-shrink: 0; }
.toast-content { flex: 1; }
.toast-title { font-weight: 600; font-size: 0.875rem; color: var(--text-primary); }
.toast-msg { font-size: 0.8rem; color: var(--text-muted); }
.toast-close { cursor: pointer; color: var(--text-muted); font-size: 0.85rem; flex-shrink: 0; }

/* ---- Stock Level Bar ---- */
.stock-bar {
    height: 6px;
    background: var(--glass-bg);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
}

.stock-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.stock-bar-fill.critical { background: var(--danger); }
.stock-bar-fill.low { background: var(--warning); }
.stock-bar-fill.normal { background: var(--success); }
.stock-bar-fill.high { background: var(--info); }

/* ---- Pagination ---- */
.pagination {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    justify-content: center;
    padding: 1.25rem;
    border-top: 1px solid var(--glass-border);
}

.page-btn {
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--glass-bg);
    color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    font-size: 0.85rem;
    font-weight: 500;
}

.page-btn:hover {
    background: var(--glass-bg-hover);
    color: var(--text-primary);
}

.page-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 2px 8px var(--accent-glow);
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ---- Progress Ring ---- */
.progress-ring {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.progress-ring svg { transform: rotate(-90deg); }
.progress-ring-value {
    position: absolute;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-primary);
}

/* ---- Loading Shimmer ---- */
.shimmer {
    background: linear-gradient(90deg,
        var(--glass-bg) 25%,
        var(--glass-bg-hover) 50%,
        var(--glass-bg) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

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

/* ---- Quick Actions ---- */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.quick-action-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    color: var(--text-secondary);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.quick-action-btn:hover {
    background: var(--glass-bg-hover);
    border-color: var(--accent);
    color: var(--accent-light);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px var(--accent-glow);
}

.quick-action-icon {
    width: 44px; height: 44px;
    border-radius: var(--radius-md);
    background: var(--badge-bg);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem;
    transition: transform var(--transition);
}

.quick-action-btn:hover .quick-action-icon {
    transform: scale(1.1);
}

.quick-action-label {
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.3;
}

/* ---- Dropdown ---- */
.dropdown { position: relative; display: inline-block; }

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    min-width: 180px;
    box-shadow: var(--shadow-lg);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s;
    overflow: hidden;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.65rem 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.dropdown-item:hover {
    background: var(--glass-bg-hover);
    color: var(--text-primary);
}

.dropdown-item.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.dropdown-divider {
    height: 1px;
    background: var(--glass-border);
    margin: 0.25rem 0;
}

/* ---- Tabs ---- */
.tabs {
    display: flex;
    gap: 0.25rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: 1.5rem;
    width: fit-content;
}

.tab-btn {
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    border: none;
    background: none;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.tab-btn.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 8px var(--accent-glow);
}

.tab-btn:not(.active):hover { color: var(--text-primary); }

/* ---- Search & Filter Bar ---- */
.filter-bar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-bar .form-control {
    padding: 0.55rem 1rem;
    font-size: 0.875rem;
}

.filter-bar .search-wrap {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.filter-bar .search-wrap .form-control {
    padding-left: 2.5rem;
}

.filter-bar .search-wrap::before {
    content: '🔍';
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    pointer-events: none;
}

/* ---- Activity Feed ---- */
.activity-item {
    display: flex;
    gap: 1rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--glass-border);
}

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

.activity-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--accent);
    margin-top: 5px;
    flex-shrink: 0;
    box-shadow: 0 0 8px var(--accent-glow);
}

.activity-dot.success { background: var(--success); box-shadow: 0 0 8px rgba(16,185,129,0.4); }
.activity-dot.warning { background: var(--warning); box-shadow: 0 0 8px rgba(245,158,11,0.4); }
.activity-dot.danger { background: var(--danger); box-shadow: 0 0 8px rgba(239,68,68,0.4); }

.activity-content { flex: 1; }
.activity-text { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.5; }
.activity-text strong { color: var(--text-primary); }
.activity-time { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

/* ---- Charts Area ---- */
.chart-wrap {
    padding: 1.5rem;
}

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.5; }
.empty-state h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}
.empty-state p { font-size: 0.875rem; }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .page-content { padding: 1rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .quick-actions { grid-template-columns: repeat(2, 1fr); }
    .page-header { flex-direction: column; }
}

/* ---- Animation Utilities ---- */
.fade-in { animation: fadeIn 0.4s ease; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.scale-in { animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* ---- Theme Toggle ---- */
.theme-toggle {
    position: relative;
    width: 44px; height: 24px;
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    transition: all var(--transition);
}

.theme-toggle::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 3px;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--accent);
    transition: transform var(--transition);
}

[data-theme="light"] .theme-toggle::after {
    transform: translateX(20px);
}

/* ---- Utility Classes ---- */
.text-primary { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-accent { color: var(--accent) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-info { color: var(--info) !important; }

.font-display { font-family: var(--font-display) !important; }
.font-bold { font-weight: 700 !important; }
.font-medium { font-weight: 500 !important; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.w-100 { width: 100%; }
.cursor-pointer { cursor: pointer; }
.overflow-hidden { overflow: hidden; }

/* Grid utilities */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
