/* 
 * FSM — Faculty Scheduling Manager
 * Enterprise SaaS Premium Theme v3.0
 * Inspired by Linear, ClickUp, Vercel Dashboard
 */

/* ============================================
   1. CSS CUSTOM PROPERTIES
   ============================================ */
:root {
    /* Brand */
    --brand: #1ABB9C;
    --brand-hover: #169F85;
    --brand-soft: rgba(26, 187, 156, 0.12);

    /* Accent  */
    --accent: #3498DB;
    --accent-hover: #2A7FB8;
    --accent-soft: rgba(52, 152, 219, 0.1);

    /* Semantic */
    --success: #16a34a;
    --success-soft: #f0fdf4;
    --warning: #d97706;
    --warning-soft: #fffbeb;
    --danger: #dc2626;
    --danger-soft: #fef2f2;
    --info: #0284c7;
    --info-soft: #f0f9ff;

    /* Layout */
    --sidebar-width: 250px;
    --topbar-height: 56px;

    /* Sidebar — Dark slate (not pure black) */
    --bg-sidebar:     #141D28;
    --sidebar-text:   rgba(214,225,236,0.68);
    --sidebar-active: #ffffff;
    --sidebar-hover:  rgba(255,255,255,0.08);
    --sidebar-border: rgba(255,255,255,0.08);

    /* Page  */
    --bg-body:    #F7F7F7;
    --bg-card:    #FFFFFF;
    --bg-hover:   #F5F7FA;

    /* Text */
    --text-heading: #34495E;
    --text-body:    #43515C;
    --text-muted:   #5F7184;
    --text-faint:   #AAB6C2;

    /* Borders */
    --border:       #E6E9ED;
    --border-dark:  #D9DEE4;

    /* Radii */
    --radius-xs: 4px;
    --radius-sm: 3px;
    --radius:    4px;
    --radius-lg: 6px;
    --radius-xl: 8px;

    /* Shadows */
    --shadow-xs:  0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm:  0 1px 4px rgba(0,0,0,0.08);
    --shadow:     0 2px 8px rgba(0,0,0,0.08);
    --shadow-md:  0 10px 18px rgba(42,63,84,0.14);
    --shadow-lg:  0 18px 35px rgba(42,63,84,0.18);

    /* Topbar */
    --primary: #1ABB9C;
    --primary-hover: #169F85;
    --primary-soft: rgba(26, 187, 156, 0.12);
    --warn: #dc2626;
    --warn-hover: #b91c1c;
}

/* Dark mode */
.dark-mode {
    --bg-body:      #17212B;
    --bg-card:      #1F2D3A;
    --bg-hover:     #243746;
    --bg-sidebar:   #101821;
    --border:       rgba(255,255,255,0.09);
    --border-dark:  rgba(255,255,255,0.14);
    --text-heading: #ECF0F1;
    --text-body:    #C8D1DA;
    --text-muted:   #9FB0BE;
    --text-faint:   #708191;
    --primary-soft: rgba(26,187,156,0.18);
    --sidebar-hover: rgba(255,255,255,0.07);
}

/* ============================================
   2. BASE
   ============================================ */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    height: 100%;
    margin: 0;
}

body,
html body {
    background-color: var(--bg-body);
    color: var(--text-body);
    font-size: 15px;
    line-height: 1.5;
    transition: background-color 0.2s, color 0.2s;
}

a { text-decoration: none; }

/* ============================================
   3. LAYOUT
   ============================================ */
.erp-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.erp-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.erp-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px;
    background: var(--bg-body);
}

/* ============================================
   4. SIDEBAR
   ============================================ */
.erp-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    transition: width 0.3s cubic-bezier(0.4,0,0.2,1);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
}
.erp-sidebar::-webkit-scrollbar { display: none; }

/* Brand */
.erp-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px 14px;
    border-bottom: 1px solid var(--sidebar-border);
    text-decoration: none;
    flex-shrink: 0;
}

.erp-brand-icon {
    width: 30px;
    height: 30px;
    background: var(--brand);
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 14px;
    flex-shrink: 0;
    letter-spacing: -0.5px;
}

.erp-brand-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--sidebar-active);
    letter-spacing: -0.3px;
}

/* Nav Sections */
.erp-nav-section {
    padding: 8px 0 4px;
}

.erp-nav-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.25);
    padding: 10px 20px 4px;
    display: block;
}

/* Nav Items */
.erp-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    margin: 1px 8px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.15s ease;
    cursor: pointer;
    border: none;
    background: transparent;
    width: calc(100% - 16px);
    min-width: 0;
    line-height: 1.4;
}

.erp-nav-item:hover {
    background: var(--sidebar-hover);
    color: rgba(255,255,255,0.85);
}

.erp-nav-item.active {
    background: rgba(94,106,210,0.18);
    color: #818CF8;
    font-weight: 600;
}

.erp-nav-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.7;
}

.erp-nav-item.active svg { opacity: 1; }
.erp-nav-item:hover svg { opacity: 0.9; }

/* Dropdown Nav */
.erp-nav-dropdown { display: flex; flex-direction: column; }

.erp-dropdown-toggle {
    width: 100%;
    justify-content: flex-start !important;
}

.erp-dropdown-toggle .chevron {
    margin-left: auto;
    width: 14px !important;
    height: 14px !important;
    opacity: 0.4;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.erp-nav-dropdown.open .erp-dropdown-toggle .chevron { transform: rotate(180deg); }
.erp-nav-dropdown.open .erp-dropdown-toggle { color: rgba(255,255,255,0.8); }
.erp-nav-dropdown.open .erp-dropdown-toggle svg:first-child { opacity: 0.9; }

.erp-nav-dropdown .erp-dropdown-menu {
    position: static;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 0 0 0 40px;
    margin: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.erp-nav-dropdown.open .erp-dropdown-menu {
    max-height: 600px;
    padding-bottom: 4px;
}

.erp-nav-dropdown .erp-dropdown-menu a {
    display: flex;
    align-items: center;
    padding: 7px 12px;
    font-size: 12.5px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
    margin-right: 8px;
    font-weight: 400;
}

.erp-nav-dropdown .erp-dropdown-menu a:hover {
    background: var(--sidebar-hover);
    color: rgba(255,255,255,0.85);
}

.erp-nav-dropdown .erp-dropdown-menu a.active {
    color: #818CF8;
    font-weight: 600;
    background: rgba(94,106,210,0.12);
}

/* General Dropdown (topbar etc) */
.erp-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    display: none;
    min-width: 10rem;
    padding: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.erp-dropdown-menu.show { display: block; }

.erp-dropdown-item {
    display: block;
    width: 100%;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-body);
    background: transparent;
    border: 0;
    border-radius: var(--radius-sm);
    text-align: left;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.12s;
}

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

/* Collapsed sidebar */
.erp-sidebar.collapsed { width: 64px; }

.erp-sidebar.collapsed .erp-brand-name,
.erp-sidebar.collapsed .erp-nav-label,
.erp-sidebar.collapsed .erp-nav-item span,
.erp-sidebar.collapsed .chevron,
.erp-sidebar.collapsed .erp-user-name,
.erp-sidebar.collapsed .erp-user-role-wrap { display: none !important; }

.erp-sidebar.collapsed .erp-brand { justify-content: center; padding: 16px 0; }
.erp-sidebar.collapsed .erp-nav-item { justify-content: center; padding: 10px 0; width: auto; margin: 2px 8px; }
.erp-sidebar.collapsed .erp-nav-item svg { width: 18px; height: 18px; margin: 0; opacity: 0.8; }
.erp-sidebar.collapsed .erp-nav-dropdown .erp-dropdown-menu { display: none !important; }

/* User panel at bottom */
.erp-user-panel {
    margin-top: auto;
    padding: 10px;
    border-top: 1px solid var(--sidebar-border);
}

.erp-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
    min-width: 0;
}

.erp-user-info:hover { background: var(--sidebar-hover); }

.erp-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
    letter-spacing: -0.3px;
}

.erp-faculty-chip {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    max-width: 100%;
    vertical-align: middle;
}

.erp-faculty-avatar {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    font-size: 10.5px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.22), 0 2px 6px rgba(42,63,84,0.14);
}

.erp-faculty-avatar-sm { width: 26px; height: 26px; font-size: 9.5px; }
.erp-faculty-avatar-lg { width: 36px; height: 36px; font-size: 12px; }

.erp-faculty-name {
    min-width: 0;
    color: var(--text-heading);
    font-size: 13px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.erp-faculty-avatar-tone-0 { background: linear-gradient(135deg, #1ABB9C, #3498DB); }
.erp-faculty-avatar-tone-1 { background: linear-gradient(135deg, #6366f1, #14b8a6); }
.erp-faculty-avatar-tone-2 { background: linear-gradient(135deg, #0ea5e9, #2563eb); }
.erp-faculty-avatar-tone-3 { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.erp-faculty-avatar-tone-4 { background: linear-gradient(135deg, #10b981, #84cc16); }
.erp-faculty-avatar-tone-5 { background: linear-gradient(135deg, #8b5cf6, #ec4899); }
.erp-faculty-avatar-tone-6 { background: linear-gradient(135deg, #64748b, #334155); }
.erp-faculty-avatar-tone-7 { background: linear-gradient(135deg, #06b6d4, #0891b2); }

.erp-user-name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--sidebar-active);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.erp-user-role {
    font-size: 11px;
    color: var(--sidebar-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.erp-role-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.7);
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid rgba(255,255,255,0.08);
    cursor: pointer;
    transition: all 0.15s;
}

.erp-role-badge:hover { background: rgba(255,255,255,0.12); }

/* ============================================
   5. TOPBAR
   ============================================ */
.erp-topbar {
    height: var(--topbar-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px 0 16px;
    flex-shrink: 0;
    gap: 16px;
}

/* Breadcrumbs */
.erp-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
    min-width: 0;
}

.erp-breadcrumbs a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
    white-space: nowrap;
}

.erp-breadcrumbs a:hover { color: var(--text-body); }

.erp-breadcrumbs .bc-sep {
    color: var(--text-faint);
    font-size: 12px;
    flex-shrink: 0;
}

.erp-breadcrumbs .bc-current {
    font-weight: 600;
    color: var(--text-heading);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.erp-topbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* Search bar */
.erp-topbar-search-wrap {
    position: relative;
    display: none;
}

@media (min-width: 1024px) { .erp-topbar-search-wrap { display: flex; align-items: center; } }

.erp-topbar-search {
    background: var(--bg-body);
    border: 1px solid var(--border);
    padding: 7px 40px 7px 36px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    width: 260px;
    color: var(--text-body);
    font-family: inherit;
    transition: all 0.2s;
    outline: none;
}

.erp-topbar-search:focus {
    background: var(--bg-card);
    border-color: var(--brand);
    width: 320px;
    box-shadow: 0 0 0 3px rgba(94,106,210,0.1);
}

.erp-topbar-search::placeholder { color: var(--text-faint); }

.erp-topbar-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-faint);
    pointer-events: none;
    width: 15px;
    height: 15px;
}

.erp-search-kbd {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: var(--text-faint);
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 5px;
    font-family: inherit;
    font-weight: 600;
    pointer-events: none;
}

/* Icon Button */
.erp-icon-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.15s;
    position: relative;
    flex-shrink: 0;
}

.erp-icon-btn:hover {
    background: var(--bg-hover);
    color: var(--text-body);
}

/* Notification bell badge */
.erp-notif-badge {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 16px;
    height: 16px;
    background: #EF4444;
    border-radius: 50%;
    font-size: 9px;
    font-weight: 800;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-card);
}

/* User button in topbar */
.erp-user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 6px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: transparent;
    cursor: pointer;
    color: var(--text-body);
    transition: all 0.15s;
}

.erp-user-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-dark);
}

.erp-user-btn .erp-avatar {
    width: 24px;
    height: 24px;
    font-size: 10px;
}

.erp-user-btn-name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-body);
}

.erp-profile-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 340px;
    max-width: calc(100vw - 24px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 8px;
    z-index: 220;
}

.erp-profile-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-hover);
}

.erp-profile-avatar {
    width: 42px !important;
    height: 42px !important;
    font-size: 13px !important;
}

.erp-profile-summary-text {
    min-width: 0;
    flex: 1;
}

.erp-profile-name {
    color: var(--text-heading);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.erp-profile-meta {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 11.5px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.erp-profile-current {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    margin-top: 7px;
    padding: 2px 8px;
    border: 1px solid rgba(26,187,156,0.22);
    border-radius: 999px;
    background: rgba(26,187,156,0.1);
    color: var(--brand);
    font-size: 10.5px;
    font-weight: 800;
}

.erp-profile-section {
    padding: 10px 4px 4px;
    border-bottom: 1px solid var(--border);
}

.erp-profile-section-title {
    padding: 0 8px 7px;
    color: var(--text-faint);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.erp-profile-switch-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 4px 7px;
    border-radius: var(--radius);
    transition: background 0.15s;
}

.erp-profile-switch-row:hover,
.erp-profile-switch-row.active {
    background: var(--bg-hover);
}

.erp-profile-switch-main {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--text-body);
    font-size: 12.5px;
    font-weight: 700;
    text-decoration: none;
}

.erp-profile-switch-main span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.erp-profile-switch-main strong {
    flex-shrink: 0;
    color: var(--brand);
    font-size: 10px;
    font-weight: 850;
}

.erp-profile-default-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 0;
    color: var(--text-muted);
    font-size: 10.5px;
    font-weight: 700;
    cursor: pointer;
}

.erp-profile-default-toggle input {
    width: 13px;
    height: 13px;
    margin: 0;
    accent-color: var(--brand);
}

.erp-profile-account {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border: none;
    border-radius: var(--radius);
    background: transparent;
    color: var(--text-body);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background 0.15s;
}

.erp-profile-account:hover {
    background: var(--bg-hover);
}

.erp-profile-account .erp-avatar {
    width: 30px;
    height: 30px;
    font-size: 10px;
}

.erp-profile-account span:last-child {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.erp-profile-account strong {
    color: var(--text-heading);
    font-size: 12.5px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.erp-profile-account small {
    color: var(--text-muted);
    font-size: 10.5px;
    font-weight: 700;
}

.erp-profile-actions {
    padding-top: 6px;
}

.erp-profile-action {
    display: flex !important;
    align-items: center;
    gap: 9px;
}

.erp-profile-action svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.erp-profile-action.danger {
    color: var(--danger);
}

.erp-profile-action.danger:hover {
    background: rgba(220,38,38,0.08);
    color: var(--danger);
}

/* Page section header */
.erp-page-header {
    margin-bottom: 24px;
}

.erp-page-title-lg {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-heading);
    letter-spacing: -0.5px;
    line-height: 1.2;
    margin: 0 0 4px;
}

.erp-page-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 400;
    margin: 0;
}

/* ============================================
   6. STAT CARDS
   ============================================ */
.erp-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

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

.erp-stat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: box-shadow 0.2s;
}

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

.erp-stat-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.erp-stat-icon svg { width: 20px; height: 20px; }

.erp-stat-icon.blue { background: rgba(94,106,210,0.1); color: var(--brand); }
.erp-stat-icon.green { background: rgba(22,163,74,0.1); color: var(--success); }
.erp-stat-icon.amber { background: rgba(217,119,6,0.1); color: var(--warning); }
.erp-stat-icon.sky { background: rgba(2,132,199,0.1); color: var(--info); }
.erp-stat-icon.rose { background: rgba(220,38,38,0.1); color: var(--danger); }
.erp-stat-icon.slate { background: rgba(71,85,105,0.1); color: #475569; }

.erp-stat-body { min-width: 0; flex: 1; }

.erp-stat-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.erp-stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-heading);
    line-height: 1;
    letter-spacing: -1px;
}

.erp-stat-sub {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
}

/* Legacy stat aliases */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.erp-stat-row { display: flex; align-items: flex-start; justify-content: space-between; }
.erp-stat-label-legacy { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); }

/* ============================================
   7. CARDS
   ============================================ */
.erp-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
}

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

