/* ===========================================
   أكاديميتك - Tutor Platform
   Gold/Black theme with dark mode support
   =========================================== */

:root {
    --gold: #c9a961;
    --gold-light: #e2c989;
    --gold-dark: #a8893e;
    --black: #0a0a0a;
    --dark: #1a1a1a;
    --darker: #050505;
    --gray: #2a2a2a;
    --gray-light: #3a3a3a;
    --light-gray: #b0b0b0;
    --white: #ffffff;
    --green: #25D366;
    --green-dark: #128C7E;
    --red: #e74c3c;
    --red-dark: #c0392b;
    --blue: #3498db;
    --yellow: #f39c12;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-light: 0 2px 10px rgba(0, 0, 0, 0.3);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.25s ease;
    --sidebar-width: 260px;
    --topbar-height: 64px;
}

[data-theme="light"] {
    --black: #f5f5f5;
    --dark: #fafafa;
    --darker: #ffffff;
    --gray: #ffffff;
    --gray-light: #e8e8e8;
    --light-gray: #555;
    --white: #0a0a0a;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    --shadow-light: 0 2px 10px rgba(0, 0, 0, 0.05);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    font-family: 'Tajawal', -apple-system, sans-serif;
    background: var(--darker);
    color: var(--white);
    min-height: 100vh;
    direction: rtl;
    transition: background 0.3s ease, color 0.3s ease;
}

body { overflow-x: hidden; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea, button { font-family: inherit; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

/* ===== Auth Screen ===== */
.auth-screen {
    position: fixed;
    inset: 0;
    background: var(--darker);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
    overflow-y: auto;
}

.auth-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(201, 169, 97, 0.15), transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(201, 169, 97, 0.1), transparent 50%);
    pointer-events: none;
}

.auth-container {
    width: 100%;
    max-width: 480px;
    position: relative;
    z-index: 1;
}

.auth-card {
    background: var(--gray);
    border: 1px solid rgba(201, 169, 97, 0.2);
    border-radius: 20px;
    padding: 40px 32px;
    box-shadow: var(--shadow);
}

.auth-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.logo-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: var(--black);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 900;
    box-shadow: 0 8px 20px rgba(201, 169, 97, 0.3);
}

.logo-circle.small {
    width: 38px;
    height: 38px;
    font-size: 0.9rem;
}

.auth-card h1 {
    color: var(--gold);
    text-align: center;
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.auth-tagline {
    text-align: center;
    color: var(--light-gray);
    margin-bottom: 24px;
    font-size: 0.95rem;
}

.auth-tabs {
    display: flex;
    background: var(--darker);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 24px;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    background: none;
    color: var(--light-gray);
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--transition);
}

.auth-tab.active {
    background: var(--gold);
    color: var(--black);
}

.auth-form { display: none; }
.auth-form.active { display: block; }

.auth-form .form-group { margin-bottom: 16px; }
.auth-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.role-selector { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.role-option { cursor: pointer; }
.role-option input { display: none; }

.role-card {
    background: var(--darker);
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 16px 8px;
    text-align: center;
    transition: all var(--transition);
}

.role-option input:checked + .role-card {
    border-color: var(--gold);
    background: rgba(201, 169, 97, 0.1);
}

.role-card i { font-size: 1.8rem; color: var(--gold); margin-bottom: 8px; }
.role-card strong { display: block; color: var(--white); }
.role-card small { display: block; color: var(--light-gray); font-size: 0.78rem; margin-top: 4px; }

.form-hint {
    text-align: center;
    color: var(--light-gray);
    font-size: 0.8rem;
    margin-top: 16px;
}

.form-hint code {
    background: var(--darker);
    color: var(--gold);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

/* ===== App Shell ===== */
.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-rows: var(--topbar-height) 1fr;
    grid-template-areas: "sidebar topbar" "sidebar main";
    min-height: 100vh;
}

/* ===== Topbar ===== */
.topbar {
    grid-area: topbar;
    background: var(--dark);
    border-bottom: 1px solid rgba(201, 169, 97, 0.15);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 15px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    color: var(--white);
    transition: background var(--transition);
}

.menu-toggle:hover { background: var(--gray); }

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.topbar-title {
    font-weight: 800;
    color: var(--gold);
    font-size: 1.05rem;
}

.topbar-search {
    flex: 1;
    max-width: 480px;
    position: relative;
}

.topbar-search i {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--light-gray);
}

