:root {
    /* Brand / surface / accent / glass tokens now live in tokens.css
       (single source of truth, shared with the student portal).
       Only app-specific tokens remain here. */
    --bg-surface-hover: rgba(15, 23, 42, 0.8);
    --border-color: rgba(255, 255, 255, 0.09);  /* was 0.03 — was nearly invisible */
    --sidebar-width: 280px;
    --transition-speed: 0.3s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Tajawal', 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    /* Soft premium background mesh gradient optimized for long working hours */
    background-image: 
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.12) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(139, 92, 246, 0.12) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.06) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(239, 68, 68, 0.06) 0px, transparent 50%);
    background-attachment: fixed;
}

/* Typography */
h1, h2, h3, h4, h5, h6 { font-weight: 700; }
a { text-decoration: none; color: inherit; }

/* Utilities */
.glass-panel {
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    position: fixed;
    top: 0;
    right: 0;
    height: 100dvh;
    max-height: 100dvh;
    min-height: 0;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    z-index: 1200;
    border-radius: 0;
    border-right: none;
    border-left: var(--glass-border);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-gutter: stable;
}

/* Slim scrollbar for the sidebar (WebKit) */
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.14);
    border-radius: 8px;
}
.sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.24); }

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.brand .logo-icon {
    font-size: 2rem;
    color: var(--accent-primary);
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    color: var(--text-secondary);
    transition: all var(--transition-speed) ease;
    font-size: 1.1rem;
    font-weight: 600;
}

.nav-item:hover, .nav-item.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    transform: translateX(-5px);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.2), transparent);
    border-right: 4px solid var(--accent-primary);
}

.nav-item i {
    width: 24px;
    font-size: 1.2rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: var(--glass-border);
}

.user-info .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.user-info .details {
    display: flex;
    flex-direction: column;
}

.user-info .name { font-weight: 700; font-size: 1rem; }
.user-info .role { font-size: 0.8rem; color: var(--text-secondary); }

/* Main Content */
.main-content {
    flex: 1;
    margin-right: var(--sidebar-width);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    position: relative;
    z-index: 1000;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1.5rem;
    flex: 1;
    max-width: 500px;
    position: relative;
    z-index: 1001;
}

.search-bar input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    width: 100%;
    outline: none;
}

.search-bar input::placeholder { color: var(--text-secondary); }

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.action-btn {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    cursor: pointer;
    border: var(--glass-border);
    transition: all var(--transition-speed);
}

.action-btn:hover {
    background: var(--bg-surface-hover);
    transform: translateY(-2px);
}

.date-display {
    padding: 0.8rem 1.5rem;
    font-weight: 600;
    letter-spacing: 1px;
}

/* Views Container */
#views-container { position: relative; }
.view-section {
    display: none;
    animation: fadeIn 0.4s ease-out;
}
.view-section.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-header { margin-bottom: 2rem; }
.section-header h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.section-header p { color: var(--text-secondary); font-size: 1.1rem; }

/* Dashboard Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: transform var(--transition-speed);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 100%; height: 4px;
}

.card.gradient-1::before { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.card.gradient-2::before { background: linear-gradient(90deg, #10b981, #34d399); }
.card.gradient-3::before { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.card.gradient-4::before { background: linear-gradient(90deg, #ef4444, #f87171); }

.card:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0,0,0,0.4); }

.card-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.card.gradient-1 .card-icon { color: #60a5fa; }
.card.gradient-2 .card-icon { color: #34d399; }
.card.gradient-3 .card-icon { color: #a78bfa; }
.card.gradient-4 .card-icon { color: #f87171; }

.card-info { flex: 1; }
.card-info h3 { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 0.5rem; font-weight: 600; }
.card-info h2 { font-size: 1.8rem; margin-bottom: 0.5rem; font-family: 'Outfit', sans-serif; }
.card-info .trend { font-size: 0.85rem; display: flex; align-items: center; gap: 0.5rem; }
.trend.positive { color: var(--accent-success); }
.trend.negative { color: var(--accent-danger); }

/* Charts */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.charts-grid.single-col { grid-template-columns: 1fr; }

.chart-container {
    padding: 1.5rem;
    min-height: 350px;
    display: flex;
    flex-direction: column;
}

.chart-container h3 {
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-wrapper {
    position: relative;
    flex: 1;
    min-height: 0;
    width: 100%;
}

.chart-container canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
}

/* Tables */
.data-tables-grid { margin-bottom: 2rem; }
.table-container { padding: 1.5rem; overflow-x: auto; }
.table-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }

.modern-table {
    width: 100%;
    border-collapse: collapse;
    text-align: right;
}

.modern-table th {
    padding: 1rem;
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

.modern-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
}

.tax-unit-tab.active {
    background: var(--accent-primary) !important;
    color: white !important;
    border-color: var(--accent-primary) !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2) !important;
}

.modern-table tbody tr { transition: background var(--transition-speed); }
.modern-table tbody tr:hover { background: rgba(255, 255, 255, 0.03); }

/* Badges */
.badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}
.badge.success { background: rgba(16, 185, 129, 0.2); color: var(--accent-success); }
.badge.warning { background: rgba(245, 158, 11, 0.2); color: var(--accent-warning); }
.badge.danger { background: rgba(239, 68, 68, 0.2); color: var(--accent-danger); }

