/* Admin pages for nallandula.com, matching the portfolio's look: night and day themes, Instrument
   Serif headings, Inter text, gold accents, a starfield with orbits around the "N." monogram. */

@font-face { font-family: "Instrument Serif"; src: url(/admin/assets/instrument-serif.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url(/admin/assets/instrument-serif-italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Inter"; src: url(/admin/assets/inter.woff2) format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --mono-font: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --pad-x: clamp(16px, 3.6vw, 72px);

  /* Night (default) */
  --bg: #050B10;
  --bar: #080E14;
  --card: #101922;
  --field: #0B141D;
  --line: #293641;
  --line-soft: #1A2631;
  --ink: #EFF3F5;
  --soft: #A9B6BF;
  --faint: #73838E;
  --gold: #D1B275;
  --btn: #C9AF79;
  --btn-hover: #D7BF8C;
  --btn-ink: #0B1117;
  --monogram: #DEDACC;
  --monogram-dot: #C9AF79;
  --danger: #EE9A8A;
  --ok: #9CC7A4;
  --glow-a: rgba(36, 92, 112, .30);
  --glow-b: rgba(168, 122, 60, .17);
  --glow-c: rgba(20, 48, 68, .45);
  --stars: .95;
  --orbit-gold: #C9AF79;
  --orbit-teal: #5C9AA2;
  --orbit-slate: #8FA3AE;
  --swirl: rgba(120, 170, 180, .16);
  --swirl-warm: rgba(201, 175, 121, .14);
  --shadow: 0 30px 80px rgba(0, 0, 0, .5);
  --hover: #131E28;
  --active: #172430;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #C7CBCF;
  --bar: #F4F7F9;
  --card: #FDFEFE;
  --field: #F7FAFC;
  --line: #CDD9E0;
  --line-soft: #E3EAEE;
  --ink: #12232E;
  --soft: #506575;
  --faint: #7D8D98;
  --gold: #8E6B2E;
  --btn: #B19668;
  --btn-hover: #A3885A;
  --btn-ink: #12232E;
  --monogram: #314854;
  --monogram-dot: #CDB27A;
  --danger: #B0473A;
  --ok: #3F7A4C;
  --glow-a: rgba(255, 255, 255, .88);
  --glow-b: rgba(255, 255, 255, .6);
  --glow-c: rgba(236, 241, 244, .55);
  --stars: .5;
  --orbit-gold: #B4975E;
  --orbit-teal: #5E8E97;
  --orbit-slate: #73899A;
  --swirl: rgba(255, 255, 255, .7);
  --swirl-warm: rgba(255, 255, 255, .45);
  --shadow: 0 24px 60px rgba(18, 35, 46, .16);
  --hover: #F1F5F7;
  --active: #E9F0F3;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--ink); font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--gold); text-underline-offset: 3px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
p { margin: 0 0 14px; }

/* ------------------------------------------------------------------ header and footer */
.bar {
  position: relative; z-index: 3; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  min-height: 54px; padding: 8px var(--pad-x); background: var(--bar); border-bottom: 1px solid var(--line);
}
.brand { font: 700 11px/1 var(--sans); letter-spacing: .3em; color: var(--ink); text-decoration: none; margin-right: auto; padding: 8px 0; }
.brand span { color: var(--gold); }
.bar-end { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; justify-content: flex-end; }
.bar-end nav { display: flex; gap: 4px 14px; flex-wrap: wrap; }
.bar-end a { font: 500 12.5px/1 var(--sans); color: var(--soft); text-decoration: none; padding: 9px 2px; }
.bar-end a:hover, .bar-end a[aria-current="page"] { color: var(--ink); }
.theme-toggle {
  width: 32px; height: 32px; display: inline-grid; place-items: center; padding: 0; cursor: pointer;
  border: 1px solid var(--line); border-radius: 4px; background: transparent; color: var(--ink);
}
.theme-toggle:hover { border-color: var(--gold); }
.theme-toggle svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
[data-theme="light"] .theme-toggle .i-sun, :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
.bar .btn { min-height: 34px; padding: 8px 14px; font-size: 12.5px; }

.foot {
  position: relative; z-index: 3; display: flex; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap;
  padding: 16px var(--pad-x); background: var(--bar); border-top: 1px solid var(--line);
  font: 11.5px/1.4 var(--sans); color: var(--soft);
}

/* ------------------------------------------------------------------ the night sky */
.cosmos {
  position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background:
    radial-gradient(58% 55% at 80% 60%, var(--glow-a), transparent 70%),
    radial-gradient(42% 38% at 94% 98%, var(--glow-b), transparent 72%),
    radial-gradient(48% 50% at 40% 50%, var(--glow-c), transparent 72%),
    var(--bg);
}
.cosmos::before, .cosmos::after {
  content: ""; position: absolute; inset: 0;
  background: url(/admin/assets/stars.svg) center / cover no-repeat; opacity: var(--stars);
}
.cosmos::after { background-size: 140% auto; background-position: 30% 70%; opacity: calc(var(--stars) * .55); }
.cosmos.quiet::before { opacity: calc(var(--stars) * .55); }
.cosmos.quiet::after { opacity: calc(var(--stars) * .3); }
.swirl { position: absolute; right: -14vw; bottom: -30vh; width: max(70vw, 760px); height: auto; }
.swirl .arc { fill: none; stroke: var(--swirl); stroke-width: 1; }
.swirl .arc.warm { stroke: var(--swirl-warm); }
.swirl .arc.thick { stroke-width: 1.6; }

/* ------------------------------------------------------------------ sign-in, setup and recovery layout */
.stage {
  position: relative; flex: 1; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); align-items: center;
  gap: clamp(24px, 4vw, 72px); padding: clamp(28px, 6vh, 72px) var(--pad-x);
}
.mark { display: grid; justify-items: center; align-content: center; text-align: center; min-height: min(64vh, 580px); }
.mark-core { position: relative; display: grid; place-items: center; }
.orbits { position: absolute; left: 50%; top: 50%; width: min(56vw, 640px); height: auto; transform: translate(-50%, -50%); overflow: visible; }
.orbits .orbit { transform-box: view-box; transform-origin: 50% 50%; animation: orbit 150s linear infinite; }
.orbits .o2 { animation-duration: 210s; animation-direction: reverse; }
.orbits .o3 { animation-duration: 120s; }
.orbits .o4 { animation-duration: 260s; animation-direction: reverse; }
.orbits .o5 { animation-duration: 180s; }
.orbits ellipse, .orbits .ring { fill: none; stroke-width: 1; }
.orbits .planet { stroke: none; }
.orbits .p-gold { fill: var(--orbit-gold); }
.orbits .p-teal { fill: var(--orbit-teal); }
.orbits .p-slate { fill: var(--orbit-slate); }
.g-gold stop { stop-color: var(--orbit-gold); }
.g-teal stop { stop-color: var(--orbit-teal); }
.g-slate stop { stop-color: var(--orbit-slate); }
.orbits .s0 { stop-opacity: 0; }
.orbits .s1 { stop-opacity: .95; }
.orbits .s2 { stop-opacity: .45; }
@keyframes orbit { to { transform: rotate(360deg); } }

.monogram { position: relative; margin: 0; font: italic 400 clamp(104px, 11vw, 176px)/.9 var(--serif); color: var(--monogram); letter-spacing: -.02em; padding: 0 .08em; }
.monogram span { color: var(--monogram-dot); font-style: normal; font-size: .58em; margin-left: .04em; }
.mark-name { margin: clamp(64px, 11vh, 120px) 0 6px; font: 600 11px/1.3 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--ink); }
.mark-sub { margin: 0; font: italic 400 20px/1.3 var(--serif); color: var(--soft); }

.dock { position: relative; width: 100%; max-width: 420px; justify-self: end; }

/* ------------------------------------------------------------------ cards and forms */
.card {
  position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 6px;
  padding: 30px 30px 26px; box-shadow: var(--shadow);
}
.card::before {
  content: ""; position: absolute; left: 12px; right: 12px; top: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold) 28%, var(--orbit-teal) 72%, transparent);
}
.seal { width: 34px; height: 34px; border: 1px solid var(--gold); border-radius: 50%; display: grid; place-items: center; color: var(--gold); margin: 0 0 18px; }
.seal svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.label { color: var(--gold); font: 600 10.5px/1.3 var(--sans); letter-spacing: .18em; text-transform: uppercase; margin: 0 0 10px; }
h1 { font: 400 clamp(32px, 4.2vw, 40px)/1.06 var(--serif); margin: 0 0 8px; letter-spacing: -.005em; text-wrap: balance; }
h2 { font: 400 25px/1.2 var(--serif); margin: 0 0 6px; }
.lead { color: var(--soft); font-size: 13.5px; margin: 0 0 22px; }
.hint { font-size: 12.5px; color: var(--soft); margin: 7px 0 0; }

