/* ═══════════════════════════════════════════════════════════════════════════
   UGB EXAM PORTAL — Design System
   Institutional Premium | MCC • Since 1975
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── CSS Variables ──────────────────────────────────────────────────────── */
:root {
    /* Brand */
    --navy:         #1B2A4A;
    --navy-light:   #2C3E6B;
    --navy-dark:    #111D35;
    --gold:         #D4A843;
    --gold-light:   #E8C97A;
    --gold-dim:     #B8922E;
    --cyan:         #5BC0EB;

    /* Surfaces */
    --white:        #FAFBFC;
    --surface:      #F0F2F5;
    --surface-dark: #E4E7EC;
    --border:       #D1D5DB;
    --border-light: #E5E7EB;

    /* Semantic */
    --success:      #2D8A4E;
    --success-bg:   #E8F5ED;
    --warning:      #E67E22;
    --warning-bg:   #FEF3E2;
    --danger:       #C0392B;
    --danger-bg:    #FBE8E6;

    /* Text */
    --text:         #1A1A2E;
    --text-muted:   #6B7280;
    --text-light:   #9CA3AF;

    /* Typography */
    --font-serif:   'Georgia', 'Palatino Linotype', 'Book Antiqua', serif;
    --font-sans:    -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;

    /* Layout */
    --sidebar-w:    252px;
    --topbar-h:     64px;

    /* Shadows */
    --shadow-sm:    0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-md:    0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg:    0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-navy:  0 4px 12px rgba(27, 42, 74, 0.25);
    --shadow-gold:  0 4px 12px rgba(212, 168, 67, 0.3);

    /* Transitions */
    --ease:         cubic-bezier(0.4, 0, 0.2, 1);
    --duration:     0.2s;
}


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

html {
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    color: var(--text);
    background: var(--surface);
    line-height: 1.5;
    overflow: hidden;
    height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
    background: none;
}

input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
    outline: none;
}

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


/* ── Scrollbar ─────────────────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}


/* ══════════════════════════════════════════════════════════════════════════
   LAYOUT
   ══════════════════════════════════════════════════════════════════════════ */

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

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

.content-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 32px;
}


/* ══════════════════════════════════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════════════════════════════════ */

.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--navy) 0%, var(--navy-dark) 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: 100vh;
    position: relative;
    z-index: 50;
}

/* Sidebar Header */
.sidebar-header {
    padding: 28px 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.sidebar-logo img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.sidebar-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.3px;
    font-family: var(--font-serif);
    line-height: 1.2;
}

.sidebar-subtitle {
    font-size: 10px;
    color: var(--gold-light);
    letter-spacing: 1.2px;
    text-transform: uppercase;
    margin-top: 2px;
}

/* Sidebar Navigation */
.sidebar-nav {
    padding: 16px 12px;
    flex: 1;
    overflow-y: auto;
}

.sidebar-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 8px 12px;
    font-weight: 600;
}

.sidebar-label.mt {
    margin-top: 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 2px;
    transition: all var(--duration) var(--ease);
    position: relative;
    color: rgba(255, 255, 255, 0.7);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.nav-item.active {
    background: rgba(212, 168, 67, 0.15);
    color: #fff;
}

.nav-item .nav-icon {
    color: rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.nav-item.active .nav-icon {
    color: var(--gold);
}

.nav-item:hover .nav-icon {
    color: rgba(255, 255, 255, 0.8);
}

.nav-item-text {
    flex: 1;
    min-width: 0;
}

.nav-item-label {
    font-size: 13px;
    font-weight: 400;
    line-height: 1.3;
}

.nav-item.active .nav-item-label {
    font-weight: 600;
}

.nav-item-sub {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.3);
    margin-top: 1px;
}

.nav-active-bar {
    width: 3px;
    height: 20px;
    border-radius: 2px;
    background: var(--gold);
    flex-shrink: 0;
    display: none;
}

.nav-item.active .nav-active-bar {
    display: block;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    gap: 6px;
}

.sidebar-footer .dot-online {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    display: inline-block;
}


/* ══════════════════════════════════════════════════════════════════════════
   TOPBAR
   ══════════════════════════════════════════════════════════════════════════ */

.topbar {
    height: var(--topbar-h);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    background: #fff;
    flex-shrink: 0;
}

.topbar-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.breadcrumbs a {
    color: var(--text-muted);
    transition: color var(--duration) var(--ease);
}

.breadcrumbs a:hover {
    color: var(--navy);
}

.breadcrumbs .bc-sep {
    font-size: 10px;
    color: var(--text-light);
    display: flex;
    align-items: center;
}

.breadcrumbs .bc-current {
    color: var(--text);
    font-weight: 500;
}

.topbar-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    font-family: var(--font-serif);
    letter-spacing: -0.3px;
    margin: 0;
}

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

