/* ============================================
   CLS PTSC – Enterprise Training Plan System
   Premium Light Theme Design System
   ============================================ */

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

/* ---- Design Tokens ---- */
:root {
    /* Colors - Light Theme */
    --bg-primary: #f0f2f5;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f8f9fb;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-card-hover: rgba(255, 255, 255, 1);
    --bg-sidebar: rgba(255, 255, 255, 0.97);
    --bg-input: rgba(0, 0, 0, 0.02);

    --border-primary: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(0, 0, 0, 0.15);
    --border-active: rgba(99, 102, 241, 0.4);

    --text-primary: #1a1a2e;
    --text-secondary: #555570;
    --text-muted: #8c8ca1;

    /* Accent Colors */
    --accent-primary: #4f46e5;
    --accent-primary-rgb: 79, 70, 229;
    --accent-secondary: #0891b2;
    --accent-secondary-rgb: 8, 145, 178;
    --accent-tertiary: #7c3aed;
    --accent-tertiary-rgb: 124, 58, 237;
    --accent-success: #059669;
    --accent-success-rgb: 5, 150, 105;
    --accent-warning: #d97706;
    --accent-warning-rgb: 217, 119, 6;
    --accent-danger: #dc2626;
    --accent-danger-rgb: 220, 38, 38;
    --accent-info: #2563eb;
    --accent-info-rgb: 37, 99, 235;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #4f46e5, #7c3aed, #0891b2);
    --gradient-hero: linear-gradient(135deg, rgba(79, 70, 229, 0.06), rgba(124, 58, 237, 0.03), transparent);
    --gradient-card: linear-gradient(145deg, rgba(79, 70, 229, 0.03), transparent);
    --gradient-sidebar: linear-gradient(180deg, rgba(79, 70, 229, 0.03), transparent);

    /* Spacing */
    --sidebar-width: 280px;
    --sidebar-collapsed: 72px;
    --header-height: 64px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.1);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ---- Background Effects ---- */
.bg-pattern {
    position: fixed;
    inset: 0;
    background-image: radial-gradient(rgba(79, 70, 229, 0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    pointer-events: none;
    z-index: 0;
    animation: orbFloat 20s ease-in-out infinite;
}

.orb-1 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.06), transparent 70%);
    top: -10%; left: 20%;
}
.orb-2 {
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.05), transparent 70%);
    bottom: 10%; right: -5%;
    animation-delay: -7s;
}
.orb-3 {
    width: 350px; height: 350px;
    background: radial-gradient(circle, rgba(8, 145, 178, 0.04), transparent 70%);
    top: 50%; left: -5%;
    animation-delay: -14s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -40px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(15px, 30px) scale(1.02); }
}

/* ---- App Layout ---- */
.app-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

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

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

.sidebar-brand .logo-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.sidebar-brand .brand-text h2 {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.sidebar-brand .brand-text span {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Sidebar User */
.sidebar-user {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.sidebar-user .user-info {
    overflow: hidden;
}

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

.sidebar-user .user-info .role {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Nav Group */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

.sidebar-nav::-webkit-scrollbar {
    width: 3px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.1);
    border-radius: 10px;
}

.nav-group {
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-group-label {
    padding: 8px 12px 6px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    margin-bottom: 2px;
}

.nav-item:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(79, 70, 229, 0.08);
    color: var(--accent-primary);
    font-weight: 600;
}

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

.nav-item .nav-icon {
    width: 20px;
    text-align: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.nav-item .nav-step {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-muted);
    background: rgba(0,0,0,0.04);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: auto;
    flex-shrink: 0;
}

.nav-item.active .nav-step {
    background: rgba(79, 70, 229, 0.1);
    color: var(--accent-primary);
}

/* ---- Main Content ---- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.main-header {
    height: var(--header-height);
    border-bottom: 1px solid var(--border-primary);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 4px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.breadcrumb a:hover {
    color: var(--accent-primary);
}

.breadcrumb .sep {
    font-size: 0.7rem;
}

.breadcrumb .current {
    color: var(--text-primary);
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.header-btn:hover {
    background: rgba(0,0,0,0.04);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.header-btn .badge-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 7px;
    height: 7px;
    background: var(--accent-danger);
    border-radius: 50%;
    border: 2px solid #fff;
}

/* ---- Page Content ---- */
.page-content {
    flex: 1;
    padding: 32px;
}

/* Page Header */
.page-header {
    margin-bottom: 32px;
}

.page-header .page-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(79, 70, 229, 0.06);
    border: 1px solid rgba(79, 70, 229, 0.12);
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent-primary);
    margin-bottom: 12px;
}

.page-header h1 {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
    line-height: 1.3;
}

.page-header p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    max-width: 700px;
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ---- Cards ---- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 24px;
    backdrop-filter: blur(10px);
    transition: all var(--transition-normal);
}