.erp-card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    gap: 8px;
}

.erp-card-body { padding: 20px; }

/* ============================================
   8. TABLES — Premium CamelCase Style
   ============================================ */
.erp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.erp-table thead tr {
    background: #F8FAFC;
    border-bottom: 1px solid #E2E8F0;
}

.erp-table th {
    padding: 11px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #64748B;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid #E2E8F0;
    letter-spacing: 0;
}

/* Sort indicators on th */
.erp-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.erp-table th.sortable::after {
    content: ' ↕';
    font-size: 10px;
    opacity: 0.4;
}

.erp-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #F1F5F9;
    color: var(--text-body);
    vertical-align: middle;
}

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

.erp-table tbody tr:hover td { background: #F8FAFC; }

/* Dark mode table */
.dark-mode .erp-table thead tr { background: #1C1F35; }
.dark-mode .erp-table th { color: rgba(255,255,255,0.5); border-color: rgba(255,255,255,0.07); }
.dark-mode .erp-table td { border-color: rgba(255,255,255,0.05); }
.dark-mode .erp-table tbody tr:hover td { background: rgba(255,255,255,0.03); }

/* ============================================
   9. BADGES
   ============================================ */
.erp-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid transparent;
}

.erp-badge-success { background: #f0fdf4; color: #16a34a; border-color: #bbf7d0; }
.erp-badge-warning { background: #fffbeb; color: #d97706; border-color: #fde68a; }
.erp-badge-amber   { background: #fffbeb; color: #d97706; border-color: #fde68a; }
.erp-badge-danger  { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.erp-badge-primary { background: rgba(94,106,210,0.1); color: var(--brand); border-color: rgba(94,106,210,0.2); }
.erp-badge-muted   { background: #f8fafc; color: #64748b; border-color: #e2e8f0; }
.erp-badge-info    { background: #f0f9ff; color: #0284c7; border-color: #bae6fd; }

.dark-mode .erp-badge-success { background: rgba(22,163,74,0.16); color: #86efac; border-color: rgba(134,239,172,0.28); }
.dark-mode .erp-badge-warning,
.dark-mode .erp-badge-amber   { background: rgba(245,158,11,0.18); color: #fcd34d; border-color: rgba(252,211,77,0.30); }
.dark-mode .erp-badge-danger  { background: rgba(220,38,38,0.18); color: #fca5a5; border-color: rgba(252,165,165,0.30); }
.dark-mode .erp-badge-primary { background: rgba(26,187,156,0.18); color: #7ee6d1; border-color: rgba(126,230,209,0.32); }
.dark-mode .erp-badge-muted   { background: rgba(148,163,184,0.14); color: #cbd5e1; border-color: rgba(203,213,225,0.20); }
.dark-mode .erp-badge-info    { background: rgba(52,152,219,0.18); color: #93c5fd; border-color: rgba(147,197,253,0.28); }

/* User group rights table, kept close to the legacy core flow. */
.user-group-table-card {
    box-shadow: var(--shadow-xs);
}

.user-group-table-header {
    background: rgba(248,250,252,0.55);
}

.erp-card-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.user-group-table th,
.user-group-table td {
    white-space: nowrap;
}

.user-group-name {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: var(--text-heading);
}

.user-group-icon {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #169F85;
    background: rgba(26,187,156,0.12);
    border: 1px solid rgba(26,187,156,0.20);
}

.user-group-rights-btn {
    height: 30px;
    padding: 0 10px;
    gap: 6px;
    font-size: 11px;
    border-radius: 3px;
}

.user-permission-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
}

.user-permission-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-height: 52px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-card);
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.user-permission-row:hover {
    border-color: rgba(26,187,156,0.38);
    background: rgba(26,187,156,0.06);
}

.user-permission-row input {
    width: 15px;
    height: 15px;
    margin-top: 3px;
    accent-color: #169F85;
    flex: 0 0 auto;
}

.user-permission-row input:disabled {
    cursor: wait;
    opacity: 0.55;
}

.user-permission-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.user-permission-copy strong {
    color: var(--text-heading);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
}

.user-permission-copy small {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    line-height: 1.25;
}

.user-permission-empty {
    grid-column: 1 / -1;
    padding: 36px 12px;
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
}

.dark-mode .user-group-table-header {
    background: rgba(255,255,255,0.035);
}

.dark-mode .user-permission-row {
    background: #1F2D3A;
}

.dark-mode .user-permission-row:hover {
    background: rgba(26,187,156,0.10);
}

@media (max-width: 767px) {
    .user-group-rights-btn span { display: none; }
    .user-permission-list { grid-template-columns: 1fr; }
}

/* Module group priority management */
.module-group-subclusters {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    max-width: 560px;
}

.module-group-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.module-group-edit-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 16px;
    min-height: 0;
}

.module-group-edit-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.module-picker-panel,
.module-selected-panel {
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-card);
    min-width: 0;
    overflow: hidden;
}

.module-picker-head,
.module-selected-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-hover);
}

.module-picker-title {
    display: block;
    color: var(--text-heading);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
}

.module-picker-head small,
.module-selected-head small {
    display: block;
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
}

.module-picker-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    color: #169F85;
    background: rgba(26,187,156,0.12);
    border: 1px solid rgba(26,187,156,0.22);
    font-size: 12px;
    font-weight: 800;
}

.module-picker-search {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
}
.module-picker-search svg {
    left: 23px; /* account for 12px padding + 11px original left */
}

.module-picker-list,
.module-selected-list {
    max-height: 382px;
    overflow-y: auto;
    padding: 8px;
    background: rgba(248,250,252,0.72);
}

.module-picker-row {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 34px;
    margin: 0;
    padding: 7px 9px;
    border: 1px solid transparent;
    border-radius: 3px;
    color: var(--text-body);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.module-picker-row + .module-picker-row {
    margin-top: 4px;
}

.module-picker-row:hover,
.module-picker-row.is-selected {
    color: #169F85;
    background: rgba(26,187,156,0.08);
    border-color: rgba(26,187,156,0.20);
}

.module-picker-checkbox {
    width: 15px;
    height: 15px;
    accent-color: #1ABB9C;
    flex: 0 0 auto;
}

.module-picker-row span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.module-selected-row {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 7px 9px;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: var(--bg-card);
}

.module-selected-row + .module-selected-row {
    margin-top: 6px;
}

.module-selected-row span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    color: #169F85;
    background: rgba(26,187,156,0.12);
    font-size: 11px;
    font-weight: 800;
}

.module-selected-row strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-heading);
    font-size: 12.5px;
    font-weight: 700;
}

.module-picker-empty {
    padding: 34px 14px;
    color: var(--text-muted);
    text-align: center;
    font-size: 12px;
    font-style: italic;
}

.dark-mode .module-picker-panel,
.dark-mode .module-selected-panel,
.dark-mode .module-selected-row {
    background: #1F2D3A;
}

.dark-mode .module-picker-head,
.dark-mode .module-selected-head {
    background: rgba(255,255,255,0.04);
}

.dark-mode .module-picker-list,
.dark-mode .module-selected-list {
    background: rgba(15,23,42,0.22);
}

.dark-mode .module-picker-row:hover,
.dark-mode .module-picker-row.is-selected {
    color: #7ee6d1;
    background: rgba(26,187,156,0.13);
    border-color: rgba(126,230,209,0.24);
}

/* Batch schedule verify workspace */
.batch-schedule-offcanvas {
    width: 1180px;
    max-width: 94vw;
}

.batch-schedule-drawer-body {
    padding: 16px;
}

.batch-schedule-workspace {
    display: grid;
    grid-template-columns: minmax(300px, 0.8fr) minmax(520px, 1.2fr);
    gap: 16px;
    min-height: 0;
}

.batch-schedule-form-panel,
.batch-verify-panel {
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-card);
}

.batch-schedule-form-panel {
    padding: 14px;
}

.batch-verify-panel {
    overflow: hidden;
}

.batch-verify-empty {
    min-height: 420px;
    padding: 32px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    color: var(--text-muted);
}

.batch-verify-empty strong {
    color: var(--text-heading);
    font-size: 14px;
    font-weight: 800;
}

.batch-verify-empty span {
    max-width: 300px;
    font-size: 12px;
    line-height: 1.45;
}

.batch-verify-empty-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: #1ABB9C;
    background: rgba(26,187,156,0.10);
}

.batch-verify-empty-icon svg {
    width: 22px;
    height: 22px;
}

.batch-verify-content {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.batch-verify-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-hover);
}

.batch-verify-head h4 {
    margin: 0;
    color: var(--text-heading);
    font-size: 13px;
    font-weight: 800;
}

.batch-verify-head p {
    margin: 2px 0 0;
    color: var(--text-muted);
    font-size: 11.5px;
    font-weight: 600;
}

.batch-verify-table-wrap {
    max-height: 360px;
    overflow: auto;
}

.batch-verify-table {
    min-width: 820px;
}

.batch-verify-table th,
.batch-verify-table td {
    padding: 8px 10px;
    font-size: 12px;
    vertical-align: middle;
}

.batch-verify-date {
    color: #2A7FB8;
    font-weight: 800;
}

.batch-verify-row.is-success {
    background: rgba(22,163,74,0.045);
}

.batch-verify-row.is-danger {
    background: rgba(231,76,60,0.055);
}

.batch-verify-row.is-pending {
    background: rgba(240,173,78,0.055);
}

.batch-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.batch-status-badge button {
    width: 18px;
    height: 18px;
    border: 0;
    padding: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    background: transparent;
    cursor: pointer;
}

.batch-status-badge button:hover {
    background: rgba(255,255,255,0.55);
}

.batch-status-badge svg {
    width: 14px;
    height: 14px;
}

.batch-status-success {
    color: #15803d;
    background: rgba(22,163,74,0.10);
    border-color: rgba(22,163,74,0.20);
}

.batch-status-danger {
    color: #C0392B;
    background: rgba(231,76,60,0.10);
    border-color: rgba(231,76,60,0.22);
}

.batch-status-pending {
    color: #B45309;
    background: rgba(240,173,78,0.14);
    border-color: rgba(240,173,78,0.30);
}

.batch-verify-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.batch-verify-controls {
    display: grid;
    grid-template-columns: minmax(180px, 0.7fr) minmax(220px, 1fr);
    gap: 12px;
    padding: 12px 14px;
    border-top: 1px solid var(--border);
}

.batch-verify-controls textarea {
    min-height: 42px;
    padding-top: 10px;
}

.batch-verify-footer {
    display: flex;
    justify-content: flex-end;
    padding: 0 14px 14px;
}

.batch-verify-empty-cell {
    padding: 28px 12px !important;
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
}

.availability-check-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 4px;
}

.availability-check-table {
    min-width: 720px;
}

.availability-check-table th,
.availability-check-table td {
    padding: 10px 12px;
    font-size: 12px;
    vertical-align: middle;
}

.availability-row-success {
    background: rgba(22,163,74,0.045);
}

.availability-row-danger {
    background: rgba(231,76,60,0.055);
}

.dark-mode .batch-schedule-form-panel,
.dark-mode .batch-verify-panel {
    background: #1F2D3A;
}

.dark-mode .batch-verify-head {
    background: rgba(255,255,255,0.04);
}

.dark-mode .batch-verify-row.is-success {
    background: rgba(34,197,94,0.08);
}

.dark-mode .batch-verify-row.is-danger {
    background: rgba(248,113,113,0.09);
}

.dark-mode .batch-verify-row.is-pending {
    background: rgba(251,191,36,0.08);
}

.dark-mode .availability-row-success {
    background: rgba(34,197,94,0.08);
}

.dark-mode .availability-row-danger {
    background: rgba(248,113,113,0.09);
}

.dark-mode .batch-status-success {
    color: #86efac;
    background: rgba(34,197,94,0.14);
    border-color: rgba(134,239,172,0.24);
}

.dark-mode .batch-status-danger {
    color: #fca5a5;
    background: rgba(248,113,113,0.14);
    border-color: rgba(252,165,165,0.24);
}

.dark-mode .batch-status-pending {
    color: #fcd34d;
    background: rgba(251,191,36,0.14);
    border-color: rgba(252,211,77,0.24);
}

.module-priority-toolbar,
.module-priority-form {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr);
    gap: 14px;
    margin-bottom: 16px;
}

.module-priority-form {
    grid-template-columns: minmax(160px, 0.8fr) minmax(240px, 1.4fr) auto;
    align-items: end;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-card);
}

.module-priority-submit {
    margin-bottom: 0;
}

.module-priority-subtitle {
    margin: 8px 0 12px;
    color: var(--text-heading);
    font-size: 14px;
    font-weight: 800;
}

.module-priority-board-shell {
    margin-top: 12px;
}

.module-priority-hint {
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(52,152,219,0.22);
    border-radius: 4px;
    color: #2A7FB8;
    background: rgba(52,152,219,0.10);
    font-size: 12px;
    font-weight: 600;
}

.module-priority-group {
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-card);
    overflow: hidden;
}

.module-priority-group + .module-priority-group {
    margin-top: 14px;
}

.module-priority-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-hover);
}

.module-priority-group-head h4 {
    margin: 0;
    color: var(--text-heading);
    font-size: 13px;
    font-weight: 800;
}

.module-priority-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
}

.module-priority-card {
    min-height: 104px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-card);
}

.module-priority-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    color: var(--text-heading);
    font-size: 12px;
    font-weight: 800;
}

.module-priority-faculty-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
}

.module-priority-faculty {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    padding: 5px 6px;
    border-radius: 3px;
    background: var(--bg-hover);
}

.module-priority-empty {
    color: var(--text-muted);
    font-size: 11px;
    font-style: italic;
    padding: 8px 4px;
}

.module-priority-empty-lg {
    padding: 34px 12px;
    text-align: center;
}

.dark-mode .module-priority-form,
.dark-mode .module-priority-group,
.dark-mode .module-priority-card {
    background: #1F2D3A;
}

.dark-mode .module-priority-group-head,
.dark-mode .module-priority-faculty {
    background: rgba(255,255,255,0.04);
}

.dark-mode .module-priority-hint {
    color: #93c5fd;
    background: rgba(52,152,219,0.14);
    border-color: rgba(147,197,253,0.24);
}

@media (max-width: 1024px) {
    .module-priority-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
    .module-group-edit-grid,
    .module-group-form-row,
    .batch-schedule-workspace,
    .batch-verify-controls {
        grid-template-columns: 1fr;
    }

    .batch-schedule-offcanvas {
        max-width: 100vw;
    }

    .module-priority-toolbar,
    .module-priority-form,
    .module-priority-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   9.05 CONFLICT WORKSPACE
   ============================================ */
.conflict-page {
    --conflict-danger: #dc2626;
    --conflict-warning: #d97706;
    --conflict-info: #0284c7;
    --conflict-success: #16a34a;
}

.conflict-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.conflict-summary-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 72px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    box-shadow: var(--shadow-xs);
    cursor: pointer;
    text-align: left;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.conflict-summary-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
    border-color: var(--border-dark);
}

.conflict-summary-card span {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 750;
}

