/* Rumi & JoJo Fiber Net — app styles. Navy and fibre-blue from the brand, orange for emphasis. */
:root {
  --bg: #f3f5f9; --surface: #ffffff; --fg: #142033; --muted: #5b6a80; --line: #dbe2ec; --soft: #eef2f8;
  --navy: #0f2a5c; --blue: #1f62d1; --blue-soft: #e4edfc; --accent: #e8742a; --accent-soft: #fdeee3;
  --good: #19784a; --good-soft: #e3f4ea; --warn: #9a5b00; --warn-soft: #fff2db; --bad: #b42318; --bad-soft: #fdecea;
  --radius: 10px; --shadow: 0 1px 2px rgba(16, 32, 60, .06), 0 1px 3px rgba(16, 32, 60, .05);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c131d; --surface: #131c28; --fg: #e3e9f1; --muted: #93a2b6; --line: #253244; --soft: #182333;
    --navy: #c9d8f5; --blue: #6aa2ff; --blue-soft: #18294a; --accent: #f39a5b; --accent-soft: #3a2414;
    --good: #5fd08f; --good-soft: #14301f; --warn: #f2b45a; --warn-soft: #33260f; --bad: #ff8a7d; --bad-soft: #3a1714;
    --shadow: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.5 var(--font); }
a { color: var(--blue); text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.25; text-wrap: balance; }
h1 { font-size: 1.55rem; } h2 { font-size: 1.1rem; } h3 { font-size: 1rem; }
p { margin: 0; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; }
.pad { padding: 14px 16px; } .pad-l { padding: 18px 20px; }
.hint { color: var(--muted); font-size: .84rem; }

/* Shell */
.shell { display: grid; grid-template-columns: 230px 1fr; grid-template-rows: auto 1fr; min-height: 100vh; }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 10px 18px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--fg); }
.brand .mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; background: var(--navy); color: var(--surface); font-weight: 800; letter-spacing: .02em; }
.brand div { display: flex; flex-direction: column; line-height: 1.1; }
.brand b { font-size: .98rem; } .brand span:not(.mark) { font-size: .78rem; color: var(--accent); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.brand.big { margin-bottom: 8px; }
.who { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.who-name { font-weight: 600; font-size: .92rem; }
.menu-btn { display: none; }
.sidenav { background: var(--surface); border-right: 1px solid var(--line); padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; }
.sidenav a { padding: 9px 12px; border-radius: 8px; color: var(--fg); font-weight: 500; }
.sidenav a:hover { background: var(--soft); }
.sidenav a.active { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.nav-roles { margin-top: auto; padding: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.content { padding: 22px 26px 60px; display: flex; flex-direction: column; gap: 18px; min-width: 0; max-width: 1180px; }

/* Blocks */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head h2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.page-head p { margin-top: 4px; max-width: 70ch; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.tile { padding: 16px 18px; color: var(--fg); display: flex; flex-direction: column; gap: 6px; transition: border-color .15s; }
.tile:hover { border-color: var(--blue); }
.coming { margin: 10px 0 12px; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1px; background: var(--line); border-bottom: 1px solid var(--line); }
.facts > div { background: var(--surface); padding: 10px 16px; display: flex; flex-direction: column; }
.facts span { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.facts b { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.facts.big { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.facts.big b { font-size: 1.4rem; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 10px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; background: var(--soft); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.detail { font-size: .85rem; color: var(--muted); word-break: break-word; }

/* Chips */
.chip { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .76rem; font-weight: 600; background: var(--soft); color: var(--muted); white-space: nowrap; }
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.chip.good { background: var(--good-soft); color: var(--good); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }

/* Buttons */
.btn { font: inherit; font-weight: 600; font-size: .9rem; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); cursor: pointer; }
.btn:hover { border-color: var(--blue); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.small { padding: 5px 10px; font-size: .82rem; }
.btn.wide { width: 100%; padding: 11px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn:focus-visible, .icon-btn:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.icon-btn { font-size: 1.3rem; line-height: 1; background: none; border: 0; color: var(--fg); cursor: pointer; padding: 4px 8px; border-radius: 6px; }

/* Forms */
.stack { display: flex; flex-direction: column; gap: 14px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.label { font-weight: 600; font-size: .86rem; }
input, select { font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--fg); width: 100%; }
.page-head select { width: auto; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.check.on { border-color: var(--blue); background: var(--blue-soft); }
.check input { width: auto; margin-top: 3px; }
.check span { display: flex; flex-direction: column; } .check small { color: var(--muted); font-size: .8rem; }
.role-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.actions { display: flex; justify-content: flex-end; gap: 8px; }
.alert { padding: 10px 14px; border-radius: 8px; font-size: .9rem; }
.alert.bad { background: var(--bad-soft); color: var(--bad); }
.alert.good { background: var(--good-soft); color: var(--good); }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }

/* Modal */
.modal-back { position: fixed; inset: 0; background: rgba(8, 15, 28, .5); display: grid; place-items: center; padding: 16px; z-index: 20; }
.modal { background: var(--surface); border-radius: 12px; width: min(620px, 100%); max-height: 92vh; overflow-y: auto; padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login { width: min(400px, 100%); padding: 26px; display: flex; flex-direction: column; gap: 14px; }

/* Phones */
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .menu-btn { display: block; }
  .who-name { display: none; }
  .sidenav { display: none; position: fixed; top: 57px; left: 0; right: 0; bottom: 0; z-index: 10; border-right: 0; }
  .sidenav.open { display: flex; }
  .content { padding: 16px 16px 50px; }
  .row2, .role-grid { grid-template-columns: 1fr; }
  th, td { padding: 9px 12px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
