@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --brand: #01696f;
    --brand-strong: #014f53;
    --brand-soft: #e8f7f7;
    --brand-soft-2: #f4fbfb;
    --accent: #0f766e;
    --text: #0f172a;
    --text-soft: #475569;
    --muted: #64748b;
    --line: #e2e8f0;
    --line-soft: #edf2f7;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --danger: #dc2626;
    --warning: #d97706;
    --success: #059669;
    --shadow-sm: 0 6px 20px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 12px 30px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 24px 60px rgba(2, 32, 36, 0.14);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --sidebar-width: 290px;
    --sidebar-collapsed: 96px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background:
        radial-gradient(circle at top left, rgba(1, 105, 111, 0.06), transparent 26%),
        linear-gradient(180deg, #f7fbfc 0%, #f3f7fa 100%);
    color: var(--text);
    line-height: 1.55;
}

a {
    color: var(--brand);
    text-decoration: none;
    transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
    color: var(--brand-strong);
}

img {
    max-width: 100%;
    display: block;
}

button,
input,
select,
textarea {
    font: inherit;
}

/* Layout */
.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #08363a 0%, #0b4347 100%);
    color: #fff;
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 22px 18px;
    box-shadow: var(--shadow-lg);
    transition: width 0.25s ease, padding 0.25s ease;
    overflow: hidden;
    z-index: 20;
}