.conflict-summary-card strong {
    color: var(--text-heading);
    font-size: 26px;
    line-height: 1;
    font-weight: 850;
}

.conflict-summary-card.danger { border-top: 3px solid var(--conflict-danger); }
.conflict-summary-card.warning { border-top: 3px solid var(--conflict-warning); }
.conflict-summary-card.info { border-top: 3px solid var(--conflict-info); }
.conflict-summary-card.success { border-top: 3px solid var(--conflict-success); }

.conflict-workspace {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
}

.conflict-tabbar {
    display: flex;
    align-items: center;
    gap: 2px;
    overflow-x: auto;
    padding: 0 12px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
}

.conflict-tab {
    min-height: 44px;
    padding: 0 14px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--text-muted);
    font-size: 12.5px;
    font-weight: 750;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

.conflict-tab.active {
    color: var(--brand);
    border-bottom-color: var(--brand);
}

.conflict-pane {
    display: none;
    padding: 16px;
}

.conflict-pane.active {
    display: block;
}

.conflict-toolbar {
    display: grid;
    grid-template-columns: minmax(180px, 240px) minmax(180px, 240px) auto;
    align-items: end;
    gap: 12px;
    padding: 12px;
    margin-bottom: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-hover);
}

.conflict-toolbar-actions,
.conflict-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.conflict-batch-card {
    margin-bottom: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    overflow: hidden;
}

.conflict-batch-card:last-child {
    margin-bottom: 0;
}

.conflict-batch-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(248,250,252,0.9), rgba(255,255,255,0.96));
}

.conflict-batch-header h3 {
    margin: 0;
    color: var(--text-heading);
    font-size: 14px;
    font-weight: 850;
}

.conflict-batch-header p {
    margin: 3px 0 0;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
}

.conflict-table th:first-child,
.conflict-table td:first-child {
    width: 48px;
}

.conflict-detail-stack {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.conflict-schedule-line {
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-hover);
}

.conflict-line-key {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(26,187,156,0.12);
    color: var(--brand);
    font-size: 11px;
    font-weight: 850;
}

.conflict-schedule-line strong {
    color: var(--text-heading);
    font-size: 12.5px;
    font-weight: 850;
}

.conflict-schedule-line span:not(.conflict-line-key) {
    color: var(--text-body);
    font-size: 12px;
    font-weight: 650;
}

.conflict-schedule-line em {
    color: var(--warning);
    font-size: 11.5px;
    font-style: normal;
    font-weight: 750;
}

.conflict-schedule-line > div:nth-child(2),
.conflict-compact-detail {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.conflict-inline-actions,
.conflict-row-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.conflict-row-actions {
    padding-left: 36px;
}

.conflict-row-actions .danger {
    color: var(--danger);
}

.conflict-row-actions .info {
    color: var(--info);
}

.conflict-compact-detail strong {
    color: var(--text-heading);
    font-size: 12.5px;
    font-weight: 800;
}

.conflict-compact-detail span,
.conflict-compact-detail em {
    color: var(--text-muted);
    font-size: 12px;
    font-style: normal;
    font-weight: 600;
}

.conflict-table-shell {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
}

.conflict-empty,
.conflict-modal-loading {
    min-height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 32px 16px;
    border: 1px dashed var(--border-dark);
    border-radius: var(--radius-lg);
    background: var(--bg-hover);
    color: var(--text-muted);
    text-align: center;
}

.conflict-empty strong {
    color: var(--text-heading);
    font-size: 14px;
    font-weight: 850;
}

.conflict-empty span,
.conflict-modal-loading {
    font-size: 12.5px;
    font-weight: 600;
}

.erp-bs-modal {
    background: var(--bg-card);
    color: var(--text-body);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.erp-bs-modal .modal-header,
.erp-bs-modal .modal-footer {
    border-color: var(--border);
}

.erp-bs-modal .table {
    margin-bottom: 0;
    color: var(--text-body);
    font-size: 13px;
}

.faculty-modules-group {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    overflow: hidden;
    margin-bottom: 14px;
}

.faculty-modules-group h4 {
    margin: 0;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-hover);
    color: var(--text-heading);
    font-size: 13px;
    font-weight: 850;
}

.faculty-modules-priority {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
}

.faculty-modules-priority:last-child {
    border-bottom: none;
}

.faculty-modules-priority-title {
    color: var(--brand);
    font-size: 12px;
    font-weight: 850;
    margin-bottom: 8px;
}

.faculty-modules-list {
    margin: 0;
    padding: 0 0 0 18px;
}

.faculty-modules-list li {
    margin: 6px 0;
    color: var(--text-body);
    font-size: 12.5px;
    font-weight: 650;
}

.faculty-modules-list small {
    color: var(--text-muted);
    font-size: 11.5px;
    font-weight: 600;
}

.dark-mode .erp-profile-dropdown,
.dark-mode .conflict-workspace,
.dark-mode .conflict-batch-card,
.dark-mode .conflict-table-shell,
.dark-mode .erp-bs-modal {
    background: var(--bg-card);
    border-color: var(--border);
}

.dark-mode .erp-profile-summary,
.dark-mode .conflict-toolbar,
.dark-mode .conflict-schedule-line,
.dark-mode .conflict-empty,
.dark-mode .conflict-modal-loading {
    background: var(--bg-hover);
}

.dark-mode .conflict-batch-header {
    background: linear-gradient(180deg, rgba(36,55,70,0.82), rgba(31,45,58,0.96));
}

.dark-mode .conflict-summary-card,
.dark-mode .conflict-tabbar {
    background: var(--bg-card);
}

.dark-mode .erp-bs-modal .btn-close {
    filter: invert(1) grayscale(100%);
}

@media (max-width: 1100px) {
    .conflict-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .conflict-summary-grid,
    .conflict-toolbar {
        grid-template-columns: 1fr;
    }

    .conflict-batch-header,
    .conflict-schedule-line {
        grid-template-columns: 1fr;
    }

    .conflict-schedule-line {
        align-items: start;
    }

    .conflict-row-actions {
        padding-left: 0;
    }
}

/* ============================================
   9.1 TIMELINE
   ============================================ */
.erp-timeline {
    width: 100%;
}

.erp-timeline-item {
    display: grid;
    grid-template-columns: 92px 44px minmax(0, 1fr);
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    transition: background-color 0.16s ease;
}

.erp-timeline-item:hover {
    background: var(--bg-hover);
}

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

.erp-timeline-time {
    text-align: right;
    padding-top: 4px;
}

.erp-timeline-date {
    color: var(--text-heading);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
}

.erp-timeline-hour {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    margin-top: 3px;
}

.erp-timeline-marker {
    position: relative;
    display: flex;
    justify-content: center;
    align-self: stretch;
    padding-top: 2px;
}

.erp-timeline-marker::before {
    content: '';
    position: absolute;
    top: -16px;
    bottom: -17px;
    left: 50%;
    width: 1px;
    background: var(--border);
    transform: translateX(-50%);
}

.erp-timeline-icon {
    position: relative;
    z-index: 1;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
}

.erp-timeline-icon svg {
    width: 20px;
    height: 20px;
}

.erp-timeline-create {
    background: #ecfdf5;
    color: #059669;
    border-color: #a7f3d0;
}

.erp-timeline-update {
    background: #eff6ff;
    color: #2563eb;
    border-color: #bfdbfe;
}

.erp-timeline-delete {
    background: #fff1f2;
    color: #e11d48;
    border-color: #fecdd3;
}

.erp-timeline-info {
    background: #f8fafc;
    color: #475569;
    border-color: #e2e8f0;
}

.erp-timeline-content {
    min-width: 0;
}

.erp-timeline-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.erp-timeline-title {
    margin: 0;
    color: var(--text-heading);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
}

.erp-timeline-desc {
    margin-top: 5px;
    color: var(--text-body);
    font-size: 13px;
    line-height: 1.55;
    white-space: pre-line;
}

.erp-timeline-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
}

.erp-meta-pill {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
}

.erp-meta-user {
    color: var(--text-faint);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.erp-timeline-empty {
    padding: 34px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
}

.dark-mode .erp-timeline-create {
    background: rgba(16, 185, 129, 0.14);
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, 0.28);
}

.dark-mode .erp-timeline-update {
    background: rgba(59, 130, 246, 0.14);
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.28);
}

.dark-mode .erp-timeline-delete {
    background: rgba(244, 63, 94, 0.14);
    color: #fda4af;
    border-color: rgba(244, 63, 94, 0.28);
}

.dark-mode .erp-timeline-info {
    background: rgba(148, 163, 184, 0.12);
    color: #cbd5e1;
    border-color: rgba(148, 163, 184, 0.22);
}

@media (max-width: 640px) {
    .erp-timeline-item {
        grid-template-columns: 44px minmax(0, 1fr);
        gap: 12px;
        padding: 14px 16px;
    }

    .erp-timeline-time {
        grid-column: 2;
        grid-row: 2;
        display: flex;
        gap: 8px;
        text-align: left;
        padding-top: 0;
    }

    .erp-timeline-marker {
        grid-column: 1;
        grid-row: 1 / span 2;
    }

    .erp-timeline-content {
        grid-column: 2;
        grid-row: 1;
    }
}

/* Status dot */
.erp-status-dot {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 500;
}

.erp-status-dot::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.erp-status-dot.active::before { background: var(--success); box-shadow: 0 0 0 3px rgba(22,163,74,0.15); }
.erp-status-dot.pending::before { background: var(--warning); box-shadow: 0 0 0 3px rgba(217,119,6,0.15); }
.erp-status-dot.inactive::before { background: #94a3b8; }

/* ============================================
   10. BUTTONS
   ============================================ */
.erp-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}

.erp-btn-xs {
    min-height: 28px;
    padding: 4px 9px;
    font-size: 11.5px;
    font-weight: 750;
}

.erp-btn svg { width: 14px; height: 14px; flex-shrink: 0; }

.erp-btn-primary {
    background: var(--brand);
    color: white;
    border-color: var(--brand);
    box-shadow: 0 1px 2px rgba(94,106,210,0.25);
}
.erp-btn-primary:hover {
    background: var(--brand-hover);
    box-shadow: 0 4px 12px rgba(94,106,210,0.35);
}

.erp-btn-accent {
    background: var(--brand);
    color: white;
    border-color: var(--brand);
    box-shadow: 0 1px 2px rgba(94,106,210,0.25);
}
.erp-btn-accent:hover {
    background: var(--brand-hover);
    box-shadow: 0 4px 12px rgba(94,106,210,0.35);
}

.erp-btn-success {
    background: var(--success);
    color: white;
    border-color: var(--success);
}
.erp-btn-success:hover { background: #15803d; box-shadow: 0 4px 10px rgba(22,163,74,0.3); }

.erp-btn-warn,
.erp-btn-danger {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}
.erp-btn-warn:hover,
.erp-btn-danger:hover { background: #b91c1c; box-shadow: 0 4px 10px rgba(220,38,38,0.3); }

.erp-btn-secondary {
    background: var(--bg-card);
    color: var(--text-body);
    border-color: var(--border-dark);
    box-shadow: var(--shadow-xs);
}
.erp-btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--text-faint);
}

.erp-btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border-color: transparent;
}
.erp-btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-body);
}

/* Split dropdown button */
.erp-btn-split {
    display: inline-flex;
    align-items: stretch;
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(94,106,210,0.25);
}

.erp-btn-split .erp-btn {
    border-radius: 0;
    box-shadow: none;
}

.erp-btn-split .erp-btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); border-right: 1px solid rgba(255,255,255,0.2); }
.erp-btn-split .erp-btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 7px 10px; }

/* Grid action buttons (icon + label in table rows) */
.btn-grid-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--radius-xs);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    gap: 4px;
    white-space: nowrap;
    font-family: inherit;
    text-decoration: none;
}

.btn-grid-action svg { width: 12px; height: 12px; }

.btn-grid-icon {
    width: 28px;
    height: 28px;
    padding: 0;
    gap: 0;
}

.btn-grid-icon svg {
    width: 13px;
    height: 13px;
}

.btn-grid-icon.btn-grid-icon-lg {
    width: 32px;
    height: 32px;
}

