/* FollowHub panel — koyu tema. Renkler ve ölçüler tek yerde (:root). */
:root {
  --bg: #07080c;
  --bg-2: #0a0c12;
  --panel: rgba(16, 19, 27, .78);
  --panel-solid: #10131b;
  --panel-2: #151925;
  --panel-3: #1b2030;
  --line: rgba(255, 255, 255, .06);
  --line-2: rgba(255, 255, 255, .1);
  --line-3: rgba(255, 255, 255, .16);
  --text: #e9ebf2;
  --text-2: #c3c8d6;
  --muted: #8b93a8;
  --faint: #5d6579;
  --accent: #8b5cf6;
  --accent-2: #22d3ee;
  --accent-soft: rgba(139, 92, 246, .14);
  --grad: linear-gradient(135deg, #8b5cf6 0%, #6366f1 48%, #22d3ee 100%);
  --ok: #34d399;
  --info: #60a5fa;
  --warn: #fbbf24;
  --violet: #a78bfa;
  --orange: #fb923c;
  --danger: #f87171;
  --gray: #94a3b8;
  --r: 16px;
  --r-sm: 10px;
  --r-xs: 7px;
  --shadow: 0 18px 50px -24px rgba(0, 0, 0, .8);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; }
/* The hidden attribute must win over the display of any class below. */
[hidden] { display: none !important; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 14px/1.45 var(--sans); -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01";
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(139, 92, 246, .16), transparent 62%),
    radial-gradient(700px 420px at 92% -12%, rgba(34, 211, 238, .10), transparent 60%),
    radial-gradient(600px 600px at 50% 120%, rgba(99, 102, 241, .07), transparent 60%);
}
#app { position: relative; z-index: 1; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(139, 92, 246, .35); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.mono { font-family: var(--mono); font-size: 12.5px; letter-spacing: -.01em; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.sub { color: var(--muted); font-size: 12px; line-height: 1.35; }
.faint { color: var(--faint); }
.ic { width: 16px; height: 16px; flex: none; }
.ic-sm { width: 13px; height: 13px; }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: #2a3042 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #262b3b; border-radius: 10px; border: 2px solid var(--bg); }

/* ---------- boot / login ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; }
.spinner {
  width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .12);
  border-top-color: var(--accent-2); animation: spin .8s linear infinite; display: inline-block;
}
.spinner.sm { width: 14px; height: 14px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(400px, 100%); padding: 34px 30px 26px; border-radius: 22px; background: var(--panel);
  border: 1px solid var(--line-2); box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .04);
  backdrop-filter: blur(20px); animation: rise .5s var(--ease);
}
.login-card .brand { margin-bottom: 26px; }
.login-card .brand-name { font-size: 22px; }
.field {
  display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 14px; border-radius: 14px;
  background: var(--bg-2); border: 1px solid var(--line-2); transition: border-color .2s, box-shadow .2s;
}
.field:focus-within { border-color: rgba(139, 92, 246, .6); box-shadow: 0 0 0 4px rgba(139, 92, 246, .14); }
.field .ic { color: var(--muted); }
.field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding: 10px 0; font-size: 15px; letter-spacing: .02em; }
.login-msg { min-height: 22px; margin-top: 12px; color: var(--danger); font-size: 13px; text-align: center; }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.99); } }

/* ---------- brand ---------- */
.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 34px; height: 34px; border-radius: 10px; flex: none; box-shadow: 0 6px 22px -6px rgba(139, 92, 246, .7); }
.brand-lg .logo { width: 46px; height: 46px; border-radius: 13px; }
.brand-name { font-weight: 700; font-size: 17px; letter-spacing: -.02em; }
.brand-sub { color: var(--muted); font-size: 13px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px;
  border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--panel-2); cursor: pointer;
  font-weight: 550; font-size: 13px; white-space: nowrap; text-decoration: none; transition: background .15s, border-color .15s, transform .1s, opacity .15s;
}
.btn:hover { background: var(--panel-3); border-color: var(--line-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 8px 24px -10px rgba(99, 102, 241, .9); }
.btn-primary:hover { background: var(--grad); filter: brightness(1.1); }
.btn-ghost { background: transparent; }
.btn-danger { background: rgba(248, 113, 113, .12); border-color: rgba(248, 113, 113, .35); color: #fecaca; }
.btn-danger:hover { background: rgba(248, 113, 113, .2); border-color: rgba(248, 113, 113, .5); }
.btn-ok { background: rgba(52, 211, 153, .12); border-color: rgba(52, 211, 153, .35); color: #bbf7d0; }
.btn-ok:hover { background: rgba(52, 211, 153, .2); }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 9px; }
.field .btn { height: 40px; width: 44px; padding: 0; border-radius: 10px; }
.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 11px;
  border: 1px solid var(--line); background: transparent; cursor: pointer; color: var(--text-2); transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--panel-2); color: var(--text); }