.card:hover {
    border-color: var(--border-hover);
}

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

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

.card-title .icon {
    font-size: 1.1rem;
}

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

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    backdrop-filter: blur(10px);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
}

.stat-card.primary::before { background: var(--accent-primary); }
.stat-card.secondary::before { background: var(--accent-secondary); }
.stat-card.success::before { background: var(--accent-success); }
.stat-card.warning::before { background: var(--accent-warning); }
.stat-card.danger::before { background: var(--accent-danger); }
.stat-card.info::before { background: var(--accent-info); }
.stat-card.tertiary::before { background: var(--accent-tertiary); }

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

.stat-card .stat-icon {
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.stat-card .stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-card .stat-change {
    font-size: 0.7rem;
    font-weight: 600;
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 10px;
}

.stat-change.up {
    color: var(--accent-success);
    background: rgba(16, 185, 129, 0.1);
}

.stat-change.down {
    color: var(--accent-danger);
    background: rgba(239, 68, 68, 0.1);
}

/* ---- Grids ---- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* ---- Tables ---- */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-primary);
}

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

thead th {
    background: rgba(79, 70, 229, 0.04);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-primary);
    white-space: nowrap;
}

tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-primary);
    color: var(--text-secondary);
    vertical-align: middle;
}

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

tbody tr:hover {
    background: rgba(79, 70, 229, 0.02);
}

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

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

.badge-primary { background: rgba(var(--accent-primary-rgb), 0.12); color: var(--accent-primary); }
.badge-success { background: rgba(var(--accent-success-rgb), 0.12); color: var(--accent-success); }
.badge-warning { background: rgba(var(--accent-warning-rgb), 0.12); color: var(--accent-warning); }
.badge-danger { background: rgba(var(--accent-danger-rgb), 0.12); color: var(--accent-danger); }
.badge-info { background: rgba(var(--accent-info-rgb), 0.12); color: var(--accent-info); }
.badge-sec { background: rgba(var(--accent-secondary-rgb), 0.12); color: var(--accent-secondary); }
.badge-tertiary { background: rgba(var(--accent-tertiary-rgb), 0.12); color: var(--accent-tertiary); }
.badge-muted { background: rgba(0,0,0,0.05); color: var(--text-muted); }

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent-primary);
    color: #fff;
    border-color: var(--accent-primary);
}
.btn-primary:hover {
    background: #5558e6;
    box-shadow: 0 4px 20px rgba(var(--accent-primary-rgb), 0.3);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
    border-color: var(--border-primary);
}
.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.07);
    border-color: var(--border-hover);
}

.btn-outline {
    background: transparent;
    color: var(--accent-primary);
    border-color: rgba(var(--accent-primary-rgb), 0.3);
}
.btn-outline:hover {
    background: rgba(var(--accent-primary-rgb), 0.08);
}

.btn-success {
    background: var(--accent-success);
    color: #fff;
}
.btn-success:hover {
    opacity: 0.9;
    box-shadow: 0 4px 20px rgba(var(--accent-success-rgb), 0.3);
}