.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-text {
    font-size: 18px;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.sidebar-toggle {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 12px;
    background: rgba(255,255,255,0.08);
    color: #fff;
    cursor: pointer;
}

.sidebar-toggle:hover {
    background: rgba(255,255,255,0.14);
}

.sidebar-user {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px;
    padding: 14px 16px;
    margin: 12px 0 18px;
    color: rgba(255,255,255,0.84);
    font-size: 13px;
}

.sidebar-user strong {
    color: #fff;
    display: inline-block;
    margin-top: 3px;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav a {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 50px;
    padding: 12px 14px;
    border-radius: 16px;
    color: rgba(255,255,255,0.86);
    font-weight: 600;
    transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.nav a:hover {
    background: rgba(255,255,255,0.09);
    color: #fff;
    transform: translateX(2px);
}

.nav a.active {
    background: linear-gradient(135deg, rgba(255,255,255,0.16), rgba(255,255,255,0.08));
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.nav-icon {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.main {
    flex: 1;
    min-width: 0;
    padding: 26px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    padding: 20px 22px;
    background: rgba(255,255,255,0.78);
    border: 1px solid rgba(255,255,255,0.7);
    backdrop-filter: blur(10px);
    border-radius: 22px;
    box-shadow: var(--shadow-sm);
}

.title-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.title-wrap h1 {
    margin: 0;
    font-size: clamp(22px, 2vw, 30px);
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #0b2d34;
}

.page-chip {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    box-shadow: var(--shadow-sm);
    padding: 8px;
    flex-shrink: 0;
}

.page-chip img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand);
    border: 1px solid rgba(1, 105, 111, 0.08);
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap;
}

/* Auth pages */
.auth-shell {
    display: grid;
    grid-template-columns: minmax(320px, 1.1fr) minmax(320px, 0.9fr);
    min-height: 100vh;
}

.auth-hero {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at top right, rgba(255,255,255,0.12), transparent 25%),
        linear-gradient(135deg, #01565b 0%, #0c3f43 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 56px;
    text-align: center;
}

.auth-hero::before,
.auth-hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
}

.auth-hero::before {
    width: 320px;
    height: 320px;
    top: -90px;
    left: -90px;
}

.auth-hero::after {
    width: 220px;
    height: 220px;
    bottom: -60px;
    right: -40px;
}

.logo-wrap {
    width: 120px;
    height: 120px;
    padding: 10px;
    background: #ffffff;
    border: 1px solid rgba(1, 105, 111, 0.12);
    border-radius: 28px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.auth-hero h1 {
    margin: 22px 0 10px;
    font-size: clamp(30px, 3.5vw, 46px);
    line-height: 1.08;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.auth-panel {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 36px;
}

.auth-card {
    width: 100%;
    max-width: 540px;
    background: rgba(255,255,255,0.94);
    border: 1px solid rgba(255,255,255,0.75);
    border-radius: 28px;
    padding: 32px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(12px);
}

.auth-card-header {
    margin-bottom: 22px;
}

.auth-card-header h2 {
    margin: 0 0 8px;
    font-size: 30px;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #0b2d34;
}

.auth-card-header p {
    margin: 0;
    color: var(--text-soft);
}

.role-switch {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 22px;
    padding: 6px;
    background: var(--surface-2);
    border: 1px solid var(--line-soft);
    border-radius: 18px;
}

.role-card {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 46px;
    border-radius: 14px;
    padding: 10px 14px;
    font-weight: 700;
    color: var(--brand);
    background: transparent;
    border: 1px solid transparent;
}

.role-card.active {
    background: linear-gradient(135deg, var(--brand), var(--brand-strong));
    color: #fff;
    box-shadow: 0 8px 20px rgba(1, 105, 111, 0.18);
}

.role-card:not(.active):hover {
    background: #fff;
    border-color: var(--line-soft);
}

/* Forms */
.field,
.mb-3 {
    margin-bottom: 18px;
}

.field label,
.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    color: #12343b;
    font-size: 14px;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="number"],
.field input[type="search"],
.field input[type="tel"],
.field input[type="date"],
.field select,
.field textarea,
.form-control,
.form-select {
    width: 100%;
    min-height: 48px;
    border: 1px solid #d8e2ea;
    background: #fff;
    color: var(--text);
    border-radius: 14px;
    padding: 12px 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, transform 0.12s ease;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.02);
}

textarea.form-control,
.field textarea {
    min-height: 110px;
    resize: vertical;
}

.field input::placeholder,
.form-control::placeholder,
.field textarea::placeholder {
    color: #94a3b8;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: rgba(1, 105, 111, 0.5);
    box-shadow: 0 0 0 4px rgba(1, 105, 111, 0.12);
    background: #fff;
}

/* Buttons */
.btn,
.btn-primary,
.btn-outline-secondary,
.btn-outline-danger,
button[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 12px 18px;
    border-radius: 14px;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn:hover,
.btn-primary:hover,
.btn-outline-secondary:hover,
.btn-outline-danger:hover,
button[type="submit"]:hover {
    transform: translateY(-1px);
}

.btn-primary,
button[type="submit"] {
    width: 100%;
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-strong));
    border-color: transparent;
    box-shadow: 0 10px 24px rgba(1, 105, 111, 0.22);
}

.btn-primary:hover,
button[type="submit"]:hover {
    color: #fff;
    background: linear-gradient(135deg, #015d62, #01494d);
}

.btn-outline-secondary {
    background: #fff;
    color: var(--text-soft);
    border-color: #cbd5e1;
}

.btn-outline-secondary:hover {
    color: var(--text);
    border-color: #94a3b8;
    background: #f8fafc;
}

.btn-outline-danger {
    background: #fff;
    color: var(--danger);
    border-color: rgba(220, 38, 38, 0.22);
}

.btn-outline-danger:hover {
    background: #fff5f5;
    border-color: rgba(220, 38, 38, 0.35);
}

/* Alerts */
.alert {
    border-radius: 18px;
    padding: 14px 16px;
    margin-bottom: 18px;
    border: 1px solid transparent;
    font-weight: 600;
}

.alert.success {
    background: #ecfdf5;
    color: #065f46;
    border-color: #a7f3d0;
}

.alert.error {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

/* Cards and content */
.container,
.dashboard-container,
.dash-container,
.dashboard {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0;
}

.card,
.dashboard-content,
.content-area {
    background: rgba(255,255,255,0.96);
    border: 1px solid rgba(226,232,240,0.9);
    border-radius: 22px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card {
    margin-bottom: 20px;
}

.card-header {
    padding: 18px 20px;
    background: linear-gradient(180deg, #fbfdff 0%, #f8fafc 100%);
    border-bottom: 1px solid var(--line-soft);
    font-weight: 800;
    color: #12343b;
}

.card-body {
    padding: 20px;
}

.page-header {
    margin: 0 0 16px;
    font-size: clamp(24px, 2.2vw, 34px);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #0b2d34;
}

.meta,
.text-muted,
.small-muted {
    color: var(--muted) !important;
}

/* Dashboard widgets */
.dashboard-nav,
.dash-buttons,
.home-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.dashboard-nav a,
.dash-buttons a,
.home-cards a {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    min-height: 136px;
    padding: 18px;
    border-radius: 22px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fcfc 100%);
    border: 1px solid rgba(1, 105, 111, 0.08);
    box-shadow: var(--shadow-sm);
    color: #0f172a;
    font-weight: 700;
}

.dashboard-nav a:hover,
.dash-buttons a:hover,
.home-cards a:hover {
    transform: translateY(-3px);
    border-color: rgba(1, 105, 111, 0.24);
    box-shadow: var(--shadow-md);
    color: var(--brand);
    background: linear-gradient(180deg, #ffffff 0%, #f1fbfb 100%);
}

.dashboard-nav a i,
.dashboard-nav a svg,
.dash-buttons a i,
.dash-buttons a svg,
.home-cards a i,
.home-cards a svg {
    font-size: 30px;
    width: 34px;
    height: 34px;
    color: var(--brand);
    margin-bottom: 16px;
}

.summary-widget {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fcfc 100%);
    padding: 20px;
    border-radius: 22px;
    border: 1px solid rgba(1, 105, 111, 0.08);
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
}

.summary-widget .icon {
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 24px;
    flex-shrink: 0;
}

.summary-widget .value {
    font-size: 28px;
    line-height: 1;
    font-weight: 800;
    color: #0b2d34;
}

.summary-widget .label {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}

/* Tables */
.table,
.setup-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 0;
    color: var(--text);
}

.table thead th,
.setup-table thead th {
    background: #f8fafc;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line-soft);
    white-space: nowrap;
}

.table tbody td,
.setup-table tbody td {
    padding: 15px 16px;
    border-bottom: 1px solid #edf2f7;
    vertical-align: middle;
}

.table tbody tr:hover,
.setup-table tbody tr:hover {
    background: #fbfefe;
}

.table-striped tbody tr:nth-of-type(odd) {
    background: rgba(148, 163, 184, 0.04);
}

.table-hover tbody tr:hover {
    background: rgba(1, 105, 111, 0.04);
}

/* Badges */
.badge,
.setup-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    border: 1px solid transparent;
}

.badge.admin {
    background: #ede9fe;
    color: #6d28d9;
}

.badge.teacher {
    background: #e0f2fe;
    color: #0369a1;
}

.badge.student {
    background: #ecfeff;
    color: #0f766e;
}

.badge.published,
.setup-chip {
    background: #ecfdf5;
    color: #047857;
    border-color: #bbf7d0;
}

.badge.hidden,
.badge.suspended {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}

/* Modals */
.modal-card {
    background: #fff;
    border-radius: 28px;
    box-shadow: var(--shadow-lg);
}

.modal-head h3 {
    margin: 0;
    color: #0b2d34;
    font-weight: 800;
}

/* Utilities */
.text-center {
    text-align: center;
}

.hidden {
    display: none !important;
}

/* Collapsed sidebar */
.layout.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed);
    padding-left: 12px;
    padding-right: 12px;
}

