/* ============================================================
   GETKEY SYSTEM — Neon Gaming Theme
   Palette: midnight indigo + electric cyan / hot magenta / neon mint
   Type: Space Grotesk (display) · Be Vietnam Pro (body) · JetBrains Mono (key)
   ============================================================ */

:root {
  --bg:        #0a0a14;
  --bg-2:      #0d0d1a;
  --surface:   #12121f;
  --surface-2: #1a1a2e;
  --line:      #262640;
  --line-soft: #1e1e34;

  --primary:   #00e5ff;  /* electric cyan  */
  --accent:    #ff2e93;  /* hot magenta    */
  --success:   #00ff9d;  /* neon mint      */
  --warn:      #ffb800;

  --text:      #eaeaf5;
  --muted:     #8686a8;
  --muted-2:   #5c5c78;

  --grad: linear-gradient(120deg, #00e5ff 0%, #7a5cff 48%, #ff2e93 100%);
  --grad-soft: linear-gradient(120deg, rgba(0,229,255,.14), rgba(255,46,147,.14));

  --radius:    16px;
  --radius-sm: 10px;
  --shadow:    0 20px 60px -20px rgba(0,0,0,.7);
  --glow-cyan: 0 0 24px rgba(0,229,255,.35);
  --glow-mag:  0 0 24px rgba(255,46,147,.35);

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body:    "Be Vietnam Pro", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, monospace;
}

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

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Ambient neon backdrop */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(650px circle at 12% -5%,  rgba(0,229,255,.12), transparent 55%),
    radial-gradient(700px circle at 90% 8%,   rgba(255,46,147,.12), transparent 55%),
    radial-gradient(900px circle at 50% 120%, rgba(122,92,255,.14), transparent 60%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.022) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 40%, #000 40%, transparent 85%);
}

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

::selection { background: rgba(0,229,255,.3); }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 20px; border: 2px solid var(--bg-2); }
::-webkit-scrollbar-thumb:hover { background: #33334d; }

/* ============================================================
   SHARED COMPONENTS
   ============================================================ */

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255,255,255,.02);
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); box-shadow: 0 0 8px var(--success); }

.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  border: none; cursor: pointer;
  padding: 13px 22px; border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, opacity .2s;
  color: #05060a;
  background: var(--grad);
  background-size: 160% 160%;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 34px -12px rgba(0,229,255,.6); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; filter: grayscale(.4); }

.btn-ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: var(--primary); box-shadow: var(--glow-cyan); background: rgba(0,229,255,.05); }

.btn-danger { background: linear-gradient(120deg,#ff2e6b,#ff2e93); color: #fff; }
.btn-danger:hover { box-shadow: 0 14px 34px -12px rgba(255,46,107,.6); }

.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 8px; }

.field { margin-bottom: 16px; }
.field label {
  display: block; margin-bottom: 7px;
  font-size: 13px; font-weight: 600; color: var(--muted);
  letter-spacing: .01em;
}
.input, .textarea, select {
  width: 100%;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: border-color .2s, box-shadow .2s;
}
.textarea { resize: vertical; min-height: 90px; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.6; }
.input:focus, .textarea:focus, select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,229,255,.15);
}
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }

.card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.toast-wrap { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.toast {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 12px 18px; border-radius: 12px;
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow);
  animation: toastIn .3s ease;
  display: flex; align-items: center; gap: 9px;
}
.toast.ok    { border-color: rgba(0,255,157,.4); }
.toast.err   { border-color: rgba(255,46,107,.4); }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ============================================================
   USER TASK PAGE
   ============================================================ */

.user-shell {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 22px 16px 60px;
}
.task-card {
  width: 100%; max-width: 560px;
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.04);
  overflow: hidden;
  position: relative;
  animation: cardUp .5s cubic-bezier(.2,.8,.2,1);
}
@keyframes cardUp { from { opacity: 0; transform: translateY(24px) scale(.98); } to { opacity: 1; transform: none; } }

.task-top {
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line-soft);
  position: relative;
}
.task-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 20px; }
.brand-logo {
  width: 38px; height: 38px; border-radius: 11px;
  background: var(--grad); display: grid; place-items: center;
  box-shadow: var(--glow-cyan);
  font-family: var(--font-display); font-weight: 700; color: #05060a; font-size: 19px;
}
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.brand-name span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.task-name-pill { margin-left: auto; }

/* Smart title */
.smart-title { text-align: center; padding: 6px 0 2px; }
.smart-eyebrow {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 8px;
}
.smart-headline {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(21px, 5.5vw, 27px); line-height: 1.2; letter-spacing: -.02em;
}
.smart-headline .count {
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 14px rgba(0,229,255,.5));
}
.smart-headline.final { color: var(--success); text-shadow: 0 0 22px rgba(0,255,157,.4); }