.icon-btn .ic { width: 18px; height: 18px; }
.dot-badge {
  position: absolute; top: 5px; right: 5px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg);
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 18px; padding: 12px 24px;
  background: rgba(7, 8, 12, .72); backdrop-filter: blur(18px) saturate(1.4); border-bottom: 1px solid var(--line);
}
.top-status { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.top-status::-webkit-scrollbar { display: none; }
.top-actions { display: flex; gap: 6px; }
.pill {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line); color: var(--text-2); font-size: 12.5px; white-space: nowrap;
}
.pill b { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }
.pill .ic { width: 14px; height: 14px; color: var(--muted); }
.pill-sub { color: var(--muted); }
.pill-err { border-color: rgba(248, 113, 113, .35); color: #fecaca; }
.pill-err .ic { color: var(--danger); }
.pill-warn { border-color: rgba(251, 191, 36, .35); color: #fde68a; }
.pill-warn .ic { color: var(--warn); }
.pill button { all: unset; cursor: pointer; display: inline-flex; color: var(--muted); }
.pill button:hover { color: var(--text); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.live-on .live-dot { background: var(--ok); box-shadow: 0 0 0 0 rgba(52, 211, 153, .6); animation: pulse 2s infinite; }
.live-wait .live-dot { background: var(--warn); }
.live-off .live-dot { background: var(--danger); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .55); } 70% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }
.bar { position: relative; width: 70px; height: 5px; border-radius: 5px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.bar i { position: absolute; inset: 0 auto 0 0; background: var(--grad); border-radius: inherit; transition: width .6s var(--ease); }

/* ---------- layout ---------- */
/* minmax(0, 1fr): no child (a nowrap label, a wide table) may widen the page. */
.main { padding: 22px 24px 60px; max-width: 1680px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.view { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.views { flex: none; }
.views button { display: inline-flex; align-items: center; gap: 7px; height: 32px; }
.views .ic { width: 15px; height: 15px; }
.views button.on .ic { color: var(--accent-2); }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.kpi {
  position: relative; overflow: hidden; text-align: left; cursor: pointer; padding: 16px 16px 15px; border-radius: var(--r);
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .2s var(--ease), border-color .2s;
  --c: var(--accent);
}
.kpi::after {
  content: ""; position: absolute; inset: auto -30% -60% auto; width: 140px; height: 140px; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--c) 30%, transparent), transparent); opacity: .5; transition: opacity .2s;
}
.kpi:hover { transform: translateY(-2px); border-color: var(--line-3); }
.kpi:hover::after { opacity: .9; }
.kpi.on { border-color: color-mix(in srgb, var(--c) 60%, transparent); box-shadow: var(--shadow), 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12.5px; font-weight: 550; }
.kpi-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.kpi-v { margin-top: 10px; font-size: 25px; font-weight: 720; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kpi-s { margin-top: 2px; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.c-ok { --c: var(--ok); } .kpi.c-info { --c: var(--info); } .kpi.c-violet { --c: var(--violet); }
.kpi.c-orange { --c: var(--orange); } .kpi.c-cyan { --c: var(--accent-2); }

/* ---------- filters ---------- */
.filters { padding: 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.f-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search {
  flex: 1 1 380px; display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 12px; border-radius: 12px;
  background: var(--bg-2); border: 1px solid var(--line-2); transition: border-color .2s, box-shadow .2s;
}
.search:focus-within { border-color: rgba(139, 92, 246, .55); box-shadow: 0 0 0 4px rgba(139, 92, 246, .12); }
.search .ic { color: var(--muted); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 14px; }
.search input::placeholder { color: var(--faint); }
.search input::-webkit-search-cancel-button { filter: invert(.6); }
kbd {
  font: 600 11px var(--mono); color: var(--muted); padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line-2);
  background: var(--panel-2);
}
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line-2); }
.seg button {
  border: 0; background: transparent; padding: 0 11px; height: 34px; border-radius: 9px; cursor: pointer; color: var(--muted);
  font-size: 12.5px; font-weight: 600; white-space: nowrap; transition: background .15s, color .15s;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--panel-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.f-adv { display: flex; flex-wrap: wrap; gap: 10px; padding: 12px; border-radius: 12px; background: var(--bg-2); border: 1px dashed var(--line-2); }
.f-adv label { display: grid; gap: 4px; color: var(--muted); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.input, .f-adv input, .select, textarea.input {
  height: 36px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--panel-solid);
  outline: 0; font-size: 13px; text-transform: none; letter-spacing: 0; color-scheme: dark;
}
.f-adv input { width: 150px; }
.f-adv input[type="datetime-local"] { width: 200px; }
.input:focus, .f-adv input:focus, .select:focus, textarea.input:focus { border-color: rgba(139, 92, 246, .6); }
.select { cursor: pointer; padding-right: 28px; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 15px, calc(100% - 10px) 15px; background-size: 5px 5px; background-repeat: no-repeat; }
.f-group { display: flex; gap: 12px; align-items: flex-start; }
.f-label { flex: none; width: 54px; padding-top: 7px; color: var(--faint); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; min-height: 32px; }
.chip {
  --c: var(--gray);
  display: inline-flex; align-items: center; gap: 7px; height: 31px; padding: 0 11px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text-2); font-size: 12.5px; font-weight: 550;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.chip:hover { border-color: var(--line-3); color: var(--text); }
.chip-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c); opacity: .9; }
.chip-n { font: 600 11px var(--mono); color: var(--muted); padding: 1px 6px; border-radius: 999px; background: rgba(255, 255, 255, .05); }
.chip.on { background: color-mix(in srgb, var(--c) 16%, transparent); border-color: color-mix(in srgb, var(--c) 55%, transparent); color: var(--text); box-shadow: 0 0 18px -8px var(--c); }
.chip.on .chip-n { color: var(--text); background: color-mix(in srgb, var(--c) 22%, transparent); }
.chip.zero { opacity: .45; }
.c-ok { --c: var(--ok); } .c-info { --c: var(--info); } .c-warn { --c: var(--warn); } .c-violet { --c: var(--violet); }
.c-orange { --c: var(--orange); } .c-danger { --c: var(--danger); } .c-gray { --c: var(--gray); } .c-faint { --c: var(--faint); }

