/* ==========================================================================
   Hameedia Energy Healing Arts and Mind Sciences — Admin Panel theme
   Serene · modern · professional
   ========================================================================== */

:root {
    --deep: #0d4f4a;
    --deep-2: #11635c;
    --teal: #14726a;
    --teal-soft: #e7f1ee;
    --sage: #8aa899;
    --gold: #c2a36b;
    --gold-soft: #f3ead7;
    --cream: #f6f3ec;
    --paper: #ffffff;
    --ink: #22322d;
    --muted: #64776f;
    --line: #e4e8e3;
    --danger: #b3493d;
    --danger-soft: #f8e9e7;
    --warn: #9a6d1f;
    --warn-soft: #faf1dc;
    --ok: #2e7d5b;
    --ok-soft: #e5f3ec;
    --radius: 14px;
    --shadow: 0 10px 30px rgba(13, 79, 74, .08);
    --shadow-sm: 0 2px 10px rgba(13, 79, 74, .06);
    --sidebar-w: 268px;
    --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font);
    color: var(--ink);
    background: var(--cream);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--deep); }

/* ── App shell ─────────────────────────────────────────────────────── */
.app { min-height: 100vh; display: flex; }

.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(170deg, var(--deep) 0%, var(--deep-2) 60%, #0b403c 100%);
    color: #dcebe6;
    position: fixed;
    inset: 0 auto 0 0;
    display: flex;
    flex-direction: column;
    z-index: 60;
    transition: transform .25s ease;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 22px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.brand-mark {
    width: 46px; height: 46px;
    flex: 0 0 46px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(194, 163, 107, .55);
    border-radius: 50%;
    display: grid; place-items: center;
}
.brand-mark svg { width: 28px; height: 28px; }
.brand-name {
    font-family: var(--font-display);
    font-size: 19px;
    line-height: 1.1;
    color: #fff;
    letter-spacing: .4px;
    font-weight: 600;
}
.brand-sub {
    font-size: 10.5px;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    color: var(--gold);
    margin-top: 3px;
}

.nav { padding: 14px 12px; flex: 1; overflow-y: auto; }
.nav-section {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: rgba(220, 235, 230, .5);
    padding: 14px 12px 6px;
}
.nav a.item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10.5px 12px;
    border-radius: 10px;
    color: #cfe0da;
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 2px;
    transition: background .15s, color .15s;
}
.nav a.item svg { width: 18px; height: 18px; flex: 0 0 18px; opacity: .85; }
.nav a.item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav a.item.active {
    background: linear-gradient(90deg, rgba(194, 163, 107, .22), rgba(194, 163, 107, .08));
    color: #fff;
    box-shadow: inset 2.5px 0 0 var(--gold);
}
.nav a.item .badge {
    margin-left: auto;
    background: var(--gold);
    color: #2c2414;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    display: none;
    align-items: center;
    justify-content: center;
}
.nav a.item .badge.show { display: inline-flex; }

.sidebar-foot {
    padding: 14px 20px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    font-size: 11.5px;
    color: rgba(220, 235, 230, .55);
}

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

.topbar {
    background: rgba(246, 243, 236, .88);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 40;
}
.topbar h1 { font-size: 19px; margin: 0; font-weight: 700; color: var(--deep); }
.topbar .spacer { flex: 1; }
.userchip {
    display: flex; align-items: center; gap: 10px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px 14px 5px 6px;
    box-shadow: var(--shadow-sm);
}
.userchip .avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(145deg, var(--teal), var(--deep));
    color: #fff; display: grid; place-items: center;
    font-size: 13px; font-weight: 700;
}
.userchip .meta { line-height: 1.2; }
.userchip .meta .n { font-size: 13px; font-weight: 600; }
.userchip .meta .r { font-size: 11px; color: var(--muted); }
.icon-btn {
    background: var(--paper); border: 1px solid var(--line);
    width: 38px; height: 38px; border-radius: 10px; cursor: pointer;
    display: none; place-items: center; color: var(--deep);
}
.icon-btn svg { width: 19px; height: 19px; }