/* Responsive */
@media (max-width: 1024px) {
    .charts-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(100%); transition: transform var(--transition-speed); }
    .main-content { margin-right: 0; }
    .top-header { flex-direction: column; align-items: stretch; }
    .search-bar { max-width: 100%; }
}

/* Attachment preview styles */
.attachment-badge {
    position: relative;
    z-index: 50;
}
.attachment-hover-preview {
    display: none;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    background: rgba(15, 23, 42, 0.98);
    border: var(--glass-border);
    padding: 0.6rem;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.7), 0 8px 10px -6px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(16px);
    pointer-events: none;
    animation: previewFadeIn 0.2s ease-out;
}
.attachment-badge:hover .attachment-hover-preview {
    display: block;
}
@keyframes previewFadeIn {
    from { opacity: 0; transform: translate(-50%, 5px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* Financials Tab Navigation System */
.financials-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.financials-tabs::-webkit-scrollbar {
    height: 4px;
}

.financials-tabs::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.financial-tab {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.financial-tab:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.financial-tab.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

/* Manager Workspace view tabs (إدارة الفريق) */
.mgr-view-tab {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    padding: 0.6rem 1.15rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.mgr-view-tab:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.mgr-view-tab.active {
    background: var(--accent-primary);
    color: #fff;
    border-color: var(--accent-primary);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.mgr-tab-count {
    display: none;
    min-width: 1.3rem;
    padding: 0 0.35rem;
    border-radius: 9px;
    background: rgba(0, 0, 0, 0.28);
    font-size: 0.72rem;
    line-height: 1.4rem;
    text-align: center;
    font-weight: 700;
}

.mgr-tab-count.show {
    display: inline-block;
}

.mgr-tab-count-alert.show {
    background: var(--accent-danger);
    color: #fff;
}

/* Drag & drop kanban */
.mgr-task-card { cursor: grab; }
.mgr-task-card.dragging { opacity: 0.45; }
.mgr-kanban-col.drop-hover {
    background: rgba(59, 130, 246, 0.08);
    outline: 2px dashed var(--accent-primary);
    outline-offset: 2px;
    border-radius: 8px;
}

/* Deadline state pills on task cards */
.mgr-due-pill {
    display: inline-block;
    padding: 0.05rem 0.45rem;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    margin-top: 0.3rem;
}
.mgr-due-overdue { background: rgba(239, 68, 68, 0.18); color: var(--accent-danger); }
.mgr-due-soon { background: rgba(245, 158, 11, 0.18); color: var(--accent-warning); }

.view-section-sub {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.view-section-sub.active {
    display: block;
}

/* Fix financials layout overflow */
#financials {
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

#financials-subcontent {
    max-width: 100%;
    overflow-x: hidden;
}

#financials .view-section-sub {
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

#financials .summary-cards {
    max-width: 100%;
    box-sizing: border-box;
}

#financials .table-container {
    max-width: 100%;
    overflow-x: auto;
    box-sizing: border-box;
}

#financials .modern-table {
    min-width: 600px;
}

#financials .data-tables-grid {
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

/* Ensure views-container never overflows */
#views-container {
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

.main-content {
    max-width: calc(100vw - var(--sidebar-width));
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Fix financials tabs scrollbar on small screens */
.financials-tabs {
    flex-wrap: nowrap;
    max-width: 100%;
}

/* Quick Export Buttons Custom Component */
.quick-export-btn {
    width: 100% !important;
    height: auto !important;
    min-height: 52px;
    padding: 0.9rem 1.25rem;
    border-radius: 12px;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0.75rem;
    color: var(--text-primary);
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    text-align: right;
    box-sizing: border-box;
}

.quick-export-btn i {
    font-size: 1.25rem;
    transition: transform var(--transition-speed) ease;
}

.quick-export-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    filter: brightness(1.15);
}

.quick-export-btn:hover i {
    transform: scale(1.15);
}

.quick-export-btn.excel-theme {
    background: rgba(16, 185, 129, 0.08) !important;
    border: 1px solid rgba(16, 185, 129, 0.25) !important;
}

.quick-export-btn.excel-theme:hover {
    background: rgba(16, 185, 129, 0.15) !important;
    border-color: rgba(16, 185, 129, 0.45) !important;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.15);
}

.quick-export-btn.danger-theme {
    background: rgba(239, 68, 68, 0.1) !important;
    border: 1px solid rgba(239, 68, 68, 0.25) !important;
}

.quick-export-btn.danger-theme:hover {
    background: rgba(239, 68, 68, 0.18) !important;
    border-color: rgba(239, 68, 68, 0.45) !important;
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.15);
}

/* Settings Tab Navigation System */
.settings-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.settings-tabs::-webkit-scrollbar {
    height: 4px;
}

.settings-tabs::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.settings-tab {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.settings-tab:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.settings-tab.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

/* =========================================================================
   === PREMIUM LOGIN PAGE & PERMISSION BADGES STYLE ===
   ========================================================================= */

#login-container input:focus {
    border-color: var(--accent-primary) !important;
    background: rgba(0, 0, 0, 0.6) !important;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.25) !important;
}

#login-container button:hover {
    background: #2563eb !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4) !important;
}