.topbar-search input {
    width: 100%;
    padding: 10px 40px 10px 14px;
    background: var(--gray);
    border: 1px solid transparent;
    border-radius: 24px;
    color: var(--white);
    font-size: 0.92rem;
    transition: all var(--transition);
}

.topbar-search input:focus {
    outline: none;
    border-color: var(--gold);
    background: var(--darker);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: auto;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gray);
    color: var(--white);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all var(--transition);
}

.icon-btn:hover { background: var(--gray-light); color: var(--gold); }

.icon-btn .badge {
    position: absolute;
    top: -2px;
    left: -2px;
    background: var(--red);
    color: var(--white);
    font-size: 0.7rem;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

.user-menu { position: relative; }

.user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 14px 4px 4px;
    background: var(--gray);
    border-radius: 24px;
    color: var(--white);
    transition: all var(--transition);
}

.user-btn:hover { background: var(--gray-light); }

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gold);
    color: var(--black);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.95rem;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: var(--gray);
    border: 1px solid rgba(201, 169, 97, 0.2);
    border-radius: 8px;
    min-width: 200px;
    overflow: hidden;
    box-shadow: var(--shadow);
    display: none;
    z-index: 100;
}

.user-dropdown.open { display: block; }
.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--white);
    transition: background var(--transition);
    font-size: 0.9rem;
}
.user-dropdown a:hover { background: var(--gray-light); color: var(--gold); }

/* ===== Sidebar ===== */
.sidebar {
    grid-area: sidebar;
    background: var(--dark);
    border-left: 1px solid rgba(201, 169, 97, 0.1);
    padding: 16px 0;
    overflow-y: auto;
    position: sticky;
    top: 0;
    height: 100vh;
}

.nav { display: flex; flex-direction: column; gap: 4px; }

.nav-section { margin-bottom: 16px; }

.nav-section-title {
    padding: 8px 24px;
    color: var(--light-gray);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 24px;
    color: var(--light-gray);
    transition: all var(--transition);
    font-weight: 500;
    border-right: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(201, 169, 97, 0.08);
    color: var(--white);
}

.nav-item.active {
    background: rgba(201, 169, 97, 0.12);
    color: var(--gold);
    border-right-color: var(--gold);
}

.nav-item i { width: 20px; text-align: center; font-size: 1.05rem; }

/* ===== Main Content ===== */
.main {
    grid-area: main;
    padding: 24px;
    overflow-x: hidden;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 15px;
}

.page-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--white);
}

.page-title small {
    display: block;
    font-size: 0.85rem;
    color: var(--light-gray);
    font-weight: 400;
    margin-top: 4px;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.92rem;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: var(--black);
}

.btn-primary:hover { box-shadow: 0 6px 18px rgba(201, 169, 97, 0.4); }

.btn-secondary {
    background: var(--gray);
    color: var(--white);
    border: 1px solid rgba(201, 169, 97, 0.2);
}

.btn-secondary:hover { background: var(--gray-light); border-color: var(--gold); }

.btn-success { background: var(--green); color: var(--white); }
.btn-success:hover { background: var(--green-dark); }

.btn-danger { background: var(--red); color: var(--white); }
.btn-danger:hover { background: var(--red-dark); }

.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 0.82rem; }
.btn-icon { width: 32px; height: 32px; padding: 0; border-radius: 6px; }