/* Search Box */
.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--surface);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    border: 1px solid transparent;
}

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

.search-box input {
    border: none;
    background: none;
    color: var(--text);
    width: 160px;
    font-size: 13px;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

/* User Avatar */
.topbar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--navy), var(--navy-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}


/* ══════════════════════════════════════════════════════════════════════════
   CARDS
   ══════════════════════════════════════════════════════════════════════════ */

.card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: all var(--duration) var(--ease);
    box-shadow: var(--shadow-sm);
}

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

.card-clickable {
    cursor: pointer;
}

.card-clickable:hover {
    transform: translateY(-2px);
}

.card-14 {
    border-radius: 14px;
}


/* ── Stat Cards ───────────────────────────────────────────────────── */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon.navy  { background: rgba(27, 42, 74, 0.08); color: var(--navy); }
.stat-icon.gold  { background: rgba(212, 168, 67, 0.12); color: var(--gold); }
.stat-icon.green { background: rgba(45, 138, 78, 0.08); color: var(--success); }
.stat-icon.amber { background: rgba(230, 126, 34, 0.08); color: var(--warning); }

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    font-family: var(--font-serif);
    line-height: 1.2;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 1px;
}


/* ── Exam Type Cards ──────────────────────────────────────────────── */

.exam-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.exam-card {
    overflow: hidden;
}

.exam-card-bar {
    height: 6px;
}

