/* Acquirely – shared design tokens and components (portal + generator): black & white, liquid glass, Inter Tight. */
@import url("../assets/fonts/fonts.css");
@import url("themes.css");

:root {
  /* ---- Theme tokens. Default theme = Monochrome. Presets override these in shared/themes.css ---- */
  --bg: #000;
  --glass-rgb: 255, 255, 255;           /* tint of glass surfaces, borders and highlights */
  --orb-rgb: 255, 255, 255;             /* soft light behind the glass */
  --accent: #fff; --accent-rgb: 255, 255, 255; --accent-dim: #d6d6d6; --on-accent: #000;
  --ok: #fff; --ok-rgb: 255, 255, 255; --on-ok: #000;
  --warn: #bdbdbd; --warn-rgb: 189, 189, 189;
  --bad: #fff; --bad-rgb: 255, 255, 255;
  --flame: #fff; --on-flame: #000;      /* streak flame / busiest-day marker */
  --series-2: #bdbdbd; --series-3: #8a8a8a;   /* extra chart line colours */
  /* Derived */
  --bg-soft: rgba(0, 0, 0, 0.38);
  --surface: rgba(var(--glass-rgb), 0.06);
  --surface-2: rgba(var(--glass-rgb), 0.09);
  --surface-3: rgba(var(--glass-rgb), 0.15);
  --line: rgba(var(--glass-rgb), 0.11);
  --line-strong: rgba(var(--glass-rgb), 0.2);
  --text: #f6f6f6;
  --text-2: #c6c6c6;
  --muted: #929292;
  --faint: #6a6a6a;
  --accent-2: var(--accent);
  --accent-soft: rgba(var(--accent-rgb), 0.12);
  --accent-line: rgba(var(--accent-rgb), 0.4);
  --ok-soft: rgba(var(--ok-rgb), 0.12);
  --warn-soft: rgba(var(--warn-rgb), 0.1);
  --bad-soft: rgba(var(--bad-rgb), 0.1);
  /* Status is always paired with a pattern or icon so it never relies on colour alone (striped = needs attention). */
  --stripes: repeating-linear-gradient(135deg, rgba(var(--bad-rgb), 0.2) 0 3px, transparent 3px 7px);
  --stripes-warn: repeating-linear-gradient(135deg, rgba(var(--warn-rgb), 0.2) 0 3px, transparent 3px 7px);
  /* Liquid glass */
  --glass: linear-gradient(155deg, rgba(var(--glass-rgb), 0.115), rgba(var(--glass-rgb), 0.04) 55%, rgba(var(--glass-rgb), 0.065));
  --panel-rgb: 60, 60, 60; --panel-deep-rgb: 24, 24, 24;   /* pop-ups, menus, toasts */
  --glass-strong: linear-gradient(155deg, rgba(var(--panel-rgb), 0.66), rgba(var(--panel-deep-rgb), 0.6));
  --glass-blur: blur(26px) saturate(170%);
  --glass-edge: inset 1px 1px 0 rgba(var(--glass-rgb), 0.26), inset -1px -1px 0 rgba(var(--glass-rgb), 0.06), inset 0 0 22px rgba(var(--glass-rgb), 0.035);
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  --font-display: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); position: relative;
  font: 400 15px/1.55 var(--font-body); -webkit-font-smoothing: antialiased; letter-spacing: -0.003em;
}
/* Fixed, soft light behind everything: gives the glass something to refract. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(52vmax 38vmax at 12% -8%, rgba(var(--orb-rgb), 0.24), transparent 62%),
    radial-gradient(44vmax 36vmax at 104% 28%, rgba(var(--orb-rgb), 0.15), transparent 62%),
    radial-gradient(56vmax 40vmax at 28% 112%, rgba(var(--orb-rgb), 0.17), transparent 62%),
    var(--bg);
}
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; letter-spacing: -0.024em; line-height: 1.2; font-weight: 650; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; } h4 { font-size: 0.9rem; }
p { margin: 0; }
a { color: var(--text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
p a, li a, .notice a, .hint a, .small a { text-decoration: underline; text-decoration-color: rgba(var(--glass-rgb), 0.35); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.ic { flex: none; vertical-align: -0.2em; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 0.82rem; } .tiny { font-size: 0.75rem; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 99px; border: 1px solid var(--line-strong);
  background: var(--glass); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-edge); color: var(--text); font-weight: 600; font-size: 0.9rem; cursor: pointer;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.18s var(--ease), box-shadow 0.18s var(--ease); white-space: nowrap; text-decoration: none;
}
.btn:hover { background: linear-gradient(155deg, rgba(var(--glass-rgb), 0.2), rgba(var(--glass-rgb), 0.08)); border-color: rgba(var(--glass-rgb), 0.4); text-decoration: none; }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn.primary { background: linear-gradient(180deg, var(--accent), var(--accent-dim)); border-color: rgba(var(--accent-rgb), 0.9); color: var(--on-accent); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 6px 22px rgba(var(--accent-rgb), 0.22); }
.btn.primary:hover { filter: brightness(1.07); background: linear-gradient(180deg, var(--accent), var(--accent-dim)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 8px 30px rgba(var(--accent-rgb), 0.34); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.btn.danger { color: var(--text); border: 1px dashed rgba(var(--bad-rgb), 0.5); background: transparent; box-shadow: none; }
.btn.danger:hover { background: var(--stripes), var(--bad-soft); }
.btn.sm { height: 32px; padding: 0 13px; font-size: 0.82rem; gap: 6px; }
.btn.lg { height: 48px; padding: 0 26px; font-size: 0.96rem; }
.btn.block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: 0.45; pointer-events: none; }
.icon-btn { width: 38px; height: 38px; padding: 0; }
.btn.sm.icon-btn { width: 32px; height: 32px; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 0.78rem; font-weight: 600; color: var(--text-2); letter-spacing: 0.01em; }
.field .hint { font-size: 0.76rem; color: var(--muted); }
.field .err { font-size: 0.78rem; color: var(--bad); min-height: 0; }
.input, .select, .textarea {
  width: 100%; background: var(--bg-soft); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 0 14px; height: 42px; outline: none; transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.45), 0 1px 0 rgba(var(--glass-rgb), 0.06); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.textarea { height: auto; padding: 11px 14px; resize: vertical; min-height: 84px; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .select:focus, .textarea:focus { border-color: rgba(var(--accent-rgb), 0.75); box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.45), 0 0 0 4px rgba(var(--accent-rgb), 0.13); }
.field.invalid .input, .field.invalid .select, .field.invalid .textarea { border: 1px dashed var(--bad); }
.select { appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a8a8a8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
.select option { background: #161616; color: #f6f6f6; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
input[type="range"] { accent-color: var(--accent); width: 100%; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 16px; height: 16px; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; width: 100%; height: 100%; z-index: 1; }
.switch span { position: absolute; inset: 0; background: rgba(var(--glass-rgb), 0.14); border: 1px solid var(--line-strong); box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4); border-radius: 99px; transition: background 0.2s; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5); transition: transform 0.2s var(--ease), background 0.2s; }
.switch input:checked + span { background: var(--accent); border-color: var(--accent); }
.switch input:checked + span::after { background: var(--on-accent); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- surfaces ---------- */
.card {
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); box-shadow: var(--glass-edge), 0 14px 40px rgba(0, 0, 0, 0.4);
}
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2, .card-head h3 { display: flex; align-items: center; gap: 8px; }
.divider { height: 1px; background: var(--line); margin: 16px 0; border: 0; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 23px; padding: 0 10px; border-radius: 99px; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.01em; background: var(--surface-3); color: var(--text-2); white-space: nowrap; box-shadow: inset 0 1px 0 rgba(var(--glass-rgb), 0.14); }
.badge.accent { background: rgba(var(--accent-rgb), 0.92); color: var(--on-accent); box-shadow: none; }
.badge.ok { background: rgba(var(--ok-rgb), 0.18); color: var(--ok); border: 1px solid rgba(var(--ok-rgb), 0.5); }
.badge.warn { background: transparent; color: var(--warn); border: 1px solid rgba(var(--warn-rgb), 0.3); box-shadow: none; }
.badge.bad { background: var(--stripes), rgba(var(--bad-rgb), 0.07); color: var(--bad); border: 1px dashed rgba(var(--bad-rgb), 0.6); box-shadow: none; }
.badge.outline { background: transparent; border: 1px solid var(--line-strong); box-shadow: none; }
.pri { display: inline-flex; align-items: center; gap: 6px; font-size: 0.76rem; font-weight: 600; color: var(--text-2); }
.pri::before { content: ""; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--faint); box-sizing: border-box; }
.pri.high::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.55); }
.pri.medium::before { background: linear-gradient(90deg, #cfcfcf 50%, transparent 50%); border-color: #cfcfcf; }
.pri.low::before { background: transparent; border-color: #8a8a8a; }

/* ---------- progress ---------- */
.bar { height: 8px; background: rgba(var(--glass-rgb), 0.1); border-radius: 99px; overflow: hidden; box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5); }
.bar > i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.55), var(--accent)); box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.45); transition: width 0.9s var(--ease); }
.bar.thin { height: 5px; }
.bar.ok > i { background: var(--ok); }