/* ===== Cards ===== */
.card {
    background: var(--gray);
    border: 1px solid rgba(201, 169, 97, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(201, 169, 97, 0.1);
}

.card-title { color: var(--gold); font-weight: 700; font-size: 1.05rem; }

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

.stat-card {
    background: var(--gray);
    border: 1px solid rgba(201, 169, 97, 0.15);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all var(--transition);
}

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

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: var(--black);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.stat-icon.green { background: linear-gradient(135deg, #25D366, #128C7E); color: var(--white); }
.stat-icon.red { background: linear-gradient(135deg, #e74c3c, #c0392b); color: var(--white); }
.stat-icon.blue { background: linear-gradient(135deg, #3498db, #2980b9); color: var(--white); }
.stat-icon.purple { background: linear-gradient(135deg, #9b59b6, #8e44ad); color: var(--white); }

.stat-info { flex: 1; }
.stat-info .num { font-size: 1.6rem; font-weight: 900; color: var(--white); }
.stat-info .label { font-size: 0.82rem; color: var(--light-gray); }

/* ===== Lecture Cards ===== */
.lectures-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}

.lecture-card {
    background: var(--gray);
    border: 1px solid rgba(201, 169, 97, 0.1);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}

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

.lecture-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    background: var(--darker);
    position: relative;
    overflow: hidden;
}

.lecture-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lecture-thumb-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, 0.7));
    display: flex;
    align-items: flex-end;
    padding: 12px;
}

.lecture-duration {
    background: rgba(0, 0, 0, 0.8);
    color: var(--white);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 700;
}

.lecture-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--green);
    color: var(--white);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}

.lecture-badge.paid {
    background: var(--gold);
    color: var(--black);
}

.lecture-info { padding: 14px; }
.lecture-info h3 {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.7em;
}

.lecture-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    color: var(--light-gray);
}

.lecture-tutor {
    display: flex;
    align-items: center;
    gap: 6px;
}

.lecture-tutor .avatar-tiny {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--gold);
    color: var(--black);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
}

.lecture-price {
    color: var(--gold);
    font-weight: 800;
}

.lecture-price.free { color: var(--green); }

/* ===== Tables ===== */
.table-wrap {
    background: var(--gray);
    border-radius: 12px;
    border: 1px solid rgba(201, 169, 97, 0.1);
    overflow: hidden;
}

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

th {
    background: var(--darker);
    color: var(--gold);
    text-align: right;
    padding: 14px 16px;
    font-weight: 700;
    font-size: 0.88rem;
    border-bottom: 2px solid rgba(201, 169, 97, 0.2);
}

td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--white);
    font-size: 0.9rem;
}

tr:hover td { background: rgba(201, 169, 97, 0.04); }

td .actions { display: flex; gap: 6px; }

/* ===== Forms ===== */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    color: var(--light-gray);
    margin-bottom: 6px;
    font-size: 0.9rem;
    font-weight: 500;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 11px 14px;
    background: var(--darker);
    border: 1px solid rgba(201, 169, 97, 0.15);
    border-radius: 8px;
    color: var(--white);
    font-size: 0.95rem;
    transition: border-color var(--transition);
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--gold);
}

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

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }

/* ===== Search + Filters ===== */
.toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.search-box i {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--light-gray);
}

.search-box input { padding-right: 40px; }

.filter-chip {
    padding: 8px 14px;
    background: var(--gray);
    border: 1px solid rgba(201, 169, 97, 0.15);
    border-radius: 20px;
    color: var(--white);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.filter-chip.active, .filter-chip:hover {
    background: var(--gold);
    color: var(--black);
    border-color: var(--gold);
}

/* ===== Status badges ===== */
.status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 700;
}

.status.active, .status.paid, .status.completed, .status.subscribed {
    background: rgba(46, 204, 113, 0.18);
    color: #2ecc71;
}
.status.pending, .status.partial, .status.draft {
    background: rgba(243, 156, 18, 0.18);
    color: #f39c12;
}
.status.expired, .status.cancelled, .status.failed {
    background: rgba(231, 76, 60, 0.18);
    color: #e74c3c;
}
.status.free {
    background: rgba(52, 152, 219, 0.18);
    color: #3498db;
}