.field { margin: 0 0 16px; }
label { display: block; font: 500 12.5px/1.3 var(--sans); color: var(--soft); margin: 0 0 7px; }
input, textarea {
  width: 100%; min-height: 46px; background: var(--field); color: var(--ink); border: 1px solid var(--line);
  border-radius: 3px; padding: 11px 13px; font: 15px var(--sans);
}
input:hover { border-color: color-mix(in srgb, var(--line) 60%, var(--gold)); }
input:focus-visible { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 24%, transparent); }
.code-input { letter-spacing: .3em; font: 600 21px/1 var(--mono-font); text-align: center; }

.reveal { position: relative; }
.reveal input { padding-right: 46px; }
.reveal-btn {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px;
  display: grid; place-items: center; border: 0; border-radius: 3px; background: transparent; color: var(--soft); cursor: pointer; padding: 0;
}
.reveal-btn:hover, .reveal-btn.on { color: var(--ink); }
.reveal-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 12px 18px; border-radius: 3px; border: 1px solid var(--line);
  background: transparent; color: var(--ink); font: 600 14px/1 var(--sans); text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: var(--gold); }
.btn.primary { background: var(--btn); border-color: var(--btn); color: var(--btn-ink); }
.btn.primary:hover { background: var(--btn-hover); border-color: var(--btn-hover); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.btn.danger:hover { border-color: var(--danger); }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .65; cursor: progress; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.error { color: var(--danger); font-size: 13.5px; margin: 12px 0 0; min-height: 1.3em; }
.error:empty { min-height: 0; margin: 0; }
.notice { border: 1px solid var(--line); background: var(--field); padding: 12px 14px; border-radius: 3px; color: var(--soft); font-size: 13.5px; margin: 0 0 18px; }
.notice strong { color: var(--ink); }
.divider { border: 0; border-top: 1px solid var(--line); margin: 26px 0; }

.captcha { min-height: 65px; margin: 4px 0 18px; }
.steps { display: flex; gap: 6px; margin: 0 0 22px; }
.steps span { flex: 1; height: 3px; border-radius: 2px; background: var(--line); }
.steps span.on { background: var(--gold); }

.qr { background: #fff; padding: 10px; border-radius: 6px; width: 220px; max-width: 100%; margin: 0 auto 16px; border: 1px solid var(--line); }
.qr svg { display: block; width: 100%; height: auto; }
.secret { font: 600 15px/1.7 var(--mono-font); letter-spacing: .08em; overflow-wrap: anywhere; word-spacing: .2em; background: var(--field); border: 1px dashed var(--line); padding: 12px; border-radius: 3px; margin: 8px 0 0; color: var(--ink); }
details { margin: 0 0 18px; color: var(--soft); }
summary { cursor: pointer; color: var(--ink); padding: 6px 0; font-size: 14px; }
.center-row { justify-content: center; margin: 0 0 16px; }

.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; list-style: none; padding: 0; margin: 0 0 16px; font: 600 16px/1 var(--mono-font); }
.codes li { background: var(--field); border: 1px solid var(--line); border-radius: 3px; padding: 13px 8px; text-align: center; color: var(--ink); }

.checklist { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; }
.checklist li { background: var(--field); border: 1px solid var(--line); border-radius: 4px; padding: 14px; }
.checklist .name { font: 600 13.5px/1.4 var(--mono-font); color: var(--ink); margin: 0; overflow-wrap: anywhere; }
.checklist .kind { font: 600 10.5px/1 var(--sans); color: var(--gold); letter-spacing: .14em; text-transform: uppercase; margin-left: 10px; }
.checklist p { margin: 6px 0 0; font-size: 13.5px; color: var(--soft); }
.checklist .value { display: flex; gap: 8px; margin-top: 10px; align-items: stretch; }
.checklist + .hint { margin: 0 0 18px; }
.checklist code { flex: 1; min-width: 0; font: 600 13px/1.5 var(--mono-font); color: var(--ink); background: var(--card); border: 1px dashed var(--line); border-radius: 3px; padding: 10px; overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ inbox */
.desk { position: relative; flex: 1; isolation: isolate; overflow: hidden; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--pad-x); }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 40px 0 0; }
.page-head h1 { font-size: clamp(38px, 5vw, 52px); }
.page-head .lead { margin: 0; }
.desk > .wrap > .notice { margin-top: 20px; }
.inbox {
  position: relative; display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); min-height: 60vh;
  border: 1px solid var(--line); border-radius: 6px; background: var(--card); box-shadow: var(--shadow); margin: 24px 0 56px;
}
.inbox::before {
  content: ""; position: absolute; left: 12px; right: 12px; top: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold) 28%, var(--orbit-teal) 72%, transparent);
}
.list { border-right: 1px solid var(--line); overflow: auto; max-height: 75vh; }
.item {
  display: grid; gap: 4px; width: 100%; text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--line-soft);
  color: var(--ink); padding: 16px 18px; cursor: pointer; font: inherit;
}
.item:hover { background: var(--hover); }
.item[aria-current="true"] { background: var(--active); box-shadow: inset 2px 0 0 var(--gold); }
.item .who { display: flex; align-items: baseline; gap: 8px; font-weight: 600; min-width: 0; }
.item .who .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .who time { margin-left: auto; color: var(--soft); font-weight: 400; font-size: 12.5px; white-space: nowrap; }
.item .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); flex: none; align-self: center; }
.item:not(.unread) .dot { visibility: hidden; }
.item:not(.unread) .who { font-weight: 500; }
.item .topic { color: var(--gold); font-size: 12.5px; }
.item .preview { color: var(--soft); font-size: 13.5px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.more { padding: 14px 18px; }
.detail { padding: 30px; overflow: auto; max-height: 75vh; min-width: 0; }
.detail h2 { font-size: 30px; }
.detail .meta { color: var(--soft); font-size: 13.5px; display: grid; gap: 2px; }
.detail .meta a { overflow-wrap: anywhere; }
.detail .body { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--field); border: 1px solid var(--line); border-radius: 4px; padding: 18px; margin: 18px 0; line-height: 1.6; }
.empty { padding: 40px 28px; color: var(--soft); }
.back { display: none; margin: 0 0 16px; }