.btn-danger {
    background: var(--accent-danger);
    color: #fff;
}
.btn-danger:hover {
    opacity: 0.9;
}

.btn-warning {
    background: var(--accent-warning);
    color: #000;
}

.btn-sm { padding: 6px 14px; font-size: 0.75rem; }
.btn-lg { padding: 14px 28px; font-size: 0.9rem; }
.btn-icon { padding: 8px; width: 36px; height: 36px; }

.btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

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

.form-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-label .required {
    color: var(--accent-danger);
    margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    transition: all var(--transition-fast);
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(var(--accent-primary-rgb), 0.1);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235a5a70' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.form-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

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

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

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.form-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-primary);
    cursor: pointer;
}

/* ---- Progress / Timeline ---- */
.workflow-timeline {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 20px 0;
    overflow-x: auto;
    margin-bottom: 24px;
}

.timeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 90px;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
}

.timeline-step::after {
    content: '';
    position: absolute;
    top: 16px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: var(--border-primary);
    z-index: 0;
}

.timeline-step:last-child::after {
    display: none;
}

.timeline-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    z-index: 1;
    transition: all var(--transition-normal);
}

.timeline-step.completed .timeline-dot {
    background: var(--accent-success);
    border-color: var(--accent-success);
    color: #fff;
}

.timeline-step.active .timeline-dot {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
    box-shadow: 0 0 15px rgba(var(--accent-primary-rgb), 0.4);
}

.timeline-step.completed::after {
    background: var(--accent-success);
}

.timeline-label {
    font-size: 0.62rem;
    color: var(--text-muted);
    text-align: center;
    max-width: 80px;
    font-weight: 500;
}

.timeline-step.active .timeline-label {
    color: var(--accent-primary);
    font-weight: 600;
}

.timeline-step.completed .timeline-label {
    color: var(--accent-success);
}

/* ---- Progress Bars ---- */
.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 10px;
    background: var(--gradient-primary);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(79,70,229,0.15), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ---- Tabs ---- */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border-primary);
    margin-bottom: 20px;
    overflow-x: auto;
}