/* ===== Modal ===== */
.modal-container {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal {
    position: relative;
    background: var(--gray);
    border: 1px solid rgba(201, 169, 97, 0.2);
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal.modal-lg { max-width: 800px; }
.modal.modal-sm { max-width: 400px; }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid rgba(201, 169, 97, 0.15);
}

.modal-header h3 { color: var(--gold); font-size: 1.15rem; }

.modal-body { padding: 22px; overflow-y: auto; flex: 1; }

.modal-footer {
    padding: 16px 22px;
    border-top: 1px solid rgba(201, 169, 97, 0.15);
    display: flex;
    gap: 10px;
    justify-content: flex-start;
}

/* ===== Video Modal ===== */
.video-modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.video-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
}

.video-container {
    position: relative;
    width: 100%;
    max-width: 1100px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1;
}

.video-close {
    position: absolute;
    top: -45px;
    left: 0;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 50%;
    font-size: 1rem;
    z-index: 2;
}

.video-close:hover { background: rgba(255, 255, 255, 0.2); }

.video-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

.video-wrapper iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.video-info {
    background: var(--gray);
    border-radius: 12px;
    padding: 16px;
    max-height: 200px;
    overflow-y: auto;
}

.video-info h3 { color: var(--gold); margin-bottom: 8px; }
.video-info p { color: var(--light-gray); font-size: 0.9rem; line-height: 1.5; }

/* ===== Toast ===== */
.toast-container {
    position: fixed;
    top: 80px;
    left: 20px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--gray);
    border: 1px solid rgba(201, 169, 97, 0.3);
    border-radius: 8px;
    padding: 12px 18px;
    color: var(--white);
    box-shadow: var(--shadow);
    min-width: 250px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastIn 0.3s ease;
}

.toast.success { border-color: var(--green); }
.toast.error { border-color: var(--red); }
.toast.warning { border-color: var(--yellow); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ===== Empty State ===== */
.empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--light-gray);
}

.empty i { font-size: 3rem; color: var(--gray-light); margin-bottom: 15px; }
.empty h3 { color: var(--white); margin-bottom: 8px; }

/* ===== Detail view ===== */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.detail-item { padding: 10px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.detail-item .lbl { color: var(--light-gray); font-size: 0.82rem; }
.detail-item .val { color: var(--white); font-size: 0.95rem; font-weight: 500; margin-top: 3px; }

/* ===== Charts ===== */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.chart-card {
    background: var(--gray);
    border: 1px solid rgba(201, 169, 97, 0.1);
    border-radius: 12px;
    padding: 20px;
    min-height: 280px;
}

.chart-card h3 { color: var(--gold); margin-bottom: 15px; font-size: 1rem; }
.chart-card canvas { max-height: 240px; }

/* ===== Report cards ===== */
.report-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.report-row .lbl { color: var(--light-gray); }
.report-row .val { color: var(--white); font-weight: 700; }

.report-row.total {
    font-size: 1.1rem;
    padding-top: 18px;
    border-top: 2px solid var(--gold);
}

.report-row.total .val { color: var(--gold); }

/* ===== Progress bar ===== */
.progress {
    width: 100%;
    height: 8px;
    background: var(--darker);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* ===== Notifications dropdown ===== */
.notif-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: var(--gray);
    border: 1px solid rgba(201, 169, 97, 0.2);
    border-radius: 8px;
    width: 340px;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: var(--shadow);
    display: none;
    z-index: 100;
}

.notif-dropdown.open { display: block; }

.notif-item {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    gap: 10px;
    transition: background var(--transition);
}

.notif-item:hover { background: var(--gray-light); }
.notif-item.unread { background: rgba(201, 169, 97, 0.05); }

.notif-item .icon { color: var(--gold); font-size: 1.1rem; }
.notif-item .body { flex: 1; font-size: 0.88rem; }
.notif-item .time { font-size: 0.75rem; color: var(--light-gray); margin-top: 3px; }

/* ===== Categories Grid ===== */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.category-card {
    background: var(--gray);
    border: 1px solid rgba(201, 169, 97, 0.1);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
}

.category-card:hover {
    transform: translateY(-3px);
    border-color: var(--gold);
    box-shadow: var(--shadow-light);
}

.category-card i {
    font-size: 2.5rem;
    color: var(--gold);
    margin-bottom: 12px;
}

.category-card h3 { font-size: 1rem; color: var(--white); margin-bottom: 4px; }
.category-card .count { font-size: 0.8rem; color: var(--light-gray); }

/* ===== Hero / Home ===== */
.hero {
    background: linear-gradient(135deg, var(--gray), var(--dark));
    border: 1px solid rgba(201, 169, 97, 0.2);
    border-radius: 16px;
    padding: 40px;
    margin-bottom: 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(201, 169, 97, 0.15), transparent 70%);
    pointer-events: none;
}