.btn-grid-edit {
    background: rgba(22,163,74,0.08);
    color: #16a34a;
    border-color: rgba(22,163,74,0.15);
}
.btn-grid-edit:hover { background: #16a34a; color: white; }

.btn-grid-reschedule {
    background: rgba(94,106,210,0.08);
    color: var(--brand);
    border-color: rgba(94,106,210,0.15);
}
.btn-grid-reschedule:hover { background: var(--brand); color: white; }

.btn-grid-cancel {
    background: rgba(220,38,38,0.08);
    color: #dc2626;
    border-color: rgba(220,38,38,0.15);
}
.btn-grid-cancel:hover { background: #dc2626; color: white; }

.btn-grid-delete {
    background: rgba(220,38,38,0.08);
    color: #dc2626;
    border-color: rgba(220,38,38,0.15);
}
.btn-grid-delete:hover { background: #dc2626; color: white; }

.btn-grid-view {
    background: rgba(2,132,199,0.08);
    color: #0284c7;
    border-color: rgba(2,132,199,0.15);
}
.btn-grid-view:hover { background: #0284c7; color: white; }

.btn-grid-assign {
    background: rgba(26,187,156,0.09);
    color: var(--brand);
    border-color: rgba(26,187,156,0.18);
}
.btn-grid-assign:hover { background: var(--brand); color: white; }

.btn-grid-merge {
    background: rgba(2,132,199,0.08);
    color: #0284c7;
    border-color: rgba(2,132,199,0.15);
}
.btn-grid-merge:hover { background: #0284c7; color: white; }

.btn-grid-disabled {
    background: #f1f5f9;
    color: #94a3b8;
    border-color: #e2e8f0;
    cursor: not-allowed !important;
}

/* Icon-only action btn */
.erp-action-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.15s;
    flex-shrink: 0;
}

.erp-action-icon:hover {
    background: var(--bg-hover);
    color: var(--text-body);
    border-color: var(--border-dark);
}

.erp-action-icon svg { width: 14px; height: 14px; }

/* ============================================
   11. FORMS & INPUTS
   ============================================ */
.erp-form-group,
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.erp-label,
.form-label,
.label-modern {
    display: block;
    font-size: 10.5px;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.065em;
    text-transform: uppercase;
    margin: 0;
    line-height: 1.25;
}

.erp-input,
.erp-select,
.erp-textarea,
.form-control,
.form-select {
    display: block;
    width: 100%;
    min-height: 42px;
    padding: 0 14px;
    font-size: 13.5px;
    font-family: inherit;
    color: var(--text-body);
    background: linear-gradient(180deg, #fff 0%, #fbfcff 100%);
    border: 1px solid #d9e0eb;
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    -webkit-appearance: none;
}

input[type="month"].form-control {
    padding-right: 14px;
}

textarea.erp-input,
.erp-textarea,
textarea.form-control {
    min-height: 84px;
    padding-top: 10px;
    padding-bottom: 10px;
    resize: vertical;
}

.erp-input:focus,
.erp-select:focus,
.erp-textarea:focus,
.form-control:focus,
.form-select:focus {
    border-color: var(--brand);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(94,106,210,0.13), 0 10px 24px rgba(15,23,42,0.06);
}

.erp-input::placeholder,
.erp-textarea::placeholder,
.form-control::placeholder { color: var(--text-faint); }

.erp-form-group > .erp-label,
.erp-form-group > .form-label,
.erp-form-group > .label-modern,
.form-group > .erp-label,
.form-group > .form-label,
.form-group > .label-modern,
.erp-filter-group > .erp-filter-label {
    margin-bottom: 0 !important;
}

.erp-label + .erp-input,
.erp-label + .erp-select,
.erp-label + .erp-textarea,
.erp-label + .form-control,
.erp-label + .form-select,
.erp-label + .select2,
.erp-label + .select2-container,
.erp-label + .relative,
.form-label + .erp-input,
.form-label + .erp-select,
.form-label + .erp-textarea,
.form-label + .form-control,
.form-label + .form-select,
.form-label + .select2,
.form-label + .select2-container,
.form-label + .relative,
.label-modern + .erp-input,
.label-modern + .erp-select,
.label-modern + .erp-textarea,
.label-modern + .form-control,
.label-modern + .form-select,
.label-modern + .select2,
.label-modern + .select2-container,
.label-modern + .relative {
    margin-top: 0 !important;
}

.erp-form-group .select2-container,
.form-group .select2-container {
    width: 100% !important;
}

form div:has(> .erp-label):has(> .erp-input),
form div:has(> .erp-label):has(> .erp-select),
form div:has(> .erp-label):has(> .erp-textarea),
form div:has(> .erp-label):has(> .form-control),
form div:has(> .erp-label):has(> .form-select),
form div:has(> .erp-label):has(> .relative),
form div:has(> .form-label):has(> .form-control),
form div:has(> .form-label):has(> .form-select),
form div:has(> .form-label):has(> .erp-input),
form div:has(> .form-label):has(> .erp-select),
form div:has(> .label-modern):has(> .erp-input),
form div:has(> .label-modern):has(> .erp-select),
form div:has(> .label-modern):has(> .form-control) {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.erp-input-icon { position: relative; }
.erp-input-icon svg {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: var(--text-faint);
    pointer-events: none;
}
.erp-input-icon .erp-input { padding-left: 38px; }

.erp-form-shell {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background:
        linear-gradient(180deg, rgba(248,250,252,0.94), rgba(255,255,255,0.98)),
        var(--bg-card);
    box-shadow: 0 16px 40px rgba(15,23,42,0.06);
    overflow: hidden;
}

.erp-form-panel {
    border: 1px solid #e4e9f2;
    border-radius: var(--radius);
    background: rgba(255,255,255,0.78);
    padding: 18px;
    box-shadow: 0 1px 0 rgba(255,255,255,0.8) inset;
}

.erp-form-panel + .erp-form-panel { margin-top: 16px; }

.erp-form-panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    color: var(--text-heading);
    font-size: 12px;
    font-weight: 850;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.erp-form-panel-title::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--brand);
    box-shadow: 0 0 0 4px var(--brand-soft);
}

.erp-check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
    max-height: 220px;
    overflow: auto;
    padding: 10px;
    border: 1px solid #e4e9f2;
    border-radius: var(--radius-sm);
    background: rgba(248,250,252,0.85);
}

.erp-check-tile {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 38px;
    padding: 9px 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: #fff;
    color: var(--text-body);
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.erp-check-tile:hover {
    border-color: rgba(94,106,210,0.28);
    box-shadow: 0 8px 18px rgba(15,23,42,0.06);
    transform: translateY(-1px);
}

.erp-check-tile:has(input:checked) {
    border-color: rgba(94,106,210,0.38);
    background: var(--brand-soft);
    color: var(--brand);
}

.erp-choice-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 6px;
    border-radius: var(--radius-sm);
    background: #f1f5f9;
}

.erp-choice-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--text-body);
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
}

.erp-choice-pill:has(input:checked) {
    background: #fff;
    box-shadow: var(--shadow-sm);
    color: var(--brand);
}

.sync-card,
.sync-summary-card {
    border: 1px solid #e4e9f2;
    border-radius: var(--radius);
    background: rgba(255,255,255,0.86);
    box-shadow: 0 14px 34px rgba(15,23,42,0.06);
    overflow: hidden;
}

.sync-tab-nav {
    display: flex;
    gap: 6px;
    padding: 10px;
    background: #f1f5f9;
    border-bottom: 1px solid #e4e9f2;
}

.sync-tab-btn {
    min-height: 36px;
    padding: 0 14px;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: 0.045em;
    text-transform: uppercase;
    background: transparent;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.sync-tab-btn.active {
    background: #fff;
    color: var(--brand);
    box-shadow: var(--shadow-sm);
}

.sync-summary-card {
    padding: 18px;
}

.sync-summary-title {
    margin: 0 0 12px;
    color: var(--text-heading);
    font-size: 12px;
    font-weight: 850;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.erp-input:-webkit-autofill,
.erp-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 30px var(--bg-card) inset !important;
    -webkit-text-fill-color: var(--text-body) !important;
}

/* Filter section labels */
.erp-filter-section { display: flex; flex-direction: column; gap: 8px; }
.erp-filter-label { font-size: 12px; font-weight: 600; color: var(--text-body); line-height: 1.25; margin: 0; }
.erp-filter-group { display: flex; flex-direction: column; gap: 8px; }
.erp-filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-body);
    line-height: 1.25;
    margin: 0;
}

/* ============================================
   12. SELECT2 OVERRIDES
   ============================================ */
.select2-container {
    width: 100% !important;
    max-width: 100%;
    font-family: inherit;
}

.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    min-height: 42px !important;
    border: 1px solid #D4DCE7 !important;
    border-radius: var(--radius-sm) !important;
    background: #FFFFFF !important;
    box-shadow: inset 0 1px 1px rgba(15,23,42,0.035);
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.select2-container--default .select2-selection--single {
    display: flex;
    align-items: center;
    height: 42px !important;
}

.select2-container--default .select2-selection--multiple {
    display: flex;
    align-items: center;
    min-height: 42px !important;
    padding: 3px 38px 3px 7px !important;
    cursor: text;
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--multiple {
    border-color: #1ABB9C !important;
    background: #FFFFFF !important;
    box-shadow: 0 0 0 3px rgba(26,187,156,0.12), inset 0 1px 1px rgba(15,23,42,0.035) !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    flex: 1;
    min-width: 0;
    padding-left: 13px !important;
    padding-right: 34px !important;
    color: var(--text-body) !important;
    font-size: 13.5px !important;
    font-weight: 400;
    line-height: 40px !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder,
.select2-container--default .select2-search--inline .select2-search__field::placeholder {
    color: #9AA7B7 !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    top: 1px !important;
    right: 9px !important;
    width: 24px !important;
    height: 40px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #8A96A6 transparent transparent transparent !important;
    border-width: 5px 4px 0 4px !important;
}

.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent #1ABB9C transparent !important;
    border-width: 0 4px 5px 4px !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__rendered {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    min-height: 28px;
    margin: 2px 0 !important;
    padding: 0 9px 0 7px !important;
    border: 1px solid rgba(26,187,156,0.28) !important;
    border-radius: 4px !important;
    background: rgba(26,187,156,0.10) !important;
    color: #2A3F54 !important;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    position: static !important;
    order: -1;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 999px;
    color: #6C7B8D !important;
    background: rgba(42,63,84,0.08) !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 14px !important;
    transition: background 0.12s, color 0.12s;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    background: #E74C3C !important;
    color: #FFFFFF !important;
}

.select2-container--default .select2-search--inline {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    margin: 0 !important;
}

.select2-container--default .select2-search--inline .select2-search__field {
    height: 28px !important;
    margin: 0 !important;
    color: var(--text-body) !important;
    font-family: inherit !important;
    font-size: 13.5px !important;
    line-height: 28px !important;
}

.select2-container--default .select2-selection--clearable .select2-selection__clear {
    height: 40px;
    margin-right: 28px;
    color: #94A3B8;
    font-size: 16px;
    line-height: 40px;
}

.select2-dropdown {
    overflow: hidden;
    margin-top: 4px;
    border: 1px solid #D4DCE7 !important;
    border-radius: var(--radius-sm) !important;
    background: #FFFFFF !important;
    box-shadow: 0 16px 38px rgba(15,23,42,0.14) !important;
    z-index: 9999 !important;
    font-size: 13px;
}

.select2-search--dropdown {
    padding: 8px !important;
    border-bottom: 1px solid #E6EAF0;
    background: #F8FAFC;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    min-height: 36px;
    padding: 0 11px;
    border: 1px solid #D4DCE7 !important;
    border-radius: var(--radius-sm);
    outline: none;
    background: #FFFFFF;
    color: var(--text-body);
    font-size: 13px;
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-color: #1ABB9C !important;
    box-shadow: 0 0 0 3px rgba(26,187,156,0.10);
}

.select2-results__options {
    max-height: 260px !important;
    padding: 4px !important;
}

.select2-results__option {
    margin: 1px 0;
    padding: 9px 10px !important;
    border-radius: 4px;
    color: var(--text-body) !important;
    font-size: 13px !important;
    line-height: 1.35;
}

.select2-container--default .select2-results__option[aria-selected=true] {
    background: rgba(26,187,156,0.10) !important;
    color: #169F85 !important;
    font-weight: 700;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: #1ABB9C !important;
    color: #FFFFFF !important;
}

.select2-results__option--disabled,
.select2-results__message {
    color: #94A3B8 !important;
    font-size: 12px !important;
}

#voucherModal .select2-selection--single,
#voucherModal .select2-selection--multiple,
#scheduleFormModal .select2-selection--single,
#scheduleFormModal .select2-selection--multiple {
    background: #FFFFFF !important;
    border-color: #D4DCE7 !important;
}

/* ============================================
   13. OFFCANVAS / DRAWER SYSTEM
   ============================================ */
.erp-offcanvas-overlay {
    position: fixed;
    inset: 0;
    background: rgba(9,13,22,0.4);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s cubic-bezier(0.16,1,0.3,1), visibility 0.35s;
}

.erp-offcanvas-overlay.open { opacity: 1; visibility: visible; }

.erp-offcanvas {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    background: var(--bg-card);
    box-shadow: -12px 0 40px rgba(0,0,0,0.15);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateX(105%);
    transition: transform 0.4s cubic-bezier(0.16,1,0.3,1);
    width: 520px;
    max-width: 100vw;
    border-left: 1px solid var(--border);
}

.erp-offcanvas.open { transform: translateX(0); }

.erp-offcanvas.erp-offcanvas-sm   { width: 480px; }
.erp-offcanvas.erp-offcanvas-md   { width: 640px; }
.erp-offcanvas.erp-offcanvas-wide { width: 760px; }
.erp-offcanvas.erp-offcanvas-lg   { width: 960px; }
.erp-offcanvas.erp-offcanvas-xl   { width: 1200px; max-width: 92vw; }
.erp-offcanvas.schedule-form-drawer { width: min(1320px, 94vw); }

/* Drawer inner structure */
.erp-drawer-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--bg-card);
}

.erp-drawer-header {
    padding: 20px 26px;
    border-bottom: 1px solid var(--border);
    background:
        linear-gradient(135deg, rgba(248,250,252,0.98), rgba(255,255,255,0.98)),
        var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.erp-drawer-title {
    font-size: 16px;
    font-weight: 850;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.2;
}

.erp-drawer-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
    font-weight: 400;
}

.erp-drawer-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 22px 26px;
    background: linear-gradient(180deg, #fbfcff 0%, #f7f9fc 100%);
}

.erp-drawer-footer {
    padding: 16px 26px;
    border-top: 1px solid var(--border);
    background: rgba(255,255,255,0.94);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    z-index: 10;
}

/* Section inside drawer */
.erp-drawer-section {
    padding: 18px;
    border: 1px solid #e4e9f2;
    border-radius: var(--radius);
    background: rgba(255,255,255,0.82);
    box-shadow: 0 1px 0 rgba(255,255,255,0.8) inset;
}
.erp-drawer-section + .erp-drawer-section { margin-top: 16px; }
.erp-drawer-section:last-child { border-bottom: 1px solid #e4e9f2; }

.erp-drawer-section-title {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--brand);
    margin-bottom: 14px;
}

/* Dark mode offcanvas */
.dark-mode .erp-offcanvas { background: #141624; border-color: rgba(255,255,255,0.07); }
.dark-mode .erp-drawer-content,
.dark-mode .erp-drawer-header,
.dark-mode .erp-drawer-footer { background: #141624; border-color: rgba(255,255,255,0.07); }

/* Mobile sheet */
@media (max-width: 767px) {
    .erp-offcanvas {
        width: 100% !important;
        height: 90% !important;
        top: auto;
        bottom: 0;
        border-left: none;
        border-top: 1px solid var(--border);
        border-radius: 16px 16px 0 0;
        transform: translateY(100%);
    }
    .erp-offcanvas.open { transform: translateY(0); }
}

/* ============================================
   14. SIDEBAR MOBILE OVERLAY
   ============================================ */
.erp-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(9,13,22,0.5);
    backdrop-filter: blur(4px);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}
.erp-sidebar-overlay.show { opacity: 1; visibility: visible; }

@media (max-width: 1023px) {
    .erp-sidebar {
        position: fixed;
        left: 0; top: 0; bottom: 0;
        z-index: 1050;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.16,1,0.3,1);
    }
    .erp-sidebar.open { transform: translateX(0); }
}

/* ============================================
   15. LOGIN PAGE
   ============================================ */
.erp-login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #eef2ff 0%, #f8fafc 50%, #f0f4ff 100%);
    padding: 24px;
}

.erp-login-card {
    width: 100%;
    max-width: 400px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 36px;
}

.erp-login-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 28px;
    gap: 12px;
}

.erp-login-logo-icon {
    width: 48px;
    height: 48px;
    background: var(--brand);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 20px;
    box-shadow: 0 4px 14px rgba(94,106,210,0.35);
}

.erp-login-title { font-size: 20px; font-weight: 700; color: var(--text-heading); letter-spacing: -0.4px; text-align: center; }
.erp-login-sub { font-size: 13px; color: var(--text-muted); text-align: center; margin-top: 2px; }
.erp-login-form { display: flex; flex-direction: column; gap: 16px; }
.erp-login-form .erp-form-group { gap: 8px; }
.erp-login-form .erp-btn { gap: 8px; }
.erp-login-spinner {
    display: none;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.45);
    border-top-color: #fff;
    border-radius: 999px;
    animation: spin 0.75s linear infinite;
}
.erp-login-form .erp-btn.is-loading .erp-login-spinner { display: inline-block; }
.erp-login-form .erp-btn.is-loading {
    opacity: 0.78;
    cursor: wait;
}
.erp-login-footer { margin-top: 18px; text-align: center; font-size: 12px; color: var(--text-faint); }

/* ============================================
   16. UTILITIES
   ============================================ */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.gap-8 { gap: 32px; }