.content { padding: 26px 28px 44px; max-width: 1240px; width: 100%; }

/* ── Cards & stat tiles ────────────────────────────────────────────── */
.card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 22px;
    margin-bottom: 22px;
}
.card h2 {
    margin: 0 0 4px;
    font-size: 16.5px;
    color: var(--deep);
    display: flex; align-items: center; gap: 9px;
}
.card .sub { color: var(--muted); font-size: 13px; margin: 0 0 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}
.stat {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}
.stat::after {
    content: "";
    position: absolute; right: -18px; top: -18px;
    width: 72px; height: 72px; border-radius: 50%;
    background: var(--teal-soft);
}
.stat.gold::after { background: var(--gold-soft); }
.stat.green::after { background: var(--ok-soft); }
.stat.red::after { background: var(--danger-soft); }
.stat .k { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.stat .v { font-size: 30px; font-weight: 700; color: var(--deep); margin-top: 4px; line-height: 1.1; }
.stat .ico { position: absolute; right: 12px; top: 12px; z-index: 1; color: var(--teal); opacity: .7; }
.stat.gold .ico { color: var(--gold); }
.stat.green .ico { color: var(--ok); }
.stat.red .ico { color: var(--danger); }

.grid-2 { display: grid; grid-template-columns: 1.5fr 1fr; gap: 22px; align-items: start; }
@media (max-width: 980px) { .grid-2 { grid-template-columns: 1fr; } }

/* ── Tables ────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: 10px; }
table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}
table.data th {
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--muted);
    font-weight: 700;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
table.data td {
    padding: 12px;
    border-bottom: 1px solid #eef1ee;
    vertical-align: middle;
}
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: #fafbf9; }
.cell-strong { font-weight: 600; color: var(--ink); }
.cell-sub { font-size: 12px; color: var(--muted); }

/* ── Badges ────────────────────────────────────────────────────────── */
.badge-pill {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 11px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}
.b-pending { background: var(--warn-soft); color: var(--warn); }
.b-approved, .b-basic { background: var(--ok-soft); color: var(--ok); }
.b-rejected { background: var(--danger-soft); color: var(--danger); }
.b-advanced { background: var(--teal-soft); color: var(--teal); }
.b-super { background: var(--gold-soft); color: #8a6d34; }
.b-role { background: #eceff3; color: #45546b; }
.b-admin { background: #e6ecf8; color: #33548f; }
.b-manager { background: #efe8f6; color: #6d4b96; }
.b-super_admin { background: linear-gradient(90deg, #efe2c4, #f7efdd); color: #8a6d34; border: 1px solid #e3d2a8; }
.b-muted { background: #eef1ee; color: var(--muted); }

/* ── Buttons & forms ───────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 9px 16px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: 13.5px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: transform .06s, box-shadow .15s, background .15s;
    white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: linear-gradient(135deg, var(--teal), var(--deep)); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--deep); color: #fff; }
.btn-gold { background: linear-gradient(135deg, #d3b57c, var(--gold)); color: #2c2414; }
.btn-gold:hover { filter: brightness(1.04); color: #2c2414); }
.btn-ghost { background: var(--paper); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--cream); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: #ecd5d1; }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }
.btn-block { width: 100%; }

.inline-form { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }

label.fld { display: block; margin-bottom: 14px; font-size: 13px; font-weight: 600; color: #31443d; }
label.fld span.req { color: var(--danger); }
input[type=text], input[type=email], input[type=password], input[type=url],
input[type=number], input[type=search], select, textarea {
    width: 100%;
    margin-top: 6px;
    padding: 10px 13px;
    border: 1px solid #d8ded8;
    border-radius: 10px;
    font-family: var(--font);
    font-size: 14px;
    color: var(--ink);
    background: #fdfefd;
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(20, 114, 106, .13);
}
textarea { min-height: 110px; resize: vertical; }
.hint { font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 5px; }
.check-row { display: flex; align-items: center; gap: 9px; font-weight: 500; margin: 6px 0 14px; }
.check-row input { width: 16px; height: 16px; accent-color: var(--teal); }

.filterbar {
    display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end;
    background: #fafbf9; border: 1px solid var(--line);
    border-radius: 12px; padding: 14px 16px; margin-bottom: 18px;
}
.filterbar .grow { flex: 1; min-width: 180px; }
.filterbar label.fld { margin: 0; font-size: 12px; }

/* ── Flash / alerts ────────────────────────────────────────────────── */
.alert {
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 18px;
    font-size: 13.5px;
    font-weight: 500;
    display: flex; align-items: center; gap: 10px;
    border: 1px solid transparent;
}
.alert svg { width: 18px; height: 18px; flex: none; }
.alert-success { background: var(--ok-soft); color: #1f5c43; border-color: #cfe6d9; }
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: #ecd5d1; }
.alert-info { background: var(--teal-soft); color: var(--deep); border-color: #cfe3dd; }

.validation {
    background: var(--danger-soft); border: 1px solid #ecd5d1;
    color: var(--danger); border-radius: 12px; padding: 10px 16px;
    margin-bottom: 16px; font-size: 13px;
}
.validation ul { margin: 6px 0 0; padding-left: 18px; }

/* ── Empty state ───────────────────────────────────────────────────── */
.empty { text-align: center; padding: 42px 20px; color: var(--muted); }
.empty svg { width: 46px; height: 46px; opacity: .4; margin-bottom: 10px; }
.empty p { margin: 4px 0; }

/* ── Login page ────────────────────────────────────────────────────── */
.login-wrap {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
}
.login-aside {
    background:
        radial-gradient(900px 500px at 15% -10%, rgba(194, 163, 107, .20), transparent 60%),
        linear-gradient(165deg, var(--deep) 0%, var(--deep-2) 55%, #0a3d39 100%);
    color: #e7f1ee;
    padding: 60px 54px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.login-aside .lotus { width: 72px; height: 72px; margin-bottom: 26px; }
.login-aside h2 {
    font-family: var(--font-display);
    font-size: 38px;
    line-height: 1.15;
    color: #fff;
    margin: 0 0 14px;
    font-weight: 600;
}
.login-aside p { font-size: 15px; color: rgba(231, 241, 238, .8); max-width: 440px; }
.login-aside .ring {
    position: absolute; border: 1px solid rgba(194, 163, 107, .25);
    border-radius: 50%; pointer-events: none;
}
.login-aside .r1 { width: 420px; height: 420px; right: -160px; bottom: -120px; }
.login-aside .r2 { width: 260px; height: 260px; right: -70px; bottom: -70px; }
.login-panel { display: grid; place-items: center; padding: 40px 24px; background: var(--cream); }
.login-card {
    width: 100%; max-width: 410px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 34px 34px 28px;
}
.login-card .mini-logo { display: none; }
.login-card h1 { font-size: 22px; color: var(--deep); margin: 0 0 4px; }
.login-card .lead { color: var(--muted); font-size: 13.5px; margin: 0 0 22px; }
.login-foot { text-align: center; margin-top: 18px; font-size: 12.5px; color: var(--muted); }

/* ── Course cards on index ─────────────────────────────────────────── */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.course-card {
    background: var(--paper); border: 1px solid var(--line);
    border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
}
.course-thumb {
    height: 138px;
    background: linear-gradient(135deg, #177068, #0d4f4a);
    position: relative;
    display: grid; place-items: center;
    color: rgba(255, 255, 255, .75);
}
.course-thumb img { width: 100%; height: 100%; object-fit: cover; }
.course-thumb .lvl {
    position: absolute; top: 10px; left: 10px;
    background: rgba(13, 79, 74, .82);
    color: #fff; font-size: 11px; font-weight: 600;
    padding: 3px 10px; border-radius: 999px;
    border: 1px solid rgba(194, 163, 107, .5);
}
.course-body { padding: 15px 17px 17px; flex: 1; display: flex; flex-direction: column; }
.course-body h3 { margin: 0 0 6px; font-size: 15.5px; color: var(--deep); }
.course-body p { font-size: 12.5px; color: var(--muted); margin: 0 0 12px; flex: 1;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.course-meta { display: flex; gap: 8px; font-size: 11.5px; color: var(--muted); margin-bottom: 12px; flex-wrap: wrap; }
.course-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Lessons ───────────────────────────────────────────────────────── */
.lesson-row {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    background: #fdfefd;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.lesson-row .order {
    width: 34px; height: 34px; border-radius: 9px; flex: none;
    background: var(--teal-soft); color: var(--deep);
    display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.lesson-row .info { flex: 1; min-width: 200px; }
.lesson-row .info .t { font-weight: 600; font-size: 14px; }
.lesson-row .info .m { font-size: 12px; color: var(--muted); margin-top: 2px; display: flex; gap: 8px; flex-wrap: wrap; }
.lesson-row .actions { display: flex; gap: 7px; flex-wrap: wrap; }
.chip-ico { display: inline-flex; align-items: center; gap: 4px; }
.chip-ico svg { width: 13px; height: 13px; }

.upload-box {
    border: 1.5px dashed #c3cfc8;
    border-radius: 12px;
    padding: 18px;
    background: #fafbf9;
    margin-bottom: 18px;
}
.upload-box h3 { margin: 0 0 12px; font-size: 14px; color: var(--deep); display: flex; align-items: center; gap: 7px; }

.pagination-wrap { margin-top: 18px; display: flex; justify-content: center; }
.pagination-wrap nav { display: inline-flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.pagination-wrap a, .pagination-wrap span {
    padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px;
    font-size: 13px; background: var(--paper); color: var(--teal);
}
.pagination-wrap .active span { background: var(--teal); color: #fff; border-color: var(--teal); }
.pagination-wrap .disabled span { color: #aab5af; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
    display: flex; gap: 12px; padding: 11px 0;
    border-bottom: 1px dashed var(--line);
    font-size: 13px;
}
.timeline li:last-child { border-bottom: none; }
.timeline .dot {
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--gold); margin-top: 7px; flex: none;
}
.timeline .act { font-weight: 600; color: var(--deep); }
.timeline .when { color: var(--muted); font-size: 11.5px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12px;
    background: #f2f5f3; padding: 1px 7px; border-radius: 6px; color: var(--deep); }

.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; margin-bottom: 16px; font-weight: 600; }
.back-link svg { width: 15px; height: 15px; }

.sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(10, 40, 37, .5); z-index: 55;
}

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 960px) {
    .icon-btn { display: grid; }
    .sidebar { transform: translateX(-100%); box-shadow: 0 0 60px rgba(0,0,0,.3); }
    body.nav-open .sidebar { transform: translateX(0); }
    body.nav-open .sidebar-overlay { display: block; }
    .main { margin-left: 0; }
    .content { padding: 18px 14px 36px; }
    .topbar { padding: 12px 14px; }
    .userchip .meta { display: none; }
    .login-wrap { grid-template-columns: 1fr; }
    .login-aside { display: none; }
    .login-card .mini-logo {
        display: flex; align-items: center; gap: 11px; margin-bottom: 20px;
    }
    .login-card .mini-logo .brand-mark {
        width: 44px; height: 44px; display: grid; place-items: center;
        border: 1px solid var(--gold); border-radius: 50%; background: var(--teal-soft);
    }
    .login-card .mini-logo .brand-mark svg { width: 26px; height: 26px; }
    .login-card .mini-logo .bn { font-family: var(--font-display); font-weight: 700; color: var(--deep); font-size: 17px; }
}