.hero h1 {
    font-size: 2rem;
    font-weight: 900;
    color: var(--white);
    margin-bottom: 12px;
    position: relative;
}

.hero h1 span { color: var(--gold); }

.hero p {
    color: var(--light-gray);
    font-size: 1.05rem;
    max-width: 600px;
    margin: 0 auto 20px;
    position: relative;
}

.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
}

.section-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--white);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i { color: var(--gold); }

/* ===== Tabs ===== */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid rgba(201, 169, 97, 0.15);
    margin-bottom: 20px;
    overflow-x: auto;
}

.tab {
    padding: 10px 18px;
    color: var(--light-gray);
    background: none;
    font-weight: 600;
    border-bottom: 2px solid transparent;
    transition: all var(--transition);
    white-space: nowrap;
}

.tab:hover { color: var(--white); }
.tab.active { color: var(--gold); border-bottom-color: var(--gold); }

/* ===== Payment Method Selector ===== */
.payment-method-option { cursor: pointer; }
.payment-method-option input { display: none; }

.pm-card {
    background: var(--darker);
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 14px 10px;
    text-align: center;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.payment-method-option input:checked + .pm-card,
.payment-method-option.selected .pm-card {
    border-color: var(--gold);
    background: rgba(201, 169, 97, 0.1);
}

.pm-card i { font-size: 1.5rem; color: var(--gold); }
.pm-card strong { color: var(--white); font-size: 0.92rem; }
.pm-card code {
    color: var(--light-gray);
    font-family: monospace;
    word-break: break-all;
    font-size: 0.78rem !important;
}

/* Proof image in pending list */
.proof-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid var(--gray-light);
    transition: all var(--transition);
}

.proof-thumb:hover {
    transform: scale(1.1);
    border-color: var(--gold);
}

.proof-viewer {
    position: fixed;
    inset: 0;
    z-index: 400;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    cursor: pointer;
}

.proof-viewer img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
}

/* Utility */
.text-success { color: #2ecc71; }
.text-danger { color: #e74c3c; }
.text-muted { color: var(--light-gray); }
.text-center { text-align: center; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.w-100 { width: 100%; }

/* ===== Responsive ===== */
@media (max-width: 968px) {
    .app-shell { grid-template-columns: 1fr; grid-template-areas: "topbar" "main"; }
    .sidebar {
        position: fixed;
        top: var(--topbar-height);
        right: 0;
        width: var(--sidebar-width);
        height: calc(100vh - var(--topbar-height));
        z-index: 100;
        transform: translateX(100%);
        transition: transform var(--transition);
    }
    .sidebar.open { transform: translateX(0); }
    .menu-toggle { display: inline-flex; }
    .topbar-search { display: none; }
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
    .charts-grid { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .main { padding: 16px 12px; }
    .topbar-title { font-size: 0.9rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .auth-card { padding: 30px 20px; }
    .hero { padding: 30px 20px; }
    .hero h1 { font-size: 1.5rem; }
    .page-title { font-size: 1.2rem; }
    .lectures-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 568px) {
    .stats-grid { grid-template-columns: 1fr; }
    .lectures-grid { grid-template-columns: 1fr; }
    .user-btn span { display: none; }
    .modal { max-height: 95vh; }
    .topbar-actions { gap: 4px; }
    .icon-btn { width: 36px; height: 36px; }
    .topbar-search { display: none; }
    .categories-grid { grid-template-columns: 1fr 1fr; }
}
