/* Arbidol dashboard — reset + component library.
   Hexes copied 1:1 from web/design/Arbidol.dc.html + SPEC §1.
   style-hover attributes from the mock are translated to :hover rules here.

   There is no custom-property layer. SPEC §1.1 declared one and nothing ever called
   var() on it — every screen writes the hex inline, so the tokens were a second
   palette that could drift from the real one without anything going red. */

/* ---- Reset + base (mirrors mock <style>) ---- */
* { box-sizing: border-box; }
body {
  margin: 0;
  background: #0d1015;
  color: #e6ecf3;
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: #6fb5e8; text-decoration: none; }
a:hover { color: #9ccdf0; text-decoration: underline; }
input, select, button, textarea { font-family: inherit; }
::placeholder { color: #546073; }

/* ---- Keyframes ---- */
@keyframes ar-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes ar-spin { to { transform: rotate(360deg); } }

/* Shorthand mono helper used across screens */
.mono { font-family: 'IBM Plex Mono', monospace; }

/* ================================================================
   HOVER rules (translated from the mock's style-hover attributes)
   ================================================================ */

/* Sidebar nav items (inactive get bg on hover) */
.ar-nav-item:hover { background: #1a212c; }
/* Lock session */
.ar-logout:hover { color: #e6ecf3; }

/* Overview total-capital bars */
.ar-capbar:hover { background: #4a76ad; }

/* Ghost buttons */
.ar-ghost:hover { color: #e6ecf3; border-color: #3b4a61; }
/* Ghost button, destructive (row Cancel etc.) */
.ar-ghost-danger:hover { border-color: #6d3230; color: #f0918d; }

/* Account tabs / mode tabs — hover border only when inactive */
.ar-tab:hover { border-color: #3b4a61; }

/* Table rows */
.ar-row:hover { background: #1a212c; }

/* Copy-to-clipboard cells (Accounts) */
.ar-copy:hover { color: #4fb7d8; }

/* Eye toggle / dim links */
.ar-eye:hover { color: #e6ecf3; }
.ar-dimlink:hover { color: #e6ecf3; }

/* ================================================================
   Shared component classes (SPEC §1.5) — exact hexes
   ================================================================ */

/* 1. Table container + rows. (The card is built inline per screen — overview.js's
   CARD and tasks.js's CARD — so there is no .ar-card here.) */
.ar-table-wrap {
  overflow-x: auto;
  border: 1px solid #232d3b;
  border-radius: 10px;
  background: #141922;
}
.ar-th {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: #66788e;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
}

/* 2. State chip — color/bg set inline (STATE_COLOR + '1f') */
.ar-chip {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}

/* 3. Route badge */
.ar-badge {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  font-weight: 600;
  padding: 1.5px 5px;
  border-radius: 3px;
  background: #22304a;
  color: #9fb3d1;
  white-space: nowrap;
}
/* Platform tag variant (account cards / TM tag) — slightly larger pad + tracking */
.ar-badge-tag {
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: .05em;
}

/* 4. Deal progress segments container */
.ar-segs { display: flex; gap: 2px; width: 96px; }
.ar-seg { flex: 1; height: 3px; border-radius: 1px; }

/* 5. Account tabs — active/inactive set inline; hover via .ar-tab */
.ar-tab {
  padding: 6px 12px;
  border-radius: 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  border: 1px solid;
  cursor: pointer;
  background: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 6. Primary button */
.ar-btn {
  background: #2f6fb0;
  border: none;
  border-radius: 6px;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  padding: 9px 16px;
  cursor: pointer;
}
.ar-btn:disabled { opacity: .5; cursor: default; }

/* 7. Ghost button */
.ar-ghost {
  background: none;
  border: 1px solid #2a3547;
  border-radius: 6px;
  color: #8b97a8;
  cursor: pointer;
  font-size: 12px;
  padding: 7px 13px;
}

/* 8. Danger button */
.ar-danger {
  background: #3a1d1e;
  border: 1px solid #6d3230;
  border-radius: 6px;
  color: #f0918d;
  font-weight: 600;
  font-size: 12px;
  padding: 7px 13px;
  cursor: pointer;
}

/* 9. Popover. (Progress bars, stacked bars and modals are all built inline where
   they are used — overview.js, transfers.js, accounts.js — so they have no class here.) */
.ar-pop-catcher { position: fixed; inset: 0; z-index: 90; }
.ar-pop {
  position: fixed;
  z-index: 95;
  background: #171d28;
  border: 1px solid #2a3547;
  border-radius: 10px;
  box-shadow: 0 14px 40px #000b;
  padding: 5px 0;
}

/* 10. Item cell thumbnail (size set inline; gradient via inline style) */
.ar-thumb {
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  color: #e6ecf3cc;
}

/* 11. Health chip (Overview account cards) */
.ar-health {
  display: flex;
  align-items: center;
  gap: 5px;
  background: #0d1015;
  border: 1px solid #1c2430;
  border-radius: 5px;
  padding: 3px 7px;
}
.ar-health-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }

/* Inputs / selects / textarea */
.ar-input, .ar-select, .ar-textarea {
  background: #0d1015;
  border: 1px solid #2a3547;
  border-radius: 6px;
  color: #e6ecf3;
  outline: none;
}
.ar-input { padding: 7px 10px; font-size: 12.5px; }
.ar-select { padding: 6px 8px; font-size: 12.5px; }
.ar-textarea { padding: 8px 10px; font-size: 12px; line-height: 1.6; resize: vertical; }
.ar-input:focus, .ar-select:focus, .ar-textarea:focus { border-color: #3b4a61; }

/* Checkboxes */
.ar-check { accent-color: #2f6fb0; cursor: pointer; margin: 0; }

/* ================================================================
   Toast host (shell-owned)
   ================================================================ */
#ar-toast-host {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}
.ar-toast {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  padding: 9px 14px;
  border-radius: 8px;
  box-shadow: 0 14px 40px #000b;
  max-width: 340px;
  border: 1px solid;
  animation: ar-toast-in .16s ease-out;
}
.ar-toast-ok  { background: #12281c; border-color: #2a5a3c; color: #63d97c; }
.ar-toast-err { background: #2a1718; border-color: #5a2b2a; color: #f0918d; }
@keyframes ar-toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Empty-state quiet text (SPEC note 6) */
.ar-empty {
  color: #546073;
  text-align: center;
  padding: 20px;
  font-size: 12.5px;
}

/* Shell layout */
.ar-app { display: flex; min-height: 100vh; background: #0d1015; }
.ar-sidebar {
  width: 184px;
  flex: none;
  border-right: 1px solid #1c2430;
  padding: 18px 10px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.ar-content {
  flex: 1;
  min-width: 0;
  padding: 22px 26px 60px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* New task / New scheme form (web/static/taskform.js, board TasksChain1) and the Schemes list */
.ar-tf-ctl:hover { border-color: #3b4a61 !important; }
.ar-tf-next:hover { border-color: #6fa8ef !important; background: #172133 !important; }
.ar-tf-mi:hover { background: #1d2635 !important; }
.ar-tf-btn:hover { border-color: #3b4a61 !important; color: #e6ecf3 !important; }
.ar-tf input:focus { border-color: #2f6fb0 !important; }
.ar-tf label:focus-within { border-color: #2f6fb0 !important; }
.ar-sc-pick:hover { border-color: #3b4a61 !important; }

/* Overview (2026-10-23): hover and focus of its controls - the rest of its look is inline. */
.ar-ov-tg[aria-pressed="false"]:hover { color: #c3cedb !important; background: #1a212c !important; }
.ar-ov-st[aria-disabled="false"]:hover { border-color: #3b4a61 !important; color: #e6ecf3 !important; background: #1a212c !important; }
.ar-ov-tg:focus-visible, .ar-ov-st:focus-visible, .ar-ov-lk:focus-visible { outline: 2px solid #6fb5e8; outline-offset: 2px; }
.ar-ov-bl:focus-visible { outline: 2px solid #0d1015; outline-offset: 2px; }
.ar-ov-lk:hover { color: #9ccdf0 !important; }
.ar-ov-go:focus-visible { opacity: 1 !important; }
.ar-ov-sc { scrollbar-width: thin; scrollbar-color: #3b4a61 #1c2430; }
.ar-ov-sc::-webkit-scrollbar { width: 5px; }
.ar-ov-sc::-webkit-scrollbar-track { background: #1c2430; border-radius: 3px; }
.ar-ov-sc::-webkit-scrollbar-thumb { background: #3b4a61; border-radius: 3px; }

/* Tasks (the 2026-10-24 rebuild, board TasksPicked): the route table, the engine dot, page states */
.ar-tk-row[aria-expanded="false"]:hover { background: #1a212c !important; }
.ar-tk-hb:hover, .ar-tk-dot:hover { background: #1a212c !important; }
.ar-tk-btn:hover { border-color: #3b4a61 !important; color: #e6ecf3 !important; }
.ar-tk-lnk:hover { color: #9ccdf0 !important; }
.ar-tk-row:focus-visible, .ar-tk-hb:focus-visible { outline: 2px solid #2f6fb0; outline-offset: -2px; }
.ar-tk-dot:focus-visible, .ar-tk-lnk:focus-visible { outline: 2px solid #2f6fb0; outline-offset: 2px; }
.ar-tk-sk { display: block; height: 8px; border-radius: 4px; background: #232d3b; }
.ar-tk-skd { display: block; width: 6px; height: 6px; border-radius: 50%; background: #232d3b; }
.ar-tk-pulse .ar-tk-sk, .ar-tk-pulse .ar-tk-skd { animation: ar-tk-skp 1.4s ease-in-out infinite; }
@keyframes ar-tk-skp { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

/* Accounts (the 2026-10-24 rebuild, board AccountsPicked): hover and focus of the Steam table */
.ar-ac-row[data-tone="plain"]:hover, .ar-ac-row[data-tone="ticked"]:hover { background: #1a212c !important; }
.ar-ac-row:hover .ar-ac-ci { opacity: 1 !important; }
.ar-ac-cp:hover { color: #4fb7d8 !important; }
.ar-ac-sort:hover { color: #e6ecf3 !important; }
.ar-ac-cb:hover > span { border-color: #6fb5e8 !important; }
.ar-ac-ctl:hover { border-color: #3b4a61 !important; }
.ar-ac-ctl:focus { border-color: #2f6fb0 !important; outline: none; }
.ar-ac-gh:hover { color: #e6ecf3 !important; border-color: #3b4a61 !important; }
.ar-ac-lnk:hover { color: #9ccdf0 !important; }
.ar-ac-sort:focus-visible, .ar-ac-cb:focus-visible, .ar-ac-cp:focus-visible { outline: 2px solid #2f6fb0; outline-offset: 2px; }

/* Transfers (the 2026-10-24 rebuild, canvas «Arbidol · Transfers»): the USDT history's pencil,
   the drawer's small buttons, the dot of a send that waits for Telegram */
.ar-tx-row:hover .ar-tx-ci { opacity: 1 !important; }
.ar-tx-cp:hover { color: #e6ecf3 !important; }
.ar-tx-max:hover { border-color: #3b4a61 !important; color: #e6ecf3 !important; }
.ar-tx-cp:focus-visible, .ar-tx-max:focus-visible { outline: 2px solid #2f6fb0; outline-offset: 2px; }
.ar-tx-pulse { animation: ar-pulse 1.6s ease-in-out infinite; }

/* The account's browser (web/static/browser.js) */
.ar-ac-ib:hover { color: #e6ecf3 !important; border-color: #3b4a61 !important; }
.ar-bw-load { animation: ar-bw-load 1.4s ease-in-out infinite; }
@keyframes ar-bw-load { 0% { margin-left: -38%; } 100% { margin-left: 100%; } }
.ar-bw-spin { animation: ar-bw-spin .8s linear infinite; }
.ar-bw-addr:focus-within { border-color: #2f6fb0 !important; }
@keyframes ar-bw-spin { to { transform: rotate(360deg); } }
