/* ==========================================================================
   Modul-Verwaltung — Business Admin Theme
   Hochschule Merseburg
   ========================================================================== */

/* ---- Design tokens ---- */
:root {
    --bg: #f1f5f9;
    --surface: #ffffff;
    --surface-2: #f8fafc;

    --sidebar-bg: #0f172a;
    --sidebar-bg-2: #111c33;
    --sidebar-text: #cbd5e1;
    --sidebar-muted: #64748b;
    --sidebar-active: #1d4ed8;

    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: #eff6ff;

    --text: #0f172a;
    --text-2: #334155;
    --muted: #64748b;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;

    --success: #16a34a;
    --success-soft: #dcfce7;
    --danger: #dc2626;
    --danger-soft: #fee2e2;
    --warning: #d97706;
    --warning-soft: #fef3c7;
    --info: #0891b2;
    --info-soft: #cffafe;

    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.08);
    --shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.18);

    --sidebar-w: 260px;
    --topbar-h: 64px;
}

/* ---- Reset & base ---- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: 'Roboto', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.55;
    color: var(--text);
    background-color: var(--bg);
    font-size: 15px;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { color: var(--text); font-weight: 600; line-height: 1.25; }

/* ==========================================================================
   App shell: sidebar + main
   ========================================================================== */
.app {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    background-image: linear-gradient(180deg, var(--sidebar-bg-2), var(--sidebar-bg));
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    z-index: 40;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.15rem 1.25rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.sidebar-brand .brand-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.4);
}

.sidebar-brand .brand-text strong {
    display: block;
    color: #fff;
    font-size: 0.98rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.sidebar-brand .brand-text span {
    display: block;
    font-size: 0.72rem;
    color: var(--sidebar-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.sidebar-nav {
    padding: 1rem 0.75rem;
    flex: 1;
}

.nav-section-label {
    padding: 0.5rem 0.75rem;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sidebar-muted);
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.7rem 0.85rem;
    margin-bottom: 0.15rem;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    font-size: 0.92rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.sidebar-nav a .nav-icon {
    font-size: 1.05rem;
    width: 1.4rem;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-nav a:hover {
    background-color: rgba(148, 163, 184, 0.12);
    color: #fff;
    text-decoration: none;
}

.sidebar-nav a.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.sidebar-footer {
    padding: 0.9rem 1rem 1.2rem;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    font-size: 0.72rem;
    color: var(--sidebar-muted);
}

/* ---- Main column ---- */
.app-main {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ---- Topbar ---- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: var(--topbar-h);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 1.5rem;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

.topbar-title h1 {
    font-size: 1.15rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-title .breadcrumb { margin: 0; }

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-2);
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
}
.sidebar-toggle:hover { background: var(--surface-2); }

/* ---- User menu ---- */
.user-menu { position: relative; }

.user-trigger {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0.5rem 0.35rem 0.4rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    cursor: pointer;
    color: var(--text-2);
    font: inherit;
}
.user-trigger:hover { background: var(--surface-2); }

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.user-trigger .user-name {
    font-size: 0.88rem;
    font-weight: 500;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-trigger .caret { font-size: 0.7rem; color: var(--muted); }

.user-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 200px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    padding: 0.4rem;
    display: none;
}
.user-menu.open .user-dropdown { display: block; }

.user-dropdown .dd-head {
    padding: 0.6rem 0.7rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.3rem;
}
.user-dropdown .dd-head strong { display: block; font-size: 0.9rem; }
.user-dropdown .dd-head span { font-size: 0.78rem; color: var(--muted); }

.user-dropdown button,
.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: none;
    background: none;
    border-radius: 6px;
    font: inherit;
    font-size: 0.88rem;
    color: var(--text-2);
    text-align: left;
    cursor: pointer;
}
.user-dropdown button:hover,
.user-dropdown a:hover { background: var(--surface-2); text-decoration: none; color: var(--danger); }

/* ---- Content ---- */
.content {
    flex: 1;
    padding: 1.75rem;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.page-head {
    margin-bottom: 1.5rem;
}
.page-head h2 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}
.page-head p { color: var(--muted); font-size: 0.95rem; }

.app-footer {
    border-top: 1px solid var(--border);
    padding: 1rem 1.75rem;
    color: var(--muted);
    font-size: 0.82rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    background: var(--surface);
}

/* ==========================================================================
   Cards
   ========================================================================== */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.card > h2 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1.1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card > h2:only-child { margin-bottom: 0; }

.card-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background-color: var(--primary);
    color: #fff;
    border: 1px solid transparent;
    padding: 0.55rem 1.05rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
    white-space: nowrap;
}
.btn:hover { background-color: var(--primary-dark); text-decoration: none; box-shadow: 0 4px 10px rgba(37, 99, 235, 0.28); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35); }

.btn-secondary {
    background-color: var(--surface);
    color: var(--text-2);
    border-color: var(--border-strong);
}
.btn-secondary:hover { background-color: var(--surface-2); box-shadow: none; }

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

.btn-success { background-color: var(--success); }
.btn-success:hover { background-color: #15803d; }

.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.82rem; }
.btn-block { width: 100%; justify-content: center; }

.btn-icon { font-size: 1rem; line-height: 1; }

/* Compact action buttons inside table rows */
.table .btn { padding: 0.35rem 0.7rem; font-size: 0.82rem; margin: 0; }

/* ==========================================================================
   Forms
   ========================================================================== */
.form-group { margin-bottom: 1.15rem; }

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 500;
    font-size: 0.88rem;
    color: var(--text-2);
}

