/* 48PEGASUS + O.R.I.O.N. — command center theme */
:root {
  --orange: #E95C2D; --orange-deep: #A63D1C; --slate: #424149; --charcoal: #242B2D; --ivory: #F2E9DE; --navy: #1E2A38;
  --bg: #111517; --panel: #1A2023; --panel-2: #20272A; --line: #2F383C; --line-2: #3B464B;
  --text: #F2E9DE; --text-2: #B8B1A8; --muted: #7E8A90;
  --ok: #4CAF7A; --warn: #D9A441; --bad: #E0533D; --info: #5BA4C7;
  --radius: 15px; --radius-s: 9px;
  --display: "Anton", "Impact", sans-serif;
  --kicker: "Benzin", "Anton", "Impact", sans-serif;
  --body: "Courier New", Courier, monospace;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #F2E9DE; --panel: #FBF7F1; --panel-2: #F4EDE3; --line: #DDD2C4; --line-2: #CBBFAF;
  --text: #242B2D; --text-2: #424149; --muted: #75706A; --shadow: 0 8px 24px rgba(36,43,45,.10);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
a { color: var(--orange); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: .02em; margin: 0; line-height: 1.15; }
h1 { font-size: 30px; text-transform: uppercase; }
h2 { font-size: 21px; text-transform: uppercase; }
h3 { font-size: 16px; text-transform: uppercase; }
.kicker { font-family: var(--kicker); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--orange); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hidden { display: none !important; }

/* Layout */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; flex-direction: column; gap: 2px; padding: 4px 10px 18px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.brand .word { font-family: var(--display); font-size: 24px; letter-spacing: .04em; }
.brand .word span { color: var(--orange); }
.brand img { max-width: 170px; max-height: 46px; object-fit: contain; }
.nav-group { margin: 14px 0 4px; padding: 0 10px; font-family: var(--kicker); font-size: 10px; letter-spacing: .2em; color: var(--muted); text-transform: uppercase; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-s); color: var(--text-2); font-size: 13px; }
.nav a:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.nav a.on { background: rgba(233,92,45,.14); color: var(--text); box-shadow: inset 3px 0 0 var(--orange); }
.nav .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.nav .count { margin-left: auto; background: var(--orange); color: #fff; border-radius: 99px; font-size: 11px; padding: 0 7px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 12px; padding: 14px 26px; border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 20; }
.top .crumbs { font-size: 12px; color: var(--muted); }
.top .spacer { flex: 1; }
.top .who { font-size: 12px; color: var(--text-2); text-align: right; line-height: 1.3; }
.top .who b { color: var(--text); font-weight: 700; }
.menu-btn { display: none; }
.content { padding: 24px 26px 60px; max-width: 1500px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .grow { flex: 1; min-width: 200px; }
.page-head p { margin: 4px 0 0; color: var(--text-2); }

/* Blocks */
.bento { display: grid; gap: 14px; grid-template-columns: repeat(12, 1fr); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; min-width: 0; }
.card.pad0 { padding: 0; overflow: hidden; }
.card > .card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card > .card-head h3 { flex: 1; }
.span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }
.stat .num { font-family: var(--display); font-size: 34px; line-height: 1; margin-top: 6px; }
.stat .sub { color: var(--muted); font-size: 12px; margin-top: 6px; }
.stat.accent .num { color: var(--orange); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 16px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.empty { color: var(--muted); padding: 22px; text-align: center; border: 1px dashed var(--line-2); border-radius: var(--radius-s); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stack > * + * { margin-top: 10px; }
.sep { height: 1px; background: var(--line); margin: 14px 0; }

/* Buttons & inputs */
.btn { appearance: none; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font: 600 13px var(--body); padding: 8px 14px; border-radius: var(--radius-s); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn:hover { border-color: var(--orange); }
.btn.primary { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn.primary:hover { background: var(--orange-deep); border-color: var(--orange-deep); }
.btn.ghost { background: transparent; }
.btn.danger { border-color: var(--bad); color: var(--bad); background: transparent; }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: default; }
input, select, textarea { width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--line-2); border-radius: var(--radius-s); padding: 8px 10px; font: 13px var(--body); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(233,92,45,.18); }
input[type=checkbox] { width: auto; accent-color: var(--orange); }
input[type=color] { padding: 2px; height: 34px; }
textarea { min-height: 90px; resize: vertical; }
label.f { display: block; }
label.f > span { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; }
label.f.full { grid-column: 1 / -1; }
.chk { display: inline-flex; align-items: center; gap: 6px; margin: 2px 12px 2px 0; font-size: 13px; cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 4px 0; }
.search { max-width: 280px; }

/* Tags */
.tag { display: inline-block; border: 1px solid var(--line-2); border-radius: 99px; padding: 1px 9px; font-size: 11px; color: var(--text-2); white-space: nowrap; }
.tag.ok { border-color: var(--ok); color: var(--ok); } .tag.warn { border-color: var(--warn); color: var(--warn); }
.tag.bad { border-color: var(--bad); color: var(--bad); } .tag.info { border-color: var(--info); color: var(--info); }
.tag.hot { border-color: var(--orange); color: var(--orange); }
.tag + .tag { margin-left: 4px; }

/* Tables */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; font-weight: 400; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--panel-2); }
table.t tr:last-child td { border-bottom: 0; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--text-2); border-bottom: 2px solid transparent; white-space: nowrap; font-size: 13px; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--text); border-bottom-color: var(--orange); }