.layout.sidebar-collapsed .brand-text,
.layout.sidebar-collapsed .sidebar-user,
.layout.sidebar-collapsed .nav-label {
    display: none;
}

.layout.sidebar-collapsed .nav a {
    justify-content: center;
}

.layout.sidebar-collapsed .sidebar-head {
    justify-content: center;
}

/* Responsive */
@media (max-width: 1100px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-hero {
        min-height: 280px;
        padding: 34px 24px;
    }

    .main {
        padding: 18px;
    }
}

@media (max-width: 980px) {
    .layout {
        flex-direction: column;
    }

    .sidebar,
    .layout.sidebar-collapsed .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        border-radius: 0 0 24px 24px;
    }

    .layout.sidebar-collapsed .brand-text,
    .layout.sidebar-collapsed .sidebar-user,
    .layout.sidebar-collapsed .nav-label {
        display: initial;
    }

    .layout.sidebar-collapsed .nav a {
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .role-switch {
        grid-template-columns: 1fr;
    }

    .auth-panel,
    .auth-card,
    .main {
        padding-left: 16px;
        padding-right: 16px;
    }

    .dashboard-nav,
    .dash-buttons,
    .home-cards {
        grid-template-columns: 1fr;
    }

    .table,
    .setup-table {
        font-size: 14px;
    }

    .table thead,
    .setup-table thead {
        display: none;
    }

    .table tr,
    .setup-table tr {
        display: block;
        padding: 10px 0;
        border-bottom: 1px solid var(--line-soft);
    }

    .table td,
    .setup-table td {
        display: block;
        border: 0;
        padding: 8px 0;
    }
}