.exam-card-bar.blue   { background: linear-gradient(90deg, #2563EB, #2563EB88); }
.exam-card-bar.purple { background: linear-gradient(90deg, #7C3AED, #7C3AED88); }
.exam-card-bar.teal   { background: linear-gradient(90deg, #059669, #05966988); }

.exam-card-body {
    padding: 24px 24px 20px;
}

.exam-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.exam-card-type {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    font-family: var(--font-serif);
}

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

.exam-card-semesters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.sem-badge {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    transition: all var(--duration) var(--ease);
}

.sem-badge.has-data {
    background: var(--success-bg);
    color: var(--success);
    border-color: #B7E4C7;
}

.exam-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--surface);
    font-size: 12px;
    color: var(--text-muted);
}

.exam-card-link {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    transition: gap var(--duration) var(--ease);
}

.exam-card-link.blue   { color: #2563EB; }
.exam-card-link.purple { color: #7C3AED; }
.exam-card-link.teal   { color: #059669; }

.card-clickable:hover .exam-card-link {
    gap: 8px;
}


/* ── Semester Cards ───────────────────────────────────────────────── */

.semester-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.sem-card {
    padding: 24px;
    transition: all var(--duration) var(--ease);
}

.sem-card.has-data {
    border-color: #B7E4C7;
    cursor: pointer;
}

.sem-card.empty {
    opacity: 0.6;
}

.sem-card.has-data:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.sem-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.sem-card-num {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    font-family: var(--font-serif);
}

.sem-card-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.sem-stat-box {
    background: var(--surface);
    border-radius: 8px;
    padding: 8px 12px;
}

.sem-stat-val {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.sem-stat-label {
    font-size: 10px;
    color: var(--text-muted);
}

.sem-card-date {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.sem-card-empty {
    padding: 20px 0;
    text-align: center;
}

.sem-card-empty p {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.sem-card-empty .upload-cta {
    font-size: 12px;
    color: var(--gold);
    font-weight: 600;
    cursor: pointer;
    transition: color var(--duration) var(--ease);
}

.sem-card-empty .upload-cta:hover {
    color: var(--gold-dim);
}


/* ══════════════════════════════════════════════════════════════════════════
   BADGES
   ══════════════════════════════════════════════════════════════════════════ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    white-space: nowrap;
}

.badge-success  { background: var(--success-bg); color: var(--success); }
.badge-warning  { background: var(--warning-bg); color: var(--warning); }
.badge-danger   { background: var(--danger-bg);  color: var(--danger); }
.badge-muted    { background: var(--surface-dark); color: var(--text-muted); }
.badge-gold     { background: #FDF6E3; color: var(--gold-dim); }
.badge-navy     { background: rgba(27, 42, 74, 0.08); color: var(--navy); }


/* ══════════════════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    transition: all var(--duration) var(--ease);
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--navy), var(--navy-light));
    color: #fff;
    box-shadow: var(--shadow-navy);
}

.btn-primary:hover {
    box-shadow: 0 6px 16px rgba(27, 42, 74, 0.35);
    transform: translateY(-1px);
}

.btn-gold {
    background: linear-gradient(135deg, var(--gold), var(--gold-dim));
    color: #fff;
    box-shadow: var(--shadow-gold);
}

.btn-gold:hover {
    box-shadow: 0 6px 16px rgba(212, 168, 67, 0.4);
    transform: translateY(-1px);
}

.btn-outline {
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
}

.btn-outline:hover {
    border-color: var(--navy);
    color: var(--navy);
}

.btn-outline-gold {
    border: 1px solid var(--border);
    background: #fff;
    color: var(--gold);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
}

.btn-outline-gold:hover {
    border-color: var(--gold);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 12px;
}

.btn-danger:hover {
    background: #A93226;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
    gap: 4px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration) var(--ease);
}

.btn-icon:hover {
    border-color: var(--navy);
    box-shadow: var(--shadow-sm);
}

.btn-icon.danger:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: var(--danger-bg);
}


/* ══════════════════════════════════════════════════════════════════════════
   TABLES
   ══════════════════════════════════════════════════════════════════════════ */

.data-table-wrap {
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: visible;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
}

.data-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--surface);
    vertical-align: middle;
}

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

.data-table tbody tr:hover {
    background: rgba(27, 42, 74, 0.02);
}

.data-table .col-version {
    display: flex;
    align-items: center;
    gap: 8px;
}

.data-table .version-num {
    font-weight: 700;
    font-size: 15px;
    font-family: var(--font-serif);
}

.data-table .actions-cell {
    display: flex;
    gap: 6px;
}

/* Table Pagination */
.table-footer {
    padding: 12px 16px;
    background: var(--surface);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}

.pagination {
    display: flex;
    gap: 4px;
}

.page-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
}

.page-btn:hover {
    border-color: var(--navy);
    color: var(--navy);
}

.page-btn.active {
    background: var(--navy);
    color: #fff;
    border-color: var(--navy);
}

.page-btn.disabled {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
}


/* ══════════════════════════════════════════════════════════════════════════
   TABS
   ══════════════════════════════════════════════════════════════════════════ */

.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--surface);
    margin-bottom: 24px;
}

.tab {
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 400;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--duration) var(--ease);
    white-space: nowrap;
}

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

.tab.active {
    font-weight: 600;
    color: var(--navy);
    border-bottom-color: var(--gold);
}

.tab-content {
    display: none;
    animation: fadeIn 0.2s var(--ease);
}

.tab-content.active {
    display: block;
}


/* ══════════════════════════════════════════════════════════════════════════
   VERSION DETAIL — Stat Row
   ══════════════════════════════════════════════════════════════════════════ */

.detail-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.detail-stat {
    flex: 1;
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 20px;
}

.detail-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-stat-value {
    font-size: 28px;
    font-weight: 700;
    font-family: var(--font-serif);
    color: var(--text);
    line-height: 1.3;
}

.detail-stat-value span {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-muted);
}

.detail-stat-value.green { color: var(--success); }
.detail-stat-value.amber { color: var(--warning); }


/* ══════════════════════════════════════════════════════════════════════════
   AUDIT DIFF VIEW
   ══════════════════════════════════════════════════════════════════════════ */

.diff-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--surface);
    font-size: 13px;
    color: var(--text-muted);
}

.diff-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--surface);
}

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

.diff-field {
    flex: 1;
    font-size: 13px;
}

.diff-field strong {
    font-weight: 600;
}

.diff-old {
    font-size: 12px;
    color: var(--danger);
    text-decoration: line-through;
    padding: 2px 8px;
    background: var(--danger-bg);
    border-radius: 4px;
}

.diff-arrow {
    color: var(--text-muted);
    flex-shrink: 0;
}

.diff-new {
    font-size: 12px;
    color: var(--success);
    padding: 2px 8px;
    background: var(--success-bg);
    border-radius: 4px;
}


/* ══════════════════════════════════════════════════════════════════════════
   UPLOAD FORM & PROGRESS
   ══════════════════════════════════════════════════════════════════════════ */

