/* ===== Imans.biz office — base layout, tokens, sidebar, shared controls ===== */
:root {
  color-scheme: dark;
  --bg: #060818;
  --bg-2: #0a0e24;
  --panel: #0f1431;
  --panel-2: #151b3f;
  --panel-3: #1c2350;
  --line: #2b2f66;
  --line-2: #3d3a80;
  --violet: #8d4df4;
  --violet-2: #b98aff;
  --violet-3: #e2ceff;
  --cyan: #4fd1ff;
  --pink: #ff5fb7;
  --ok: #3ddc97;
  --warn: #ffb547;
  --danger: #ff6b8a;
  --text: #f4f2ff;
  --muted: #a9a5cc;
  --muted-2: #7f7aa8;
  --radius: 14px;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --display: "Sora", "Manrope", system-ui, sans-serif;
  --sidebar-w: 96px;
  --topbar-h: 58px;
  --focus: 0 0 0 3px #0a0e24, 0 0 0 5px #d8b8ff;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: radial-gradient(1200px 700px at 60% 20%, #14103a 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 8px; }
a { color: var(--violet-2); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; background: #1a1f47; padding: 1px 5px; border-radius: 5px; }

.skip-link { position: absolute; left: -999px; top: 8px; z-index: 1000; background: var(--violet); color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { left: 8px; }

/* ---------- sidebar (separate from the office art; real controls) ---------- */
.sidebar {
  width: var(--sidebar-w); flex: none; position: sticky; top: 0; height: 100vh;
  background: linear-gradient(180deg, #0b1029 0%, #080b1e 100%);
  border-right: 1px solid #2a2460;
  display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 14px 10px;
  z-index: 20;
}
.brand { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0 18px; font: 700 13px var(--display); letter-spacing: .2px; }
.brand svg { width: 38px; height: 27px; filter: drop-shadow(0 0 8px #8d4df488); }
.brand b { color: var(--violet-2); font-weight: 700; }
.nav { display: flex; flex-direction: column; gap: 6px; }
.nav button {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  background: transparent; border: 1px solid transparent; border-radius: 14px;
  color: #ddd6ff; padding: 11px 4px 9px; font-size: 11.5px; font-weight: 600; min-height: 60px;
  transition: background .18s, border-color .18s, color .18s;
}
.nav button svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav button:hover { background: #1b1647; border-color: #3f2f86; }
.nav button[aria-current="page"] { background: linear-gradient(180deg, #4a2496, #2c176a); border-color: #9a63ff; color: #fff; box-shadow: 0 0 18px #7b3cff55, inset 0 0 12px #b98aff33; }
.sidebar-foot { margin: auto 0 0; font-size: 10.5px; color: var(--muted); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.sidebar-foot .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 8px var(--warn); }

/* ---------- app frame ---------- */
.app { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  height: var(--topbar-h); display: flex; align-items: center; gap: 16px; padding: 0 20px;
  border-bottom: 1px solid #251f58; background: #090d22cc; backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 15;
}
.topbar h1 { margin: 0; font: 700 20px var(--display); white-space: nowrap; }
.topbar h1 .t2 { font: 500 14px var(--font); color: var(--muted); margin-left: 6px; }
.mode-pill { margin: 0; font-size: 12px; color: #ffd9a1; background: #2a1f12; border: 1px solid #6e4b1d; padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.mode-pill span { color: var(--warn); }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; }
main { flex: 1; display: flex; flex-direction: column; padding: 14px 16px 6px; gap: 14px; min-height: 0; }
.footer { text-align: center; color: var(--muted-2); font-size: 11.5px; padding: 6px 16px 12px; }

/* ---------- buttons ---------- */
.btn-primary, .btn-ghost, .btn-back, .btn-icon, .btn-soft {
  border-radius: 10px; border: 1px solid transparent; font-weight: 700; font-size: 13.5px;
  padding: 9px 14px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px;
  transition: background .15s, border-color .15s, transform .1s, box-shadow .15s;
}
.btn-primary { background: linear-gradient(180deg, #9c5cff, #7536e6); color: #fff; box-shadow: 0 4px 18px #7b3cff55; }
.btn-primary:hover { background: linear-gradient(180deg, #a96fff, #8243f0); }
.btn-primary:active, .btn-ghost:active, .btn-soft:active { transform: translateY(1px); }
.btn-primary[disabled] { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn-ghost { background: #16183d; border-color: #3c3584; color: #ece6ff; }
.btn-ghost:hover { background: #211d55; border-color: #7a55e0; }
.btn-ghost[aria-pressed="false"] { color: var(--muted); }
.btn-soft { background: #1d2354; border-color: #2f3779; color: #dcd6ff; }
.btn-soft:hover { border-color: #6a55d8; }
.btn-sm { min-height: 34px; padding: 6px 11px; font-size: 12.5px; }
.btn-icon { width: 40px; padding: 0; background: #1b1c48; border-color: #3a3486; color: #fff; }
.btn-icon:hover { background: #2a2468; }
.btn-back { background: transparent; border-color: #4a3f99; color: #e9e2ff; }
.btn-back:hover { background: #1f1a50; }

.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: #1a1844; border: 1px solid #7a55e0; color: #fff; padding: 10px 16px; border-radius: 12px;
  font-size: 13.5px; box-shadow: 0 10px 40px #0008; transition: opacity .2s, transform .2s; z-index: 2000; max-width: min(92vw, 520px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.visually-hidden, .visually-hidden-desktop { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- dialogs (shared) ---------- */
dialog { color: var(--text); padding: 0; border: none; background: transparent; max-width: none; max-height: none; }
dialog::backdrop { background: #03040fcc; backdrop-filter: blur(5px); }
.eyebrow { font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--violet-2); margin: 0 0 6px; font-weight: 700; }

.settings[open], .approval[open] {
  width: min(520px, calc(100vw - 24px)); background: var(--panel); border: 1px solid #5a40b8; border-radius: 18px;
  box-shadow: 0 0 80px #6b31ff44, 0 30px 80px #000a; padding: 22px 22px 18px; max-height: calc(100vh - 32px); overflow: auto;
}
.settings-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.settings-head h2, .approval h2 { margin: 0; font: 600 21px var(--display); }
fieldset { border: 1px solid var(--line); border-radius: 12px; margin: 12px 0 0; padding: 10px 14px 12px; }
legend { padding: 0 6px; color: var(--violet-2); font-size: 12px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; }
.radio, .switch, .check { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 14px; cursor: pointer; }
.radio small { color: var(--muted); }
.switch input, .check input, .radio input { width: 18px; height: 18px; accent-color: var(--violet); flex: none; }
.hint-text { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }

/* ---------- responsive frame ---------- */
@media (max-width: 1100px) { .topbar h1 .t2 { display: none; } }
@media (max-width: 860px) { .mode-pill { display: none; } }
@media (max-width: 760px) {
  body { display: block; }
  .sidebar {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; width: 100%; height: auto;
    flex-direction: row; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid #2a2460;
    background: #0a0d23f2; backdrop-filter: blur(10px);
  }
  .brand, .sidebar-foot { display: none; }
  .nav { flex-direction: row; width: 100%; justify-content: space-between; gap: 2px; }
  .nav button { flex: 1; min-height: 52px; padding: 7px 2px 5px; font-size: 10px; gap: 3px; min-width: 0; }
  .nav button svg { width: 21px; height: 21px; }
  .app { min-height: 100vh; padding-bottom: 70px; }
  .topbar { padding: 0 12px; gap: 10px; }
  .topbar h1 { font-size: 17px; }
  #btn-tour { display: none; }
  .topbar .btn-ghost { min-height: 44px; }
  main { padding: 10px max(16px, env(safe-area-inset-right, 0px)) 4px max(16px, env(safe-area-inset-left, 0px)); }
}
@media (prefers-reduced-motion: reduce) {
  .toast, .nav button, .btn-primary, .btn-ghost { transition: none; }
}