.form-control {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-family: inherit;
    color: var(--text);
    background-color: var(--surface);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-control::placeholder { color: #94a3b8; }
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
textarea.form-control { min-height: 90px; resize: vertical; }

.form-actions {
    display: flex;
    gap: 0.6rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--border);
}

/* Checkbox list (module / program selection) */
.module-selection {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.4rem;
    max-height: 220px;
    overflow-y: auto;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
}
.module-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.55rem;
    border-radius: 6px;
    font-size: 0.86rem;
    font-weight: 400;
    color: var(--text-2);
    cursor: pointer;
    margin: 0;
}
.module-checkbox:hover { background: var(--primary-soft); }
.module-checkbox input { accent-color: var(--primary); width: 16px; height: 16px; }

/* ==========================================================================
   Tables
   ========================================================================== */
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    font-size: 0.9rem;
}

.table th,
.table td {
    padding: 0.8rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.table thead th {
    background-color: var(--surface-2);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    white-space: nowrap;
}

.table tbody tr { transition: background-color 0.12s ease; }
.table tbody tr:hover { background-color: var(--primary-soft); }
.table tbody tr:last-child td { border-bottom: none; }

.table td .btn + .btn { margin-left: 0.35rem; }
.row-actions { display: flex; gap: 0.35rem; flex-wrap: wrap; }

/* ==========================================================================
   Dashboard statistics
   ========================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--surface);
    padding: 1.35rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
    background: var(--primary-soft);
    color: var(--primary);
}
.stat-icon.green { background: var(--success-soft); color: var(--success); }
.stat-icon.amber { background: var(--warning-soft); color: var(--warning); }
.stat-icon.cyan  { background: var(--info-soft);   color: var(--info); }

.stat-body { min-width: 0; }
.stat-card h3 {
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
    margin-bottom: 0.25rem;
}
.stat-card p {
    color: var(--muted);
    font-size: 0.85rem;
    margin: 0;
    font-weight: 500;
}

/* Two-column dashboard layout */
.grid-2 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    align-items: start;
}
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

/* ==========================================================================
   Document / list cards
   ========================================================================== */
.document-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.document-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 1.1rem 1.2rem;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.document-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-left-color: var(--primary-dark);
}
.document-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.35rem; }
.document-card p { color: var(--muted); font-size: 0.85rem; margin: 0; }

.document-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.72rem;
    color: var(--muted);
    margin-top: 0.9rem;
    padding-top: 0.7rem;
    border-top: 1px solid var(--border);
}
.document-meta span {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.15rem 0.6rem;
}

/* Quick-action list */
.quick-actions { display: flex; flex-direction: column; gap: 0.6rem; }
.quick-actions .btn { justify-content: flex-start; }

/* ==========================================================================
   Search & filters
   ========================================================================== */
.search-bar {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}
.search-bar .form-control { flex: 1; }

.filters {
    display: flex;
    gap: 0.6rem;
    margin-top: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-select {
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background-color: var(--surface);
    min-width: 170px;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.filter-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); }
.filters .btn { margin-left: auto; }
.filters .btn + .btn { margin-left: 0.5rem; }

/* ==========================================================================
   Modals
   ========================================================================== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background-color: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
    padding: 1rem;
}
.modal.show { display: flex; align-items: flex-start; justify-content: center; }

.modal-content {
    background-color: var(--surface);
    padding: 1.75rem;
    border-radius: var(--radius);
    max-width: 620px;
    width: 100%;
    margin-top: 6vh;
    max-height: 86vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modal-in 0.18s ease-out;
}
@keyframes modal-in {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 1.15rem; font-weight: 600; }

.close {
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--muted);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.close:hover { color: var(--danger); background-color: var(--danger-soft); }

/* File info inside preview modal */
.file-info p { margin-bottom: 0.5rem; font-size: 0.9rem; color: var(--text-2); }
.file-info strong { color: var(--text); }
.file-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* ==========================================================================
   File upload dropzone
   ========================================================================== */