.tab-btn {
    padding: 10px 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

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

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

/* ---- Modals ---- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.modal-backdrop.show {
    display: flex;
    opacity: 1;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 1000px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: transform var(--transition-slow);
}

.modal-backdrop.show .modal {
    transform: translateY(0);
}

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

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 4px;
}
.modal-close:hover { color: var(--text-primary); }

.modal-body {
    padding: 24px;
}

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

/* ---- Section Views (all pages hidden by default) ---- */
.view-section {
    display: none;
    animation: fadeInView 0.35s ease;
}

.view-section.active {
    display: block;
}

@keyframes fadeInView {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---- Info Boxes ---- */
.info-box {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    border-left: 4px solid;
    margin-bottom: 16px;
    font-size: 0.82rem;
}

.info-box.info {
    background: rgba(var(--accent-info-rgb), 0.06);
    border-color: var(--accent-info);
    color: var(--accent-info);
}

.info-box.warning {
    background: rgba(var(--accent-warning-rgb), 0.06);
    border-color: var(--accent-warning);
    color: var(--accent-warning);
}

.info-box.success {
    background: rgba(var(--accent-success-rgb), 0.06);
    border-color: var(--accent-success);
    color: var(--accent-success);
}

.info-box.danger {
    background: rgba(var(--accent-danger-rgb), 0.06);
    border-color: var(--accent-danger);
    color: var(--accent-danger);
}

.info-box h4 {
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.info-box ul {
    margin: 6px 0 0 16px;
    line-height: 1.8;
}

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 48px 24px;
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

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

.empty-state p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* ---- Evaluation Tiers ---- */
.eval-tiers {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.eval-tier {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.eval-tier::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.eval-tier.tier-1::before {
    background: var(--accent-secondary);
}

.eval-tier.tier-2::before {
    background: var(--accent-tertiary);
}

.eval-tier .tier-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}

.eval-tier.tier-1 .tier-label { color: var(--accent-secondary); }
.eval-tier.tier-2 .tier-label { color: var(--accent-tertiary); }

.eval-tier h3 {
    font-size: 1rem;
    margin-bottom: 12px;
}

.eval-tier ul {
    list-style: none;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.eval-tier ul li {
    padding: 6px 0;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.eval-tier ul li::before {
    content: '•';
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ---- File List ---- */
.file-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.file-item:hover {
    background: rgba(0, 0, 0, 0.03);
    border-color: var(--border-hover);
}

.file-item .file-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

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

.file-item .file-name {
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-item .file-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.file-item .file-actions {
    display: flex;
    gap: 4px;
}

/* ---- Kanban-like columns ---- */
.kanban-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.kanban-col {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.kanban-col-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    font-weight: 700;
}

.kanban-col-header .count {
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.03);
    padding: 2px 8px;
    border-radius: 10px;
    color: var(--text-muted);
}

.kanban-col-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 100px;
}

.kanban-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 14px;
    cursor: pointer;
    transition: all var(--transition-normal);
}

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

.kanban-card .kc-title {
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.kanban-card .kc-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ---- Chart Placeholder ---- */
.chart-placeholder {
    background: linear-gradient(135deg, rgba(99,102,241,0.04), rgba(139,92,246,0.02));
    border-radius: var(--radius-md);
    padding: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 220px;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 140px;
    margin-bottom: 16px;
}

.chart-bar {
    width: 32px;
    border-radius: 6px 6px 0 0;
    transition: height 1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.chart-bar span {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.doughnut-chart {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.doughnut-chart .center-text {
    position: absolute;
    text-align: center;
}

.doughnut-chart .center-text .value {
    font-size: 1.5rem;
    font-weight: 800;
}

.doughnut-chart .center-text .label {
    font-size: 0.65rem;
    color: var(--text-muted);
}

/* ---- Registration Cards (FM01) ---- */
.reg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.reg-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 20px;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.reg-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

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

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

.reg-card-status {
    position: absolute;
    top: 16px;
    right: 16px;
}

.reg-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    padding-right: 80px;
}

.reg-card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: rgba(var(--accent-primary-rgb), 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.reg-card-dept {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

.reg-card-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.reg-card-body {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    padding: 12px 0;
    border-top: 1px solid var(--border-primary);
    border-bottom: 1px solid var(--border-primary);
}

.reg-card-stat {
    flex: 1;
    text-align: center;
}

.reg-stat-num {
    display: block;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--accent-primary);
    line-height: 1.2;
}

.reg-stat-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 2px;
}

.reg-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.reg-card-person {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ---- Drill-down Breadcrumb ---- */
.drill-breadcrumb {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    flex-wrap: wrap;
}

.drill-sep {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.drill-current {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.drill-link {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color var(--transition-fast);
    text-decoration: none;
}

.drill-link:hover {
    color: var(--accent-primary);
    text-decoration: underline;
}

/* ---- Unified Modal Layout ---- */
.unified-modal-layout {
    display: flex;
    gap: 24px;
}

.uml-section {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.uml-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ---- Course Tabs ---- */
.course-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.course-tab {
    padding: 6px 14px;
    border: 1px solid var(--border-primary);
    border-radius: 20px;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.course-tab:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.course-tab.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
}

.course-tab-remove {
    font-size: 0.65rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    cursor: pointer;
    transition: opacity var(--transition-fast);
}

.course-tab-remove:hover {
    opacity: 1;
    background: rgba(255,255,255,0.2);
}

/* ---- Employee Picker ---- */
.emp-picker {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.emp-search-wrap {
    position: relative;
}

.emp-search {
    padding-left: 14px !important;
}

.emp-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    max-height: 240px;
    overflow-y: auto;
    z-index: 200;
    box-shadow: var(--shadow-md);
}

.emp-dd-item {
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background var(--transition-fast);
    font-size: 0.82rem;
}

.emp-dd-item:hover {
    background: rgba(var(--accent-primary-rgb), 0.06);
}

.emp-dd-code {
    font-weight: 600;
    color: var(--accent-primary);
    font-size: 0.75rem;
    min-width: 50px;
}

.emp-dd-name {
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.emp-dd-role {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.emp-dd-empty,
.emp-dd-more {
    padding: 12px 14px;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
}

.emp-selected-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
}

.emp-tag {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(var(--accent-primary-rgb), 0.04);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    transition: all var(--transition-fast);
}

.emp-tag:hover {
    border-color: var(--border-hover);
}

.emp-tag-code {
    font-weight: 600;
    color: var(--accent-primary);
    font-size: 0.72rem;
    min-width: 45px;
}

.emp-tag-name {
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.emp-tag-role {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.emp-tag-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all var(--transition-fast);
}

.emp-tag-remove:hover {
    color: var(--accent-danger);
    background: rgba(var(--accent-danger-rgb), 0.1);
}

.emp-empty {
    padding: 16px;
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-style: italic;
    border: 1px dashed var(--border-primary);
    border-radius: var(--radius-sm);
}

/* ---- Clickable Table Rows ---- */
.clickable-row {
    cursor: pointer;
}

.clickable-row:hover {
    background: rgba(var(--accent-primary-rgb), 0.04) !important;
}

/* ---- FM01 Print Preview ---- */
.fm01-print {
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    font-size: 0.82rem;
    line-height: 1.7;
}

.fm01-header-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.fm01-header-left,
.fm01-header-right {
    width: 48%;
}

.fm01-title {
    text-align: center;
    font-size: 1.3rem;
    font-weight: 800;
    margin: 20px 0 10px;
    color: var(--text-primary);
}

.fm01-subtitle {
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.fm01-section {
    margin-bottom: 14px;
    font-size: 0.82rem;
}

.fm01-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 0.78rem;
}

.fm01-table th,
.fm01-table td {
    border: 1px solid var(--border-primary);
    padding: 8px 10px;
}

.fm01-table th {
    background: rgba(var(--accent-primary-rgb), 0.04);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
    text-align: center;
}

.fm01-footer-note {
    margin-top: 16px;
    font-size: 0.82rem;
}

.fm01-signatures {
    display: flex;
    justify-content: space-between;
    margin-top: 28px;
}

.fm01-sig-col {
    text-align: center;
    width: 40%;
}

.fm01-sig-title {
    font-weight: 700;
    font-size: 0.85rem;
}

.fm01-sig-sub {
    font-style: italic;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 4px 0 36px;
}

.fm01-sig-name {
    font-weight: 700;
    font-size: 0.85rem;
}

/* ---- AI Analysis ---- */
.btn-ai {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.btn-ai::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    animation: aiShimmer 3s infinite;
}

@keyframes aiShimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.btn-ai:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.ai-header {
    position: relative;
}

.ai-badge {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    color: #fff !important;
    animation: aiBadgePulse 2s ease-in-out infinite;
}

@keyframes aiBadgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(102, 126, 234, 0); }
}

.ai-card {
    border-left: 3px solid #667eea;
}

/* Score bar */
.ai-score-wrap {
    padding: 20px;
}

.ai-score-bar-track {
    height: 20px;
    background: rgba(var(--accent-primary-rgb), 0.06);
    border-radius: 10px;
    position: relative;
    overflow: visible;
}

.ai-score-bar-fill {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, #ef4444, #f59e0b 40%, #22c55e 75%, #667eea);
    transition: width 1.5s ease;
}

.ai-score-marker {
    position: absolute;
    top: -8px;
    transform: translateX(-50%);
    transition: left 1.5s ease;
}

.ai-score-marker span {
    display: block;
    background: var(--bg-card);
    border: 2px solid #667eea;
    border-radius: 12px;
    padding: 2px 10px;
    font-size: 0.75rem;
    font-weight: 800;
    color: #667eea;
    white-space: nowrap;
}

.ai-score-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.68rem;
    color: var(--text-muted);
}

.ai-score-note {
    margin-top: 12px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    padding: 10px 14px;
    background: rgba(102, 126, 234, 0.04);
    border-radius: var(--radius-sm);
    border-left: 3px solid #667eea;
}

/* Duplicate groups */
.ai-dup-group {
    padding: 20px;
    border-bottom: 1px solid var(--border-primary);
}

.ai-dup-group:last-child {
    border-bottom: none;
}

.ai-dup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.ai-dup-label {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
}

.ai-confidence {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
}

.ai-dup-reason {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 14px;
    line-height: 1.6;
}

.ai-dup-courses {
    display: flex;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 14px;
}

.ai-dup-course {
    flex: 1;
    padding: 14px;
    background: rgba(var(--accent-primary-rgb), 0.03);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
}

.ai-dup-course-dept {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 4px;
}

.ai-dup-course-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.ai-dup-course-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.ai-dup-vs {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--accent-warning);
    min-width: 30px;
}

/* AI Suggestion Box */
.ai-suggestion {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(34, 197, 94, 0.04);
    border: 1px solid rgba(34, 197, 94, 0.15);
    border-radius: var(--radius-sm);
    border-left: 3px solid #22c55e;
}

.ai-suggestion-icon {
    font-size: 1.1rem;
    line-height: 1;
    flex-shrink: 0;
}

.ai-suggestion-text {
    font-size: 0.82rem;
    color: var(--text-primary);
    line-height: 1.6;
}

/* AI Insight panels */
.ai-insight {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-primary);
}

.ai-insight:last-child {
    border-bottom: none;
}

.ai-insight-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 0.88rem;
    color: var(--text-primary);
}

.ai-insight-icon {
    font-size: 1.2rem;
}

.ai-insight-detail {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
    padding-left: 30px;
}

/* ---- Action Checkboxes & AI Plan ---- */
.action-checked {
    background: rgba(34, 197, 94, 0.03);
}

.action-unchecked {
    opacity: 0.5;
}

.action-unchecked td {
    text-decoration: line-through;
    text-decoration-color: var(--text-muted);
}

.action-unchecked td:first-child {
    text-decoration: none;
}

.action-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.ai-plan-card {
    border-left: 3px solid #22c55e;
    animation: planSlideIn 0.5s ease;
}

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

.plan-row-merged {
    background: rgba(102, 126, 234, 0.04) !important;
    border-left: 3px solid #667eea;
}

.plan-row-moved {
    background: rgba(245, 158, 11, 0.04) !important;
    border-left: 3px solid #d97706;
}

.ai-plan-legend {
    display: flex;
    gap: 16px;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    display: inline-block;
}

.ai-plan-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-primary);
}

.plan-type-header {
    background: rgba(var(--accent-primary-rgb), 0.04) !important;
    border-left: 3px solid var(--accent-primary);
}

.plan-type-header td {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}

/* ---- Comparison Timeline ---- */
.compare-container {
    display: flex;
    gap: 2px;
    min-height: 200px;
}

.compare-side {
    flex: 1;
    padding: 16px;
    border-radius: var(--radius-sm);
    transition: all 0.4s ease;
}

.compare-before { background: rgba(239, 68, 68, 0.02); }
.compare-after { background: rgba(34, 197, 94, 0.02); }

.compare-label {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 6px 12px;
    border-radius: 6px;
    display: inline-block;
    margin-bottom: 14px;
}

.compare-label-before { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.compare-label-after { background: rgba(34, 197, 94, 0.1); color: #22c55e; }

.tl-quarter {
    margin-bottom: 12px;
}

.tl-quarter-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.tl-q-name {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--text-primary);
}

.tl-q-load {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
}

.tl-load-low { background: rgba(34, 197, 94, 0.1); color: #22c55e; }
.tl-load-balanced { background: rgba(102, 126, 234, 0.1); color: #667eea; }
.tl-load-high { background: rgba(245, 158, 11, 0.15); color: #d97706; }
.tl-load-critical { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

.tl-courses {
    display: flex;
    gap: 3px;
    min-height: 52px;
}

.tl-course-bar {
    min-width: 0;
}

.tl-bar-inner {
    height: 100%;
    min-height: 52px;
    border-radius: 6px;
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.tl-bar-before {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.tl-bar-after {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.tl-bar-merged {
    background: rgba(102, 126, 234, 0.1) !important;
    border-color: rgba(102, 126, 234, 0.3) !important;
}

.tl-bar-moved {
    border-style: dashed !important;
}

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

.tl-bar-days {
    font-size: 0.62rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.tl-badge-merged,
.tl-badge-moved {
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 0.55rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 6px;
    line-height: 1.3;
}

.tl-badge-merged { background: rgba(102, 126, 234, 0.2); color: #667eea; }
.tl-badge-moved { background: rgba(245, 158, 11, 0.2); color: #d97706; }

/* Comparison metrics */
.compare-metrics {
    display: flex;
    gap: 0;
    border-top: 1px solid var(--border-primary);
    padding: 16px 20px;
    flex-wrap: wrap;
}

.cm-item {
    flex: 1;
    min-width: 140px;
    padding: 8px 12px;
    text-align: center;
}

.cm-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 6px;
}

.cm-values {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.78rem;
}

.cm-before {
    color: #ef4444;
    font-weight: 600;
    text-decoration: line-through;
    opacity: 0.7;
}

.cm-arrow {
    color: var(--text-muted);
    font-size: 0.7rem;
}

.cm-after {
    color: #22c55e;
    font-weight: 800;
}

.cm-delta {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 8px;
}

.cm-delta-good { background: rgba(34, 197, 94, 0.1); color: #22c55e; }
.cm-delta-bad { background: rgba(239, 68, 68, 0.1); color: #ef4444; }

/* ---- Top Courses Ranking ---- */
.top-courses-list {
    padding: 0;
}

.tc-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-primary);
    transition: background var(--transition-fast);
}

.tc-row:hover {
    background: rgba(var(--accent-primary-rgb), 0.02);
}

.tc-row:last-child { border-bottom: none; }

.tc-row-top {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.03), rgba(118, 75, 162, 0.03));
    border-left: 3px solid #667eea;
}

.tc-rank {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 44px;
    font-size: 1.6rem;
}

.tc-rank span {
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--text-muted);
}

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

.tc-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.tc-original {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.tc-original em {
    color: var(--text-secondary);
    font-style: normal;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
}

.tc-depts {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.tc-dept-pill {
    font-size: 0.62rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(var(--accent-primary-rgb), 0.06);
    color: var(--accent-primary);
}

.tc-note {
    font-size: 0.7rem;
    color: #22c55e;
    font-weight: 500;
}

.tc-chart {
    width: 160px;
    flex-shrink: 0;
}

.tc-bar-track {
    height: 10px;
    background: rgba(var(--accent-primary-rgb), 0.06);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 6px;
}

.tc-bar-fill {
    height: 100%;
    border-radius: 5px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 1s ease;
}

.tc-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 600;
}

.tc-students { color: var(--accent-primary); }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .eval-tiers { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .menu-toggle {
        display: flex;
    }
    .page-content {
        padding: 20px 16px;
    }
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .page-header h1 {
        font-size: 1.3rem;
    }
    .kanban-grid {
        grid-template-columns: 1fr;
    }
}

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

/* ---- Utility ---- */
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.flex-1 { flex: 1; }
.hidden { display: none !important; }
