/* Nava server pages (login, admin, notices): the same graphite glass look as the app (public/index.html) */
@font-face { font-family: Vazirmatn; src: url("/fonts/Vazirmatn.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
:root, :root[data-theme="dark"] {
  --page: #0b0b0d; --glow: rgba(120, 120, 132, 0.22); --glow2: rgba(70, 70, 82, 0.20);
  --card: linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.028));
  --card-line: rgba(255, 255, 255, 0.085); --card-hi: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  --shadow: 0 24px 50px rgba(0, 0, 0, 0.45);
  --text: #f4f4f6; --muted: #8e8e97; --faint: rgba(255, 255, 255, 0.06); --sep: rgba(255, 255, 255, 0.07);
  --well: #09090b; --well-shadow: inset 0 2px 9px rgba(0, 0, 0, 0.7), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  --ink: #f4f4f6; --ink-text: #0b0b0d;
  --pop: rgba(26, 26, 30, 0.92); --pop-line: rgba(255, 255, 255, 0.1);
  --ok: #63e08f; --bad: #ff7d72; --wait: #f3c35e;
  --grain: 0.05;
}
:root[data-theme="light"] {
  --page: #e6e6e9; --glow: rgba(255, 255, 255, 0.95); --glow2: rgba(205, 205, 214, 0.6);
  --card: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.58));
  --card-line: rgba(0, 0, 0, 0.06); --card-hi: inset 0 1px 0 rgba(255, 255, 255, 0.95);
  --shadow: 0 20px 44px rgba(20, 20, 30, 0.10);
  --text: #141416; --muted: #6f6f78; --faint: rgba(0, 0, 0, 0.05); --sep: rgba(0, 0, 0, 0.07);
  --well: #ececef; --well-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.09), inset 0 0 0 1px rgba(0, 0, 0, 0.05);
  --ink: #141416; --ink-text: #ffffff;
  --pop: rgba(255, 255, 255, 0.94); --pop-line: rgba(0, 0, 0, 0.08);
  --ok: #18994b; --bad: #d23a2f; --wait: #a86f00;
  --grain: 0.06;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--page); color: var(--text); font: 14.5px/1.7 Vazirmatn, Tahoma, sans-serif; overflow: hidden; }
button, input, textarea { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
bdi { unicode-bidi: isolate; }

.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background: radial-gradient(1200px 520px at 50% -8%, var(--glow), transparent 70%),
              radial-gradient(900px 600px at 100% 110%, var(--glow2), transparent 70%),
              radial-gradient(700px 500px at -5% 60%, var(--glow2), transparent 70%); }
.backdrop::after { content: ""; position: absolute; inset: 0; opacity: var(--grain);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

.card { background: var(--card); border: 1px solid var(--card-line); box-shadow: var(--card-hi), var(--shadow); border-radius: 26px;
  -webkit-backdrop-filter: blur(26px) saturate(140%); backdrop-filter: blur(26px) saturate(140%); padding: 16px 18px; min-width: 0; min-height: 0; }
.muted { color: var(--muted); } .small { font-size: 12.5px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--card-line); background: var(--faint);
  padding: 8px 16px; border-radius: 999px; cursor: pointer; font-weight: 700; font-size: 13.5px; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--sep); }
.btn.primary { background: var(--ink); color: var(--ink-text); border-color: transparent; }
.btn.primary:hover { filter: brightness(.92); }
.btn.danger { color: var(--bad); }
.btn.wide { width: 100%; padding: 11px 16px; }
.btn.sm { padding: 5px 12px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: wait; }
.well-input { width: 100%; min-width: 0; padding: 10px 16px; border-radius: 999px; border: 0; outline: 0; background: var(--well); box-shadow: var(--well-shadow); }
.well-input:focus { box-shadow: var(--well-shadow), 0 0 0 2px var(--card-line); }
.well-input::placeholder { color: var(--muted); }
textarea.well-input { border-radius: 18px; resize: none; }
.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--well); box-shadow: var(--well-shadow); flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 5px 13px; border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 700; color: var(--muted); }
.seg button.on { background: var(--ink); color: var(--ink-text); }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; font-weight: 700; font-size: 13px;
  background: var(--well); box-shadow: var(--well-shadow); white-space: nowrap; }
.pill.ok { color: var(--ok); } .pill.wait { color: var(--wait); } .pill.bad { color: var(--bad); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; flex: none; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 1px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--faint); white-space: nowrap; }
.chip.ok { color: var(--ok); } .chip.bad { color: var(--bad); } .chip.wait { color: var(--wait); }
.round { position: relative; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--card-line); background: var(--faint); cursor: pointer;
  display: grid; place-items: center; flex: none; }
