/* Idrok Projects — studio console. Brand palette from idrok.group. */
:root {
  --ink: #0b1f2c;
  --navy: #003b5c;
  --teal: #2ad2c9;
  --paper: #f3f5f4;
  --surface: #ffffff;
  --mute: #5d6f7a;
  --line: #dde4e2;
  --line-strong: #c5d0cd;
  --red: #c4372d;
  --red-bg: #fbeceb;
  --amber: #a8740f;
  --amber-bg: #fbf3e2;
  --ok: #17806f;
  --ok-bg: #e2f6f3;
  --text: #0b1f2c;
  --rail: #0b1f2c;
  --rail-text: #b9c7cd;
  --focus: #2ad2c9;
  --display: "Unbounded", "Onest", system-ui, sans-serif;
  --body: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0a1720; --surface: #102330; --text: #e4ecec; --mute: #8fa3ad; --line: #1d3442; --line-strong: #2a4656;
    --navy: #6cc3e8; --red: #ff7b6e; --red-bg: #3a1c1b; --amber: #e2b04a; --amber-bg: #33280f; --ok: #4fd9c6; --ok-bg: #0f3330;
    --rail: #06111a; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0a1720; --surface: #102330; --text: #e4ecec; --mute: #8fa3ad; --line: #1d3442; --line-strong: #2a4656;
  --navy: #6cc3e8; --red: #ff7b6e; --red-bg: #3a1c1b; --amber: #e2b04a; --amber-bg: #33280f; --ok: #4fd9c6; --ok-bg: #0f3330;
  --rail: #06111a; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--text); font: 15px/1.5 var(--body); font-feature-settings: "tnum" 1; }
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { margin: 0; font-weight: 600; }
p { margin: 0; }
.mute { color: var(--mute); }
.red { color: var(--red); } .amber { color: var(--amber); } .okc { color: var(--ok); }
.nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100vh; }
.rail { background: var(--rail); color: var(--rail-text); padding: 22px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font: 600 15px/1.1 var(--display); padding: 0 10px 22px; letter-spacing: -.01em; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--teal); display: grid; place-items: center; color: var(--ink); font-size: 14px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 8px; color: var(--rail-text); font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav a[aria-current="page"] { background: rgba(42,210,201,.14); color: #fff; }
.nav a[aria-current="page"] svg { color: var(--teal); }
.nav svg { width: 18px; height: 18px; flex: none; }
.rail-foot { margin-top: auto; padding: 10px; font-size: 13px; display: flex; flex-direction: column; gap: 8px; }
.rail-foot button { all: unset; cursor: pointer; color: var(--rail-text); }
.rail-foot button:hover { color: #fff; }

.main { padding: 28px clamp(16px, 3.4vw, 44px) 80px; max-width: 1360px; width: 100%; }
.top { display: flex; gap: 16px; align-items: center; justify-content: space-between; margin-bottom: 26px; flex-wrap: wrap; }
.search { position: relative; flex: 1; max-width: 520px; }
.search input { width: 100%; padding: 10px 14px 10px 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 17px; color: var(--mute); }
.search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font: 12px var(--body); color: var(--mute); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }

/* ---------- type ---------- */
.page-title { font: 600 clamp(22px, 2.6vw, 30px)/1.15 var(--display); letter-spacing: -.02em; }
.sec-title { font: 600 15px/1.3 var(--body); margin-bottom: 12px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.sec-title .mute, .sec-title a { font-weight: 400; font-size: 14px; }
.figure { font: 600 clamp(26px, 3.4vw, 40px)/1.05 var(--display); letter-spacing: -.03em; }

/* ---------- buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border-radius: 9px; border: 1px solid var(--navy); background: var(--navy); color: #fff; font: 500 14px var(--body); cursor: pointer; white-space: nowrap; }
.btn:hover { text-decoration: none; filter: brightness(1.12); }
.btn.ghost { background: transparent; color: var(--navy); border-color: var(--line-strong); }
.btn.danger { background: transparent; color: var(--red); border-color: var(--red); }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 7px; }
:root[data-theme="dark"] .btn:not(.ghost):not(.danger) { color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn:not(.ghost):not(.danger) { color: var(--ink); } }
.linkbtn { all: unset; cursor: pointer; color: var(--navy); font-size: 13px; }
.linkbtn:hover { text-decoration: underline; }

.f { display: flex; flex-direction: column; gap: 6px; }
.f-label { font-size: 13px; font-weight: 500; color: var(--mute); }
.f input:not([type=checkbox]), .f select, .f textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; padding: 9px 11px; width: 100%;
}
.f textarea { resize: vertical; }
.f input:focus, .f select:focus, .f textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(42,210,201,.2); }
.f-check { flex-direction: row; align-items: center; gap: 9px; padding-top: 22px; }
.f-check input { width: 18px; height: 18px; accent-color: var(--navy); }
.f-help { font-size: 12px; color: var(--mute); }
.f-err { font-size: 13px; color: var(--red); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px 18px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 22px; flex-wrap: wrap; }
.form-actions .spacer { flex: 1; }
.errors { background: var(--red-bg); color: var(--red); padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; }

/* ---------- surfaces ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; }
.panel + .panel { margin-top: 18px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 18px; }

.msg { padding: 10px 14px; border-radius: 9px; background: var(--ok-bg); color: var(--ok); margin-bottom: 18px; font-weight: 500; }

/* ---------- status ---------- */
.st { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.st::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--st, var(--mute)); }
.s-lead { --st: #c08a1a; } .s-in_development { --st: #2f7fd6; } .s-testing { --st: #7a5cd6; }
.s-live { --st: var(--teal); } .s-support { --st: #17a58f; } .s-completed { --st: #8a9aa2; }
.s-paused { --st: #d08a3a; } .s-archived { --st: #b9c3c7; }

.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--line-strong); flex: none; }
.dot.ok { background: var(--teal); } .dot.bad { background: var(--red); } .dot.warn { background: var(--amber); }

/* ---------- money hero + ribbon ---------- */
.money { display: grid; grid-template-columns: minmax(240px, 340px) minmax(0, 1fr); gap: 34px; align-items: end; }
.money-sum .figure { margin-top: 6px; font-size: clamp(24px, 2.4vw, 34px); }
.money-sum .figure.zero { color: var(--ok); }
.money-sum .note { margin-top: 10px; color: var(--mute); font-size: 14px; }
.ribbon-scroll { overflow-x: auto; overflow-y: hidden; padding: 0 12px 0 12px; margin: 0 -12px; }
.ribbon { position: relative; height: 150px; min-width: 560px; }
.ribbon-axis { position: absolute; left: 0; right: 0; bottom: 26px; height: 2px; background: var(--line-strong); }
.ribbon-late { position: absolute; left: 0; width: 6%; bottom: 26px; height: 2px; background: var(--red); }
.ribbon-today { position: absolute; left: 6%; bottom: 18px; width: 2px; height: 18px; background: var(--teal); }
.ribbon-today span { position: absolute; top: 20px; left: -20px; font-size: 12px; color: var(--mute); }
.tick { position: absolute; bottom: 0; font-size: 12px; color: var(--mute); transform: translateX(-50%); }
.tick::before { content: ""; position: absolute; left: 50%; bottom: 20px; width: 1px; height: 8px; background: var(--line-strong); }
.mark { position: absolute; bottom: 22px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; }
.mark i { width: 10px; height: 10px; border-radius: 50%; background: var(--navy); border: 2px solid var(--surface); box-sizing: content-box; }
.mark.late i { background: var(--red); } .mark.soon i { background: var(--amber); }
.mark a { position: absolute; bottom: calc(18px + var(--row) * 30px); white-space: nowrap; font-size: 12.5px; line-height: 1.25; color: var(--text); background: var(--surface);
  padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line); }
.mark a::after { content: ""; position: absolute; left: 50%; top: 100%; width: 1px; height: calc(var(--row) * 30px + 4px); background: var(--line-strong); }
.mark a small { display: block; color: var(--mute); font-size: 11.5px; }
.mark.late a { border-color: var(--red); left: -6px; }
.mark.late a::after { left: 10px; }
.mark a:hover { text-decoration: none; border-color: var(--navy); z-index: 2; }

/* ---------- lists ---------- */
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li { display: grid; align-items: center; gap: 14px; padding: 12px 4px; border-top: 1px solid var(--line); }
.rows > li:first-child { border-top: 0; }
.row-main { min-width: 0; }
.row-name { font: 500 15px/1.25 var(--display); letter-spacing: -.01em; color: var(--text); }
.row-name:hover { color: var(--navy); }
.row-sub { font-size: 13px; color: var(--mute); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.plist > li { grid-template-columns: 4px minmax(0, 2.2fr) minmax(0, 1.3fr) minmax(0, 1fr) 120px 110px; }
.plist .bar { align-self: stretch; border-radius: 4px; background: var(--st, var(--line)); }
.plist .cell { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plist .cell.right { text-align: right; }
.plist .head { font-size: 12.5px; color: var(--mute); padding: 0 4px 8px; border: 0; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 18px; }
.chip { padding: 6px 13px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--text); font-size: 14px; background: var(--surface); }
.chip:hover { text-decoration: none; border-color: var(--navy); }
.chip[aria-current="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
:root[data-theme="dark"] .chip[aria-current="true"] { background: var(--teal); color: var(--ink); border-color: var(--teal); }
.filters select { font: inherit; font-size: 14px; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 500; font-size: 12.5px; color: var(--mute); padding: 0 10px 8px 0; }
.table td { padding: 10px 10px 10px 0; border-top: 1px solid var(--line); vertical-align: top; }
.table td.num, .table th.num { text-align: right; white-space: nowrap; }
.table tr.is-late td:first-child { box-shadow: inset 3px 0 0 var(--red); padding-left: 10px; }
.table-wrap { overflow-x: auto; }

/* ---------- project page ---------- */
.p-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 24px; }
.p-name { font: 600 clamp(26px, 3.6vw, 40px)/1.08 var(--display); letter-spacing: -.03em; }
.p-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 14px; color: var(--mute); }
.p-meta a { color: var(--navy); }
.status-form select { font: 500 14px var(--body); padding: 8px 32px 8px 12px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); }
.kv { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 9px 14px; font-size: 14px; }
.kv dt { color: var(--mute); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; }
.debt-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--red-bg); color: var(--red); border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; font-weight: 500; }
.contacts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.contact { border: 1px solid var(--line); border-radius: 11px; padding: 12px 14px; }
.contact b { font-weight: 600; display: block; }
.contact p { font-size: 13.5px; margin-top: 3px; }
.empty { color: var(--mute); font-size: 14px; padding: 6px 0; }
.empty b { color: var(--text); font-weight: 500; }
.secret-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.3fr) auto; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); font-size: 14px; }
.secret-row:first-child { border-top: 0; }
.secret-val { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; overflow-wrap: anywhere; }
details.add { margin-top: 12px; }
details.add > summary { cursor: pointer; color: var(--navy); font-size: 14px; list-style: none; display: inline-flex; gap: 6px; align-items: center; }
details.add > summary::-webkit-details-marker { display: none; }
details.add[open] > summary { margin-bottom: 14px; }
details.add .form-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 460px); }
.login-art { background: var(--ink); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art h1 { font: 600 clamp(28px, 3.6vw, 48px)/1.08 var(--display); letter-spacing: -.03em; max-width: 12ch; }
.login-art p { color: var(--rail-text); max-width: 40ch; margin-top: 14px; }
.login-art svg.orbit { position: absolute; right: -120px; bottom: -120px; width: 520px; opacity: .9; }
.login-form { padding: 48px clamp(20px, 5vw, 56px); display: flex; flex-direction: column; justify-content: center; gap: 16px; background: var(--surface); }
.login-form h2 { font: 600 22px var(--display); margin-bottom: 4px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .plist > li { grid-template-columns: 4px minmax(0, 2fr) minmax(0, 1fr) 110px; }
  .plist .c-server, .plist .c-domain { display: none; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; z-index: 10; flex-direction: row; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .brand, .rail-foot { display: none; }
  .nav { display: flex; width: 100%; justify-content: space-around; }
  .nav a { flex-direction: column; gap: 3px; font-size: 11px; padding: 6px 4px; }
  .nav a.opt { display: none; }
  .main { padding-bottom: 96px; }
  .money { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .hide-sm { display: none; }
  .top .btn { display: none; }
  .plist > li { grid-template-columns: 4px minmax(0, 1fr) auto; }
  .plist .c-client { display: none; }
  .plist .head { display: none; }
  .login { grid-template-columns: 1fr; }
  .login-art { min-height: 220px; padding: 28px; }
  .secret-row { grid-template-columns: 1fr auto; }
  .secret-row > :nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
}
@media (prefers-reduced-motion: no-preference) {
  .mark { animation: drop .5s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i) * 40ms); }
  @keyframes drop { from { opacity: 0; transform: translate(-50%, -8px); } }
}