/* ---------- results ---------- */
.results { overflow: hidden; }
.r-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.r-summary { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.r-summary b { color: var(--text); font-weight: 650; }
.dot-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }
.took { font: 500 11px var(--mono); color: var(--faint); padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line); }
.r-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sel-actions { display: flex; align-items: center; gap: 8px; padding: 3px 3px 3px 12px; border-radius: 11px; background: var(--accent-soft); border: 1px solid rgba(139, 92, 246, .35); }
.sel-actions span { font-size: 12.5px; font-weight: 600; color: #ddd6fe; }
.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 1120px; }
.grid th {
  position: sticky; top: 0; z-index: 2; text-align: left; padding: 10px 12px; font-size: 11.5px; font-weight: 700; color: var(--faint);
  text-transform: uppercase; letter-spacing: .06em; background: var(--panel-solid); border-bottom: 1px solid var(--line); white-space: nowrap; user-select: none;
}
.grid th.num { text-align: right; }
.grid th.sortable { cursor: pointer; }
.grid th.sortable:hover { color: var(--text-2); }
.grid th.sorted { color: var(--text); }
.grid th .arrow { display: inline-block; margin-left: 4px; color: var(--accent-2); }
.grid td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; font-variant-numeric: tabular-nums; }
.grid tbody tr { cursor: pointer; transition: background .15s; }
.grid tbody tr:hover { background: rgba(255, 255, 255, .025); }
.grid tbody tr.is-sel { background: rgba(139, 92, 246, .08); }
.grid tbody tr.flash { animation: flash 1.6s var(--ease); }
@keyframes flash { 0% { background: rgba(34, 211, 238, .16); } 100% { background: transparent; } }
.c-sel { width: 38px; padding-right: 0 !important; }
.c-sel input, .check { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.c-date { white-space: nowrap; }
.c-svc .svc { display: flex; align-items: center; gap: 9px; }
.svc-ico { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: #000; border: 1px solid var(--line-2); font-size: 13px; flex: none; }
.c-target { max-width: 320px; }
.tgt { display: flex; align-items: center; gap: 6px; min-width: 0; }
.tlink { display: inline-flex; align-items: center; gap: 5px; min-width: 0; color: var(--text); text-decoration: none; font-weight: 550; }
.tlink span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tlink .ic { width: 12px; height: 12px; color: var(--faint); flex: none; transition: color .15s; }
.tlink:hover { color: #fff; text-decoration: underline; text-decoration-color: rgba(34, 211, 238, .5); text-underline-offset: 3px; }
.tlink:hover .ic { color: var(--accent-2); }
.tag { font: 600 10.5px var(--mono); padding: 1px 6px; border-radius: 6px; background: var(--panel-3); color: var(--muted); flex: none; }
.c-prog { min-width: 170px; }
.prog-bar { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .07); overflow: hidden; margin: 3px 0 5px; }
.prog-bar i { display: block; height: 100%; border-radius: inherit; background: var(--grad); }
.prog-bar i.p-ok { background: linear-gradient(90deg, #10b981, #34d399); }
.prog-bar i.p-violet { background: linear-gradient(90deg, #8b5cf6, #c4b5fd); }
.prog-bar i.p-gray { background: #3b4256; }
.c-id { width: 92px; }
.id-btn { all: unset; cursor: copy; color: var(--muted); padding: 3px 6px; border-radius: 6px; }
.id-btn:hover { color: var(--text); background: var(--panel-3); }
.badge {
  --c: var(--gray);
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  color: color-mix(in srgb, var(--c) 82%, white); background: color-mix(in srgb, var(--c) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 28%, transparent); white-space: nowrap;
}
.badge i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.badge.b-soft { background: transparent; }
.b-ok { --c: var(--ok); } .b-info { --c: var(--info); } .b-warn { --c: var(--warn); } .b-violet { --c: var(--violet); }
.b-orange { --c: var(--orange); } .b-danger { --c: var(--danger); } .b-gray { --c: var(--gray); } .b-faint { --c: var(--faint); }
.b-info i, .b-violet i { animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }
.rf { display: grid; gap: 3px; justify-items: start; }
.sentinel { height: 1px; }
.more { display: flex; justify-content: center; padding: 16px; color: var(--muted); gap: 10px; align-items: center; }
.empty { padding: 60px 20px; text-align: center; color: var(--muted); }
.empty h3 { margin: 12px 0 6px; color: var(--text); font-size: 16px; }
.empty .ic { width: 34px; height: 34px; color: var(--faint); }

/* ---------- drawers ---------- */
.backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(3, 4, 8, .55); backdrop-filter: blur(3px); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 50; width: min(720px, 100vw); background: rgba(12, 14, 21, .96);
  border-left: 1px solid var(--line-2); box-shadow: -30px 0 80px -30px rgba(0, 0, 0, .9); transform: translateX(104%);
  transition: transform .32s var(--ease); display: flex; flex-direction: column; backdrop-filter: blur(20px);
}
.drawer.open { transform: none; }
.drawer.narrow { width: min(460px, 100vw); }
.d-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px 16px; border-bottom: 1px solid var(--line); }
.d-head h2 { margin: 0; font-size: 17px; letter-spacing: -.01em; }
.d-head .grow { flex: 1; min-width: 0; }
.d-body { flex: 1; overflow-y: auto; padding: 18px 22px 30px; display: grid; gap: 18px; align-content: start; }
.d-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 7px; color: var(--muted); font-size: 12.5px; }
.d-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.d-cell { padding: 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); min-width: 0; }
.d-cell .k { color: var(--muted); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.d-cell .v { margin-top: 4px; font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.d-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.d-sec h3 { margin: 0 0 10px; font-size: 12px; color: var(--faint); text-transform: uppercase; letter-spacing: .07em; }
.mini { width: 100%; border-collapse: collapse; font-size: 13px; }
.mini th { text-align: left; color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.mini td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.mini td.num, .mini th.num { text-align: right; }
.timeline { display: grid; gap: 0; }
.tl { display: grid; grid-template-columns: 18px 1fr auto; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); align-items: center; }
.tl:last-child { border-bottom: 0; }
.tl-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--accent)); justify-self: center; box-shadow: 0 0 0 3px color-mix(in srgb, var(--c, var(--accent)) 20%, transparent); }
.tl-t { color: var(--muted); font-size: 12px; white-space: nowrap; }
.note { padding: 12px 14px; border-radius: 12px; background: rgba(96, 165, 250, .08); border: 1px solid rgba(96, 165, 250, .25); color: #bfdbfe; font-size: 13px; }
.note.warn { background: rgba(251, 191, 36, .08); border-color: rgba(251, 191, 36, .28); color: #fde68a; }
.note code, .code {
  font: 12px var(--mono); padding: 2px 6px; border-radius: 6px; background: rgba(0, 0, 0, .35); border: 1px solid var(--line-2); color: #e9d5ff; user-select: all;
}
pre.raw { margin: 0; padding: 12px; max-height: 320px; overflow: auto; border-radius: 12px; background: #05060a; border: 1px solid var(--line); font: 12px/1.5 var(--mono); color: var(--text-2); }
details summary { cursor: pointer; color: var(--muted); font-size: 12.5px; }

/* activity feed */
.feed { display: grid; }
.feed-item { display: grid; grid-template-columns: 10px 1fr; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--line); cursor: pointer; border-radius: 8px; }
.feed-item:hover { background: rgba(255, 255, 255, .025); }
.feed-item .tl-dot { margin-top: 5px; }
.feed-item .ft { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.feed-item .arrow-r { color: var(--faint); }
.feed-item.unread { background: rgba(139, 92, 246, .06); }

/* ---------- modal / toast ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 20px; background: rgba(3, 4, 8, .6); backdrop-filter: blur(4px); animation: fade .15s; }
.modal {
  width: min(520px, 100%); max-height: calc(100vh - 40px); overflow: auto; padding: 22px; border-radius: 20px; background: #0f121a;
  border: 1px solid var(--line-2); box-shadow: 0 30px 90px -30px #000; animation: rise .25s var(--ease);
}
.modal.wide { width: min(640px, 100%); }
.modal h3 { margin: 0 0 8px; font-size: 17px; }
.modal p { margin: 0 0 14px; color: var(--text-2); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.modal textarea.input { width: 100%; height: 96px; padding: 10px; resize: vertical; font: 12px/1.5 var(--mono); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: grid; gap: 10px; width: min(380px, calc(100vw - 40px)); }
.toast {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 13px; background: rgba(19, 22, 32, .97);
  border: 1px solid var(--line-2); box-shadow: 0 20px 50px -20px #000; font-size: 13px; animation: rise .25s var(--ease);
}
.toast .ic { margin-top: 1px; }
.toast.ok .ic { color: var(--ok); } .toast.err .ic { color: var(--danger); } .toast.info .ic { color: var(--accent-2); }
.toast.err { border-color: rgba(248, 113, 113, .3); }
.toast .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.toast .bar { width: 100%; margin-top: 8px; }
.toast.out { opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .25s; }

/* ---------- repeats ---------- */
.rp-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi.static { cursor: default; }
.kpi.static:hover { transform: none; border-color: var(--line); }
.rp-rule { color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.rp-rule b { color: var(--text-2); font-weight: 650; }
.rp-list { display: grid; }
.ro {
  display: grid; align-items: center; gap: 12px; padding: 9px 16px;
  grid-template-columns: 84px 116px 100px minmax(120px, 1fr) 76px 88px 140px 160px 88px;
}
.ro > div { min-width: 0; }
.ro-head { padding-top: 10px; padding-bottom: 10px; color: var(--faint); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; background: var(--panel-solid); border-bottom: 1px solid var(--line); }
.rg { border-bottom: 1px solid var(--line-2); }
.rg:last-child { border-bottom: 0; }
.rg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px 18px; padding: 14px 16px 10px; flex-wrap: wrap; }
.rg-title { flex: 1 1 320px; min-width: 0; }
.rg-title .tlink { font-size: 15px; font-weight: 650; }
.rg-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.icon-btn.sm { width: 28px; height: 28px; border-radius: 8px; flex: none; }
.icon-btn.sm .ic { width: 14px; height: 14px; }
.rg-money { display: flex; gap: 10px; }
.rg-money .m { display: grid; gap: 1px; min-width: 128px; padding: 8px 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); text-align: right; }
.rg-money .k { color: var(--muted); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.rg-money b { font-size: 17px; font-weight: 720; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.rg-money .rep { background: rgba(251, 146, 60, .08); border-color: rgba(251, 146, 60, .32); }
.rg-money .rep b { color: #fdba74; }
.rg-rows .ro { cursor: pointer; border-top: 1px dashed var(--line); transition: background .15s; outline: 0; }
.rg-rows .ro:hover, .rg-rows .ro:focus-visible { background: rgba(255, 255, 255, .03); }
.ro.is-main { box-shadow: inset 3px 0 0 var(--accent-2); }
.ro.is-rep { box-shadow: inset 3px 0 0 rgba(251, 146, 60, .7); }
.role { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 7px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.r-main { color: #a5f3fc; background: rgba(34, 211, 238, .1); border: 1px solid rgba(34, 211, 238, .3); }
.r-rep { color: #fed7aa; background: rgba(251, 146, 60, .1); border: 1px solid rgba(251, 146, 60, .32); }
.ro-date, .ro-gap { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ro-gap { color: var(--text-2); }
.ro-head > div { color: inherit; }
.ro-svc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ro-amt .u { display: none; }
.rg-more { all: unset; cursor: pointer; display: block; margin: 2px 16px 12px; padding: 6px 0; color: var(--accent-2); font-size: 12.5px; font-weight: 600; }
.rg-more:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .rp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Narrower screens: an order's refill and ID move to its detail. */
@media (max-width: 1180px) {
  .ro { grid-template-columns: 84px 116px 100px minmax(100px, 1fr) 76px 88px 140px; }
  .ro-rf, .ro-id { display: none; }
}
/* Phones and small tablets: two lines per order; the service is in the group's header. */
@media (max-width: 900px) {
  .ro { grid-template-columns: 88px minmax(0, 1fr) auto; grid-template-areas: "role date cost" "gap amt st"; gap: 6px 10px; }
  .ro-role { grid-area: role; } .ro-date { grid-area: date; } .ro-cost { grid-area: cost; }
  .ro-gap { grid-area: gap; color: var(--muted); font-size: 12.5px; }
  .ro-amt { grid-area: amt; text-align: left; color: var(--text-2); }
  .ro-amt .u { display: inline; color: var(--muted); }
  .ro-st { grid-area: st; justify-self: end; }
  .ro-date { overflow: hidden; text-overflow: ellipsis; }
  .ro-svc, .ro-head { display: none; }
}
@media (max-width: 760px) {
  .topbar { padding: 10px 14px; gap: 8px 10px; flex-wrap: wrap; }
  .topbar .brand { flex: none; }
  .views { margin-right: auto; }
  .top-status { order: 3; flex: 1 0 100%; }
  .main { padding: 14px 12px 50px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi-v { font-size: 20px; }
  .f-group { flex-direction: column; gap: 6px; }
  .f-label { padding-top: 0; }
  .d-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .seg { overflow-x: auto; max-width: 100%; min-width: 0; }
  .seg button { flex: none; }
  .rg-head { padding: 12px 12px 8px; }
  .rg-money { width: 100%; }
  .rg-money .m { flex: 1; min-width: 0; }
  .ro { padding: 9px 12px; }
  .rg-more { margin: 2px 12px 12px; }
  #rp-days, #rp-win { flex-wrap: wrap; overflow: visible; }
}
@media (max-width: 480px) {
  .topbar .brand-name { display: none; }
  .views .ic { display: none; }
  .views button { padding: 0 10px; }
}
/* 360 px phones: an order's status is its coloured dot (the detail has it in words). */
@media (max-width: 380px) {
  .ro-st .badge { width: 22px; padding: 0; gap: 0; justify-content: center; font-size: 0; }
}
/* 360 px phones: logo, view switch and the three buttons still share one row. */
@media (max-width: 400px) {
  .topbar { gap: 8px; }
  .top-actions { gap: 4px; }
  .top-actions .icon-btn { width: 34px; height: 34px; }
  .views { padding: 2px; }
  .views button { padding: 0 8px; height: 30px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
