/* ============================================
   Admin Panel Styles
   Dark Theme + Glassmorphism
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800;900&display=swap');

/* ============================================
   Variables
   ============================================ */
:root {
    --primary: #6c5ce7;
    --primary-light: #a29bfe;
    --primary-dark: #5a4bd1;
    --secondary: #00cec9;
    --secondary-light: #81ecec;
    --accent: #fd79a8;
    --success: #00b894;
    --warning: #fdcb6e;
    --danger: #d63031;
    --info: #74b9ff;

    /* Light Theme (Default) */
    --bg-body: #f4f6f8;
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f8f9fa;
    --bg-input: #ffffff;
    --bg-glass: rgba(0, 0, 0, 0.03);
    --bg-glass-strong: rgba(0, 0, 0, 0.08);
    --header-bg: rgba(255, 255, 255, 0.8);
    --modal-bg: rgba(255, 255, 255, 0.8);

    --text-primary: #2d3436;
    --text-secondary: #636e72;
    --text-muted: #b2bec3;

    --border: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(108, 92, 231, 0.4);

    --shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 30px rgba(108, 92, 231, 0.15);

    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;

    --sidebar-width: 260px;
    --header-height: 64px;

    --font: 'Tajawal', sans-serif;
}

[data-theme="dark"] {
    --bg-body: #0a0a1a;
    --bg-sidebar: #0d0d20;
    --bg-card: #12122a;
    --bg-card-hover: #1a1a3e;
    --bg-input: rgba(255,255,255,0.05);
    --bg-glass: rgba(255,255,255,0.05);
    --bg-glass-strong: rgba(255,255,255,0.1);
    --header-bg: rgba(10, 10, 26, 0.8);
    --modal-bg: rgba(0, 0, 0, 0.7);

    --text-primary: #ffffff;
    --text-secondary: #b2b2d0;
    --text-muted: #6c6c8a;

    --border: rgba(255,255,255,0.08);

    --shadow: 0 4px 20px rgba(0,0,0,0.4);
}

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

body {
    font-family: var(--font);
    background: var(--bg-body);
    color: var(--text-primary);
    direction: rtl;
    line-height: 1.6;
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 10% 0%, rgba(108,92,231,0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 100%, rgba(0,206,201,0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

a { text-decoration:none; color:inherit; }
img { max-width:100%; display:block; }
ul { list-style:none; }

/* ============================================
   Sidebar
   ============================================ */
.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-left: 1px solid var(--border);
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

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

.sidebar-logo-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: white;
}

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

.sidebar-user {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: white;
    font-weight: 700;
}

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

.sidebar-user-name {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.7rem;
    color: var(--primary-light);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
}

.sidebar-section-title {
    padding: 8px 12px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 700;
    margin-top: 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 2px;
    position: relative;
}

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

.sidebar-link.active {
    background: linear-gradient(135deg, rgba(108,92,231,0.2), rgba(108,92,231,0.05));
    color: var(--primary-light);
    border: 1px solid rgba(108,92,231,0.2);
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--primary);
    border-radius: 3px;
}

.sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: 0.95rem;
}

.sidebar-link .badge {
    margin-right: auto;
    padding: 2px 8px;
    background: var(--primary);
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
}

.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--danger);
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.2s ease;
    width: 100%;
    border: none;
    background: none;
    cursor: pointer;
    font-family: var(--font);
}

.sidebar-logout:hover {
    background: rgba(214,48,49,0.1);
}

/* ============================================
   Main Content Area
   ============================================ */
