:root {
  --bg: #f4f6fa; --panel: #fff; --ink: #1b2433; --muted: #5d6b82; --line: #e1e6ef; --primary: #1f3a5f; --primary-2: #2d5286; --accent: #0f766e;
  --red: #c0392b; --red-bg: #fdecea; --amber: #b45309; --amber-bg: #fef3c7; --green: #15803d; --green-bg: #dcfce7; --blue: #1d4ed8; --blue-bg: #dbeafe; --gray-bg: #eef1f6;
  --side: #14263f; --side-ink: #c6d3e8; --shadow: 0 1px 2px rgba(20, 38, 63, .06), 0 4px 14px rgba(20, 38, 63, .06);
  --c-in: #15803d; --c-out: #c0392b; --c-line: #1d4ed8; --c-base: #94a3b8;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0e1626; --panel: #16213a; --ink: #e6ecf7; --muted: #9db0cf; --line: #263554; --primary: #6ea0e8; --primary-2: #8db4ee; --accent: #34c3b5;
    --red-bg: #3b1d1d; --amber-bg: #3b2e12; --green-bg: #14341f; --blue-bg: #14284d; --gray-bg: #1c2944; --side: #0a1220; --red: #ff7b6e; --amber: #f5b14c; --green: #52d37e; --blue: #7aa7ff; --c-base: #5d6f90; }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif; color: var(--ink); background: var(--bg); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
a { color: var(--primary-2); }
button { font: inherit; cursor: pointer; }
.hidden { display: none !important; }
/* login */
.login { min-height: 100%; display: grid; place-items: center; padding: 20px; background: linear-gradient(135deg, #14263f, #2d5286); }
.login form { background: var(--panel); padding: 32px; border-radius: 14px; width: 100%; max-width: 380px; box-shadow: var(--shadow); display: grid; gap: 14px; }
.login h1 { font-size: 20px; } .login p { margin: 0; color: var(--muted); }
/* layout */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); padding: 14px 10px; position: sticky; top: 0; height: 100vh; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.brand { padding: 6px 10px 14px; color: #fff; font-weight: 700; font-size: 15px; line-height: 1.25; }
.brand small { display: block; font-weight: 400; color: var(--side-ink); opacity: .8; font-size: 11px; margin-top: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; color: var(--side-ink); text-decoration: none; border-radius: 8px; }
.nav a:hover { background: rgba(255, 255, 255, .07); }
.nav a.on { background: rgba(255, 255, 255, .14); color: #fff; font-weight: 600; }
.nav .ic { width: 20px; text-align: center; }
.nav .cnt { margin-left: auto; background: var(--red); color: #fff; border-radius: 99px; font-size: 11px; padding: 1px 7px; }
.side .grow { flex: 1; }
.userbox { padding: 10px; font-size: 12px; border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 8px; }
.userbox b { color: #fff; display: block; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 10px 24px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; flex-wrap: wrap; }
.topbar .proj { font-weight: 600; } .topbar .grow { flex: 1; }
.topbar label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.topbar input[type=date] { padding: 4px 6px; }
.hamb { display: none; }
.content { padding: 22px 24px 60px; max-width: 1600px; width: 100%; }
.page-h { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-h h1 { font-size: 22px; } .sub { margin: 4px 0 0; color: var(--muted); }
.tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
/* cards & kpis */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card-h { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); gap: 10px; flex-wrap: wrap; }
.card-h h2 { font-size: 15px; } .card-b { padding: 14px 16px; }
.card-b.flush { padding: 0; }
.grid { display: grid; gap: 14px; } .g2 { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); } .g3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); } .g4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--primary-2); border-radius: 10px; padding: 12px 14px; box-shadow: var(--shadow); }
.kpi.red { border-left-color: var(--red); } .kpi.amber { border-left-color: #d97706; } .kpi.green { border-left-color: var(--green); }
.kpi-l { font-size: 12px; color: var(--muted); } .kpi-v { font-size: 22px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; } .kpi-s { font-size: 12px; color: var(--muted); margin-top: 2px; }
/* tables */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--gray-bg); position: sticky; top: 0; white-space: nowrap; }
td.r, th.r { text-align: right; white-space: nowrap; } td.c, th.c { text-align: center; } td.nw { white-space: nowrap; }
tbody tr:hover { background: rgba(120, 140, 180, .07); }
tr.sum td { font-weight: 700; background: var(--gray-bg); } tr.sub td { font-weight: 600; background: rgba(120, 140, 180, .05); }
tr.late td:first-child { box-shadow: inset 3px 0 0 var(--red); } tr.warn td:first-child { box-shadow: inset 3px 0 0 #d97706; }
.neg { color: var(--red); } .pos { color: var(--green); } .muted { color: var(--muted); } .small { font-size: 12px; }
.empty { padding: 26px; text-align: center; color: var(--muted); }
/* badges / bars / buttons */
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.badge.gray { background: var(--gray-bg); color: var(--muted); } .badge.red { background: var(--red-bg); color: var(--red); } .badge.amber { background: var(--amber-bg); color: var(--amber); }
.badge.green { background: var(--green-bg); color: var(--green); } .badge.blue { background: var(--blue-bg); color: var(--blue); }
.bar { height: 8px; background: var(--gray-bg); border-radius: 99px; overflow: hidden; min-width: 60px; }
.bar i { display: block; height: 100%; background: var(--primary-2); border-radius: 99px; } .bar i.green { background: var(--green); } .bar i.red { background: var(--red); } .bar i.amber { background: #d97706; } .bar i.teal { background: var(--accent); }
.btn { border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 7px 13px; border-radius: 8px; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.btn:hover { border-color: var(--primary-2); } .btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); } .btn.primary:hover { background: var(--primary-2); }
.btn.danger { color: var(--red); border-color: var(--red); } .btn.ghost { background: transparent; } .btn.sm { padding: 3px 9px; font-size: 12px; } .btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.left { margin-right: auto; }
.icon-btn { background: none; border: 0; font-size: 16px; color: var(--muted); }
.linkbtn { background: none; border: 0; color: var(--primary-2); padding: 0; text-align: left; text-decoration: underline; text-underline-offset: 2px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tab { background: none; border: 0; padding: 9px 14px; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; }
.tab.on { color: var(--primary-2); border-bottom-color: var(--primary-2); font-weight: 600; }
/* forms */
input, select, textarea { font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; width: 100%; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--primary-2); outline-offset: 1px; }
input[type=checkbox], input[type=radio] { width: auto; } input[type=range] { padding: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.field { display: flex; flex-direction: column; gap: 4px; } .field.full { grid-column: 1/-1; } .field.check { flex-direction: row; align-items: center; gap: 8px; }
.field label { font-size: 12px; color: var(--muted); font-weight: 600; } .field small { color: var(--muted); font-size: 11.5px; } .req { color: var(--red); }
.form-err { grid-column: 1/-1; color: var(--red); min-height: 18px; font-size: 13px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 12px; } .filters .field { min-width: 150px; }
.filters input, .filters select { width: auto; min-width: 140px; }
.filters input[type=checkbox] { min-width: 0; width: auto; }
.filters .field.check { min-width: 0; align-self: center; margin-top: 16px; } .filters .field.check label { font-size: 13px; color: var(--ink); font-weight: 500; }
/* modal / toast */
.modal-bg { position: fixed; inset: 0; background: rgba(10, 20, 40, .55); display: grid; place-items: start center; padding: 4vh 12px; z-index: 100; overflow: auto; }
.modal { background: var(--panel); border-radius: 12px; width: 100%; max-width: 640px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); } .modal.wide { max-width: 980px; }
.modal-h { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); } .modal-h h3 { font-size: 16px; }
.modal-b { padding: 16px 18px; max-height: 74vh; overflow: auto; } .modal-f { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
.toast { position: fixed; bottom: 20px; right: 20px; background: #14263f; color: #fff; padding: 10px 16px; border-radius: 8px; opacity: 0; transform: translateY(10px); transition: .25s; z-index: 200; max-width: 420px; } .toast.show { opacity: 1; transform: none; } .toast.err { background: var(--red); }
/* charts */
.chart { width: 100%; height: auto; display: block; } .chart text { fill: var(--muted); font-size: 11px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 6px; } .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.alert { display: flex; gap: 10px; padding: 9px 12px; border-radius: 8px; margin-bottom: 8px; background: var(--gray-bg); border-left: 4px solid var(--muted); }
.alert.critical { background: var(--red-bg); border-left-color: var(--red); } .alert.warning { background: var(--amber-bg); border-left-color: #d97706; } .alert.info { background: var(--blue-bg); border-left-color: var(--blue); }
.alert b { display: block; } .alert span { font-size: 12.5px; color: var(--muted); }
.stage-row { display: grid; grid-template-columns: 170px 1fr 54px; gap: 10px; align-items: center; margin: 7px 0; font-size: 13px; }
/* gantt */
.gantt { display: grid; grid-template-columns: var(--gl, 560px) 1fr; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel); }
.gantt-left { border-right: 1px solid var(--line); overflow: hidden; } .gantt-right { overflow: auto; max-height: 72vh; }
.gantt-left .gl-body { overflow: hidden; }
.grow-row { display: grid; grid-template-columns: 54px 1fr 84px 84px 44px 44px; align-items: center; height: 28px; border-bottom: 1px solid var(--line); padding: 0 6px; font-size: 12px; gap: 4px; cursor: pointer; }
.grow-row.head { background: var(--gray-bg); color: var(--muted); font-weight: 600; height: 46px; cursor: default; position: sticky; top: 0; z-index: 2; }
.grow-row:hover { background: rgba(120, 140, 180, .09); } .grow-row.sum { font-weight: 700; background: rgba(120, 140, 180, .05); }
.grow-row .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .grow-row .tg { cursor: pointer; display: inline-block; width: 14px; color: var(--muted); }
.grow-row.crit .nm { color: var(--red); }
.gantt-svg text { font-size: 11px; fill: var(--muted); } .gantt-svg .gridline { stroke: var(--line); } .gantt-svg .rowline { stroke: var(--line); stroke-opacity: .6; }
/* suites matrix */
.matrix td { padding: 4px 6px; } .cell { display: block; border-radius: 6px; padding: 5px 4px; text-align: center; font-size: 12px; min-width: 66px; cursor: pointer; border: 1px solid transparent; }
.cell.done { background: var(--green-bg); color: var(--green); } .cell.in_progress { background: var(--blue-bg); color: var(--blue); } .cell.not_started { background: var(--gray-bg); color: var(--muted); } .cell.late { background: var(--amber-bg); color: var(--amber); border-color: #d97706; } .cell.crit { border-color: var(--red); }
.note { font-size: 12.5px; color: var(--muted); padding: 8px 12px; background: var(--gray-bg); border-radius: 8px; margin-bottom: 12px; }
.dep-row { display: grid; grid-template-columns: 1fr 70px 70px 30px; gap: 6px; margin-bottom: 6px; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; } .side { position: fixed; z-index: 60; left: -260px; width: 250px; transition: left .2s; } .side.open { left: 0; }
  .hamb { display: inline-block; } .content { padding: 14px 12px 60px; } .form-grid { grid-template-columns: 1fr; } .topbar { padding: 8px 12px; }
  .g2, .g3 { grid-template-columns: 1fr; } .stage-row { grid-template-columns: 120px 1fr 44px; }
}
@media print {
  .side, .topbar, .tools, .btn, .tabs, .hamb, .toast { display: none !important; }
  .app { display: block; } body { background: #fff; color: #000; } .content { padding: 0; max-width: none; }
  .card { box-shadow: none; break-inside: avoid; } th { position: static; }
  .gantt-right, .modal-b { max-height: none !important; }
  @page { size: A4 landscape; margin: 12mm; }
}