/* ---------- notices / empty states ---------- */
.notice { display: flex; gap: 12px; padding: 13px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--glass); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); box-shadow: var(--glass-edge); font-size: 0.86rem; color: var(--text-2); align-items: flex-start; }
.notice > .ic { margin-top: 2px; color: var(--accent); }
.notice.warn { border-left: 3px solid var(--warn); } .notice.warn > .ic { color: var(--warn); }
.notice.bad { background: var(--stripes), var(--glass); border-style: dashed; border-color: rgba(var(--bad-rgb), 0.5); }
.notice.ok { border-left: 3px solid var(--ok); }
.notice strong { color: var(--text); }
.empty { text-align: center; padding: 44px 20px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .ic-wrap { width: 56px; height: 56px; border-radius: 18px; background: var(--glass); box-shadow: var(--glass-edge); border: 1px solid var(--line); display: grid; place-items: center; color: var(--accent); }
.empty h3 { color: var(--text); } .empty p { max-width: 420px; }

/* ---------- modal ---------- */
.modal-root { position: fixed; inset: 0; z-index: 100; display: none; }
.modal-root.open { display: block; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(8px) saturate(120%); -webkit-backdrop-filter: blur(8px) saturate(120%); animation: fade 0.18s var(--ease); }
.modal { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(640px, calc(100vw - 28px)); max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--glass-strong); backdrop-filter: blur(44px) saturate(180%); -webkit-backdrop-filter: blur(44px) saturate(180%); border: 1px solid var(--line-strong); border-radius: 26px; box-shadow: var(--glass-edge), var(--shadow); animation: pop 0.22s var(--ease); }
.modal.wide { width: min(860px, calc(100vw - 28px)); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 12px; }
.modal-body { padding: 4px 22px 20px; overflow: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -47%) scale(0.98); } }

/* ---------- toast ---------- */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 16px; background: var(--glass-strong); backdrop-filter: blur(30px) saturate(170%); -webkit-backdrop-filter: blur(30px) saturate(170%); border: 1px solid var(--line-strong); box-shadow: var(--glass-edge), var(--shadow); font-size: 0.86rem; max-width: min(380px, calc(100vw - 36px)); animation: toast-in 0.25s var(--ease); }
.toast .ic { color: var(--accent); } .toast.bad { border-style: dashed; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- misc ---------- */
.kbd, code.inline { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8em; background: var(--surface-3); padding: 1px 6px; border-radius: 5px; }
.code-box { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.78rem; line-height: 1.6; word-break: break-all; background: var(--bg-soft); border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); padding: 12px 14px; color: var(--accent); user-select: all; max-height: 160px; overflow: auto; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--accent); animation: spin 0.8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: rgba(var(--glass-rgb), 0.2); border-radius: 10px; border: 2px solid #000; } ::-webkit-scrollbar-track { background: transparent; }