.round:hover { background: var(--sep); }
.msg { min-height: 1.6em; font-weight: 700; font-size: 13px; margin-top: 8px; }
.msg.ok { color: var(--ok); } .msg.bad { color: var(--bad); }
label.lbl { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); margin: 12px 4px 5px; }

/* Centered pages: login, setup, notices */
.center { min-height: 100vh; display: grid; place-items: center; padding: 18px; }
.auth, .notice { width: min(420px, 100%); padding: 30px 30px 22px; border-radius: 32px; text-align: center; }
.auth-logo, .notice-logo { width: 96px; height: 96px; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .45)); }
.auth h1, .notice h1 { margin: 12px 0 2px; font-size: 26px; font-weight: 800; line-height: 1.3; }
.notice h1 { font-size: 21px; }
.auth form { text-align: start; margin-top: 10px; }
.auth .btn.wide { margin-top: 8px; }
.pw { position: relative; }
.pw .well-input { padding-inline-start: 46px; }
.eye { position: absolute; top: 50%; left: 6px; transform: translateY(-50%); width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent;
  color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.eye:hover { background: var(--faint); }
.dl { display: inline-flex; align-items: center; gap: 7px; margin-top: 14px; color: var(--muted); font-size: 13px; font-weight: 700; text-decoration: none; }
.dl:hover { color: var(--text); }
.credit { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--sep); font-size: 12.5px; color: var(--muted); }
.credit b { color: var(--text); font-weight: 800; }
.plan-list { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; text-align: start; }
.plan-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 16px; background: var(--well); box-shadow: var(--well-shadow); }
.plan-row b { flex: 1; font-size: 14px; }
.plan-row span:not(.btn) { font-weight: 800; font-size: 13.5px; }
.actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

/* Sheets */
.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .38);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); animation: fade .15s ease-out; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; border-radius: 30px; padding: 22px 24px; scrollbar-width: none;
  background: var(--pop); border: 1px solid var(--pop-line); box-shadow: var(--card-hi), 0 30px 70px rgba(0, 0, 0, .5);
  -webkit-backdrop-filter: blur(30px) saturate(150%); backdrop-filter: blur(30px) saturate(150%); animation: rise .18s ease-out; }
.sheet::-webkit-scrollbar { display: none; }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.sheet-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.sheet-head h3 { margin: 0; flex: 1; font-size: 18px; font-weight: 800; }
.sheet-head img { width: 40px; height: 40px; }
.x { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--card-line); background: var(--faint); cursor: pointer; font-size: 15px; flex: none; }
.row-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--sep); }
.confirm-actions { display: flex; gap: 8px; justify-content: flex-start; margin-top: 18px; flex-wrap: wrap; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.with-btn { display: flex; gap: 8px; align-items: center; }
.with-btn .well-input { flex: 1; }
.creds { margin-top: 10px; padding: 14px 18px; border-radius: 20px; background: var(--well); box-shadow: var(--well-shadow); }
.creds .kv { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-top: 1px solid var(--sep); }
.creds .kv:first-child { border-top: 0; }
.creds .kv b { font-weight: 800; }
.pop { position: fixed; z-index: 50; padding: 6px; border-radius: 18px; background: var(--pop); border: 1px solid var(--pop-line); min-width: 190px;
  box-shadow: 0 24px 50px rgba(0, 0, 0, .45); -webkit-backdrop-filter: blur(28px) saturate(150%); backdrop-filter: blur(28px) saturate(150%); animation: rise .12s ease-out; }
.pop button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 12px; border: 0; border-radius: 12px; background: transparent; cursor: pointer;
  text-align: start; font-weight: 600; font-size: 13.5px; }
.pop button:hover { background: var(--faint); }
.pop button.danger { color: var(--bad); }
.pop hr { border: 0; border-top: 1px solid var(--sep); margin: 4px 6px; }
pre.log { direction: ltr; text-align: left; margin: 8px 0 0; padding: 12px 14px; border-radius: 16px; background: var(--well); box-shadow: var(--well-shadow);
  font: 11.5px/1.55 Consolas, "Cascadia Mono", monospace; max-height: 52vh; overflow: auto; white-space: pre-wrap; word-break: break-all; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 60; padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: 13.5px;
  background: var(--ink); color: var(--ink-text); box-shadow: 0 14px 30px rgba(0, 0, 0, .35); animation: rise .18s ease-out; }