.grid { display: grid; }
.w-full { width: 100%; }
.ml-auto { margin-left: auto; }
.mt-auto { margin-top: auto; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }
.space-y-4 > * + * { margin-top: 16px; }
.space-y-5 > * + * { margin-top: 20px; }
.space-y-6 > * + * { margin-top: 24px; }
.space-y-8 > * + * { margin-top: 32px; }
.hidden { display: none !important; }
.relative { position: relative; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Animations */
.animate-in { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.animate-spin {
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Avatar ring */
.erp-avatar-ring {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid var(--border);
    overflow: hidden;
    background: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

/* Faculty avatar in table */
.erp-fac-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

/* Skeleton loaders */
.skeleton {
    background: linear-gradient(90deg, var(--bg-hover) 25%, var(--border) 50%, var(--bg-hover) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-xs);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.erp-skeleton-loader { display: flex; flex-direction: column; gap: 14px; padding: 20px; }
.erp-skeleton-item { height: 14px; border-radius: var(--radius-xs); }
.erp-skeleton-item.title { width: 40%; height: 20px; }
.erp-skeleton-item.short { width: 55%; }
.erp-skeleton-item.medium { width: 75%; }
.erp-skeleton-item.long { width: 95%; }

/* Page intro block */
.erp-page-intro {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

/* Content grid */
.filter-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; align-items: end; }
.content-grid { display: grid; grid-template-columns: 1fr 300px; gap: 24px; }
@media (max-width: 1024px) { .content-grid { grid-template-columns: 1fr; } .filter-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 640px) { .filter-grid { grid-template-columns: 1fr; } }

/* Pagination (common) */
.erp-pagination {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px 16px;
    border-top: 1px solid var(--border);
    justify-content: space-between;
    font-size: 12.5px;
    color: var(--text-muted);
}

.erp-pagination-pages {
    display: flex;
    align-items: center;
    gap: 4px;
}

.erp-page-btn {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-body);
    transition: all 0.15s;
    font-family: inherit;
}

.erp-page-btn:hover { background: var(--bg-hover); }
.erp-page-btn.active { background: var(--brand); color: white; border-color: var(--brand); }

/* Three-dot menu */
.erp-dot-menu { position: relative; display: inline-block; }

.erp-dot-btn {
    width: 28px;
    height: 28px;
    border: 1px solid transparent;
    border-radius: var(--radius-xs);
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.15s;
}
.erp-dot-btn:hover { background: var(--bg-hover); border-color: var(--border); color: var(--text-body); }

.erp-dot-menu-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    z-index: 500;
    min-width: 160px;
    padding: 4px;
    display: none;
}
.erp-dot-menu-dropdown.show { display: block; }
.erp-dot-menu-dropdown a,
.erp-dot-menu-dropdown button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 12px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-body);
    background: transparent;
    border: none;
    border-radius: var(--radius-xs);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: all 0.12s;
    text-decoration: none;
}
.erp-dot-menu-dropdown a:hover,
.erp-dot-menu-dropdown button:hover { background: var(--bg-hover); }
.erp-dot-menu-dropdown .danger { color: var(--danger); }
.erp-dot-menu-dropdown .danger:hover { background: rgba(220,38,38,0.07); }

/* Divider in dropdown */
.erp-dot-menu-dropdown hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 4px 0;
}

/* Portal / welcome page */
.erp-portal-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(150deg, #eef2ff 0%, #f8fafc 40%, #e0f2fe 100%);
    padding: 32px;
    text-align: center;
}

/* Columns / Export button row  */
.erp-table-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

/* Premium Global Loading Spinner Overlay */
.erp-global-loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out;
}

.erp-global-loader-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.erp-spinner-card {
    background: var(--bg-card, #ffffff);
    padding: 2rem 2.5rem;
    border-radius: var(--radius-xl, 1rem);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    transform: scale(0.9);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.erp-global-loader-overlay.active .erp-spinner-card {
    transform: scale(1);
}

.erp-spinner-ring {
    width: 2.75rem;
    height: 2.75rem;
    border: 3.5px solid rgba(94, 106, 210, 0.1);
    border-top: 3.5px solid var(--brand, #5e6ad2);
    border-radius: 50%;
    animation: erp-spin 0.8s linear infinite;
}

.erp-spinner-text {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-body);
    letter-spacing: 0.02em;
}

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

/* Premium Toast Notifications */
.erp-toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 100000;
    pointer-events: none;
    max-width: 380px;
    width: calc(100% - 3rem);
}

.erp-toast {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 0.75rem);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    padding: 0.875rem 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    pointer-events: auto;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
}

.dark-mode .erp-toast {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(255, 255, 255, 0.1);
}

.erp-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.erp-toast-icon {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.125rem;
}

.erp-toast-content {
    flex-grow: 1;
    min-width: 0;
}

.erp-toast-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-body);
    margin-bottom: 0.125rem;
}

.erp-toast-message {
    font-size: 0.75rem;
    color: var(--text-faint);
    line-height: 1.4;
    word-break: break-word;
}

.erp-toast-close {
    flex-shrink: 0;
    cursor: pointer;
    color: var(--text-faint);
    opacity: 0.6;
    transition: opacity 0.15s;
    background: none;
    border: none;
    padding: 0;
    margin-top: 0.125rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.erp-toast-close:hover {
    opacity: 1;
}

/* Toast themes */
.erp-toast-success {
    border-left: 4px solid #10b981;
}
.erp-toast-success .erp-toast-icon {
    color: #10b981;
}

.erp-toast-error {
    border-left: 4px solid #ef4444;
}
.erp-toast-error .erp-toast-icon {
    color: #ef4444;
}

.erp-toast-info {
    border-left: 4px solid #3b82f6;
}
.erp-toast-info .erp-toast-icon {
    color: #3b82f6;
}

.erp-toast-warning {
    border-left: 4px solid #f59e0b;
}
.erp-toast-warning .erp-toast-icon {
    color: #f59e0b;
}

/* ============================================
   GENTELELLA SKIN OVERRIDES
   ============================================ */
body,
html body {
    background: var(--bg-body);
    color: var(--text-body);
    font-family: "Helvetica Neue", Roboto, Arial, "Droid Sans", sans-serif;
    font-size: 15px;
}

.erp-content {
    background: var(--bg-body);
    padding: 20px 22px;
}

.erp-sidebar {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.015), rgba(0,0,0,0.14)),
        var(--bg-sidebar);
}

.erp-brand {
    min-height: 58px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    background: rgba(0,0,0,0.14);
}

.erp-brand-icon,
.erp-avatar,
.erp-avatar-ring,
.erp-fac-avatar {
    background: linear-gradient(135deg, #1ABB9C, #3498DB);
    border: 2px solid rgba(255,255,255,0.16);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.erp-brand-name {
    font-size: 21px;
    font-weight: 500;
    letter-spacing: 0;
}

.erp-nav-label {
    color: rgba(214,225,236,0.38);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding-top: 14px;
}

.erp-nav-item {
    border-radius: 0;
    margin: 0;
    width: 100%;
    padding: 11px 18px;
    border-left: 4px solid transparent;
    color: var(--sidebar-text);
}

.erp-nav-item:hover {
    background: rgba(26,187,156,0.08);
    color: #F2F5F7;
}

.erp-nav-item.active,
.erp-nav-dropdown.open > .erp-dropdown-toggle {
    color: #fff;
    background: rgba(26,187,156,0.15);
    border-left-color: var(--brand);
}

.erp-nav-item.active {
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), inset 0 -1px 0 rgba(0,0,0,0.12);
}

.erp-nav-dropdown .erp-dropdown-menu {
    padding-left: 34px;
    background: rgba(0,0,0,0.12);
}

.erp-nav-dropdown .erp-dropdown-menu a {
    border-radius: 0;
    margin: 0;
    padding: 8px 12px;
    color: rgba(230,237,243,0.68);
}

.erp-nav-dropdown .erp-dropdown-menu a.active,
.erp-nav-dropdown .erp-dropdown-menu a:hover {
    color: #fff;
    background: transparent;
}

.erp-user-panel {
    background: rgba(0,0,0,0.12);
    border-top-color: rgba(255,255,255,0.08);
}

.erp-user-info {
    border-radius: 3px;
}

.erp-topbar {
    background: #EDEDED;
    border-bottom: 1px solid #D9DEE4;
    box-shadow: 0 1px 2px rgba(42,63,84,0.08);
}

.dark-mode .erp-topbar {
    background: #1B2A38;
    border-bottom-color: rgba(255,255,255,0.1);
}

.erp-topbar-search,
.erp-input,
.erp-select,
textarea.erp-input {
    border-radius: 3px;
    border-color: #CCD0D7;
    background: #fff;
    color: var(--text-body);
    box-shadow: inset 0 1px 1px rgba(0,0,0,0.04);
}

.erp-topbar-search:focus,
.erp-input:focus,
.erp-select:focus {
    border-color: #1ABB9C;
    box-shadow: 0 0 0 2px rgba(26,187,156,0.14), inset 0 1px 1px rgba(0,0,0,0.04);
}

.dark-mode .erp-topbar-search,
.dark-mode .erp-input,
.dark-mode .erp-select,
.dark-mode textarea.erp-input {
    background: #243746;
    border-color: rgba(255,255,255,0.14);
    color: var(--text-body);
}

.erp-icon-btn,
.erp-user-btn {
    border: 1px solid transparent;
    border-radius: 3px;
}

.erp-icon-btn:hover,
.erp-user-btn:hover {
    color: #1ABB9C;
    background: rgba(26,187,156,0.08);
    border-color: rgba(26,187,156,0.2);
}

.erp-icon-btn-primary {
    color: #fff !important;
    background: #1ABB9C !important;
    border-color: #169F85 !important;
    box-shadow: 0 1px 4px rgba(26,187,156,0.22);
}

.erp-icon-btn-primary:hover {
    color: #fff !important;
    background: #169F85 !important;
    border-color: #12876F !important;
}

.erp-card,
.erp-stat,
.erp-form-panel,
.sync-card,
.sync-summary-card {
    border: 1px solid var(--border);
    border-radius: 3px;
    background: var(--bg-card) !important;
    box-shadow: 0 1px 2px rgba(42,63,84,0.06);
}

.erp-card-header,
.erp-drawer-header {
    background: var(--bg-card);
    border-bottom: 2px solid #E6E9ED;
    padding: 13px 17px;
}

.dark-mode .erp-card-header,
.dark-mode .erp-drawer-header {
    border-bottom-color: rgba(255,255,255,0.12);
}

.erp-card-title,
.erp-drawer-title,
.erp-form-panel-title {
    color: var(--text-heading);
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

.erp-card-title::after,
.erp-drawer-title::after {
    content: "";
    display: block;
    width: 48px;
    height: 2px;
    margin-top: 8px;
    background: #1ABB9C;
}

.erp-page-title-lg {
    font-size: 24px;
    font-weight: 400;
    color: var(--text-heading);
}

.erp-page-subtitle {
    color: var(--text-muted);
}

.erp-stat {
    border-left: 4px solid #1ABB9C !important;
    padding: 17px;
}

.erp-stat h3,
.erp-stat .erp-stat-value {
    color: var(--text-heading) !important;
    font-weight: 500 !important;
}

.erp-stat p,
.erp-stat .erp-stat-label,
.erp-stat .erp-stat-sub {
    color: var(--text-muted) !important;
}

.erp-stat .w-10,
.erp-stat-icon {
    border-radius: 50%;
    background: rgba(26,187,156,0.12) !important;
    color: #1ABB9C !important;
}

.erp-stat-value {
    color: var(--text-heading);
    font-weight: 500;
}

.erp-stat-label,
.erp-stat-sub {
    color: var(--text-muted);
}

.dark-mode .erp-stat,
.dark-mode .erp-stat * {
    color: var(--text-body) !important;
}

.dark-mode .erp-stat h3,
.dark-mode .erp-stat h3 *,
.dark-mode .erp-stat .erp-stat-value {
    color: var(--text-heading) !important;
}

.dark-mode .erp-stat p,
.dark-mode .erp-stat .erp-stat-label,
.dark-mode .erp-stat .erp-stat-sub {
    color: var(--text-muted) !important;
}

.dark-mode .erp-stat .w-10,
.dark-mode .erp-stat-icon {
    background: rgba(26,187,156,0.16) !important;
    color: #1ABB9C !important;
}

.erp-btn {
    border-radius: 3px;
    font-weight: 400;
    box-shadow: none !important;
}

.erp-btn-primary,
.erp-btn-accent,
.erp-page-btn.active {
    background: #1ABB9C;
    border-color: #169F85;
    color: #fff;
}

.erp-btn-primary:hover,
.erp-btn-accent:hover {
    background: #169F85;
    border-color: #13866F;
    color: #fff;
}

.erp-btn-secondary {
    background: #F7FAFC;
    border-color: #D9E2EA;
    color: #526A7F;
}

.erp-btn-secondary:hover {
    background: rgba(26,187,156,0.08);
    border-color: rgba(26,187,156,0.28);
    color: #169F85;
}

.dark-mode .erp-btn-secondary {
    background: #263F55;
    color: var(--text-body);
    border-color: rgba(177,205,226,0.18);
}

.dark-mode .erp-btn-secondary:hover {
    background: rgba(26,187,156,0.13);
    border-color: rgba(26,187,156,0.34);
    color: #D5FFF5;
}

.erp-btn-soft-blue {
    background: #3498DB;
    border-color: #2A7FB8;
    color: #fff;
}

.erp-btn-soft-blue:hover {
    background: #2A7FB8;
    border-color: #226B9D;
    color: #fff;
}

.erp-btn-blue {
    background: #3498DB;
    border-color: #2A7FB8;
    color: #fff;
}

.erp-btn-blue:hover {
    background: #2A7FB8;
    border-color: #226B9D;
    color: #fff;
}

.erp-btn-soft-amber {
    background: #F0AD4E;
    border-color: #D9983F;
    color: #fff;
}

.erp-btn-soft-amber:hover {
    background: #D9983F;
    border-color: #C4862E;
    color: #fff;
}

.erp-btn-soft-red {
    background: #E74C3C;
    border-color: #C0392B;
    color: #fff;
}

.erp-btn-soft-red:hover {
    background: #C0392B;
    border-color: #A93226;
    color: #fff;
}

.erp-btn-soft-slate {
    background: #34495E;
    border-color: #263747;
    color: #fff;
}

.erp-btn-soft-slate:hover {
    background: #263747;
    border-color: #1D2B38;
    color: #fff;
}

.dark-mode .erp-btn-soft-blue {
    background: #3498DB;
    border-color: #2A7FB8;
    color: #fff;
}

.dark-mode .erp-btn-blue {
    background: #2A7FB8;
    border-color: #3498DB;
    color: #fff;
}

.dark-mode .erp-btn-soft-amber {
    background: #F0AD4E;
    border-color: #D9983F;
    color: #fff;
}

.dark-mode .erp-btn-soft-red {
    background: #E74C3C;
    border-color: #C0392B;
    color: #fff;
}

.dark-mode .erp-btn-soft-slate {
    background: #34495E;
    border-color: #263747;
    color: #fff;
}

.erp-btn-danger,
.erp-btn-warn,
.btn-grid-cancel {
    background: #E74C3C;
    border-color: #D43F3A;
    color: #fff;
}

.erp-table {
    background: var(--bg-card);
}

.erp-table thead tr {
    background: #F5F7FA;
}

.erp-table th {
    color: #73879C;
    font-weight: 600;
    border-bottom: 2px solid #E6E9ED;
}

.erp-table td {
    color: var(--text-body);
    border-top: 1px solid #E6E9ED;
    border-bottom: none;
}

.erp-table tbody tr:hover td {
    background: #F7FAFC;
}

.dark-mode .erp-table thead tr,
.dark-mode .erp-table tbody tr:hover td {
    background: rgba(255,255,255,0.04);
}

.dark-mode .erp-table td,
.dark-mode .erp-table th {
    border-color: rgba(255,255,255,0.09);
}

.erp-badge {
    border-radius: 3px;
    font-weight: 500;
}

.erp-badge-primary {
    background: rgba(26,187,156,0.12);
    color: #169F85;
    border-color: rgba(26,187,156,0.28);
}

.erp-badge-info {
    background: rgba(52,152,219,0.12);
    color: #2A7FB8;
    border-color: rgba(52,152,219,0.28);
}

.erp-drawer-content,
.erp-drawer-body {
    background: var(--bg-card);
}

.erp-drawer-body {
    background: var(--bg-body);
}

.erp-drawer-footer {
    background: var(--bg-card);
    border-top-color: var(--border);
}

.erp-offcanvas {
    box-shadow: -6px 0 24px rgba(42,63,84,0.22);
}

.dark-mode .erp-offcanvas,
.dark-mode .erp-drawer-content,
.dark-mode .erp-drawer-footer {
    background: var(--bg-card);
    border-color: var(--border);
}

.dark-mode .erp-drawer-body {
    background: var(--bg-body);
}

.erp-offcanvas-overlay {
    background: rgba(42,63,84,0.38);
    backdrop-filter: blur(2px);
}

.erp-check-tile,
.erp-choice-pill {
    border-radius: 3px;
}

.erp-check-tile:has(input:checked),
.erp-choice-pill:has(input:checked) {
    color: #169F85;
    background: rgba(26,187,156,0.12);
    border-color: rgba(26,187,156,0.34);
}

.sync-tab-btn.active {
    color: #169F85;
}

#chart,
#workloadChart {
    color: var(--text-body);
}

.workload-graph-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 18px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-card);
}

