/* =====================================================================
   SkillLink Management Console — admin-only styles
   Built on the same tokens as styles.css (loaded first).
   ===================================================================== */

body.admin-body { background: var(--surface-2); }

/* ---------- Login gate ---------- */
.login {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 1.5rem;
  background:
    radial-gradient(900px 500px at 80% -10%, #d6e8ff 0, transparent 60%),
    radial-gradient(800px 500px at 0 100%, #ffeecf 0, transparent 55%),
    var(--surface-2);
}
.login__card { width: 100%; max-width: 440px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: clamp(1.6rem, 4vw, 2.4rem); }
.login__brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.3rem; color: var(--ink); margin-bottom: .3rem; }
.login__brand .brand__mark { width: 34px; height: 34px; }
.login h1 { font-size: 1.5rem; margin: .8rem 0 .3rem; }
.login p { color: var(--muted); font-size: .95rem; }
.login__roles { display: grid; gap: .7rem; margin: 1.4rem 0 .5rem; }
.role-btn { display: grid; grid-template-columns: auto 1fr auto; gap: .9rem; align-items: center; text-align: left; background: var(--surface-2); border: 1.5px solid var(--line); border-radius: 14px; padding: .9rem 1.1rem; cursor: pointer; font: inherit; transition: border-color .2s, background .2s, transform .2s var(--spring); }
.role-btn:hover { border-color: var(--brand); background: var(--brand-tint); transform: translateY(-2px); }
.role-btn__ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: #fff; border: 1px solid var(--line); color: var(--brand); }
.role-btn__ic svg { width: 22px; height: 22px; }
.role-btn b { display: block; color: var(--ink); }
.role-btn span { color: var(--muted); font-size: .85rem; }
.role-btn__arrow { color: var(--muted); }
.login__note { font-size: .8rem; color: var(--muted); margin-top: 1rem; }

/* ---------- App shell ---------- */
.app { display: none; min-height: 100vh; grid-template-columns: 260px 1fr; }
.app.is-authed { display: grid; }
@media (max-width: 900px) { .app.is-authed { grid-template-columns: 1fr; } }

/* Sidebar */
.side { background: var(--ink); color: #cbd5e1; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
@media (max-width: 900px) {
  .side { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 80; transform: translateX(-100%); transition: transform .3s var(--ease-out); }
  .side.is-open { transform: none; box-shadow: var(--shadow-lg); }
}
.side__brand { display: flex; align-items: center; gap: .55rem; font-weight: 800; color: #fff; font-size: 1.15rem; padding: 1.1rem 1.3rem; border-bottom: 1px solid #1e293b; }
.side__brand .brand__mark { width: 30px; height: 30px; }
.side__tag { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: #64748b; font-weight: 700; padding: 1rem 1.3rem .5rem; }
.side__nav { display: flex; flex-direction: column; gap: 2px; padding: 0 .7rem; overflow-y: auto; }
.side__nav a { display: flex; align-items: center; gap: .7rem; color: #cbd5e1; padding: .7rem .8rem; border-radius: 10px; font-weight: 600; font-size: .95rem; cursor: pointer; }
.side__nav a:hover { background: #1e293b; color: #fff; text-decoration: none; }
.side__nav a.is-active { background: var(--brand); color: #fff; }
.side__nav a svg { width: 20px; height: 20px; flex: none; }
.side__nav a[hidden] { display: none; }
.side__foot { margin-top: auto; padding: 1rem 1.3rem; border-top: 1px solid #1e293b; }
.side__user { display: flex; align-items: center; gap: .6rem; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .95rem; flex: none; }
.side__user b { color: #fff; display: block; font-size: .9rem; }
.side__user span { color: #64748b; font-size: .78rem; text-transform: capitalize; }

/* Main area */
.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.8); -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 1rem; padding: .8rem clamp(1rem, 3vw, 1.8rem); }
.topbar__toggle { display: none; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; place-items: center; }
.topbar__toggle svg { width: 22px; height: 22px; }
@media (max-width: 900px) { .topbar__toggle { display: grid; } }
.topbar h2 { margin: 0; font-size: 1.15rem; }
.topbar__search { margin-left: auto; position: relative; display: none; }
@media (min-width: 620px) { .topbar__search { display: block; } }
.topbar__search input { width: 240px; padding: .6rem .9rem .6rem 2.2rem; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface-2); font: inherit; font-size: .9rem; }
.topbar__search svg { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.topbar__logout { margin-left: auto; }
.topbar__search + .topbar__logout { margin-left: .6rem; }

.view-wrap { padding: clamp(1.2rem, 3vw, 2rem); }
.view { display: none; }
.view.is-active { display: block; animation: panelIn .4s var(--ease-out); }
.view__head { margin-bottom: 1.4rem; }
.view__head h1 { font-size: 1.6rem; margin: 0 0 .25rem; }
.view__head p { color: var(--muted); margin: 0; }

/* Stat tiles */
.tiles { display: grid; gap: 1rem; grid-template-columns: repeat(2, 1fr); margin-bottom: 1.6rem; }
@media (min-width: 720px) { .tiles { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); } }

/* filter chips */
.filterchips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { font: inherit; font-size: .84rem; font-weight: 700; padding: .4rem .85rem; border-radius: var(--radius-pill); border: 1px solid var(--line); background: #fff; color: var(--body); cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.2rem 1.3rem; box-shadow: var(--shadow-sm); }
.tile__ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; margin-bottom: .8rem; }
.tile__ic svg { width: 22px; height: 22px; }
.tile__ic.blue { background: var(--brand-tint); color: var(--brand); }
.tile__ic.green { background: var(--verified-tint); color: var(--verified); }
.tile__ic.amber { background: #fef3dd; color: var(--accent-dark); }
.tile__ic.red { background: #fdecec; color: #c02626; }
.tile b { display: block; font-size: 1.9rem; font-weight: 800; color: var(--ink); letter-spacing: -.02em; line-height: 1; }
.tile span { color: var(--muted); font-size: .85rem; font-weight: 600; }

/* Panels & tables */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; margin-bottom: 1.6rem; }
.panel__head { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; justify-content: space-between; padding: 1.1rem 1.3rem; border-bottom: 1px solid var(--line-soft); }
.panel__head h3 { margin: 0; font-size: 1.1rem; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.dt { width: 100%; border-collapse: collapse; min-width: 640px; }
.dt th, .dt td { text-align: left; padding: .85rem 1.3rem; border-bottom: 1px solid var(--line-soft); font-size: .92rem; white-space: nowrap; }
.dt thead th { background: var(--surface-2); color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.dt tbody tr:hover { background: var(--surface-2); }
.dt tbody tr:last-child td { border-bottom: 0; }
.dt .who { display: flex; align-items: center; gap: .6rem; }
.dt .who b { color: var(--ink); }
.dt .muted { color: var(--muted); }

/* Badges */
.badge2 { display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; font-size: .76rem; padding: .28rem .6rem; border-radius: var(--radius-pill); white-space: nowrap; }
.badge2 svg { width: 13px; height: 13px; }
.b-pending { background: #fef3dd; color: var(--accent-dark); }
.b-approved, .b-active { background: var(--verified-tint); color: #14532d; }
.b-rejected, .b-suspended { background: #fdecec; color: #c02626; }
.b-new { background: var(--brand-tint); color: var(--brand); }
.b-contacted { background: #ede9fe; color: #6d28d9; }
.b-verifying { background: #fef3dd; color: var(--accent-dark); }
.b-role-superadmin { background: #1d1d1f; color: #fff; }
.b-role-admin { background: var(--brand-tint); color: var(--brand); }
.b-role-mod { background: var(--surface-3); color: var(--body); }
.lvl { font-weight: 700; color: var(--ink); }

/* Row actions */
.rowbtns { display: flex; gap: .4rem; flex-wrap: wrap; }
.mini { font: inherit; font-size: .82rem; font-weight: 700; padding: .4rem .7rem; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--body); transition: background .15s, border-color .15s, color .15s; white-space: nowrap; }
.mini:hover { border-color: var(--brand); color: var(--brand); }
.mini--go { background: var(--verified); border-color: var(--verified); color: #fff; }
.mini--go:hover { background: #2b8f46; color: #fff; }
.mini--no { background: #fff; border-color: #f0c4c4; color: #c02626; }
.mini--no:hover { background: #fdecec; color: #c02626; }
.mini:disabled { opacity: .5; cursor: not-allowed; }

/* status split bar (dashboard) */
.statusbar { display: flex; height: 14px; border-radius: var(--radius-pill); overflow: hidden; margin: .3rem 0 1rem; background: var(--surface-3); }
.statusbar i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 1rem; }
.legend span { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; color: var(--body); font-weight: 600; }
.legend i { width: 12px; height: 12px; border-radius: 4px; }

/* Drawer (verification detail) */
.scrim { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 90; opacity: 0; visibility: hidden; transition: opacity .3s; }
.scrim.is-open { opacity: 1; visibility: visible; }
.drawer { position: fixed; top: 0; right: 0; height: 100vh; width: min(460px, 100%); background: #fff; z-index: 95; box-shadow: var(--shadow-lg); transform: translateX(100%); transition: transform .35s var(--ease-out); display: flex; flex-direction: column; }
.drawer.is-open { transform: none; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 1.2rem 1.4rem; border-bottom: 1px solid var(--line); }
.drawer__head h3 { margin: 0; font-size: 1.2rem; }
.drawer__x { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; display: grid; place-items: center; }
.drawer__x svg { width: 20px; height: 20px; }
.drawer__body { padding: 1.4rem; overflow-y: auto; flex: 1; }
.drawer__foot { padding: 1.1rem 1.4rem; border-top: 1px solid var(--line); display: flex; gap: .7rem; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: .5rem 1rem; margin-bottom: 1.3rem; }
.kv dt { color: var(--muted); font-size: .88rem; }
.kv dd { margin: 0; color: var(--ink); font-weight: 600; font-size: .92rem; }
.docgrid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.docthumb { border: 1px solid var(--line); border-radius: 12px; padding: 1rem; text-align: center; background: var(--surface-2); }
.docthumb svg { width: 30px; height: 30px; color: var(--brand); margin-bottom: .4rem; }
.docthumb b { display: block; font-size: .85rem; color: var(--ink); }
.docthumb span { font-size: .75rem; color: var(--muted); }

/* Forms in admin */
.formrow { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 620px) { .formrow { grid-template-columns: 1fr; } }
.hint2 { font-size: .85rem; color: var(--muted); margin-top: .3rem; }
.notice { background: var(--brand-tint); border: 1px solid #cfe0ff; color: #0a3d91; border-radius: 12px; padding: .9rem 1.1rem; font-size: .9rem; margin-bottom: 1.2rem; }
.empty { text-align: center; color: var(--muted); padding: 2.5rem 1rem; }

.toast { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%) translateY(30px); background: var(--ink); color: #fff; padding: .8rem 1.3rem; border-radius: var(--radius-pill); font-weight: 600; font-size: .92rem; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s var(--spring); z-index: 120; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.locked { display: grid; place-items: center; padding: 3rem 1rem; text-align: center; color: var(--muted); }
.locked svg { width: 42px; height: 42px; color: var(--line); margin-bottom: .8rem; }