/* ------------------------------------------------------------------ smaller screens */
@media (max-width: 980px) {
  .stage { grid-template-columns: minmax(0, 1fr); align-content: start; gap: 8px; padding-top: 18px; }
  .mark { min-height: 0; padding: 26px 0 10px; }
  .orbits { width: min(118vw, 520px); }
  .monogram { font-size: clamp(78px, 20vw, 120px); }
  .mark-name { margin-top: clamp(40px, 9vw, 64px); }
  .mark-sub { font-size: 17px; }
  .dock { justify-self: center; max-width: 480px; }
}
@media (max-width: 760px) {
  .inbox { grid-template-columns: minmax(0, 1fr); }
  .list { border-right: 0; max-height: none; }
  .inbox.show-detail .list { display: none; }
  .inbox:not(.show-detail) .detail { display: none; }
  .detail { max-height: none; padding: 22px; }
  .back { display: inline-flex; }
  .page-head { margin-top: 28px; }
}
@media (max-width: 480px) {
  .card { padding: 24px 20px 22px; }
  .bar { gap: 8px; }
  .bar-end { gap: 4px 10px; }
  .mark { padding-top: 14px; }
  .mark-name { letter-spacing: .16em; }
}

@media (prefers-reduced-motion: no-preference) {
  .card, .inbox { animation: rise .45s ease-out both; }
  .monogram { animation: glow 1.4s ease-out both; }
  @keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
  @keyframes glow { from { opacity: 0; letter-spacing: .04em; } to { opacity: 1; letter-spacing: -.02em; } }
}
@media (prefers-reduced-motion: reduce) {
  .orbits .orbit { animation: none; }
}