.material-details-card {
    background: #ffffff;
    border: 1px solid #e6edf0;
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
}

.material-title {
    font-size: 40px;
    font-weight: 700;
    line-height: 1.1;
    color: #1e293b;
    margin: 0 0 10px;
}

.material-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 15px;
    color: #64748b;
    margin-bottom: 24px;
}

.material-description {
    font-size: 16px;
    line-height: 1.7;
    color: #334155;
    margin-bottom: 28px;
}

.material-info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.material-info-item {
    background: #f8fbfc;
    border: 1px solid #e6edf0;
    border-radius: 18px;
    padding: 18px 20px;
}

.material-info-item span {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 6px;
}

.material-info-item strong {
    display: block;
    font-size: 17px;
    color: #0f172a;
    font-weight: 700;
}




/* ===== MOVED FROM INLINE STYLE BLOCK ===== */
.setup-hero{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;margin-bottom:20px}
.setup-hero h2{margin:0;font-size:32px;color:#0b2d34;letter-spacing:-0.02em}
.setup-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:20px 0 16px;padding:6px;background:rgba(1,105,111,0.04);border-radius:100px;width:fit-content;border:1px solid rgba(1,105,111,0.06)}
.setup-tab{border:none;background:transparent;color:#4b6770;padding:10px 22px;border-radius:999px;font-weight:700;cursor:pointer;transition:all 0.2s ease;font-size:14px}
.setup-tab.active{background:#fff;color:var(--brand);box-shadow:0 4px 12px rgba(1,105,111,0.12);border:1px solid rgba(1,105,111,0.08)}
.setup-tab:not(.active):hover{background:rgba(1,105,111,0.05);color:var(--brand)}
.setup-stats{display:grid;grid-template-columns:repeat(4,minmax(120px,1fr));gap:14px;margin:10px 0 24px}
.setup-stat{padding:18px 20px;border-radius:20px;background:#fff;border:1px solid rgba(1,105,111,0.08);box-shadow:0 12px 28px rgba(1,105,111,0.04)}
.setup-stat span{display:block;font-size:11px;text-transform:uppercase;letter-spacing:0.1em;color:#8a9fa6;margin-bottom:10px;font-weight:800}
.setup-stat strong{font-size:30px;color:#0b2d34;font-weight:800}
.setup-panel{display:none;border-radius:28px;padding:24px;background:#fff;border:1px solid rgba(1,105,111,0.08);box-shadow:0 20px 40px rgba(1,105,111,0.05)}
.setup-panel.active{display:block}
.setup-panel-head{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:20px}
.setup-panel-head h3{margin:0;color:#0b2d34;font-size:24px;font-weight:800}
.setup-addbox{padding:18px;border-radius:20px;background:#f6fbfb;border:1px solid rgba(1,105,111,0.08);margin-bottom:18px;display:none;animation:slideDown 0.3s ease-out}
@keyframes slideDown{from{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}
.setup-controls{display:flex;gap:12px;flex-wrap:wrap;align-items:center;margin-bottom:16px;padding-bottom:16px;border-bottom:1px solid #f0f5f5}
.setup-controls input,.setup-controls select{min-width:140px;flex:1;border-color:#e2e8f0;background:#fcfdfe}
.setup-controls input:focus,.setup-controls select:focus{background:#fff}
.bulk-bar{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;padding:12px 18px;border:1px solid #e0f2f1;border-radius:18px;background:#f4fbfb;margin-bottom:16px;opacity:0.4;pointer-events:none;transition:all 0.3s ease;transform:translateY(5px)}
.bulk-bar.active{opacity:1;pointer-events:auto;transform:translateY(0);border-color:var(--brand);box-shadow:0 8px 20px rgba(1,105,111,0.08)}
.bulk-bar .btn{opacity:0;transform:scale(0.95);transition:all 0.2s ease}
.bulk-bar.active .btn{opacity:1;transform:scale(1)}
.setup-table-wrap{border-radius:16px;border:1px solid #edf2f7;overflow:hidden;background:#fff}
.setup-table{font-size:14px;margin:0}
.setup-table thead th{background:#f8fafb;padding:14px 16px;border-bottom:2px solid #edf2f7;color:#4b6770;font-weight:700;text-transform:uppercase;font-size:11px;letter-spacing:0.05em;white-space:nowrap}
.setup-table tbody td{padding:14px 16px;border-bottom:1px solid #f1f5f9;vertical-align:middle}
.setup-table tbody tr:hover{background:#f9fcfc}
.setup-table .meta-line{color:#94a3b8;font-size:12px}
.setup-chip{background:#f0f7f7;color:#0b646a;padding:5px 12px;border-radius:100px;font-size:12px;font-weight:700;border:1px solid rgba(1,105,111,0.08)}
.modal-card{padding:28px;border-radius:32px;border:none}
.modal-head h3{font-size:26px;font-weight:800}
.pagination{margin-top:20px;padding:10px 0}
.pagination .btn{height:36px;min-width:36px;padding:0 10px;border-radius:10px;font-weight:700}
.hide-bulk-btn{display:none!important}

/* ===== MISSING UTILITY CLASSES USED BY index.php ===== */
.row{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:16px}
.row>.field{grid-column:span 12}
.grid{display:grid;gap:18px}
.grid-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.stat{padding:22px;background:linear-gradient(180deg,#ffffff 0%,#f8fcfc 100%);border:1px solid rgba(1,105,111,0.08);border-radius:22px;box-shadow:var(--shadow-sm)}
.stat h3{margin:0 0 10px;font-size:15px;color:var(--muted);font-weight:800;letter-spacing:.02em;text-transform:uppercase}
.stat strong{display:block;font-size:34px;line-height:1;color:#0b2d34;font-weight:800}
.actions{display:flex;flex-wrap:wrap;gap:12px;align-items:center}
.actions .btn{width:auto}
.btn.secondary,.btn.light{width:auto;color:var(--brand);background:#eef9f9;border:1px solid rgba(1,105,111,.12);box-shadow:none}
.btn.secondary:hover,.btn.light:hover{background:#e3f3f3;color:var(--brand-strong)}
.table-wrap{overflow:auto;border:1px solid var(--line-soft);border-radius:18px;background:#fff}
.empty{padding:28px;border:1px dashed #cbd5e1;border-radius:18px;background:#f8fafc;color:var(--muted);font-weight:600;text-align:center}
.list-clean{list-style:none;padding:0;margin:0}
.list-clean li+li{margin-top:10px}
.muted{color:var(--muted)}
.preview{width:100%;border-radius:18px;border:1px solid var(--line-soft);background:#fff;box-shadow:var(--shadow-sm)}
.auth-foot{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-top:16px}
.link-inline{display:inline-flex;align-items:center;justify-content:center;min-height:42px;padding:10px 16px;border-radius:12px;font-weight:700;text-decoration:none;transition:all .2s ease}
.link-inline.primary{color:#01696f;background:rgba(1,105,111,.08);border:1px solid rgba(1,105,111,.12)}
.link-inline.primary:hover{color:#014f53;background:rgba(1,105,111,.14)}
.link-inline.secondary{color:#475569;background:#f8fafc;border:1px solid #e2e8f0}
.link-inline.secondary:hover{color:#0f172a;background:#f1f5f9}
.card>h3:first-child{margin:0;padding:20px 22px 0;font-size:30px;line-height:1.15;font-weight:800;color:#0b2d34}
.card>form{padding:22px}
.card>h3:first-child+form{padding-top:14px}
.card>p,.card>.grid,.card>.actions,.card>.table-wrap,.card>.empty{margin-left:22px;margin-right:22px;margin-bottom:22px}
.card>.grid:last-child,.card>.table-wrap:last-child,.card>.empty:last-child{margin-bottom:22px}
.card .meta{display:inline-block;margin-top:4px}
.table td strong{font-size:16px;color:#0f172a}

/* ===== POLISH FOR USER MANAGEMENT / LIBRARY / MATERIAL DETAILS ===== */
form .btn[type="submit"]{width:auto;min-width:180px}
.card form .row .field[style*="display:flex"] .btn{min-width:120px}
.card form .row .field label{font-size:13px;text-transform:uppercase;letter-spacing:.04em;color:#5b7085}
.table td form{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.table td form .btn{min-width:100px}
.table td form select{min-width:140px;max-width:180px}
.table td a.btn.light{margin-top:8px}
.table td{line-height:1.5}

/* Student library filter polish */
.card form .row{align-items:end}
.card form .row .field .btn{width:auto}

/* Material detail page */
.actions[style*="justify-content:space-between"]{margin:0 22px 18px;padding-top:22px;justify-content:space-between;align-items:flex-start}
.actions[style*="justify-content:space-between"] + p{margin-top:0}
.actions[style*="justify-content:space-between"] .btn.secondary{background:linear-gradient(135deg,var(--brand),var(--brand-strong));color:#fff;border:none;box-shadow:0 10px 24px rgba(1,105,111,.22)}
.actions[style*="justify-content:space-between"] .btn.secondary:hover{background:linear-gradient(135deg,#015d62,#01494d);color:#fff}
.card > .grid.grid-3 > div{padding:18px 20px;border-radius:18px;background:#f8fbfc;border:1px solid #e6edf0}
.card > .grid.grid-3 > div strong{display:block;font-size:13px;text-transform:uppercase;letter-spacing:.05em;color:#64748b;margin-bottom:8px}
.card > .grid.grid-3 > div .muted{font-size:17px;color:#0f172a !important;font-weight:700;line-height:1.4}

/* Logo rendering fix */
.logo-wrap{overflow:hidden}
.logo-wrap img{max-width:100%;max-height:100%;object-position:center center}
.page-chip img{max-width:100%;max-height:100%;object-fit:contain;object-position:center}

/* Better spacing for dashboard stat rows */
.dashboard-hero + .grid.grid-3,
.role-dash-hero + .grid.grid-3{margin-top:18px;margin-bottom:22px}

@media (max-width:1100px){
  .grid-3,.setup-stats{grid-template-columns:1fr 1fr}
  .grid-2{grid-template-columns:1fr}
}
@media (max-width:700px){
  .grid-3,.setup-stats,.row{grid-template-columns:1fr}
  .card>h3:first-child{font-size:24px;padding:18px 18px 0}
  .card>form,.card>p,.card>.grid,.card>.actions,.card>.table-wrap,.card>.empty{margin-left:18px;margin-right:18px;padding-left:0;padding-right:0}
  .card form .row .field[style*="display:flex"]{flex-direction:column;align-items:stretch !important}
  .actions[style*="justify-content:space-between"]{margin-left:18px;margin-right:18px;padding-top:18px}
  .auth-foot{justify-content:center}
}