/* Progress */
.progress-wrap { padding: 20px 24px 4px; }
.progress-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); margin-bottom: 9px; font-family: var(--font-mono); }
.progress-track {
  height: 9px; border-radius: 999px; background: var(--bg);
  border: 1px solid var(--line-soft); overflow: hidden; position: relative;
}
.progress-fill {
  height: 100%; width: 0%;
  background: var(--grad); background-size: 200% 100%;
  border-radius: 999px;
  transition: width .5s cubic-bezier(.3,.9,.3,1);
  animation: shimmer 2.4s linear infinite;
  box-shadow: 0 0 14px rgba(0,229,255,.5);
}
@keyframes shimmer { to { background-position: 200% 0; } }
.step-dots { display: flex; gap: 6px; justify-content: center; padding: 14px 0 2px; flex-wrap: wrap; }
.step-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); transition: all .3s; }
.step-dot.done { background: var(--success); box-shadow: 0 0 8px var(--success); }
.step-dot.active { background: var(--primary); box-shadow: 0 0 10px var(--primary); transform: scale(1.4); }

/* Ad body */
.task-body { padding: 6px 24px 24px; }
.section-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .08em;
  margin: 20px 0 12px;
}
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }

.ad-slot { min-height: 4px; margin-bottom: 6px; }
.ad-slot:empty { display: none; }

/* Directlink buttons */
.dl-list { display: flex; flex-direction: column; gap: 11px; }
.dl-btn {
  display: flex; align-items: center; gap: 13px;
  width: 100%; text-align: left; cursor: pointer;
  padding: 15px 17px; border-radius: 13px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text); font-family: var(--font-body); font-size: 14.5px; font-weight: 500;
  transition: all .2s;
  position: relative; overflow: hidden;
}
.dl-btn::before {
  content: ""; position: absolute; inset: 0;
  background: var(--grad-soft); opacity: 0; transition: opacity .25s;
}
.dl-btn:hover { transform: translateX(3px); border-color: var(--primary); }
.dl-btn:hover::before { opacity: 1; }
.dl-btn .ic {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  display: grid; place-items: center;
  background: rgba(0,229,255,.1); color: var(--primary);
  position: relative; z-index: 1;
}
.dl-btn .txt { flex: 1; position: relative; z-index: 1; }
.dl-btn .txt small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.dl-btn .state { position: relative; z-index: 1; font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.dl-btn.done { border-color: rgba(0,255,157,.5); background: rgba(0,255,157,.06); }
.dl-btn.done .ic { background: rgba(0,255,157,.15); color: var(--success); }
.dl-btn.done .state { color: var(--success); }

/* Continue / countdown */
.task-foot { padding: 6px 24px 26px; }
.countdown-note { text-align: center; font-size: 13px; color: var(--muted); margin-bottom: 12px; min-height: 18px; font-family: var(--font-mono); }
.countdown-note b { color: var(--primary); }
.btn-continue { width: 100%; font-size: 16px; padding: 16px; }

/* Key reveal */
.key-reveal { text-align: center; padding: 8px 24px 30px; animation: cardUp .5s; }
.key-lock {
  width: 84px; height: 84px; margin: 0 auto 18px;
  border-radius: 24px; display: grid; place-items: center;
  background: rgba(0,255,157,.08); border: 1px solid rgba(0,255,157,.35);
  box-shadow: 0 0 40px rgba(0,255,157,.25);
  animation: unlockPop .6s cubic-bezier(.2,1.4,.4,1);
}
@keyframes unlockPop { 0% { transform: scale(.4) rotate(-10deg); opacity: 0; } 60% { transform: scale(1.12); } 100% { transform: scale(1); opacity: 1; } }
.key-title { font-family: var(--font-display); font-weight: 700; font-size: 22px; margin-bottom: 6px; color: var(--success); }
.key-sub { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.key-box {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg); border: 1px dashed var(--line);
  border-radius: 12px; padding: 14px 16px; margin-bottom: 14px;
}
.key-value {
  flex: 1; font-family: var(--font-mono); font-size: 16px; font-weight: 600;
  color: var(--primary); word-break: break-all; text-align: left;
  letter-spacing: .02em;
}
.copy-btn { flex-shrink: 0; }

.error-state { text-align: center; padding: 60px 30px; }
.error-state .ic { font-size: 46px; margin-bottom: 14px; }
.error-state h2 { font-family: var(--font-display); margin-bottom: 8px; }
.error-state p { color: var(--muted); font-size: 14px; }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.confetti i { position: absolute; width: 8px; height: 8px; top: -10px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(600deg); opacity: 0; } }