.workload-graph-tool-left {
    display: flex;
    align-items: center;
    gap: 22px;
    min-width: 0;
}

.workload-graph-label {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.workload-graph-range-sep {
    color: var(--text-faint);
    font-size: 11px;
    font-weight: 700;
}

.workload-graph-divider {
    width: 1px;
    height: 34px;
    background: var(--border);
}

.workload-graph-insight {
    color: var(--text-body);
    font-size: 12px;
    font-weight: 600;
}

.calendar-month-nav {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: #F5F7FA;
    box-shadow: inset 0 1px 2px rgba(42,63,84,0.08);
}

.calendar-month-nav-btn {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 3px;
    color: #5F7184;
    background: transparent;
    transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.calendar-month-nav-btn:hover {
    color: #34495E;
    background: #FFFFFF;
    box-shadow: 0 1px 3px rgba(42,63,84,0.14);
}

.calendar-month-nav-divider,
.calendar-header-divider {
    width: 1px;
    background: var(--border-dark);
}

.calendar-month-nav-divider {
    height: 18px;
}

.calendar-header-divider {
    height: 26px;
}

.fc-modern .fc-header-toolbar h2,
.fc-modern .fc-toolbar h2 {
    color: var(--text-heading) !important;
    font-weight: 500 !important;
}

.fc-modern .fc-view-container {
    border-color: var(--border) !important;
    border-radius: 3px !important;
}

.fc-modern .fc-day-header {
    color: #73879C !important;
    background: #F5F7FA;
    border-color: var(--border) !important;
}

.fc-modern .fc-day-top,
.fc-modern .fc-day-number {
    color: var(--text-muted) !important;
}

.fc-modern .fc-day,
.fc-modern td,
.fc-modern th {
    border-color: var(--border) !important;
}

.fc-modern .fc-today {
    background: rgba(26,187,156,0.09) !important;
}

.fc-modern .fc-event {
    background: rgba(26,187,156,0.13) !important;
    border: 1px solid rgba(26,187,156,0.38) !important;
    border-radius: 3px !important;
    box-sizing: border-box;
    color: #12876F !important;
    max-width: calc(100% - 4px);
    margin-left: 2px !important;
    margin-right: 2px !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-shadow: none;
}

.dark-mode .fc-modern .fc-event {
    background: rgba(26,187,156,0.18) !important;
    border-color: rgba(26,187,156,0.48) !important;
    color: #D5FFF5 !important;
}

.fc-modern .fc-more {
    color: #169F85 !important;
}

.fc-modern .fc-day-header.fc-sun,
.fc-modern .fc-day-top.fc-sun .fc-day-number,
.fc-modern .fc-day.fc-sun .fc-day-number,
.fc-modern .fc-day-sun .fc-daygrid-day-number {
    color: #DC2626 !important;
    font-weight: 700 !important;
}

.fc-modern .fc-day.fc-sun,
.fc-modern .fc-day-top.fc-sun {
    background-color: rgba(220,38,38,0.025);
}

.dark-mode .fc-modern .fc-day-header {
    background: #243746;
    color: var(--text-muted) !important;
}

.dark-mode .fc-modern .fc-header-toolbar h2,
.dark-mode .fc-modern .fc-toolbar h2 {
    color: var(--text-heading) !important;
}

.dark-mode .fc-modern .fc-day-top,
.dark-mode .fc-modern .fc-day-number {
    color: var(--text-muted) !important;
}

.dark-mode .fc-modern .fc-day:hover {
    background: rgba(255,255,255,0.04);
}

.dark-mode .workload-graph-tools {
    background: #1F2D3A;
    border-color: rgba(255,255,255,0.09);
}

.dark-mode .workload-graph-divider {
    background: rgba(255,255,255,0.10);
}

.dark-mode .calendar-month-nav {
    background: #1A2733;
    border-color: rgba(255,255,255,0.11);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.20);
}

.dark-mode .calendar-month-nav-btn {
    color: #9FB0BE;
}

.dark-mode .calendar-month-nav-btn:hover {
    color: #ECF0F1;
    background: #243746;
    box-shadow: none;
}

.dark-mode .calendar-month-nav-divider,
.dark-mode .calendar-header-divider {
    background: rgba(255,255,255,0.16);
}

.dark-mode .fc-modern .fc-day-header.fc-sun,
.dark-mode .fc-modern .fc-day-top.fc-sun .fc-day-number,
.dark-mode .fc-modern .fc-day.fc-sun .fc-day-number,
.dark-mode .fc-modern .fc-day-sun .fc-daygrid-day-number {
    color: #FCA5A5 !important;
}

.dark-mode .fc-modern .fc-day.fc-sun,
.dark-mode .fc-modern .fc-day-top.fc-sun {
    background-color: rgba(248,113,113,0.045);
}

@media (max-width: 767px) {
    .workload-graph-tools,
    .workload-graph-tool-left {
        align-items: stretch;
        flex-direction: column;
    }

    .workload-graph-divider {
        width: 100%;
        height: 1px;
    }
}

#calendar-context-menu {
    border-radius: 3px !important;
    border-color: var(--border) !important;
    box-shadow: 0 6px 18px rgba(42,63,84,0.18) !important;
}

#calendar-context-menu .menu-header {
    background: #F5F7FA !important;
    color: #73879C !important;
}

#calendar-context-menu button:hover {
    color: #169F85 !important;
}

.dark-mode #calendar-context-menu,
.dark-mode #calendar-context-menu .menu-header {
    background: #1F2D3A !important;
    border-color: rgba(255,255,255,0.1) !important;
}

.dark-mode .select2-container--default .select2-selection--single,
.dark-mode .select2-container--default .select2-selection--multiple,
.dark-mode .select2-dropdown {
    background: #243746 !important;
    border-color: rgba(255,255,255,0.14) !important;
    box-shadow: inset 0 1px 1px rgba(0,0,0,0.18);
}

.dark-mode .select2-container--default.select2-container--focus .select2-selection--single,
.dark-mode .select2-container--default.select2-container--focus .select2-selection--multiple,
.dark-mode .select2-container--default.select2-container--open .select2-selection--single,
.dark-mode .select2-container--default.select2-container--open .select2-selection--multiple {
    border-color: #1ABB9C !important;
    box-shadow: 0 0 0 3px rgba(26,187,156,0.16), inset 0 1px 1px rgba(0,0,0,0.18) !important;
}

.dark-mode .select2-container--default .select2-selection__rendered,
.dark-mode .select2-container--default .select2-search__field,
.dark-mode .select2-results__option {
    color: var(--text-body) !important;
}

.dark-mode .select2-container--default .select2-selection--single .select2-selection__placeholder,
.dark-mode .select2-container--default .select2-search--inline .select2-search__field::placeholder {
    color: #8193A6 !important;
}

.dark-mode .select2-search--dropdown {
    background: #1D2B38 !important;
    border-bottom-color: rgba(255,255,255,0.10);
}

.dark-mode .select2-container--default .select2-search--dropdown .select2-search__field {
    background: #172431 !important;
    border-color: rgba(255,255,255,0.14) !important;
}

.dark-mode .select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: rgba(26,187,156,0.18) !important;
    border-color: rgba(26,187,156,0.36) !important;
    color: #D5FFF5 !important;
}

.dark-mode .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    background: rgba(255,255,255,0.08) !important;
    color: #9FB0BE !important;
}

.dark-mode .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    background: #E74C3C !important;
    color: #FFFFFF !important;
}

.dark-mode .select2-container--default .select2-results__option[aria-selected=true] {
    background: rgba(26,187,156,0.18) !important;
    color: #D5FFF5 !important;
}

.dark-mode .select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: #1ABB9C !important;
    color: #FFFFFF !important;
}

.dark-mode .bg-white,
.dark-mode .bg-slate-50,
.dark-mode .bg-blue-50,
.dark-mode .bg-emerald-50,
.dark-mode .bg-amber-50,
.dark-mode .bg-rose-50 {
    background-color: var(--bg-card) !important;
}

.dark-mode .text-slate-900,
.dark-mode .text-slate-800,
.dark-mode .text-slate-700,
.dark-mode .text-slate-600 {
    color: var(--text-body) !important;
}

.dark-mode .text-slate-500,
.dark-mode .text-slate-400 {
    color: var(--text-muted) !important;
}

.dark-mode .border-slate-100,
.dark-mode .border-slate-200,
.dark-mode .border-blue-100,
.dark-mode .border-emerald-100,
.dark-mode .border-amber-100,
.dark-mode .border-rose-100 {
    border-color: var(--border) !important;
}

.text-indigo-400,
.text-indigo-500,
.text-indigo-600,
.hover\:text-indigo-600:hover,
.hover\:text-indigo-800:hover {
    color: #169F85 !important;
}

.bg-indigo-600,
.hover\:bg-indigo-700:hover {
    background-color: #26B99A !important;
}

.bg-indigo-50\/50,
.bg-indigo-100,
.hover\:bg-indigo-100:hover {
    background-color: rgba(26,187,156,0.1) !important;
}

.border-indigo-100,
.border-indigo-500,
.border-indigo-600 {
    border-color: rgba(26,187,156,0.34) !important;
}

/* Unified page polish overrides */
.erp-page-intro {
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 22px;
}

.erp-page-title-lg {
    letter-spacing: 0;
    line-height: 1.2;
}

.erp-page-subtitle {
    margin-top: 5px;
    line-height: 1.45;
}

.erp-breadcrumbs {
    gap: 7px;
    font-size: 12.5px;
    font-weight: 600;
}

.erp-breadcrumbs a,
.erp-breadcrumbs .bc-current {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.erp-drawer-header {
    background: #F2F4F6 !important;
    border-bottom: 1px solid #D9DEE4 !important;
}

.erp-drawer-content,
.erp-drawer-body {
    background: #FFFFFF !important;
}

.dark-mode .erp-drawer-header {
    background: #24313D !important;
    border-bottom-color: var(--border) !important;
}

.dark-mode .erp-drawer-content,
.dark-mode .erp-drawer-body {
    background: var(--bg-card) !important;
}

button[onclick*="toggleFilters(true)"],
.erp-filter-btn {
    background: #F8FAFC !important;
    color: #475569 !important;
    border-color: #D9E0EB !important;
    box-shadow: none !important;
}

button[onclick*="toggleFilters(true)"]:hover,
.erp-filter-btn:hover {
    background: #EEF2F7 !important;
    color: #334155 !important;
    border-color: #CBD5E1 !important;
}

.erp-schedule-form {
    padding: 18px 26px !important;
    background: #FFFFFF !important;
}

.erp-schedule-form .erp-form-panel {
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.erp-schedule-form .erp-form-panel + .erp-form-panel {
    margin-top: 18px;
    padding-top: 18px !important;
    border-top: 1px solid var(--border) !important;
}

.erp-schedule-form .erp-form-panel-title {
    display: none !important;
}

.erp-schedule-form .erp-input,
.erp-schedule-form .erp-select,
.erp-schedule-form textarea.erp-input {
    background: #FFFFFF;
}

.erp-current-schedule-info {
    padding: 12px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-hover);
}

.erp-current-schedule-info h5 {
    margin: 0 0 8px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0;
}

.erp-current-schedule-info .grid {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 6px 18px !important;
    align-items: center;
}

.erp-current-schedule-info span {
    color: var(--text-muted);
}

.erp-current-schedule-info strong {
    display: inline-block;
    min-width: 0;
    margin-left: 4px;
    color: var(--text-heading);
    font-weight: 700;
    vertical-align: middle;
}

.erp-current-schedule-info + .erp-schedule-two-col {
    margin-top: 18px;
}

.erp-label,
.form-label,
.label-modern {
    color: var(--text-body) !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    line-height: 1.25 !important;
    margin: 0 !important;
}

.erp-input[readonly],
.erp-input:disabled,
.erp-select:disabled,
input[readonly],
select:disabled {
    background: #F1F5F9 !important;
    color: #64748B !important;
    border-color: #D9E0EB !important;
    cursor: not-allowed;
}

.dashboard-stats {
    gap: 14px !important;
    margin-top: 12px;
    margin-bottom: 16px;
}

.dashboard-stat {
    position: relative;
    min-height: 92px;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 54px;
    align-items: center;
    gap: 10px;
    padding: 12px 14px !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-xl) !important;
    background: var(--bg-card) !important;
    box-shadow: 0 2px 8px rgba(42,63,84,0.07) !important;
    overflow: hidden;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.dashboard-stat:hover {
    transform: translateY(-1px);
    border-color: var(--border-dark) !important;
    box-shadow: 0 8px 18px rgba(42,63,84,0.11) !important;
}

.dashboard-stat .erp-stat-label {
    margin: 0;
    color: #7B8797;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0;
    line-height: 1.1;
}

.dashboard-stat .erp-stat-value {
    margin: 3px 0 0;
    color: #1F2937;
    font-size: 24px;
    line-height: 1;
    font-weight: 700 !important;
}

.dashboard-stat .erp-stat-value span {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
}

.dashboard-stat .erp-stat-sub {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
}

.dashboard-stat .erp-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-lg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    grid-column: 1;
}

.dashboard-stat .erp-stat-icon svg {
    width: 17px;
    height: 17px;
}

.dashboard-stat-copy {
    min-width: 0;
}

.dashboard-stat-spark {
    height: 28px;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 3px;
}

.dashboard-stat-spark span {
    width: 4px;
    height: var(--h);
    min-height: 8px;
    border-radius: 999px 999px 2px 2px;
    background: currentColor;
    opacity: 0.42;
}