/* Kanban */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.col { flex: 0 0 270px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100vh - 230px); }
.col-head { padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.col-head .name { font-family: var(--display); text-transform: uppercase; font-size: 14px; letter-spacing: .03em; flex: 1; }
.col-head .n { color: var(--muted); font-size: 12px; }
.col-body { padding: 10px; overflow-y: auto; min-height: 80px; display: flex; flex-direction: column; gap: 8px; }
.col.drop .col-body { background: rgba(233,92,45,.07); }
.kcard { background: var(--panel-2); border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; cursor: grab; font-size: 13px; }
.kcard:hover { border-color: var(--line-2); }
.kcard .t { font-weight: 700; margin-bottom: 3px; }
.kcard .m { color: var(--muted); font-size: 12px; }
.kcard.dragging { opacity: .4; }

/* Progress */
.bar { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--orange); border-radius: 99px; }

/* Lists */
.list { display: flex; flex-direction: column; }
.list .li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.list .li:last-child { border-bottom: 0; }
.list .li .grow { flex: 1; min-width: 0; }
.feed .li .when { color: var(--muted); font-size: 12px; white-space: nowrap; }
.note-body { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Modal */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto; }
.modal { background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius); width: 100%; max-width: 640px; box-shadow: var(--shadow); }
.modal.wide { max-width: 900px; }
.modal-head { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { flex: 1; font-size: 19px; }
.modal-body { padding: 18px 20px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); }
.modal-foot .left { margin-right: auto; }
.x { background: none; border: 0; color: var(--muted); font-size: 22px; cursor: pointer; line-height: 1; }

/* Toast */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--panel-2); border: 1px solid var(--line-2); border-left: 3px solid var(--orange); padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow); max-width: 360px; font-size: 13px; }
.toast.bad { border-left-color: var(--bad); }

/* Auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 20% 10%, rgba(233,92,45,.16), transparent 45%), radial-gradient(circle at 90% 90%, rgba(30,42,56,.9), transparent 55%), var(--bg); }
.auth .card { width: 100%; max-width: 410px; padding: 28px; }
.auth .brand { border: 0; padding: 0 0 18px; margin: 0; }
.auth form > * + * { margin-top: 12px; }
.err { color: var(--bad); font-size: 13px; }
.okmsg { color: var(--ok); font-size: 13px; }

/* Folder chips */
.folders { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.folders a { border: 1px solid var(--line-2); border-radius: 11px; padding: 8px 12px; color: var(--text-2); font-size: 13px; }
.folders a.on { border-color: var(--orange); color: var(--text); background: rgba(233,92,45,.1); }
.folders a:hover { text-decoration: none; color: var(--text); }
.drop-zone { border: 1px dashed var(--line-2); border-radius: var(--radius-s); padding: 16px; text-align: center; color: var(--muted); font-size: 13px; }
.drop-zone.over { border-color: var(--orange); color: var(--text); }

.frame { width: 100%; height: calc(100vh - 170px); border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }

@media (max-width: 1100px) {
  .span-3, .span-4 { grid-column: span 6; }
  .span-5, .span-6, .span-7, .span-8 { grid-column: span 12; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: var(--shadow); }
  .menu-btn { display: inline-flex; }
  .content { padding: 16px; }
  .top { padding: 12px 16px; }
  .span-3, .span-4 { grid-column: span 12; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
  .top .who { display: none; }
}
@media print {
  .side, .top, .no-print { display: none !important; }
  .shell { display: block; }
}