#login-container button:active {
    transform: translateY(0);
}

.permission-badge-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    border: var(--glass-border);
    margin: 0.15rem;
    user-select: none;
    font-family: 'Tajawal', sans-serif;
}

.permission-badge-toggle.active {
    background: rgba(16, 185, 129, 0.2) !important;
    border-color: var(--accent-success) !important;
    color: var(--accent-success) !important;
}

.permission-badge-toggle.inactive {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: var(--text-secondary) !important;
}

.permission-badge-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* === ACADEMIC / CPA TAB STYLES === */
.academic-tab {
    padding: 0.6rem 1.2rem;
    border: var(--glass-border);
    background: rgba(255,255,255,0.03);
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    white-space: nowrap;
}
.academic-tab:hover {
    background: rgba(255,255,255,0.08);
    color: var(--text-primary);
}
.academic-tab.active {
    background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(139,92,246,0.15));
    color: var(--accent-secondary);
    border-color: rgba(139,92,246,0.3);
    font-weight: 600;
    box-shadow: 0 0 12px rgba(139,92,246,0.15);
}
.cpa-score-input:focus {
    border-color: var(--accent-secondary) !important;
    box-shadow: 0 0 10px rgba(139,92,246,0.2);
}
.cpa-score-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.cpa-attendance-select {
    padding: 0.35rem;
    border: var(--glass-border);
    border-radius: 6px;
    color: white;
    background: rgba(0,0,0,0.3);
    font-family: inherit;
    font-size: 0.8rem;
    outline: none;
}
.cpa-attendance-select:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.cpa-lecture-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.6rem 0.8rem;
    background: rgba(255,255,255,0.03);
    border: var(--glass-border);
    border-radius: 8px;
    transition: background 0.2s;
}
.cpa-lecture-row:hover {
    background: rgba(255,255,255,0.06);
}

/* === CALENDAR & STATISTICS PREMIUM STYLES === */
.calendar-month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    width: 100%;
}
.calendar-header-day {
    padding: 0.75rem;
    text-align: center;
    font-weight: bold;
    color: var(--text-secondary);
    background: rgba(255,255,255,0.02);
    border-radius: 8px;
    font-size: 0.9rem;
}
.calendar-day-cell {
    min-height: 100px;
    padding: 0.5rem;
    border: var(--glass-border);
    border-radius: 10px;
    background: rgba(255,255,255,0.01);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    position: relative;
    transition: all 0.2s;
}
.calendar-day-cell:hover {
    background: rgba(255,255,255,0.04);
}
.calendar-day-cell.empty {
    opacity: 0.25;
    background: transparent;
}
.calendar-day-cell.today {
    background: rgba(99,102,241,0.08);
    border-color: rgba(99,102,241,0.5);
    box-shadow: 0 0 10px rgba(99,102,241,0.1);
}
.calendar-day-num {
    font-weight: bold;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: left;
}
.calendar-day-cell.today .calendar-day-num {
    color: var(--accent-secondary);
}
.calendar-event-badge {
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: transform 0.15s;
    border-right: 3px solid transparent;
}
.calendar-event-badge:hover {
    transform: scale(1.02);
    filter: brightness(1.1);
}
.calendar-event-badge.branch-ghamra {
    background: rgba(59,130,246,0.15);
    border: 1px solid rgba(59,130,246,0.3);
    border-right-color: var(--accent-primary);
    color: #60a5fa;
}
.calendar-event-badge.branch-tagamoa {
    background: rgba(139,92,246,0.15);
    border: 1px solid rgba(139,92,246,0.3);
    border-right-color: var(--accent-secondary);
    color: #c084fc;
}
.calendar-event-badge.branch-online {
    background: rgba(16,185,129,0.15);
    border: 1px solid rgba(16,185,129,0.3);
    border-right-color: var(--accent-success);
    color: #34d399;
}

/* Weekly & Daily Views */
.calendar-week-grid {
    display: grid;
    grid-template-columns: 80px repeat(7, 1fr);
    gap: 0.5rem;
    width: 100%;
}
.calendar-time-col {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    border-left: 1px solid rgba(255,255,255,0.05);
}

/* Stats Progress */
.stats-ranking-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.8rem;
    background: rgba(255,255,255,0.02);
    border: var(--glass-border);
    border-radius: 8px;
    font-size: 0.9rem;
    transition: background 0.2s;
}
.stats-ranking-row:hover {
    background: rgba(255,255,255,0.04);
}

/* Sidebar Accordion Submenu Styles */
.sidebar-submenu {
    display: none;
    flex-direction: column;
    padding-right: 1.2rem;
    margin-top: 0.25rem;
    border-right: 1px dashed rgba(255, 255, 255, 0.08);
    margin-right: 1.4rem;
    animation: submenuSlideDown 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes submenuSlideDown {
    from { opacity: 0; transform: translateY(-8px); max-height: 0; }
    to { opacity: 1; transform: translateY(0); max-height: 1000px; }
}

.submenu-group-label {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.28);
    font-weight: 700;
    margin-top: 0.6rem;
    margin-bottom: 0.2rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    letter-spacing: 0.5px;
}

.submenu-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    transition: all var(--transition-speed) ease;
    cursor: pointer;
}