/* ============================================================
   ADMIN PANEL
   ============================================================ */

/* Login */
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 380px; padding: 34px 30px; }
.login-logo {
  width: 54px; height: 54px; border-radius: 15px; margin: 0 auto 18px;
  background: var(--grad); display: grid; place-items: center;
  box-shadow: var(--glow-cyan); font-family: var(--font-display); font-weight: 700; color: #05060a; font-size: 26px;
}
.login-card h1 { font-family: var(--font-display); text-align: center; font-size: 22px; margin-bottom: 4px; }
.login-card .sub { text-align: center; color: var(--muted); font-size: 13.5px; margin-bottom: 26px; }
.login-err { color: #ff5c7a; font-size: 13px; text-align: center; margin-top: 12px; min-height: 18px; }

/* App shell */
.admin { display: none; min-height: 100vh; }
.admin.active { display: grid; grid-template-columns: 250px 1fr; }

.sidebar {
  background: var(--bg-2); border-right: 1px solid var(--line-soft);
  padding: 20px 16px; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sb-brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 22px; }
.sb-brand .logo { width: 34px; height: 34px; border-radius: 10px; background: var(--grad); display: grid; place-items: center; color: #05060a; font-family: var(--font-display); font-weight: 700; }
.sb-brand .name { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.sb-nav { display: flex; flex-direction: column; gap: 4px; }
.sb-link {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 13px; border-radius: 10px;
  color: var(--muted); font-weight: 500; font-size: 14.5px; cursor: pointer;
  transition: all .18s; border: 1px solid transparent;
}
.sb-link:hover { color: var(--text); background: rgba(255,255,255,.03); }
.sb-link.active { color: var(--text); background: var(--grad-soft); border-color: var(--line); }
.sb-link.active svg { color: var(--primary); }
.sb-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line-soft); }

.main { padding: 28px 34px 60px; overflow-y: auto; height: 100vh; }
.main-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; gap: 16px; flex-wrap: wrap; }
.main-head h1 { font-family: var(--font-display); font-size: 26px; letter-spacing: -.02em; }
.main-head p { color: var(--muted); font-size: 14px; margin-top: 2px; }

.view { display: none; }
.view.active { display: block; animation: fadeUp .35s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Stats */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 14px; margin-bottom: 26px; }
.stat { padding: 20px; }
.stat .k { font-family: var(--font-mono); font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.stat .v { font-family: var(--font-display); font-size: 30px; font-weight: 700; margin-top: 6px; }
.stat .v.c1 { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Task list */
.task-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px,1fr)); gap: 16px; }
.task-item { padding: 20px; display: flex; flex-direction: column; gap: 14px; transition: border-color .2s, transform .2s; }
.task-item:hover { border-color: var(--line); transform: translateY(-2px); }
.ti-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.ti-name { font-family: var(--font-display); font-weight: 700; font-size: 17px; }
.ti-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font-family: var(--font-mono); font-size: 11px; padding: 4px 9px; border-radius: 7px; background: var(--bg); border: 1px solid var(--line-soft); color: var(--muted); }
.chip.c-key { color: var(--success); border-color: rgba(0,255,157,.3); }
.chip.c-page { color: var(--primary); border-color: rgba(0,229,255,.3); }
.ti-link { font-family: var(--font-mono); font-size: 12px; color: var(--muted); background: var(--bg); padding: 9px 11px; border-radius: 8px; border: 1px solid var(--line-soft); word-break: break-all; }
.ti-actions { display: flex; gap: 8px; }
.ti-actions .btn { flex: 1; }

.empty-state { text-align: center; padding: 70px 20px; color: var(--muted); }
.empty-state .ic { font-size: 44px; margin-bottom: 12px; opacity: .6; }
.empty-state h3 { font-family: var(--font-display); color: var(--text); margin-bottom: 6px; }