.main-content {
    margin-right: var(--sidebar-width);
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.top-bar {
    height: var(--header-height);
    background: var(--header-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.top-bar-title {
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.top-bar-title i {
    color: var(--primary-light);
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-content {
    padding: 32px;
}

/* ============================================
   Stats Cards
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: var(--stat-color, var(--primary));
    border-radius: 0 4px 4px 0;
}

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

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    background: var(--bg-glass);
    color: var(--stat-color, var(--primary-light));
}

.stat-info h3 {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-info p {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* ============================================
   Cards & Tables
   ============================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 24px;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title i {
    color: var(--primary-light);
}

.card-body {
    padding: 24px;
}

.table-responsive {
    overflow-x: auto;
}

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

.table th {
    padding: 14px 16px;
    text-align: right;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table td {
    padding: 14px 16px;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

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

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

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-color: var(--primary);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(108,92,231,0.3);
}

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

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

.btn-success {
    background: linear-gradient(135deg, var(--success), #00a884);
    color: white;
}

.btn-success:hover {
    box-shadow: 0 4px 15px rgba(0,184,148,0.3);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #c0392b);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning), #f0b429);
    color: #333;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.btn-whatsapp {
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: white;
}

.btn-whatsapp:hover {
    box-shadow: 0 4px 15px rgba(37,211,102,0.3);
}

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

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-label .required {
    color: var(--danger);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: var(--font);
    transition: all 0.2s ease;
    direction: rtl;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108,92,231,0.15);
}

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

select.form-control {
    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='%236c6c8a' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    padding-left: 32px;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

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

.badge-pending { background: rgba(243,156,18,0.15); color: #f39c12; }
.badge-progress { background: rgba(52,152,219,0.15); color: #3498db; }
.badge-completed { background: rgba(39,174,96,0.15); color: #27ae60; }
.badge-cancelled { background: rgba(214,48,49,0.15); color: #d63031; }

/* ============================================
   Modal
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--modal-bg);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

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

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.3s ease;
}

.modal-lg { max-width: 800px; }
.modal-xl { max-width: 1000px; }

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

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-title i {
    color: var(--primary-light);
}

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

.modal-close:hover {
    background: rgba(214,48,49,0.2);
    color: var(--danger);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-start;
    gap: 12px;
}

/* ============================================
   Order Detail Timeline
   ============================================ */
.order-timeline {
    position: relative;
    padding-right: 28px;
}

.order-timeline::before {
    content: '';
    position: absolute;
    right: 7px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--border);
}

.timeline-step {
    position: relative;
    padding: 12px 20px;
    margin-bottom: 12px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.timeline-step::before {
    content: '';
    position: absolute;
    right: -28px;
    top: 16px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--text-muted);
    border: 2px solid var(--bg-body);
}

.timeline-step.done::before { background: var(--success); box-shadow: 0 0 8px rgba(0,184,148,0.4); }
.timeline-step.current::before { background: var(--primary); box-shadow: 0 0 8px rgba(108,92,231,0.4); animation: timelinePulse 2s infinite; }
.timeline-step.pending::before { background: var(--text-muted); }

@keyframes timelinePulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(108,92,231,0.3); }
    50% { box-shadow: 0 0 0 6px rgba(108,92,231,0); }
}

.timeline-dept {
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.timeline-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.timeline-action-btn {
    margin-top: 8px;
}

/* ============================================
   Customer Card
   ============================================ */
.customer-card {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.2s ease;
}

.customer-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-glass-strong);
}

.customer-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: white;
    font-weight: 700;
    flex-shrink: 0;
}

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

.customer-name {
    font-weight: 700;
    margin-bottom: 2px;
}

.customer-phone {
    font-size: 0.85rem;
    color: var(--text-muted);
    direction: ltr;
    text-align: right;
}

.customer-actions {
    display: flex;
    gap: 8px;
}

/* ============================================
   Order Card (Kanban-style)
   ============================================ */
.orders-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.order-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
}

.order-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-glow);
}

.order-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.order-number {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--primary-light);
}

.order-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.order-card-customer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 12px;
    background: var(--bg-glass);
    border-radius: var(--radius-sm);
}

.order-card-items {
    margin-bottom: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.order-card-items span {
    display: inline-block;
    padding: 2px 8px;
    background: var(--bg-glass-strong);
    border-radius: 4px;
    margin-left: 4px;
    margin-bottom: 4px;
    font-size: 0.8rem;
}

.order-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.order-total {
    font-weight: 700;
    color: var(--secondary);
}

/* ============================================
   File Upload Area
   ============================================ */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-glass);
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary);
    background: rgba(108,92,231,0.05);
}

.upload-area i {
    font-size: 2.5rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.upload-area p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.upload-area .browse-link {
    color: var(--primary-light);
    cursor: pointer;
}

.upload-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

.upload-thumb {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}

.upload-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-thumb-remove {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: var(--danger);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.6rem;
    cursor: pointer;
    border: none;
}

/* ============================================
   Drag & Drop Sortable
   ============================================ */
.sortable-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sortable-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: grab;
    transition: all 0.2s ease;
}