.submenu-item i {
    width: 14px;
    font-size: 0.85rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    transition: color 0.2s;
}

.submenu-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    transform: translateX(-3px);
}

.submenu-item:hover i {
    color: var(--accent-primary);
}

.submenu-item.active {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.15), transparent);
    color: #60a5fa;
    border-right: 2px solid var(--accent-primary);
}

.submenu-item.active i {
    color: #60a5fa;
}

.submenu-chevron {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-submenu.active {
    display: flex;
}

/* === PREMIUM HR SUB-TAB STYLES === */
.hr-tab {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.hr-tab:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.hr-tab.active {
    background: var(--accent-warning);
    color: #111;
    border-color: var(--accent-warning);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

/* =========================================================================
   === PROFESSIONAL DENTAL CLINIC SUBSYSTEM (Dentalore Styles) ===
   ========================================================================= */

/* EHR / Patient Odontogram Chart styling */
.odontogram-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 16px;
    border: var(--glass-border);
    direction: ltr; /* Tooth numbers are international standard LTR layout */
}

.odontogram-row {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.odontogram-divider {
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    margin: 0.5rem 0;
}

.tooth-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    width: 62px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    user-select: none;
}

.tooth-item:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateY(-4px);
    box-shadow: 0 6px 15px rgba(59, 130, 246, 0.15);
}

.tooth-item.active {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.35);
}

.tooth-number {
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--text-secondary);
}

.tooth-item:hover .tooth-number {
    color: var(--text-primary);
}

/* Teeth SVG States color markers */
.tooth-svg {
    width: 32px;
    height: 42px;
    transition: filter 0.3s;
}

.tooth-svg path {
    fill: #e2e8f0; /* Default healthy enamel white/grey */
    stroke: #334155;
    stroke-width: 1.5;
    transition: fill 0.3s, stroke 0.3s;
}