/* Editor */
.editor-grid { display: grid; grid-template-columns: 1fr; gap: 20px; max-width: 860px; }
.panel { padding: 22px 24px; }
.panel-title { font-family: var(--font-display); font-weight: 700; font-size: 16px; margin-bottom: 4px; display: flex; align-items: center; gap: 9px; }
.panel-sub { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.pages-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.page-block { border: 1px solid var(--line-soft); border-radius: 14px; margin-bottom: 16px; overflow: hidden; background: var(--bg-2); }
.pb-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; background: rgba(255,255,255,.02);
  border-bottom: 1px solid var(--line-soft); cursor: pointer;
}
.pb-num { width: 30px; height: 30px; border-radius: 9px; background: var(--grad); color: #05060a; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 14px; flex-shrink: 0; }
.pb-title { font-weight: 600; font-size: 15px; flex: 1; }
.pb-title small { color: var(--muted); font-weight: 400; font-size: 12.5px; margin-left: 8px; }
.pb-body { padding: 18px; }
.pb-body.collapsed { display: none; }

.sub-block { margin-bottom: 18px; }
.sub-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sub-label span { font-size: 13px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 7px; }
.sub-label small { color: var(--muted); font-weight: 400; }

.item-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: flex-start; }
.item-row .input, .item-row .textarea { flex: 1; }
.icon-btn {
  width: 38px; height: 40px; flex-shrink: 0; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  cursor: pointer; display: grid; place-items: center; transition: all .18s;
}
.icon-btn:hover { border-color: #ff2e6b; color: #ff5c7a; background: rgba(255,46,107,.08); }
.add-mini {
  font-size: 13px; font-weight: 600; color: var(--primary); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px;
  border: 1px dashed var(--line); border-radius: 9px; background: transparent; transition: all .18s;
}
.add-mini:hover { border-color: var(--primary); background: rgba(0,229,255,.06); }

.editor-foot { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 40%); padding: 20px 0 8px; display: flex; gap: 12px; max-width: 860px; }

/* API docs */
.api-wrap { max-width: 900px; }
.api-info { padding: 22px 24px; margin-bottom: 20px; }
.kv-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.kv-row:last-child { border-bottom: none; }
.kv-key { font-size: 13px; color: var(--muted); width: 130px; flex-shrink: 0; font-weight: 600; }
.kv-val { flex: 1; font-family: var(--font-mono); font-size: 12.5px; color: var(--text); word-break: break-all; }
.token-val { color: var(--success); }

.code-block { position: relative; margin-bottom: 18px; }
.code-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; background: var(--surface-2);
  border: 1px solid var(--line); border-bottom: none;
  border-radius: 12px 12px 0 0;
}
.code-head .lang { font-family: var(--font-mono); font-size: 12px; color: var(--primary); font-weight: 600; }
.code-block pre {
  margin: 0; padding: 18px 16px; overflow-x: auto;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 0 0 12px 12px;
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.7; color: #d5d5e8;
}
.code-block pre .cm { color: var(--muted-2); }
.code-block pre .kw { color: #7a9cff; }
.code-block pre .st { color: var(--success); }
.code-block pre .fn { color: var(--accent); }

.tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.tab { padding: 9px 16px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer; border: 1px solid var(--line-soft); background: transparent; transition: all .18s; }
.tab.active { color: var(--text); background: var(--grad-soft); border-color: var(--line); }

.endpoint-card { padding: 16px 18px; margin-bottom: 12px; }
.endpoint-card .method { font-family: var(--font-mono); font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: rgba(0,229,255,.12); color: var(--primary); }
.endpoint-card .ep-title { font-weight: 600; margin: 0 0 4px 0; }
.endpoint-card .ep-desc { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.endpoint-card .ep-return { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.endpoint-card .ep-return code { font-family: var(--font-mono); color: var(--success); background: var(--bg); padding: 2px 6px; border-radius: 5px; }

.copy-inline { cursor: pointer; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 7px; padding: 5px 10px; font-size: 12px; display: inline-flex; align-items: center; gap: 5px; transition: all .18s; }
.copy-inline:hover { color: var(--primary); border-color: var(--primary); }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(5,6,12,.7); backdrop-filter: blur(4px);
  display: none; place-items: center; padding: 20px;
}
.modal-overlay.active { display: grid; animation: fadeUp .2s; }
.modal { width: 100%; max-width: 440px; padding: 26px; }
.modal h3 { font-family: var(--font-display); margin-bottom: 8px; }
.modal p { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* Mobile menu toggle */
.menu-toggle { display: none; }

/* Lớp phủ menu mobile — luôn fixed để KHÔNG chiếm ô grid trên desktop */
.sb-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 99; display: none; }
.sb-backdrop.show { display: block; }

/* ---- Responsive ---- */
@media (max-width: 860px) {
  .admin.active { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; z-index: 100; width: 250px; left: 0; top: 0;
    transform: translateX(-100%); transition: transform .3s;
  }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow); }
  .main { height: auto; min-height: 100vh; padding: 20px 18px 60px; }
  .menu-toggle {
    display: grid; place-items: center; width: 42px; height: 42px;
    border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
    color: var(--text); cursor: pointer;
  }
  .row2 { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .main-head h1 { font-size: 22px; }
  .stat .v { font-size: 26px; }
  .task-top, .task-body, .task-foot, .progress-wrap { padding-left: 18px; padding-right: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* URL endpoint hiển thị trong tài liệu API */
.ep-url {
  background: var(--bg); padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--line-soft); word-break: break-all;
}