.dashboard-stat.stat-teal {
    color: #1ABB9C;
}
.dashboard-stat.stat-teal .erp-stat-icon { background: rgba(26,187,156,0.08) !important; color: #1ABB9C !important; }

.dashboard-stat.stat-green {
    color: #16A34A;
}
.dashboard-stat.stat-green .erp-stat-icon { background: rgba(22,163,74,0.08) !important; color: #16A34A !important; }

.dashboard-stat.stat-rose {
    color: #DC2626;
}
.dashboard-stat.stat-rose .erp-stat-icon { background: rgba(220,38,38,0.07) !important; color: #DC2626 !important; }

.dashboard-stat.stat-purple {
    color: #A855F7;
}
.dashboard-stat.stat-purple .erp-stat-icon { background: rgba(168,85,247,0.08) !important; color: #A855F7 !important; }

.dashboard-stat.stat-blue {
    color: #2563EB;
}
.dashboard-stat.stat-blue .erp-stat-icon { background: rgba(37,99,235,0.08) !important; color: #2563EB !important; }

.dashboard-stat.stat-amber {
    color: #D97706;
}
.dashboard-stat.stat-amber .erp-stat-icon { background: rgba(217,119,6,0.08) !important; color: #D97706 !important; }

.erp-schedule-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    min-height: 24px;
    padding: 3px 9px;
    border: 1px solid color-mix(in srgb, var(--schedule-type-color) 26%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--schedule-type-color) 10%, #FFFFFF);
    color: var(--schedule-type-color);
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
}

.erp-schedule-type-dot {
    width: 6px;
    height: 6px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--schedule-type-color) 16%, transparent);
}

.erp-schedule-type-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-section-title {
    margin: 0;
    color: var(--text-heading);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.25;
}

.dashboard-side-card {
    background: var(--bg-card);
}

.dashboard-sidebar-tabs {
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 72px 0 14px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
}

.dashboard-sidebar-action {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.dashboard-show-all {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    min-width: 28px;
    padding: 0 7px;
    border: 1px solid rgba(26,187,156,0.2);
    border-radius: var(--radius);
    background: rgba(26,187,156,0.08);
    color: var(--brand);
    font-size: 10px;
    font-weight: 700;
}

.dashboard-show-all svg {
    width: 13px;
    height: 13px;
}

.dashboard-show-all:hover {
    background: rgba(26,187,156,0.14);
    color: var(--brand-hover);
}

.sidebar-tab-btn {
    min-height: 40px;
    padding: 0 12px;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.sidebar-tab-btn.active {
    color: var(--brand);
    border-bottom-color: var(--brand);
    background: transparent;
}

.dashboard-conflict-list {
    padding: 8px;
}

.dashboard-conflict-item {
    position: relative;
    margin: 0 0 10px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    box-shadow: 0 1px 3px rgba(42,63,84,0.05);
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.dashboard-conflict-item:hover {
    border-color: var(--border-dark);
    box-shadow: 0 8px 18px rgba(42,63,84,0.09);
    transform: translateY(-1px);
}

.dashboard-conflict-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.dashboard-conflict-status {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, #DC2626 24%, transparent);
    background: color-mix(in srgb, #DC2626 8%, var(--bg-card));
    color: #DC2626;
    font-size: 10px;
    font-weight: 700;
}

.dashboard-conflict-stack {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.dashboard-conflict-course {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 9px;
    align-items: start;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-hover);
}

.dashboard-conflict-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--brand) 12%, var(--bg-card));
    color: var(--brand);
    font-size: 10px;
    font-weight: 700;
}

.dashboard-conflict-course strong,
.dashboard-conflict-course span,
.dashboard-conflict-course em {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-conflict-course strong {
    color: var(--text-heading);
    font-size: 12px;
    font-weight: 700;
}

.dashboard-conflict-course span {
    color: var(--text-body);
    font-size: 11px;
}

.dashboard-conflict-course em {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 10.5px;
    font-style: normal;
    font-weight: 600;
}

.dashboard-empty-state {
    padding: 44px 22px;
    text-align: center;
}

.dashboard-empty-icon {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    border-radius: 999px;
    background: rgba(26,187,156,0.1);
    color: var(--brand);
}

.dashboard-empty-state p {
    margin: 0;
    color: var(--text-heading);
    font-size: 13px;
    font-weight: 700;
}

.dashboard-empty-state span {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 12px;
}

.dashboard-list-footer {
    padding: 12px;
    text-align: center;
    background: var(--bg-hover);
}

.erp-schedule-two-col {
    display: grid;
    grid-template-columns: minmax(430px, 0.72fr) minmax(660px, 1fr);
    gap: 28px;
    align-items: start;
}

.erp-schedule-fields {
    display: grid;
    align-content: start;
    gap: 14px;
    min-width: 0;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #FFFFFF;
}

.erp-schedule-field-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-flow: dense;
    gap: 14px 16px !important;
}

.erp-schedule-field-grid > div {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.erp-schedule-field-grid > .erp-field-wide {
    grid-column: 1 / -1;
}

.erp-schedule-fields .erp-label {
    display: block;
    margin: 0 !important;
    line-height: 1.25;
}

.erp-schedule-fields .erp-label + .relative,
.erp-schedule-fields .erp-label + .erp-input,
.erp-schedule-fields .erp-label + .erp-select,
.erp-schedule-fields .erp-label + .select2,
.erp-schedule-fields .erp-label + .select2-container {
    margin-top: 0 !important;
}

.erp-schedule-fields .relative,
.erp-schedule-fields .select2,
.erp-schedule-fields .select2-container,
.erp-schedule-fields .erp-input,
.erp-schedule-fields .erp-select {
    min-width: 0;
    width: 100% !important;
}

.erp-schedule-fields #titleDiv.hidden,
.erp-schedule-fields #batchDiv.hidden,
.erp-schedule-fields #moduleDiv.hidden,
.erp-schedule-fields #campusDiv.hidden {
    display: none !important;
}

.erp-schedule-side-panel {
    position: static;
    align-self: start;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #F8FAFC;
    padding: 14px 16px;
    min-width: 0;
}

.erp-schedule-side-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    color: var(--text-heading);
    font-size: 13px;
    font-weight: 700;
}

.erp-availability-panel {
    min-height: 330px;
    border: 1px dashed #CBD5E1;
    border-radius: var(--radius-sm);
    background: #FFFFFF;
    padding: 14px;
}

.erp-availability-panel .availability-check-wrap {
    overflow: visible;
    width: 100%;
}

.erp-availability-panel .availability-check-table {
    min-width: 0;
    width: 100%;
    table-layout: fixed;
}

.erp-availability-panel .availability-check-table th,
.erp-availability-panel .availability-check-table td {
    padding: 10px 9px !important;
    white-space: normal;
    word-break: normal;
    overflow-wrap: anywhere;
    font-size: 11.5px;
}

.erp-availability-panel .availability-check-table th:first-child,
.erp-availability-panel .availability-check-table td:first-child {
    width: 28%;
}

.erp-availability-panel .availability-check-table th:nth-child(2),
.erp-availability-panel .availability-check-table td:nth-child(2) {
    width: 14%;
}

.erp-availability-empty {
    min-height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
}

.erp-availability-empty strong {
    color: var(--text-heading);
    font-size: 13px;
}

.erp-compare-card {
    margin-bottom: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #FFFFFF;
    overflow: hidden;
}

.erp-compare-label {
    padding: 8px 12px;
    background: #EEF2F7;
    color: var(--text-heading);
    font-size: 12px;
    font-weight: 700;
}

.erp-compare-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 14px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 11.5px;
}

#individualScheduleForm .erp-drawer-footer {
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 30px;
}

#individualScheduleForm .erp-drawer-footer .erp-btn {
    flex: 0 0 auto !important;
    min-width: 170px;
    justify-content: center;
}

.erp-compare-row strong {
    color: var(--text-body);
    font-weight: 700;
    text-align: right;
}

.erp-compare-row strong .erp-faculty-chip,
.erp-compare-row strong .erp-schedule-type-badge {
    justify-content: flex-end;
}

.dark-mode .dashboard-stat {
    background: #1F2D3A !important;
    border-color: rgba(255,255,255,0.09) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important;
}

body.dark-mode,
html body.dark-mode {
    background-color: var(--bg-body) !important;
    color: var(--text-body) !important;
}

.dark-mode .dashboard-stat:hover {
    border-color: rgba(255,255,255,0.16) !important;
    box-shadow: 0 10px 20px rgba(0,0,0,0.26) !important;
}

.dark-mode .dashboard-stat .erp-stat-label {
    color: #9FB0BE;
}

.dark-mode .dashboard-stat .erp-stat-value {
    color: #ECF0F1;
}

.dark-mode .dashboard-stat.stat-teal { color: #1ABB9C !important; }
.dark-mode .dashboard-stat.stat-green { color: #16A34A !important; }
.dark-mode .dashboard-stat.stat-rose { color: #F87171 !important; }
.dark-mode .dashboard-stat.stat-purple { color: #C084FC !important; }
.dark-mode .dashboard-stat.stat-blue { color: #60A5FA !important; }
.dark-mode .dashboard-stat.stat-amber { color: #FBBF24 !important; }

.dark-mode .dashboard-stat-spark span {
    color: inherit !important;
}

.dark-mode .erp-schedule-type-badge {
    background: color-mix(in srgb, var(--schedule-type-color) 18%, #1F2D3A);
    border-color: color-mix(in srgb, var(--schedule-type-color) 34%, rgba(255,255,255,0.08));
}

.dark-mode .dashboard-sidebar-tabs,
.dark-mode .dashboard-side-card,
.dark-mode .dashboard-conflict-item,
.dark-mode .erp-availability-panel,
.dark-mode .erp-compare-card {
    background: var(--bg-card);
}

.dark-mode .dashboard-conflict-course,
.dark-mode .erp-schedule-side-panel,
.dark-mode .erp-compare-label,
.dark-mode .dashboard-list-footer {
    background: var(--bg-hover);
}

.dark-mode .dashboard-conflict-status {
    background: rgba(220,38,38,0.14);
    border-color: rgba(248,113,113,0.24);
    color: #FCA5A5;
}

.dark-mode .dashboard-show-all {
    background: rgba(26,187,156,0.14);
    border-color: rgba(26,187,156,0.24);
}

.dark-mode .erp-schedule-form {
    background: var(--bg-card) !important;
}

.dark-mode .erp-schedule-form .erp-input,
.dark-mode .erp-schedule-form .erp-select,
.dark-mode .erp-schedule-form textarea.erp-input {
    background: #17212B;
    color: var(--text-body);
    border-color: var(--border);
}

.dark-mode .erp-availability-panel {
    border-color: rgba(255,255,255,0.18);
}

.dark-mode .erp-current-schedule-info {
    background: var(--bg-hover);
    border-color: var(--border);
}

.dark-mode .erp-schedule-form .bg-indigo-500\/10 {
    background: rgba(99,102,241,0.16) !important;
}

.dark-mode #sidebar-panel-unassigned .hover\:bg-slate-50:hover {
    background: var(--bg-hover) !important;
}

.dark-mode #sidebar-panel-unassigned .bg-slate-50,
.dark-mode #sidebar-panel-unassigned .bg-slate-100 {
    background: var(--bg-hover) !important;
}

.dark-mode #sidebar-panel-unassigned .text-slate-900,
.dark-mode #sidebar-panel-unassigned .text-slate-700,
.dark-mode #sidebar-panel-unassigned .text-slate-600 {
    color: var(--text-body) !important;
}

.dark-mode #sidebar-panel-unassigned .text-slate-500,
.dark-mode #sidebar-panel-unassigned .text-slate-400 {
    color: var(--text-muted) !important;
}

.dark-mode .erp-input[readonly],
.dark-mode .erp-input:disabled,
.dark-mode .erp-select:disabled,
.dark-mode input[readonly],
.dark-mode select:disabled {
    background: #263746 !important;
    color: #94A3B8 !important;
    border-color: rgba(255,255,255,0.12) !important;
}

.erp-drawer-person-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.faculty-name-cell {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 210px;
}

.faculty-name-main {
    min-width: 0;
}

.faculty-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.faculty-name-text {
    display: block;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-heading);
}

.faculty-calendar-link {
    text-decoration: none;
    transition: color 0.15s ease;
}

.faculty-calendar-link:hover {
    color: var(--brand);
}

.faculty-code-line {
    margin-top: 1px;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0;
}

.faculty-support-toggle,
.faculty-module-more,
.faculty-promote-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    border: 1px solid rgba(26,187,156,0.28);
    background: rgba(26,187,156,0.1);
    color: #169F85;
    cursor: pointer;
    transition: all 0.15s ease;
}

.faculty-support-toggle {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
}

.faculty-support-toggle svg,
.faculty-promote-btn svg {
    width: 12px;
    height: 12px;
}

.faculty-support-toggle:hover,
.faculty-module-more:hover,
.faculty-promote-btn:hover {
    background: #1ABB9C;
    border-color: #169F85;
    color: #fff;
}

.faculty-popover {
    position: fixed;
    display: none;
    z-index: 1090;
    width: min(340px, calc(100vw - 32px));
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-card);
    box-shadow: 0 14px 32px rgba(42,63,84,0.18);
}

.faculty-popover.is-open {
    display: block;
}

.faculty-popover-title {
    padding: 2px 2px 8px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.faculty-support-list {
    display: grid;
    gap: 7px;
}

.faculty-support-row {
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr) 26px;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: var(--bg-body);
}

.faculty-support-copy {
    min-width: 0;
}

.faculty-support-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-heading);
    font-size: 12px;
    font-weight: 700;
}

.faculty-support-meta {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-muted);
    font-size: 10.5px;
}

.faculty-promote-btn {
    width: 26px;
    height: 26px;
}

.faculty-module-cell {
    position: relative;
}

.faculty-module-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    max-width: 190px;
}

.faculty-module-chip,
.faculty-module-popover-chip {
    display: inline-flex;
    align-items: center;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 2px 6px;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: var(--bg-body);
    color: var(--text-body);
    font-size: 10px;
    font-weight: 600;
}

.faculty-module-more {
    min-height: 20px;
    padding: 1px 7px;
    font-size: 10px;
    font-weight: 800;
}

.faculty-empty-text {
    color: var(--text-faint);
    font-size: 11px;
    font-style: italic;
}

.faculty-module-popover {
    width: min(300px, calc(100vw - 32px));
}

.faculty-module-popover-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    max-height: 220px;
    overflow-y: auto;
}

.faculty-primary-modal {
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-card);
    box-shadow: 0 22px 55px rgba(42,63,84,0.2);
}

.faculty-primary-modal .modal-header {
    align-items: flex-start;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--border);
}

.faculty-primary-modal .modal-body {
    padding: 18px 20px;
}

.faculty-primary-modal .modal-footer {
    gap: 10px;
    padding: 14px 20px 18px;
    border-top: 1px solid var(--border);
}

.faculty-primary-modal-head {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.faculty-primary-modal-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border: 1px solid rgba(26,187,156,0.28);
    border-radius: 4px;
    background: rgba(26,187,156,0.1);
    color: var(--brand);
}

.faculty-primary-modal-icon svg,
.faculty-primary-swap-icon svg {
    width: 18px;
    height: 18px;
}

.faculty-primary-modal .modal-title {
    margin: 0;
    color: var(--text-heading);
    font-size: 16px;
    font-weight: 700;
}

.faculty-primary-modal-subtitle {
    display: block;
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.4;
}

.faculty-primary-swap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
}

.faculty-primary-card {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-body);
}

.faculty-primary-card.is-next {
    border-color: rgba(26,187,156,0.32);
    background: rgba(26,187,156,0.08);
}

.faculty-primary-card-label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.faculty-primary-card strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-heading);
    font-size: 13px;
    font-weight: 700;
}

.faculty-primary-swap-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(52,152,219,0.12);
    color: #2980B9;
}

.faculty-primary-note {
    margin-top: 14px;
    padding: 10px 12px;
    border: 1px solid rgba(243,156,18,0.24);
    border-radius: 4px;
    background: rgba(243,156,18,0.08);
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.45;
}

.faculty-support-modal {
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-card);
    box-shadow: 0 22px 55px rgba(42,63,84,0.2);
}

.faculty-support-modal .modal-header {
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--border);
}

.faculty-support-modal .modal-body {
    padding: 18px 20px;
}