.sortable-item:active { cursor: grabbing; }

.sortable-item:hover {
    border-color: var(--border-hover);
    background: var(--bg-glass-strong);
}

.sortable-item.dragging {
    opacity: 0.5;
    background: rgba(108,92,231,0.1);
    border-color: var(--primary);
}

.sortable-handle {
    color: var(--text-muted);
    cursor: grab;
}

.sortable-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.sortable-name {
    flex: 1;
    font-weight: 600;
}

.sortable-order {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-glass-strong);
    padding: 2px 8px;
    border-radius: 4px;
}

.sortable-actions {
    display: flex;
    gap: 6px;
}

/* ============================================
   Create Order from Admin
   ============================================ */
.invoice-items-table {
    width: 100%;
    margin-bottom: 16px;
}

.invoice-items-table th {
    padding: 10px;
    text-align: right;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.invoice-items-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
}

.invoice-items-table .form-control {
    padding: 8px 10px;
    font-size: 0.85rem;
}

.invoice-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-glass);
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    font-weight: 700;
}

.invoice-total-row .amount {
    color: var(--secondary);
    font-size: 1.3rem;
}

/* ============================================
   Search & Filters
   ============================================ */
.filters-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.search-box {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 10px 14px 10px 36px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.9rem;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* ============================================
   Dept Tabs
   ============================================ */
.dept-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 24px;
}

.dept-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-family: var(--font);
}

.dept-tab:hover {
    background: var(--bg-glass-strong);
    color: var(--text-primary);
}

.dept-tab.active {
    background: linear-gradient(135deg, rgba(108,92,231,0.2), rgba(108,92,231,0.05));
    color: var(--primary-light);
    border-color: var(--primary);
}

.dept-tab .tab-count {
    padding: 1px 8px;
    background: var(--bg-glass-strong);
    border-radius: 10px;
    font-size: 0.7rem;
}

.dept-tab.active .tab-count {
    background: var(--primary);
    color: white;
}

/* ============================================
   PDF File List (Admin only)
   ============================================ */
.pdf-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pdf-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.pdf-item i {
    color: #e74c3c;
    font-size: 1.2rem;
}

.pdf-item-name {
    flex: 1;
    font-size: 0.88rem;
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

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

/* ============================================
   Alerts
   ============================================ */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: rgba(0,184,148,0.1);
    border: 1px solid rgba(0,184,148,0.2);
    color: var(--success);
}

.alert-danger {
    background: rgba(214,48,49,0.1);
    border: 1px solid rgba(214,48,49,0.2);
    color: var(--danger);
}

.alert-warning {
    background: rgba(253,203,110,0.1);
    border: 1px solid rgba(253,203,110,0.2);
    color: var(--warning);
}

/* ============================================
   Login Page
   ============================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.login-card .logo {
    justify-content: center;
    margin-bottom: 32px;
    font-size: 1.6rem;
}

.login-card h2 {
    margin-bottom: 8px;
    font-size: 1.4rem;
}

.login-card p {
    color: var(--text-muted);
    margin-bottom: 28px;
    font-size: 0.9rem;
}

.login-card .form-group {
    text-align: right;
}

.login-card .btn-primary {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    justify-content: center;
    margin-top: 8px;
}

/* ============================================
   Responsive
   ============================================ */
.mobile-toggle {
    display: none;
    width: 40px;
    height: 40px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1.1rem;
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(100%);
    }

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

    .main-content {
        margin-right: 0;
    }

    .mobile-toggle {
        display: flex;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .page-content {
        padding: 20px 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .top-bar {
        padding: 0 16px;
    }
}

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

/* ============================================
   Scrollbar
   ============================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-glass-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ============================================
   Toast (Admin)
   ============================================ */
.admin-toast-container {
    position: fixed;
    top: 80px;
    left: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-toast {
    padding: 12px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow);
    animation: toastSlideIn 0.3s ease;
    min-width: 260px;
    font-size: 0.9rem;
    backdrop-filter: blur(20px);
}

.admin-toast.success { border-color: var(--success); }
.admin-toast.success i { color: var(--success); }
.admin-toast.error { border-color: var(--danger); }
.admin-toast.error i { color: var(--danger); }

@keyframes toastSlideIn {
    from { opacity:0; transform: translateX(-20px); }
    to { opacity:1; transform: translateX(0); }
}