.upload-container {
    max-width: 640px;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input,
.form-select {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 14px;
    color: var(--text);
    background: #fff;
    transition: border-color var(--duration) var(--ease);
}

.form-input:focus,
.form-select:focus {
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(27, 42, 74, 0.08);
}

.form-input.disabled,
.form-select.disabled {
    background: var(--surface);
    cursor: not-allowed;
}

/* File Drop Zone */
.file-drop {
    padding: 24px;
    border-radius: 10px;
    border: 2px dashed var(--border);
    text-align: center;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    position: relative;
}

.file-drop:hover,
.file-drop.dragover {
    border-color: var(--gold);
    background: #FDF6E3;
}

.file-drop.has-file {
    border-color: var(--gold);
    background: #FDF6E3;
}

.file-drop input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.file-drop-icon {
    color: var(--text-muted);
    margin-bottom: 8px;
}

.file-drop-text {
    font-size: 13px;
    color: var(--text-muted);
}

.file-drop-text strong {
    color: var(--gold);
}

.file-drop.has-file .file-drop-text {
    color: var(--gold);
    font-weight: 600;
}

.file-drop-hint {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 4px;
}

/* Progress Steps */
.progress-section {
    border-top: 1px solid var(--surface);
    padding-top: 20px;
    margin-top: 24px;
}

.progress-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    transition: opacity var(--duration) var(--ease);
}

.progress-step.pending {
    opacity: 0.35;
}

.progress-step.active {
    opacity: 1;
}

.progress-step.done {
    opacity: 1;
}

.step-indicator {
    width: 24px;
    height: 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 11px;
    color: var(--text-muted);
    background: var(--surface);
    transition: all var(--duration) var(--ease);
}

.progress-step.done .step-indicator {
    background: var(--success-bg);
    color: var(--success);
}

.progress-step.active .step-indicator {
    background: rgba(212, 168, 67, 0.12);
    border: 2px solid var(--gold);
}

.step-label {
    font-size: 13px;
    color: var(--text-muted);
}

.progress-step.active .step-label {
    color: var(--text);
    font-weight: 600;
}

.progress-step.done .step-label {
    color: var(--text);
}

.step-check {
    margin-left: auto;
    font-size: 11px;
    color: var(--success);
}

/* Pulse animation for active step */
.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gold);
    animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.5; transform: scale(0.75); }
}

/* Upload Result */
.upload-result {
    margin-top: 24px;
    padding: 20px;
    border-radius: 10px;
    animation: fadeIn 0.3s var(--ease);
}

.upload-result.success {
    background: var(--success-bg);
    border: 1px solid #B7E4C7;
}

.upload-result.error {
    background: var(--danger-bg);
    border: 1px solid #F5C6CB;
}

.upload-result-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
}

.upload-result.success .upload-result-title { color: var(--success); }
.upload-result.error .upload-result-title   { color: var(--danger); }

.upload-result-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

/* Warnings list */
.warnings-list {
    margin-top: 16px;
}

.warning-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 12px;
    background: var(--warning-bg);
    border-radius: 6px;
    margin-bottom: 4px;
    font-size: 12px;
    color: var(--warning);
}


/* ══════════════════════════════════════════════════════════════════════════
   MASTER FILES
   ══════════════════════════════════════════════════════════════════════════ */

.master-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    margin-bottom: 16px;
}

.master-card.missing {
    border-color: var(--warning);
}

.master-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.master-icon.active  { background: var(--success-bg); color: var(--success); }
.master-icon.missing { background: var(--warning-bg); color: var(--warning); }

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

.master-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.master-title span {
    font-size: 16px;
    font-weight: 700;
    font-family: var(--font-serif);
}

.master-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.master-missing-msg {
    font-size: 12px;
    color: var(--warning);
}

.master-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* Backup History */
.backup-section {
    margin-top: 32px;
    padding: 24px;
}

.backup-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
}

.backup-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.backup-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--surface);
    font-size: 13px;
}

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

.backup-name {
    flex: 1;
    color: var(--text);
}

.backup-date {
    color: var(--text-muted);
    font-size: 12px;
}


/* ══════════════════════════════════════════════════════════════════════════
   RECENT ACTIVITY
   ══════════════════════════════════════════════════════════════════════════ */

.activity-list {
    overflow: hidden;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 24px;
    border-bottom: 1px solid var(--surface);
    transition: background var(--duration) var(--ease);
}

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

.activity-item:hover {
    background: rgba(27, 42, 74, 0.02);
}

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.activity-dot.success { background: var(--success); }
.activity-dot.danger  { background: var(--danger); }
.activity-dot.warning { background: var(--warning); }

.activity-text {
    flex: 1;
    font-size: 13px;
    color: var(--text);
}

.activity-text strong {
    font-weight: 600;
}

.activity-time {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}


/* ══════════════════════════════════════════════════════════════════════════
   MODALS
   ══════════════════════════════════════════════════════════════════════════ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s var(--ease);
    backdrop-filter: blur(4px);
}

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

.modal {
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95);
    transition: transform 0.2s var(--ease);
}

.modal-overlay.open .modal {
    transform: scale(1);
}

.modal-lg {
    max-width: 680px;
}

.modal-header {
    padding: 24px 24px 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    font-family: var(--font-serif);
    color: var(--text);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
}

.modal-close:hover {
    background: var(--surface);
    color: var(--text);
}

.modal-body {
    padding: 20px 24px;
}

.modal-footer {
    padding: 0 24px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Delete Confirmation */