.faculty-support-modal .modal-footer {
    padding: 14px 20px 18px;
    border-top: 1px solid var(--border);
}

.schedule-conflict-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: 6px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #EF4444;
    vertical-align: middle;
    cursor: pointer;
}

.schedule-conflict-icon svg {
    width: 15px;
    height: 15px;
}

.schedule-conflict-icon:hover {
    color: #DC2626;
}

.assigned-schedule-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-hover);
}

.assigned-schedule-summary span {
    display: block;
    margin-bottom: 4px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
}

.assigned-schedule-summary strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-heading);
    font-size: 12.5px;
    font-weight: 800;
}

.assigned-schedule-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.assigned-day-card {
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    overflow: hidden;
}

.assigned-day-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 12px;
    border-bottom: 1px solid var(--border);
    background: #343A46;
    color: #fff;
}

.assigned-day-head strong {
    font-size: 12px;
    font-weight: 800;
}

.assigned-day-head span {
    color: rgba(255,255,255,0.75);
    font-size: 11px;
    font-weight: 700;
}

.assigned-session-card {
    margin: 10px;
    padding: 11px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-body);
}

.assigned-session-top,
.assigned-session-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.assigned-session-top strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-heading);
    font-size: 12.5px;
}

.assigned-session-top span {
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(22,163,74,0.11);
    color: #16A34A;
    font-size: 10px;
    font-weight: 800;
}

.assigned-session-card p {
    margin: 7px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-body);
    font-size: 12px;
}

.assigned-session-meta span,
.assigned-session-meta em {
    color: var(--text-muted);
    font-size: 11px;
    font-style: normal;
    font-weight: 700;
}

.assigned-reschedule-btn {
    margin-top: 9px;
    padding: 5px 9px;
    border: 1px solid rgba(26,187,156,0.28);
    border-radius: 3px;
    background: rgba(26,187,156,0.1);
    color: var(--brand);
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

.assigned-reschedule-btn:hover {
    background: var(--brand);
    color: #fff;
}

.assigned-empty {
    margin: 10px;
    padding: 18px 10px;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
}

.match-faculty-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.match-faculty-table {
    min-width: 860px;
    table-layout: fixed;
    width: 100%;
}

.match-col-sl {
    width: 52px;
}

.match-col-name {
    width: 330px;
}

.match-col-check {
    width: 76px;
}

.match-faculty-table th,
.match-faculty-table td {
    padding: 10px 10px !important;
    vertical-align: middle;
}

.match-faculty-table th {
    background: #F3F6FA;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.match-faculty-table td {
    font-size: 12px;
}

.match-faculty-meta {
    margin-top: 3px;
    padding-left: 38px;
    color: var(--text-muted);
    font-size: 10.5px;
    font-weight: 600;
}

.match-faculty-name-line {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    white-space: nowrap;
}

.match-name-text {
    color: var(--text-heading);
    font-size: 12.5px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 205px;
    line-height: 1.25;
}

.match-faculty-picker {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    accent-color: var(--brand);
    cursor: pointer;
}

.match-hours {
    color: var(--text-body);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.match-status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.match-status-icon svg {
    width: 16px;
    height: 16px;
}

.match-status-icon.is-ok {
    color: #16A34A;
}

.match-status-icon.is-bad {
    color: #EF4444;
}

.match-status-icon.is-warn {
    color: #F59E0B;
}

.match-empty {
    padding: 30px !important;
    color: var(--text-muted);
    font-weight: 700;
    text-align: center;
}

.faculty-support-detail-grid {
    display: grid;
    grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.1fr);
    gap: 16px;
    align-items: start;
}

.faculty-support-detail-list {
    display: grid;
    gap: 12px;
}

.faculty-detail-card {
    min-width: 0;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-body);
}

.faculty-detail-card.is-primary {
    background: rgba(52,152,219,0.07);
    border-color: rgba(52,152,219,0.22);
}

.faculty-detail-card.is-support {
    background: rgba(26,187,156,0.06);
    border-color: rgba(26,187,156,0.22);
}

.faculty-detail-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    padding-bottom: 9px;
    border-bottom: 1px solid var(--border);
}

.faculty-detail-card-head span {
    color: var(--text-heading);
    font-size: 13px;
    font-weight: 800;
}

.faculty-detail-row {
    display: grid;
    grid-template-columns: 105px minmax(0, 1fr);
    gap: 10px;
    padding: 6px 0;
    color: var(--text-body);
    font-size: 12px;
}

.faculty-detail-row span {
    color: var(--text-muted);
    font-weight: 600;
}

.faculty-detail-row strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-heading);
    font-weight: 700;
}

.faculty-make-primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 5px 10px;
    border: 1px solid rgba(243,156,18,0.38);
    border-radius: 3px;
    background: rgba(243,156,18,0.11);
    color: #B45309;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.faculty-make-primary-btn:hover {
    background: #F39C12;
    border-color: #D97706;
    color: #fff;
}

.faculty-support-empty {
    padding: 18px;
    border: 1px dashed var(--border);
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
}

.dark-mode .faculty-popover {
    background: var(--bg-card);
    border-color: var(--border);
    box-shadow: 0 16px 36px rgba(0,0,0,0.34);
}

.dark-mode .faculty-support-row,
.dark-mode .faculty-module-chip,
.dark-mode .faculty-module-popover-chip {
    background: var(--bg-hover);
    border-color: var(--border);
}

.dark-mode .faculty-primary-modal {
    background: var(--bg-card);
    border-color: var(--border);
    box-shadow: 0 22px 55px rgba(0,0,0,0.4);
}

.dark-mode .faculty-primary-card {
    background: var(--bg-hover);
    border-color: var(--border);
}

.dark-mode .faculty-primary-card.is-next {
    border-color: rgba(26,187,156,0.34);
    background: rgba(26,187,156,0.12);
}

.dark-mode .faculty-primary-note {
    border-color: rgba(243,156,18,0.3);
    background: rgba(243,156,18,0.12);
}

.dark-mode .faculty-support-modal {
    background: var(--bg-card);
    border-color: var(--border);
    box-shadow: 0 22px 55px rgba(0,0,0,0.4);
}

.dark-mode .faculty-detail-card {
    background: var(--bg-hover);
    border-color: var(--border);
}

.dark-mode .faculty-detail-card.is-primary {
    background: rgba(52,152,219,0.12);
    border-color: rgba(52,152,219,0.28);
}

.dark-mode .faculty-detail-card.is-support {
    background: rgba(26,187,156,0.12);
    border-color: rgba(26,187,156,0.28);
}

.dark-mode .faculty-make-primary-btn {
    background: rgba(243,156,18,0.14);
    border-color: rgba(243,156,18,0.34);
    color: #FBBF24;
}

.dark-mode .assigned-schedule-summary,
.dark-mode .assigned-session-card {
    background: var(--bg-hover);
    border-color: var(--border);
}

.dark-mode .assigned-day-card {
    background: var(--bg-card);
    border-color: var(--border);
}

.dark-mode .assigned-day-head {
    background: #111827;
}

.dark-mode .match-faculty-table th {
    background: var(--bg-hover);
    color: var(--text-muted);
}

@media (max-width: 575px) {
    .faculty-primary-swap {
        grid-template-columns: 1fr;
    }

    .faculty-primary-swap-icon {
        transform: rotate(90deg);
        justify-self: center;
    }

    .faculty-detail-row {
        grid-template-columns: 1fr;
        gap: 2px;
    }
}

@media (max-width: 767px) {
    .faculty-support-detail-grid {
        grid-template-columns: 1fr;
    }

    .assigned-schedule-summary,
    .assigned-schedule-grid {
        grid-template-columns: 1fr;
    }

    .erp-page-intro {
        align-items: stretch;
    }

    .erp-breadcrumbs a,
    .erp-breadcrumbs .bc-current {
        max-width: 115px;
    }

    .erp-schedule-two-col {
        grid-template-columns: 1fr;
    }

    .erp-current-schedule-info .grid {
        grid-template-columns: 1fr !important;
    }

    .erp-schedule-fields {
        padding: 14px;
    }

    .erp-schedule-field-grid {
        grid-template-columns: 1fr;
        gap: 12px !important;
    }

    .erp-schedule-side-panel {
        position: static;
    }

    #individualScheduleForm .erp-drawer-footer {
        justify-content: stretch;
    }

    #individualScheduleForm .erp-drawer-footer .erp-btn {
        width: 100%;
    }
}

/* ============================================
   Inline Filters System
   ============================================ */
.erp-inline-filters {
    margin-top: 12px;
    margin-bottom: 16px;
    padding: 14px 16px;
}
.erp-filter-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.erp-filter-head span {
    color: var(--text-heading);
    font-size: 13.5px;
    font-weight: 750;
    letter-spacing: -0.01em;
}
.erp-inline-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    align-items: end;
}
.erp-inline-filter-grid.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.erp-inline-filter-grid.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.erp-inline-filter-grid.cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.erp-keyword-filter {
    min-width: 0;
}
.erp-filter-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px;
    gap: 8px;
    align-items: center;
}

@media (max-width: 1024px) {
    .erp-inline-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}
@media (max-width: 640px) {
    .erp-filter-head {
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
    }
    .erp-inline-filter-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ============================================
   Shared Datepicker Theme
   ============================================ */
.datepicker-dropdown {
    padding: 8px !important;
    border: 1px solid #D9E2EA !important;
    border-radius: var(--radius-sm) !important;
    background: var(--bg-card) !important;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16) !important;
    color: var(--text-body);
    z-index: 3000 !important;
}

.datepicker-dropdown:before,
.datepicker-dropdown:after {
    display: none !important;
}

.datepicker table {
    width: 100%;
    margin: 0;
    border-collapse: separate;
    border-spacing: 2px;
}

.datepicker table tr th,
.datepicker table tr td {
    width: 32px;
    height: 30px;
    border-radius: 4px;
    border: 0;
    color: var(--text-body);
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    text-shadow: none;
}

.datepicker table tr th {
    color: var(--text-heading);
    font-weight: 800;
}

.datepicker .datepicker-switch {
    color: var(--text-heading);
    font-size: 13px;
    font-weight: 800;
}

.datepicker .prev,
.datepicker .next {
    color: var(--brand);
    font-size: 16px;
}

.datepicker table tr td.day:hover,
.datepicker table tr td.focused {
    background: rgba(26, 187, 156, 0.10) !important;
    color: #169F85 !important;
}

.datepicker table tr td.today {
    background: rgba(52, 152, 219, 0.12) !important;
    color: #2A7FB8 !important;
}

.datepicker table tr td.active,
.datepicker table tr td.active:hover,
.datepicker table tr td.active.highlighted,
.datepicker table tr td.active.highlighted:hover {
    background: #1ABB9C !important;
    color: #fff !important;
    text-shadow: none !important;
}

.datepicker table tr td.old,
.datepicker table tr td.new {
    color: var(--text-faint);
}

.datepicker .month,
.datepicker .year,
.datepicker .decade,
.datepicker .century {
    border-radius: 4px;
    padding: 7px 8px;
}

.datepicker .month:hover,
.datepicker .year:hover,
.datepicker .decade:hover,
.datepicker .century:hover {
    background: rgba(26, 187, 156, 0.10) !important;
    color: #169F85 !important;
}

.dark-mode .datepicker-dropdown {
    background: var(--bg-card) !important;
    border-color: rgba(255,255,255,0.14) !important;
    box-shadow: 0 18px 40px rgba(0,0,0,0.42) !important;
}

.dark-mode .datepicker table tr th,
.dark-mode .datepicker table tr td,
.dark-mode .datepicker .datepicker-switch {
    color: var(--text-body);
}

.dark-mode .datepicker table tr td.old,
.dark-mode .datepicker table tr td.new {
    color: #708294;
}

/* ============================================
   Offcanvas Form Rhythm
   ============================================ */
.erp-offcanvas .erp-drawer-body form,
#filter-drawer .erp-drawer-body form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.erp-offcanvas .erp-filter-section,
.erp-offcanvas .erp-form-group,
.erp-offcanvas .batch-schedule-form-panel .grid > div {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.erp-offcanvas .erp-label,
.erp-offcanvas .erp-filter-label {
    display: block;
    margin: 0 !important;
    line-height: 1.35;
}

.erp-offcanvas .erp-section-label {
    color: var(--text-heading);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

.erp-offcanvas .erp-drawer-body > div:not(.erp-form-group) > .erp-label + .erp-input,
.erp-offcanvas .erp-drawer-body > div:not(.erp-form-group) > .erp-label + .erp-select,
.erp-offcanvas .erp-drawer-body > div:not(.erp-form-group) > .erp-label + .form-control,
.erp-offcanvas .erp-drawer-body > div:not(.erp-form-group) > .erp-label + .form-select,
.erp-offcanvas .erp-drawer-body > div:not(.erp-form-group) > .erp-label + .select2,
.erp-offcanvas .erp-drawer-body > div:not(.erp-form-group) > .erp-label + .select2-container,
.erp-offcanvas .erp-drawer-body form > div:not(.erp-form-group) > .erp-label + .erp-input,
.erp-offcanvas .erp-drawer-body form > div:not(.erp-form-group) > .erp-label + .erp-select,
.erp-offcanvas .erp-drawer-body form > div:not(.erp-form-group) > .erp-label + .form-control,
.erp-offcanvas .erp-drawer-body form > div:not(.erp-form-group) > .erp-label + .form-select,
.erp-offcanvas .erp-drawer-body form > div:not(.erp-form-group) > .erp-label + .select2,
.erp-offcanvas .erp-drawer-body form > div:not(.erp-form-group) > .erp-label + .select2-container {
    margin-top: 8px !important;
}

.erp-offcanvas .erp-input,
.erp-offcanvas .erp-select,
#filter-drawer .erp-input,
#filter-drawer .erp-select {
    min-height: 42px;
    padding-left: 16px !important;
    padding-right: 16px !important;
}

.erp-input.datepicker {
    padding-left: 16px !important;
    padding-right: 16px !important;
}

.erp-offcanvas .select2-container--default .select2-selection--single {
    min-height: 42px !important;
}

.erp-offcanvas .select2-container--default .select2-selection--single .select2-selection__rendered {
    padding-left: 16px !important;
    padding-right: 34px !important;
}

.erp-offcanvas .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px !important;
    right: 10px !important;
}

.erp-offcanvas .select2-container--default.select2-container--disabled .select2-selection--single,
.erp-offcanvas .erp-input[readonly] {
    background: var(--bg-hover) !important;
    color: var(--text-muted) !important;
    cursor: not-allowed;
}

.batch-schedule-offcanvas .batch-schedule-form-panel .space-y-6 > * + * {
    margin-top: 22px !important;
}

/* Custom Pagination Styles to Match Premium Theme */
.pagination {
    display: flex;
    padding-left: 0;
    list-style: none;
    align-items: center;
    gap: 4px;
    margin: 0;
}
.pagination .page-item {
    margin: 0;
}
.pagination .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-body);
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    text-decoration: none;
    transition: all 0.15s ease-in-out;
}
.pagination .page-link:hover {
    background-color: var(--bg-hover);
    color: var(--brand);
    border-color: var(--border-dark);
}
.pagination .page-item.active .page-link {
    background-color: var(--brand);
    border-color: var(--brand);
    color: #ffffff !important;
}
.pagination .page-item.disabled .page-link {
    color: var(--text-faint);
    pointer-events: none;
    background-color: var(--bg-hover);
    border-color: var(--border);
    opacity: 0.6;
}