/* Tooth states */
.tooth-item.state-normal .tooth-svg path { fill: #f8fafc; stroke: #64748b; }
.tooth-item.state-missing { opacity: 0.35; }
.tooth-item.state-missing .tooth-svg path { fill: #334155; stroke: #0f172a; }
.tooth-item.state-root-canal .tooth-svg path { fill: #fdba74; stroke: #ea580c; } /* Pulp filled Orange */
.tooth-item.state-composite .tooth-svg path { fill: #93c5fd; stroke: #2563eb; } /* Filled Blue */
.tooth-item.state-crown .tooth-svg path { fill: #a7f3d0; stroke: #059669; } /* Crown Green */

.tooth-status-badge {
    position: absolute;
    bottom: -6px;
    font-size: 0.55rem;
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: bold;
    white-space: nowrap;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}
.tooth-status-badge.normal { display: none; }
.tooth-status-badge.missing { background: #475569; color: white; }
.tooth-status-badge.root-canal { background: #ea580c; color: white; }
.tooth-status-badge.composite { background: #2563eb; color: white; }
.tooth-status-badge.crown { background: #059669; color: white; }

/* Live Queue Digital Waiting Room */
.live-queue-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 1rem;
    min-height: 400px;
}

/* Merged clinic day board: 5 stages, horizontal scroll on narrow screens */
.live-queue-grid.clinic-day-board {
    grid-template-columns: repeat(5, minmax(230px, 1fr));
    gap: 1rem;
    margin-top: 0;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}
@media (max-width: 1200px) {
    .live-queue-grid.clinic-day-board {
        grid-auto-flow: column;
        grid-auto-columns: minmax(240px, 1fr);
        grid-template-columns: none;
    }
}
/* Collapsed "غادر" column shows only its header */
.clinic-day-board .queue-column.queue-column-collapsed {
    min-height: 0;
}
.clinic-day-board .queue-column.queue-column-collapsed .queue-list {
    display: none;
}
.clinic-day-board .queue-column.queue-column-collapsed .queue-column-header {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
/* Wait-time pill on waiting cards */
.wait-timer {
    font-size: 0.7rem;
    font-family: 'Outfit';
    padding: 1px 7px;
    border-radius: 20px;
    background: rgba(245, 158, 11, 0.15);
    color: #fde047;
    white-space: nowrap;
}
.wait-timer.wait-long {
    background: rgba(239, 68, 68, 0.18);
    color: #fca5a5;
}

.queue-column {
    padding: 1.25rem;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 16px;
    border: var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 250px;
    transition: background 0.3s;
}

.queue-column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.75rem;
    margin-bottom: 0.5rem;
}

.queue-column-header h3 {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.queue-count-badge {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
}

.queue-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
    overflow-y: auto;
    max-height: 450px;
}

.queue-card {
    padding: 1rem;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.queue-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(30, 41, 59, 0.85);
    box-shadow: var(--glass-shadow);
}

.queue-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.queue-card-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.queue-card-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: monospace;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.queue-card-body {
    font-size: 0.82rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.queue-card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    padding-top: 0.5rem;
}

.queue-card-btn {
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.25s;
    border: none;
    font-family: inherit;
}

/* Scheduler styles */
.clinic-appointments-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.clinic-appointment-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.25rem;
    background: rgba(255, 255, 255, 0.02);
    border: var(--glass-border);
    border-radius: 12px;
    transition: all 0.25s;
}

.clinic-appointment-row:hover {
    background: rgba(255, 255, 255, 0.05);
}

.appointment-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.appointment-time {
    font-family: monospace;
    font-weight: bold;
    color: var(--accent-primary);
    background: rgba(59, 130, 246, 0.15);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
}

.appointment-patient {
    font-weight: bold;
    font-size: 0.95rem;
}

.appointment-type-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: bold;
    color: white;
}
.appointment-type-badge.c1 { background: #3b82f6; } /* كشف */
.appointment-type-badge.c2 { background: #8b5cf6; } /* استشارة */
.appointment-type-badge.c3 { background: #10b981; } /* جلسة */

/* Odontogram selector dialog styling */
.odont_tooth_option {
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.25s;
}
.odont_tooth_option:hover {
    background: rgba(255,255,255,0.06);
}
.odont_tooth_option.selected {
    border-color: var(--accent-primary);
    background: rgba(59, 130, 246, 0.12);
}

/* Implant / Bridge / Decay tooth states */
.tooth-item.state-implant .tooth-svg path { fill: #c4b5fd; stroke: #7c3aed; }
.tooth-item.state-bridge .tooth-svg path { fill: #fde68a; stroke: #d97706; }
.tooth-item.state-decay .tooth-svg path { fill: #fca5a5; stroke: #ef4444; }
.tooth-status-badge.implant { background: #7c3aed; color: white; }
.tooth-status-badge.bridge { background: #d97706; color: white; }
.tooth-status-badge.decay { background: #ef4444; color: white; }

/* ── Clinic form group ── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.form-group label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}
.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.65rem 0.8rem;
    border: var(--glass-border);
    border-radius: 8px;
    color: white;
    background: rgba(0,0,0,0.3);
    outline: none;
    font-family: inherit;
    font-size: 0.88rem;
    transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: rgba(59,130,246,0.5);
}

/* Patient list card */
.patient-list-card {
    padding: 0.7rem 0.9rem;
    border-radius: 8px;
    cursor: pointer;
    background: rgba(255,255,255,0.01);
    border: 1px solid rgba(255,255,255,0.04);
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    transition: all 0.18s;
}
.patient-list-card:hover {
    background: rgba(59,130,246,0.08);
    border-color: rgba(59,130,246,0.25);
}
.patient-list-card.active {
    background: rgba(59,130,246,0.12);
    border-color: var(--accent-secondary);
}

/* Chair card */
.chair-card {
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.07);
    background: rgba(255,255,255,0.02);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: all 0.2s;
    position: relative;
}
.chair-card.available { border-color: rgba(16,185,129,0.3); }
.chair-card.occupied  { border-color: rgba(245,158,11,0.4); background: rgba(245,158,11,0.04); }
.chair-card.maintenance { border-color: rgba(239,68,68,0.35); background: rgba(239,68,68,0.04); }
.chair-label { font-weight: 700; font-size: 0.95rem; color: white; }
.chair-status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-left: 4px;
}
.chair-status-dot.available { background: #10b981; }
.chair-status-dot.occupied  { background: #f59e0b; }
.chair-status-dot.maintenance { background: #ef4444; }

/* Patient file sub-tabs */
.ptab-content { animation: fadeInTab 0.2s ease; }
@keyframes fadeInTab { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* Medical record timeline */
.medical-timeline-entry {
    display: flex;
    gap: 0.8rem;
    padding: 0.75rem 1rem;
    background: rgba(255,255,255,0.02);
    border: var(--glass-border);
    border-radius: 10px;
    border-right: 3px solid var(--accent-secondary);
}

/* Import wizard steps */
.import-step { color: var(--text-secondary); transition: background 0.2s; }
.import-step.active { background: rgba(59,130,246,0.2) !important; color: white; font-weight: bold; }

/* Services table active/inactive row */
tr.svc-inactive td { opacity: 0.45; }

/* Patient status badges */
.badge-active    { background: rgba(16,185,129,0.15); color: #6ee7b7; border: 1px solid rgba(16,185,129,0.3); padding: 2px 8px; border-radius: 20px; font-size: 0.75rem; }
.badge-stopped   { background: rgba(239,68,68,0.15); color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); padding: 2px 8px; border-radius: 20px; font-size: 0.75rem; }
.badge-archived  { background: rgba(100,116,139,0.15); color: #94a3b8; border: 1px solid rgba(100,116,139,0.3); padding: 2px 8px; border-radius: 20px; font-size: 0.75rem; }

/* Appt patient dropdown */
#appt-patient-dropdown .appt-patient-opt {
    padding: 0.6rem 0.9rem;
    cursor: pointer;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background 0.15s;
}
#appt-patient-dropdown .appt-patient-opt:hover { background: rgba(59,130,246,0.15); }



/* Radiology Dashboard Stats */
.stat-card { padding: 1.5rem; display: flex; align-items: center; gap: 1rem; border-radius: 12px; }
.stat-card .stat-icon { font-size: 2rem; width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(0,0,0,0.05); }
.stat-card .stat-info { display: flex; flex-direction: column; }
.stat-card .stat-value { font-size: 1.6rem; font-weight: bold; line-height: 1.2; }
.stat-card .stat-label { font-size: 0.9rem; color: var(--text-secondary); margin-top: 0.2rem; }

/* ── Inventory System Tabs ── */
.inv-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.inv-tab {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    font-size: 0.95rem;
    font-family: Tajawal, sans-serif;
    font-weight: 500;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    border-radius: 6px 6px 0 0;
    transition: all 0.2s ease;
}

.inv-tab:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.inv-tab.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
    background: rgba(59, 130, 246, 0.08);
}

.inv-pane {
    display: none;
}

.inv-pane.active {
    display: block;
    animation: fadeInTab 0.3s ease;
}

/* ── Inventory Quick Operations Cards ── */
.inv-op-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.5rem;
    gap: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.inv-op-card i {
    font-size: 2rem;
    opacity: 0.9;
}

.inv-op-card span {
    font-size: 1rem;
    font-weight: bold;
    line-height: 1.3;
}

.inv-op-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.15);
}

/* ============================================================
   Clinic Day Board — big appointment scheduler (day/week/month)
   Restored 2026-06-14. The grid layout itself is set inline by
   app.js (renderClinicDaySchedule); these rules add theming/polish.
   ============================================================ */
.clinic-day-layout {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.clinic-scheduler-panel,
.clinic-today-panel,
.clinic-live-panel {
    padding: 1.1rem 1.25rem;
    border-radius: 14px;
}
.clinic-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.clinic-panel-head h3 { margin: 0 0 0.2rem; }
.clinic-panel-head p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.clinic-primary-btn {
    width: auto;
    padding: 0.5rem 1rem;
    height: 38px;
    border: none;
    background: var(--accent-primary);
    color: #fff;
    font-weight: bold;
    font-size: 0.82rem;
}
.clinic-scheduler-toolbar,
.clinic-inline-controls {
    display: flex;
    gap: 0.55rem;
    align-items: center;
    flex-wrap: wrap;
}
.clinic-scheduler-toolbar { margin-bottom: 0.9rem; }
.clinic-control {
    padding: 0.45rem 0.7rem;
    border: var(--glass-border);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-primary);
    outline: none;
    font-family: inherit;
    font-size: 0.85rem;
    min-width: 120px;
}
.clinic-view-switch {
    display: inline-flex;
    border-radius: 8px;
    overflow: hidden;
    border: var(--glass-border);
}
.clinic-view-switch button {
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    padding: 0.45rem 0.9rem;
    font-family: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.clinic-view-switch button + button { border-right: var(--glass-border); }
.clinic-view-switch button:hover { background: rgba(255, 255, 255, 0.1); color: var(--text-primary); }
.clinic-view-switch button.active { background: var(--accent-primary); color: #fff; }
.clinic-schedule-title {
    color: var(--text-secondary);
    font-size: 0.82rem;
    margin-bottom: 0.6rem;
}

/* --- The time grid (day & week share lane/slot/event classes) --- */
.clinic-time-grid,
.clinic-week-grid {
    display: grid;
    border: var(--glass-border);
    border-radius: 10px;
    overflow: auto;
    max-height: 640px;
    background: rgba(0, 0, 0, 0.18);
}
.clinic-week-time-head,
.clinic-week-day-head {
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 0.5rem 0.4rem;
    text-align: center;
    font-size: 0.78rem;
    font-weight: bold;
    color: var(--text-primary);
    background: rgba(15, 23, 42, 0.95);
    border-bottom: var(--glass-border);
}
.clinic-time-ruler {
    display: grid;
    border-left: var(--glass-border);
}
.clinic-slot-time {
    font-size: 0.68rem;
    color: var(--text-secondary);
    text-align: center;
    padding-top: 2px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.clinic-lane {
    display: grid;
    position: relative;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
}
.clinic-lane-slot {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    background: transparent;
    cursor: pointer;
    transition: background 0.12s;
}
.clinic-lane-slot:hover { background: rgba(99, 102, 241, 0.18); }
.clinic-slot-event {
    position: relative;
    z-index: 2;
    margin: 1px 2px;
    border-radius: 6px;
    padding: 3px 6px;
    background: linear-gradient(135deg, var(--accent-primary), #4f46e5);
    color: #fff;
    font-size: 0.7rem;
    line-height: 1.25;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 1px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
.clinic-slot-event strong { font-size: 0.72rem; font-weight: 700; }
.clinic-slot-event span {
    opacity: 0.85;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.clinic-slot-event.masked {
    background: rgba(100, 116, 139, 0.55);
    color: #e2e8f0;
    cursor: default;
}
.clinic-slot-event.has-conflict {
    background: linear-gradient(135deg, var(--accent-danger), #b91c1c);
    outline: 1px solid #fca5a5;
}
.clinic-slot-event em {
    font-style: normal;
    font-size: 0.64rem;
    color: #fee2e2;
}
.clinic-event-resize {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 6px;
    border: none;
    background: rgba(255, 255, 255, 0.25);
    cursor: ns-resize;
}
.clinic-event-resize:hover { background: rgba(255, 255, 255, 0.5); }

/* --- Month calendar --- */
.clinic-month-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    border: var(--glass-border);
    border-radius: 10px;
    padding: 6px;
    background: rgba(0, 0, 0, 0.18);
}
.clinic-month-head {
    text-align: center;
    font-size: 0.76rem;
    font-weight: bold;
    color: var(--text-secondary);
    padding: 0.4rem 0;
}
.clinic-month-day {
    min-height: 92px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.clinic-month-day:hover { background: rgba(99, 102, 241, 0.12); border-color: rgba(99, 102, 241, 0.4); }
.clinic-month-day.is-muted { background: transparent; border-color: transparent; cursor: default; }
.clinic-month-day.today { border-color: var(--accent-primary); box-shadow: inset 0 0 0 1px var(--accent-primary); }
.clinic-month-day-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.clinic-month-day-num { font-size: 0.78rem; font-weight: bold; color: var(--text-primary); }
.clinic-month-book {
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    width: 20px;
    height: 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.7rem;
    line-height: 1;
}
.clinic-month-book:hover { background: var(--accent-primary); color: #fff; }
.clinic-month-events { display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.clinic-month-event {
    font-size: 0.66rem;
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(99, 102, 241, 0.3);
    color: #e0e7ff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}
.clinic-month-more { font-size: 0.64rem; color: var(--text-secondary); padding: 0 5px; }

@media (max-width: 720px) {
    .clinic-month-day { min-height: 64px; }
    .clinic-scheduler-panel,
    .clinic-today-panel,
    .clinic-live-panel { padding: 0.85rem; }
}

/* DG tab alignment patch */
.financial-tab,
.hr-tab,
.settings-tab,
.tab,
.staffspace-tabs .staffspace-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 40px;
    line-height: 1.35;
    white-space: nowrap;
    flex: 0 0 auto;
}
.financial-tab i,
.hr-tab i,
.settings-tab i,
.tab i,
.staffspace-tabs .staffspace-tab i {
    width: 1.1em;
    min-width: 1.1em;
    text-align: center;
    line-height: 1;
}
/* Unified academic content catalog */
.academic-content-filters{display:grid;grid-template-columns:minmax(220px,2fr) repeat(3,minmax(140px,1fr));gap:.55rem;margin-bottom:.85rem}
.academic-content-card{display:flex;align-items:center;gap:.75rem;padding:.75rem .85rem;border-radius:11px;background:rgba(255,255,255,.025)}
.academic-content-icon{width:42px;height:42px;border-radius:11px;display:grid;place-items:center;flex:0 0 auto;background:rgba(99,102,241,.14);color:var(--accent-primary)}
.academic-content-icon.live{color:#ef4444;background:rgba(239,68,68,.12)}
.academic-content-icon.exam{color:var(--accent-secondary);background:rgba(139,92,246,.12)}
.academic-content-icon.handout{color:#f97316;background:rgba(249,115,22,.12)}
.academic-content-card-body{flex:1;min-width:0}
.academic-content-title{display:flex;gap:.5rem;align-items:center;flex-wrap:wrap}.academic-content-title span{font-size:.66rem;color:var(--text-muted)}
.academic-content-actions{display:flex;gap:.4rem;align-items:center;flex-wrap:wrap}.academic-content-actions .inp{width:auto;min-width:125px;padding:.35rem}.academic-content-actions .action-btn{width:auto;padding:.35rem .6rem;font-size:.72rem;white-space:nowrap}.academic-content-attach{color:var(--accent-success)!important}
.lms-content-status{font-size:.68rem;padding:.2rem .5rem;border-radius:999px;background:rgba(255,255,255,.06);color:var(--text-secondary)}.lms-content-status.published{color:var(--accent-success);background:rgba(34,197,94,.1)}.lms-content-status.archived{color:var(--text-muted)}
.academic-video-preview{aspect-ratio:16/9;background:#000;border-radius:12px;overflow:hidden}.academic-video-preview iframe,.academic-video-preview video{width:100%;height:100%;border:0}
.academic-live-preview{display:flex;flex-direction:column;gap:.7rem;align-items:center;text-align:center;padding:2rem;border-radius:14px;background:rgba(239,68,68,.08);color:#fca5a5}.academic-live-preview>i{font-size:2.4rem}
.academic-preview-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:.65rem}.academic-preview-stats span{padding:1rem;text-align:center;border-radius:10px;background:rgba(255,255,255,.04);color:var(--text-secondary)}.academic-preview-stats strong{display:block;font-size:1.35rem;color:white}
.academic-html-preview{display:block;width:100%;padding:0;border:0;border-radius:10px;background:white;color:#111;min-height:280px}
@media(max-width:820px){.academic-content-filters{grid-template-columns:1fr 1fr}.academic-content-card{align-items:flex-start;flex-wrap:wrap}.academic-content-card-body{min-width:calc(100% - 60px)}.academic-content-actions{width:100%}.academic-content-actions .inp{flex:1}.academic-preview-stats{grid-template-columns:1fr}}


/* Clinic Settings Hub — structured management workspace */
.clinic-config-hub { min-width:0; }
.clinic-config-hero { display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:1rem; align-items:center; padding:1.2rem 1.35rem; margin-bottom:1rem; border:1px solid rgba(99,102,241,.28); background:linear-gradient(120deg,rgba(79,70,229,.20),rgba(15,23,42,.45) 48%,rgba(14,165,233,.08)); }
.clinic-config-hero-icon { width:50px; height:50px; display:grid; place-items:center; border-radius:15px; color:#fff; font-size:1.25rem; background:linear-gradient(135deg,var(--accent-primary),#7c3aed); box-shadow:0 10px 24px rgba(79,70,229,.28); }
.clinic-config-eyebrow { color:var(--accent-secondary); font-size:.74rem; font-weight:800; letter-spacing:.02em; }
.clinic-config-hero h2 { margin:.15rem 0; font-size:1.35rem; }
.clinic-config-hero p { margin:0; max-width:650px; color:var(--text-secondary); font-size:.86rem; line-height:1.7; }
.clinic-config-unit { display:flex; align-items:center; gap:.65rem; min-width:175px; padding:.65rem .75rem; border:1px solid rgba(255,255,255,.10); border-radius:12px; background:rgba(15,23,42,.42); }
.clinic-config-unit > i { color:var(--accent-success); font-size:1.05rem; }
.clinic-config-unit span { display:block; color:var(--text-secondary); font-size:.7rem; margin-bottom:.12rem; }
.clinic-config-unit strong { display:block; font-size:.84rem; }
.confighub-shell { display:grid; grid-template-columns:245px minmax(0,1fr); gap:1rem; align-items:start; }
.confighub-nav { position:sticky; top:1rem; display:flex; flex-direction:column; gap:.18rem; padding:.65rem; border-radius:14px; }
.confighub-nav-group { margin:.65rem .45rem .2rem; color:var(--text-secondary); font-size:.67rem; font-weight:800; letter-spacing:.04em; }
.confighub-nav-group:first-of-type { margin-top:.45rem; }
.confighub-nav-item { width:100%; display:flex; align-items:center; gap:.7rem; padding:.65rem .7rem; color:var(--text-secondary); background:transparent; border:1px solid transparent; border-radius:9px; font:inherit; font-size:.83rem; font-weight:700; text-align:right; cursor:pointer; transition:background .18s ease,border-color .18s ease,color .18s ease,transform .18s ease; }
.confighub-nav-item i { width:1.05rem; text-align:center; color:rgba(255,255,255,.48); }
.confighub-nav-item:hover { color:var(--text-primary); background:rgba(255,255,255,.055); transform:translateX(-2px); }
.confighub-nav-item.active { color:#fff; border-color:rgba(129,140,248,.48); background:linear-gradient(90deg,rgba(99,102,241,.32),rgba(99,102,241,.12)); box-shadow:inset -3px 0 0 var(--accent-primary); }
.confighub-nav-item.active i { color:#c4b5fd; }
.confighub-content { min-width:0; }
.confighub-page { min-width:0; animation:clinicConfigReveal .2s ease both; }
@keyframes clinicConfigReveal { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:translateY(0); } }
.confighub-page-head { display:flex; justify-content:space-between; align-items:flex-start; gap:1rem; margin:0 0 1rem; }
.confighub-page-head h3, .confighub-page-head h2 { margin:0; font-size:1.15rem; }
.confighub-page-head p { margin:.35rem 0 0; color:var(--text-secondary); font-size:.84rem; line-height:1.6; }
.confighub-actions { display:flex; gap:.5rem; flex-wrap:wrap; }
.confighub-actions .action-btn { width:auto; height:36px; padding:.45rem .8rem; }
.confighub-card-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.85rem; }
.confighub-card { --config-tone:var(--accent-primary); position:relative; min-height:178px; display:flex; flex-direction:column; align-items:flex-start; gap:.55rem; padding:1rem; overflow:hidden; color:var(--text-primary); text-align:right; font:inherit; background:rgba(15,23,42,.42); border:1px solid rgba(255,255,255,.09); border-radius:14px; cursor:pointer; transition:transform .2s ease,border-color .2s ease,background .2s ease,box-shadow .2s ease; }
.confighub-card::after { content:''; position:absolute; inset:auto -28px -40px auto; width:105px; height:105px; border-radius:50%; background:var(--config-tone); opacity:.08; transition:transform .25s ease; }
.confighub-card:hover { transform:translateY(-3px); border-color:var(--config-tone); background:rgba(30,41,59,.68); box-shadow:0 12px 24px rgba(0,0,0,.18); }
.confighub-card:hover::after { transform:scale(1.25); }
.confighub-card-icon { width:40px; height:40px; display:grid; place-items:center; border-radius:11px; color:var(--config-tone); background:rgba(255,255,255,.07); font-size:1rem; }
.confighub-card strong { font-size:.92rem; }
.confighub-card > span:not(.confighub-card-icon) { min-height:2.6em; color:var(--text-secondary); font-size:.78rem; line-height:1.65; }
.confighub-card em { display:inline-flex; align-items:center; gap:.35rem; margin-top:auto; color:var(--config-tone); font-size:.72rem; font-style:normal; font-weight:800; }
.confighub-card.tone-green { --config-tone:#34d399; }.confighub-card.tone-blue { --config-tone:#93c5fd; }.confighub-card.tone-cyan { --config-tone:#38bdf8; }.confighub-card.tone-purple { --config-tone:#c4b5fd; }.confighub-card.tone-amber { --config-tone:#fbbf24; }.confighub-card.tone-whatsapp { --config-tone:#4ade80; }.confighub-card.tone-slate { --config-tone:#94a3b8; }
.confighub-editor-panel { padding:1.25rem; }