.delete-warning {
    padding: 16px;
    background: var(--danger-bg);
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--danger);
    line-height: 1.6;
}

.delete-confirm-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 14px;
    margin-top: 8px;
}

.delete-confirm-input:focus {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.08);
}


/* ══════════════════════════════════════════════════════════════════════════
   TOASTS
   ══════════════════════════════════════════════════════════════════════════ */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: #fff;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--text-muted);
    font-size: 13px;
    min-width: 320px;
    max-width: 420px;
    pointer-events: all;
    animation: slideInRight 0.3s var(--ease);
    transition: all 0.3s var(--ease);
}

.toast.success { border-left-color: var(--success); }
.toast.warning { border-left-color: var(--warning); }
.toast.error   { border-left-color: var(--danger); }

.toast.hiding {
    opacity: 0;
    transform: translateX(100%);
}

.toast-icon {
    flex-shrink: 0;
}

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

.toast-title {
    font-weight: 600;
    margin-bottom: 2px;
}

.toast-msg {
    font-size: 12px;
    color: var(--text-muted);
}

.toast-close {
    flex-shrink: 0;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    transition: color var(--duration) var(--ease);
}

.toast-close:hover {
    color: var(--text);
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(100%); }
    to   { opacity: 1; transform: translateX(0); }
}


/* ══════════════════════════════════════════════════════════════════════════
   DOWNLOAD DROPDOWN
   ══════════════════════════════════════════════════════════════════════════ */

.dropdown-wrap {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all 0.15s var(--ease);
    overflow: hidden;
}

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

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
    transition: background var(--duration) var(--ease);
}

.dropdown-item:hover {
    background: var(--surface);
}

.dropdown-divider {
    height: 1px;
    background: var(--surface);
    margin: 4px 0;
}


/* ══════════════════════════════════════════════════════════════════════════
   RAW OCR VIEW
   ══════════════════════════════════════════════════════════════════════════ */

.ocr-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 16px;
}

.ocr-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.ocr-text {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.6;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 400px;
    overflow-y: auto;
}


/* ══════════════════════════════════════════════════════════════════════════
   EMPTY STATES
   ══════════════════════════════════════════════════════════════════════════ */

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: var(--text-light);
}

.empty-state-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

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


/* ══════════════════════════════════════════════════════════════════════════
   SECTION HEADERS
   ══════════════════════════════════════════════════════════════════════════ */

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.section-meta {
    font-size: 14px;
    color: var(--text-muted);
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
}


/* ══════════════════════════════════════════════════════════════════════════
   UTILITY CLASSES
   ══════════════════════════════════════════════════════════════════════════ */

.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4       { gap: 4px; }
.gap-6       { gap: 6px; }
.gap-8       { gap: 8px; }
.gap-12      { gap: 12px; }
.gap-16      { gap: 16px; }
.gap-20      { gap: 20px; }
.mt-4        { margin-top: 4px; }
.mt-8        { margin-top: 8px; }
.mt-16       { margin-top: 16px; }
.mt-24       { margin-top: 24px; }
.mt-32       { margin-top: 32px; }
.mb-4        { margin-bottom: 4px; }
.mb-8        { margin-bottom: 8px; }
.mb-16       { margin-bottom: 16px; }
.mb-24       { margin-bottom: 24px; }
.text-muted  { color: var(--text-muted); }
.text-sm     { font-size: 12px; }
.text-xs     { font-size: 11px; }
.fw-600      { font-weight: 600; }
.fw-700      { font-weight: 700; }
.font-serif  { font-family: var(--font-serif); }
.truncate    { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only     { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.hidden      { display: none !important; }


/* ══════════════════════════════════════════════════════════════════════════
   ANIMATIONS
   ══════════════════════════════════════════════════════════════════════════ */

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

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

@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.fade-in {
    animation: fadeIn 0.2s var(--ease);
}

.fade-in-up {
    animation: fadeInUp 0.3s var(--ease);
}

/* Loading spinner */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--navy);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}


/* ══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — Laptop / Large Desktop
   ══════════════════════════════════════════════════════════════════════════ */

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

    .exam-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

    .detail-stats {
        flex-wrap: wrap;
    }

    .detail-stat {
        flex: 0 0 calc(50% - 6px);
    }
}

@media (min-width: 1600px) {
    .content-area {
        padding: 40px 48px;
    }
}