.file-upload {
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius);
    padding: 2.25rem 1.5rem;
    text-align: center;
    transition: background-color 0.15s ease, border-color 0.15s ease;
    cursor: pointer;
    background-color: var(--surface-2);
}
.file-upload:hover { background-color: var(--primary-soft); border-color: var(--primary); }
.file-upload.dragover { background-color: #dbeafe; border-color: var(--primary); }
.file-upload p { margin: 0.15rem 0; color: var(--muted); font-size: 0.88rem; }
.file-upload p:first-child { color: var(--text-2); font-weight: 500; font-size: 0.95rem; }
#file-names-display { margin-top: 0.75rem; font-size: 0.85rem; color: var(--primary); font-weight: 500; }

/* ==========================================================================
   Alerts
   ========================================================================== */
.alert {
    padding: 0.85rem 1.1rem;
    margin-bottom: 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border: 1px solid transparent;
}
.alert .alert-icon { font-size: 1rem; font-weight: 700; }
.alert-success { background-color: var(--success-soft); color: #14532d; border-color: #bbf7d0; }
.alert-danger  { background-color: var(--danger-soft);  color: #7f1d1d; border-color: #fecaca; }
.alert-info    { background-color: var(--info-soft);    color: #155e75; border-color: #a5f3fc; }

/* ==========================================================================
   Badges
   ========================================================================== */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    border-radius: 999px;
}
.badge-primary   { color: var(--primary); background-color: var(--primary-soft); }
.badge-secondary { color: var(--text-2);  background-color: var(--surface-2); border: 1px solid var(--border); }
.badge-success   { color: #14532d; background-color: var(--success-soft); }
.badge-danger    { color: #7f1d1d; background-color: var(--danger-soft); }

/* ==========================================================================
   Loading spinner
   ========================================================================== */
.loading { text-align: center; padding: 2rem; color: var(--muted); font-weight: 500; }
.loading::after {
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   Breadcrumb
   ========================================================================== */
.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    font-size: 0.78rem;
    color: var(--muted);
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { margin: 0 0.4rem; color: var(--border-strong); }
.breadcrumb .current { color: var(--text-2); font-weight: 500; }

/* ==========================================================================
   Login page
   ========================================================================== */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background:
        radial-gradient(1200px 600px at 100% 0%, rgba(37, 99, 235, 0.12), transparent 60%),
        radial-gradient(900px 500px at 0% 100%, rgba(37, 99, 235, 0.10), transparent 55%),
        var(--bg);
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 2.25rem;
}
.auth-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.75rem;
}
.auth-brand .brand-mark {
    width: 44px; height: 44px; border-radius: 11px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #fff; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.4);
}
.auth-brand strong { display: block; font-size: 1rem; }
.auth-brand span { display: block; font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }

.auth-card h1 { font-size: 1.35rem; margin-bottom: 0.35rem; }
.auth-card .auth-sub { color: var(--muted); font-size: 0.9rem; margin-bottom: 1.5rem; }
.auth-card .btn { width: 100%; justify-content: center; margin-top: 0.5rem; padding: 0.65rem; }
.auth-hint {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.7;
}
.auth-hint code {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.05rem 0.35rem;
    font-size: 0.75rem;
    color: var(--text-2);
}

/* ==========================================================================
   Utilities
   ========================================================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--muted); }
.mt-1 { margin-top: 0.25rem; } .mt-2 { margin-top: 0.5rem; } .mt-3 { margin-top: 1rem; } .mt-4 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 0.25rem; } .mb-2 { margin-bottom: 0.5rem; } .mb-3 { margin-bottom: 1rem; } .mb-4 { margin-bottom: 1.5rem; }
.d-flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: 0.5rem; } .gap-3 { gap: 1rem; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }
.w-100 { width: 100%; }

/* ==========================================================================
   Sidebar off-canvas (mobile)
   ========================================================================== */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 39;
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: var(--shadow-lg);
    }
    body.sidebar-open .sidebar { transform: translateX(0); }
    body.sidebar-open .sidebar-overlay { display: block; }
    .app-main { margin-left: 0; }
    .sidebar-toggle { display: flex; }
}

@media (max-width: 640px) {
    .content { padding: 1.1rem; }
    .topbar { padding: 0 1rem; }
    .user-trigger .user-name { display: none; }
    .card { padding: 1.15rem; }
    .filters .btn, .filters .btn + .btn { margin-left: 0; }
    .filters { align-items: stretch; }
    .search-bar { flex-direction: column; align-items: stretch; }
    .form-actions { flex-direction: column-reverse; }
    .form-actions .btn { width: 100%; justify-content: center; }
}

/* ===== PDF viewer (PDF.js) ===== */
.pdf-viewer-card { display: flex; flex-direction: column; }
.pdf-viewer-card .card-toolbar { align-items: center; }
.pdf-viewer-title { flex: 1; margin: 0; text-align: center; }
.pdf-frame {
    width: 100%;
    height: calc(100vh - 260px);
    min-height: 420px;
    border: 1px solid var(--border, #d9dee5);
    border-radius: 8px;
    background: #525659;
}
@media (max-width: 640px) {
    .pdf-frame { height: calc(100vh - 210px); }
}
