/* Bridge PlanTrack — загвар (Бридж Корпораци: navy #344D85) */
:root {
  --primary: #344D85; --primary-ink: #fff; --primary-2: #263a68; --accent: #C9A227;
  --bg: #F3F5F9; --surface: #FFFFFF; --surface-2: #F7F8FB; --surface-3: #EDF0F6;
  --ink: #141A26; --ink-2: #3B4558; --muted: #6A7487; --line: #E1E5EE; --line-2: #CDD3E0;
  --sb-bg: #2B406F; --sb-ink: #E7ECF7; --sb-muted: #A9B6D3; --sb-on: rgba(255,255,255,.14);
  --good: #0ca30c; --good-t: #1E7B34; --warn: #E8A400; --warn-t: #8A5D00; --serious: #E07848; --serious-t: #A04A1E; --crit: #D03B3B; --crit-t: #B42318; --info: #2A78D6; --info-t: #1C5CAB; --idle: #9AA3B5; --none: #C9CED8;
  --c-plan: #9AA3B5; --c-act: var(--primary);
  --radius: 12px; --radius-sm: 8px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08); --shadow-lg: 0 12px 32px rgba(16,24,40,.18);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --gname: 340px; --rowh: 32px; --bn-h: 62px;
  color-scheme: light;
}
[data-theme="steppe"] { --primary: #2F6B4F; --primary-2: #224f3a; --sb-bg: #24533D; --sb-muted: #A9C9B8; }
[data-theme="copper"] { --primary: #A4532A; --primary-2: #7d3f20; --sb-bg: #6E3A21; --sb-muted: #DDB9A5; }
[data-theme="sky"] { --primary: #0B6E99; --primary-2: #085474; --sb-bg: #0B5577; --sb-muted: #A6CBE0; }
[data-theme="graphite"] { --primary: #3B4250; --primary-2: #2a2f39; --sb-bg: #262B34; --sb-muted: #A7AEBC; }
[data-theme="contrast"] { --primary: #0A2A6B; --primary-2: #061c48; --sb-bg: #061c48; --ink: #000; --ink-2: #111; --muted: #333; --line: #9aa3b5; --line-2: #6b7385; }
html.dark { --bg: #10141f; --surface: #181e2c; --surface-2: #1d2434; --surface-3: #242c3f; --ink: #EEF1F7; --ink-2: #C9D0DE; --muted: #96A0B5; --line: #2b3448; --line-2: #3a4560; --sb-bg: #0f1422; --sb-on: rgba(123,150,214,.18); --primary-2: #9db2e6; --shadow: 0 1px 2px rgba(0,0,0,.4); --c-plan: #6f7a92; color-scheme: dark; --good-t: #4cc75a; --warn-t: #f2c14e; --serious-t: #f0a07a; --crit-t: #ff8a80; --info-t: #8ab6f0; }
html.dark [data-theme] {}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); font-size: 15px; line-height: 1.45; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
a { color: var(--primary); text-decoration: none; }
html.dark a { color: #9db2e6; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; font-weight: 700; }
h3 { font-size: 15.5px; font-weight: 650; }
h4 { font-size: 14px; margin: 14px 0 6px; }
code { font-family: ui-monospace, Consolas, monospace; font-size: .9em; background: var(--surface-3); padding: 1px 6px; border-radius: 5px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.ic { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .center { text-align: center; } .nowrap { white-space: nowrap; }
.crit-t { color: var(--crit-t); } .warn-t { color: var(--warn-t); } .ok-t { color: var(--good-t); }
.sp { flex: 1; }
.row-c { display: flex; align-items: center; gap: 10px; } .row-c.wrap { flex-wrap: wrap; } .row-c.end { justify-content: flex-end; margin: 14px 0; }
.stack { display: flex; flex-direction: column; gap: 10px; }

/* boot */
.boot { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; }
.boot img { width: 72px; opacity: .9; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; text-decoration: none !important; transition: background .15s, border-color .15s, box-shadow .15s; }
.btn:hover { background: var(--surface-2); }
.btn:focus-visible, .inp:focus-visible, .icon-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--crit-t); border-color: #f1c4c0; }
.btn.danger:not(.ghost) { background: var(--crit); color: #fff; border-color: var(--crit); }
.btn.lg { height: 46px; font-size: 15.5px; padding: 0 20px; border-radius: 11px; }
.btn.sm { height: 32px; padding: 0 10px; font-size: 13px; }
.btn.xs { height: 26px; padding: 0 9px; font-size: 12.5px; border-radius: 7px; gap: 4px; }
.btn.xs .ic { width: 14px; height: 14px; }
.btn.block { width: 100%; }
.btn.left { justify-content: flex-start; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); cursor: pointer; position: relative; font: inherit; }
.icon-btn:hover { background: var(--surface-3); }
.icon-btn.sm { width: 30px; height: 30px; } .icon-btn.xs { width: 24px; height: 24px; border-radius: 6px; } .icon-btn.xs .ic { width: 14px; height: 14px; }
.icon-btn.lg { width: 54px; height: 54px; font-size: 26px; font-weight: 600; border: 1px solid var(--line-2); border-radius: 50%; background: var(--surface); }
.inp { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--surface); color: var(--ink); font: inherit; font-size: 15px; }
textarea.inp { height: auto; padding: 9px 12px; resize: vertical; }
select.inp { padding-right: 28px; }
select[multiple].inp { height: auto; padding: 6px; }
.inp.sm { height: 34px; font-size: 14px; }
.inp.lg { height: 48px; font-size: 16px; }
.inp.color { padding: 3px; height: 40px; }
.fld { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.fld > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.fld.row { flex-direction: row; align-items: center; gap: 10px; }
.fld.chk { flex-direction: row; align-items: center; gap: 8px; }
.fld.chk input { width: 18px; height: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .span2 { grid-column: 1 / -1; }
.pick { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.pick:hover { background: var(--surface-2); }
.pick input { width: 17px; height: 17px; flex: none; accent-color: var(--primary); }
.pick small { color: var(--muted); margin-left: auto; font-size: 12px; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 8px; }
.perms.dim { opacity: .6; }
.pw-wrap { position: relative; } .pw-wrap .icon-btn { position: absolute; right: 4px; top: 5px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 9px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 0 12px; height: 34px; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--primary); color: var(--primary-ink); }
input[type=checkbox], input[type=radio] { accent-color: var(--primary); }

/* chips */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--surface-3); color: var(--ink-2); border: 1px solid transparent; white-space: nowrap; line-height: 1.3; cursor: default; font-family: inherit; }
button.chip { cursor: pointer; border-color: var(--line-2); background: var(--surface); }
button.chip.on { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.chip .ic { width: 13px; height: 13px; }
.chip.sm { padding: 1px 7px; font-size: 11.5px; }
.st-done { background: #E3F4E6; color: #17672b; } .st-ok { background: #E4EEFB; color: #1C5CAB; } .st-warn { background: #FFF2CC; color: #7A5300; } .st-serious { background: #FDE8DE; color: #993F16; } .st-crit { background: #FCE4E2; color: #A11A12; } .st-idle { background: #EEF0F4; color: #4D5566; } .st-none { background: #F2F3F6; color: #6A7487; } .st-info { background: #E4EEFB; color: #1C5CAB; }
html.dark .st-done { background: #163a20; color: #7fe08d; } html.dark .st-ok, html.dark .st-info { background: #17304f; color: #9cc3f5; } html.dark .st-warn { background: #3d3110; color: #f3cd62; } html.dark .st-serious { background: #42261a; color: #f4ae8b; } html.dark .st-crit { background: #4a1d1d; color: #ff9b94; } html.dark .st-idle, html.dark .st-none { background: #262e40; color: #aab3c6; }
.role-admin { background: #E8E3FA; color: #4b3aa7; } .role-executive { background: #E4EEFB; color: #1C5CAB; } .role-approver { background: #E3F4E6; color: #17672b; } .role-member { background: var(--surface-3); color: var(--ink-2); } .role-viewer { background: #FFF2CC; color: #7A5300; }

/* login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: linear-gradient(150deg, var(--primary) 0%, var(--primary-2) 100%); color: #fff; padding: 56px 64px; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.login-art::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; background: url(../img/emblem-white.png) center/contain no-repeat; opacity: .07; }
.login-logo { width: min(380px, 80%); margin-bottom: 36px; }
.login-art h1 { font-size: 34px; margin-bottom: 10px; }
.login-art p { font-size: 17px; opacity: .85; max-width: 460px; }
.login-feats { list-style: none; padding: 0; margin: 30px 0 0; display: grid; gap: 12px; }
.login-feats li { display: flex; gap: 10px; align-items: center; font-size: 15px; opacity: .92; }
.login-feats .ic { width: 22px; height: 22px; }
.login-author { display: flex; gap: 8px; align-items: center; margin-top: 34px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.22); font-size: 14px; opacity: .9; max-width: 460px; position: relative; z-index: 1; }
.login-author .ic { width: 18px; height: 18px; flex: none; }
.login-card { position: relative; z-index: 2; align-self: center; justify-self: center; width: min(420px, 92vw); background: var(--surface); padding: 34px 32px; border-radius: 18px; box-shadow: var(--shadow-lg); margin: 24px; }
.login.single { grid-template-columns: 1fr; place-items: center; background: linear-gradient(160deg, var(--primary), var(--primary-2)); }
.login-logo-sm { display: block; width: 210px; margin: 0 auto 18px; }
html.dark .login-logo-sm { filter: brightness(0) invert(1); opacity: .92; }
.login-card h2 { font-size: 20px; margin-bottom: 16px; text-align: center; }
.login-card .ver { margin-top: 2px; opacity: .6; }
.demo-users { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* shell */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.sidebar { background: var(--sb-bg); color: var(--sb-ink); position: sticky; top: 0; height: 100vh; padding-top: env(safe-area-inset-top); display: flex; flex-direction: column; z-index: 40; }
.sb-top { padding: 18px 18px 10px; }
.sb-logo img { width: 100%; max-width: 210px; display: block; }
.sb-app { margin-top: 10px; font-size: 12.5px; letter-spacing: .3px; color: var(--sb-muted); font-weight: 600; text-transform: uppercase; }
.sb-nav { flex: 1; overflow-y: auto; padding: 6px 10px; }
.sb-item { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px; color: var(--sb-ink); font-size: 14.5px; font-weight: 500; margin: 1px 0; text-decoration: none !important; position: relative; }
.sb-item .ic { opacity: .85; }
.sb-item:hover { background: rgba(255,255,255,.07); }
.sb-item.on { background: var(--sb-on); font-weight: 650; }
.sb-item.on::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--accent); }
.sb-sep { font-size: 11px; color: var(--sb-muted); text-transform: uppercase; letter-spacing: .6px; padding: 14px 12px 4px; min-height: 8px; }
.nb { margin-left: auto; background: var(--crit); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; min-width: 20px; text-align: center; }
.sb-foot { padding: 10px; border-top: 1px solid rgba(255,255,255,.08); }
.sb-user { display: flex; gap: 10px; align-items: center; width: 100%; background: transparent; border: 0; color: inherit; text-align: left; padding: 8px; border-radius: 9px; cursor: pointer; font: inherit; }
.sb-user:hover { background: rgba(255,255,255,.07); }
.sb-user b { display: block; font-size: 13.5px; } .sb-user small { color: var(--sb-muted); font-size: 12px; }
.sb-ver { font-size: 11px; line-height: 1.45; color: var(--sb-muted); padding: 4px 8px 0; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; height: calc(60px + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top) !important; display: flex; align-items: center; gap: 8px; padding: 0 18px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.tb-title { font-weight: 650; font-size: 16px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-proj select { max-width: 340px; min-width: 200px; }
.tb-emblem { width: 30px; height: 30px; }
.bell .badge { position: absolute; top: 3px; right: 2px; background: var(--crit); color: #fff; font-size: 10px; font-weight: 700; min-width: 17px; height: 17px; border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.av-btn { border: 0; background: transparent; padding: 2px; cursor: pointer; border-radius: 50%; }
.av { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 13px; flex: none; letter-spacing: -.3px; }
.av.xs { width: 24px; height: 24px; font-size: 10.5px; }
.av.lg { width: 54px; height: 54px; font-size: 19px; }
.av.more { background: var(--surface-3); color: var(--ink-2); }
.avs { display: inline-flex; } .avs .av + .av { margin-left: -6px; box-shadow: 0 0 0 2px var(--surface); }
.netbar { display: none; padding: 8px 18px; font-size: 13.5px; background: #FFF2CC; color: #6b4a00; align-items: center; gap: 8px; }
.netbar.on { display: flex; } .netbar.off { background: #FCE4E2; color: #8a1a12; }
.view { padding: 22px 26px 40px; max-width: 1500px; width: 100%; outline: none; }
.only-m, .only-s { display: none !important; }
.bottomnav { display: none; }
.sb-scrim { display: none; }

/* page */
.page-hd { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-hd p { margin: 4px 0 0; font-size: 13.5px; }
.hd-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.hd-chips { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; box-shadow: var(--shadow); min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-hd { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-hd.pad { padding: 14px 18px 0; }
.card-hd h3 { display: flex; align-items: center; gap: 7px; }
.link { font-size: 13px; font-weight: 600; }
.grid { display: grid; gap: 16px; margin-bottom: 0; }
.grid > .card { margin-bottom: 16px; }
.g-2-1 { grid-template-columns: 2fr 1fr; } .g-1-1 { grid-template-columns: 1fr 1fr; } .g-1-2 { grid-template-columns: 1fr 2fr; }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 14.5px; }
.empty .ic { width: 34px; height: 34px; opacity: .45; }
.empty.sm { padding: 18px 10px; font-size: 13.5px; }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 10px; margin-bottom: 14px; font-size: 14px; background: var(--surface-3); }
.note > .ic { margin-top: 1px; }
.note ul { margin: 4px 0 0; padding-left: 18px; }
.note.warn { background: #FFF6DB; color: #5e4300; } .note.info { background: #E9F1FC; color: #173f75; } .note.ok { background: #E6F5E9; color: #145a26; } .note.serious { background: #FDEBE2; color: #7a3412; }
html.dark .note.warn { background: #3a2f12; color: #f3d48a; } html.dark .note.info { background: #172a45; color: #b6d0f5; } html.dark .note.ok { background: #16321d; color: #a3e3ad; } html.dark .note.serious { background: #3d2419; color: #f6bfa4; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpis.k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 15px; position: relative; box-shadow: var(--shadow); height: 100%; }
.kpi-link { color: inherit; text-decoration: none !important; display: block; }
.kpi-link:hover .kpi { border-color: var(--primary); }
.kpi-ic { position: absolute; right: 12px; top: 12px; color: var(--muted); opacity: .6; }
.kpi-l { font-size: 12.5px; color: var(--muted); font-weight: 600; padding-right: 22px; }
.kpi-v { font-size: 28px; font-weight: 750; letter-spacing: -.5px; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.kpi-s { font-size: 12.5px; color: var(--ink-2); }
.kpi-s .pbar { margin-top: 9px; }
.kpi.hero { grid-column: span 2; background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; border: 0; }
.kpi.hero .kpi-l, .kpi.hero .kpi-s, .kpi.hero .kpi-ic { color: rgba(255,255,255,.85); }
.kpi.hero .kpi-v { font-size: 38px; }
.kpi.hero .pbar { background: rgba(255,255,255,.22); }
.kpi.hero .pbar-fill { background: #fff; }
.kpi.hero .pbar-plan { background: var(--accent); }
.kpi.hero .var { background: rgba(255,255,255,.16); color: #fff; }
.kpi.crit .kpi-v { color: var(--crit-t); } .kpi.warn .kpi-v { color: var(--warn-t); } .kpi.serious .kpi-v { color: var(--serious-t); } .kpi.ok .kpi-v { color: var(--good-t); }
.kpis.k4 .kpi.hero { grid-column: span 1; }
.var { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 700; padding: 0 6px; border-radius: 6px; font-variant-numeric: tabular-nums; }
.var .ic { width: 12px; height: 12px; }
.var.pos { color: var(--good-t); background: rgba(12,163,12,.1); } .var.neg { color: var(--crit-t); background: rgba(208,59,59,.1); } .var.warnv { color: var(--warn-t); background: rgba(232,164,0,.12); }

/* progress bar */
.pbar { position: relative; height: 8px; background: var(--surface-3); border-radius: 99px; overflow: visible; min-width: 60px; }
.pbar.big { height: 11px; }
.pbar-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--primary); border-radius: 99px; max-width: 100%; transition: width .3s; }
.pbar-plan { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--ink); border-radius: 2px; opacity: .65; }
.prog-cell { min-width: 120px; } .prog-cell small { display: block; font-size: 12px; font-weight: 650; margin-top: 3px; font-variant-numeric: tabular-nums; }

/* status stack */
.sstack { display: flex; height: 22px; border-radius: 6px; overflow: hidden; gap: 2px; margin: 4px 0 12px; }
.sseg { min-width: 3px; } .sseg.st-done, .sdot.st-done, .sw.st-done { background: #2E7D32; } .sseg.st-ok, .sdot.st-ok, .sw.st-ok { background: #3E7BD6; } .sseg.st-warn, .sdot.st-warn, .sw.st-warn { background: #E0A000; } .sseg.st-crit, .sdot.st-crit, .sw.st-crit { background: #D03B3B; } .sseg.st-idle, .sdot.st-idle, .sw.st-idle { background: #9AA3B5; } .sseg.st-none, .sdot.st-none, .sw.st-none { background: #D3D8E2; }
.slegend { display: grid; grid-template-columns: 1fr; gap: 0; }
.sleg { display: flex; align-items: center; gap: 7px; font: inherit; font-size: 13px; padding: 5px 6px; border: 0; background: transparent; border-radius: 7px; cursor: pointer; color: var(--ink); text-align: left; }
.sleg:hover { background: var(--surface-2); }
.sleg b { margin-left: auto; font-variant-numeric: tabular-nums; }
.sdot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.mini-stats b { display: block; font-size: 18px; } .mini-stats span { font-size: 12px; color: var(--muted); }

/* charts */
.chart-wrap { position: relative; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { stroke: var(--line-2); }
.chart .tick { stroke: var(--line-2); }
.chart .axl { font-size: 11px; fill: var(--muted); font-family: var(--font); }
.chart .ln-plan { fill: none; stroke: var(--c-plan); stroke-width: 2; stroke-dasharray: 6 5; }
.chart .ln-act { fill: none; stroke: var(--c-act); stroke-width: 2.5; stroke-linejoin: round; }
.chart .pt-a { fill: var(--c-act); stroke: var(--surface); stroke-width: 2; }
.chart .today { stroke: var(--crit); stroke-width: 1.5; stroke-dasharray: 3 3; }
.chart .today-l { fill: var(--crit-t); }
.chart .vl { font-size: 12px; font-weight: 700; fill: var(--ink); font-family: var(--font); }
.chart .muted-t { fill: var(--muted); font-weight: 600; }
.chart .xhair { stroke: var(--ink-2); stroke-width: 1; opacity: .5; }
.tip { position: absolute; background: var(--surface); border: 1px solid var(--line-2); border-radius: 9px; padding: 8px 10px; font-size: 12.5px; box-shadow: var(--shadow-lg); pointer-events: none; min-width: 150px; z-index: 5; }
.tip div { display: flex; align-items: center; gap: 6px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; }
.legend.sm { font-size: 12px; margin: 10px 0 0; }
.lgd { display: inline-flex; align-items: center; gap: 6px; }
.lg-line { display: inline-block; width: 18px; height: 0; border-top: 2.5px solid var(--c-act); }
.lg-line.plan { border-top: 2px dashed var(--c-plan); }
.lg-box { display: inline-block; width: 12px; height: 8px; border-radius: 3px; background: var(--primary); }
.lg-tick { display: inline-block; width: 2px; height: 12px; background: var(--ink); opacity: .65; }
.hbars { display: flex; flex-direction: column; gap: 4px; }
.hb-row { display: grid; grid-template-columns: minmax(110px, 170px) 1fr 82px; gap: 10px; align-items: center; padding: 6px 6px; border-radius: 8px; color: var(--ink); text-decoration: none !important; }
.hb-row:hover { background: var(--surface-2); }
.hb-name { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 7px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-val { display: flex; align-items: center; justify-content: flex-end; gap: 6px; font-size: 13px; font-variant-numeric: tabular-nums; }
.sw { display: inline-block; width: 11px; height: 11px; border-radius: 3px; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.pname { display: inline-flex; align-items: center; gap: 6px; margin-right: 6px; }

/* tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 650; color: var(--muted); padding: 9px 10px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl.compact td, .tbl.compact th { padding: 6px 8px; font-size: 13px; }
.tbl tr.clickable { cursor: pointer; } .tbl tr.clickable:hover td, .tbl tbody tr:hover td { background: var(--surface-2); }
.tbl tr.grp-row td { background: var(--surface-2); font-weight: 600; }
.tbl tr.prj-row td { background: var(--surface-3); font-weight: 700; }
.tbl tr.off td { opacity: .45; }
.tbl .ind1 { padding-left: 28px; }
.tbl .act-col { width: 40px; text-align: right; }
.tname { padding-left: calc(10px + var(--d, 0) * 18px) !important; min-width: 260px; }
.tname a { color: var(--ink); font-weight: 500; } .grp-row .tname a { font-weight: 650; }
.tname .path { margin-left: 26px; }
.g-tog { width: 22px; height: 22px; border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 0; display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; border-radius: 5px; margin-right: 2px; flex: none; }
.g-tog:hover { background: var(--surface-3); }
.g-tog.sp { cursor: default; } .g-tog.sp:hover { background: transparent; }
.g-tog .ic { width: 15px; height: 15px; }
.wbs { display: inline-block; font-size: 11.5px; font-weight: 700; color: var(--muted); margin-right: 6px; font-variant-numeric: tabular-nums; }
.wbs.lg { font-size: 16px; }
.pend-dot, .pend { color: var(--warn); font-size: 11px; }
.tasks-wrap { max-height: calc(100vh - 230px); overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.toolbar .inp { width: auto; min-width: 170px; height: 36px; font-size: 14px; }
.search { position: relative; flex: 1; min-width: 200px; max-width: 380px; }
.search .ic { position: absolute; left: 10px; top: 9px; color: var(--muted); }
.search .inp { padding-left: 34px; width: 100%; }

/* tabs */
.tabs { display: flex; gap: 4px; margin-bottom: 14px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.tab { border: 0; background: transparent; font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); padding: 9px 12px; cursor: pointer; border-bottom: 2.5px solid transparent; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.tab.on { color: var(--primary); border-bottom-color: var(--primary); }
html.dark .tab.on { color: #9db2e6; border-bottom-color: #9db2e6; }
.tab .cnt { background: var(--surface-3); color: var(--ink-2); border-radius: 99px; padding: 0 7px; font-size: 12px; }

/* task cards (my) */
.tcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.tcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 15px; display: flex; flex-direction: column; gap: 9px; box-shadow: var(--shadow); border-left: 4px solid var(--primary); }
.tcard.st-crit { border-left-color: var(--crit); background: var(--surface); } .tcard.st-warn { border-left-color: var(--warn); background: var(--surface); } .tcard.st-done { border-left-color: var(--good); background: var(--surface); } .tcard.st-idle { border-left-color: var(--idle); background: var(--surface); } .tcard.st-ok { background: var(--surface); }
.tc-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.tc-path { font-size: 12px; color: var(--muted); }
.tc-name { font-size: 15.5px; font-weight: 650; color: var(--ink); line-height: 1.3; }
.tc-meta { font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.tc-meta .ic { width: 15px; height: 15px; color: var(--muted); }
.tc-meta .dot { color: var(--line-2); }
.tc-nums { display: flex; justify-content: space-between; font-size: 13px; margin-top: 6px; }
.tc-pend, .tc-stale { font-size: 12.5px; padding: 6px 9px; border-radius: 8px; display: flex; align-items: center; gap: 6px; }
.tc-pend { background: #FFF6DB; color: #6b4a00; } .tc-stale { background: #FDEBE2; color: #7a3412; }
html.dark .tc-pend { background: #3a2f12; color: #f3d48a; } html.dark .tc-stale { background: #3d2419; color: #f6bfa4; }
.tc-pend .ic, .tc-stale .ic { width: 15px; height: 15px; }

/* alerts / feed */
.alist { display: flex; flex-direction: column; }
.aitem { display: flex; gap: 10px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.aitem:last-child { border-bottom: 0; }
.aitem.clickable { cursor: pointer; } .aitem.clickable:hover { background: var(--surface-2); }
.aitem > .chip { flex: none; min-width: 0; }
.a-main { flex: 1; min-width: 0; }
.a-t { font-weight: 600; color: var(--ink); font-size: 14px; display: block; }
.a-s { font-size: 12.5px; color: var(--ink-2); }
.feed { display: flex; flex-direction: column; }
.feed-i { display: flex; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--line); color: var(--ink); font-size: 13.5px; text-decoration: none !important; align-items: flex-start; }
.feed-i:last-child { border-bottom: 0; } .feed-i:hover { background: var(--surface-2); }

/* task detail */
.prog-card { text-align: center; }
.big-pct { font-size: 46px; font-weight: 800; letter-spacing: -1px; color: var(--primary); }
html.dark .big-pct { color: #9db2e6; }
.prog-card .pbar { margin: 14px 4px; }
.pc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.pc-row small { display: block; color: var(--muted); font-size: 12px; } .pc-row b { font-size: 16px; }
.info { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; margin: 0; }
.info dt { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.info dd { margin: 0; font-size: 14px; }
.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-i { position: relative; padding: 0 0 16px; }
.tl-dot { position: absolute; left: -19px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 3px var(--surface); }
.tl-i.approved .tl-dot { background: var(--good); } .tl-i.rejected .tl-dot { background: var(--crit); }
.tl-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-h b { font-size: 17px; }
.tl-note { background: var(--surface-2); border-radius: 8px; padding: 8px 10px; margin: 6px 0; font-size: 14px; }
.tl-act { display: flex; gap: 6px; margin-top: 6px; }
.atts { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.att { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.att.img { padding: 0; overflow: hidden; }
.att.img img { width: 96px; height: 72px; object-fit: cover; display: block; }
.comments { display: flex; flex-direction: column; gap: 12px; margin-bottom: 10px; }
.cmt { display: flex; gap: 10px; font-size: 14px; }
.cmt-new { display: flex; gap: 8px; align-items: flex-end; }

/* entry */
.entry { display: flex; flex-direction: column; gap: 12px; }
.en-task { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; background: var(--surface-2); border-radius: 10px; }
.en-task b { font-size: 15.5px; }
.en-big { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 4px; }
.en-val { display: flex; align-items: baseline; }
.en-val input { width: 120px; font-size: 52px; font-weight: 800; text-align: center; border: 0; background: transparent; color: var(--primary); font-family: var(--font); -moz-appearance: textfield; }
html.dark .en-val input { color: #9db2e6; }
.en-val input::-webkit-outer-spin-button, .en-val input::-webkit-inner-spin-button { -webkit-appearance: none; }
.en-val span { font-size: 28px; font-weight: 700; color: var(--muted); }
.range { width: 100%; height: 36px; accent-color: var(--primary); }
.en-quick { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.en-quick .chip { padding: 7px 14px; font-size: 14px; }
.en-files { display: flex; gap: 8px; flex-wrap: wrap; }
.en-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumb { position: relative; width: 90px; height: 72px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11px; text-align: center; padding: 2px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb span { overflow: hidden; text-overflow: ellipsis; max-width: 100%; white-space: nowrap; }
.thumb .icon-btn { position: absolute; top: 2px; right: 2px; background: rgba(0,0,0,.55); color: #fff; }
.en-more summary { cursor: pointer; font-size: 13px; color: var(--muted); }

/* approvals */
.ap-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.ap-card { display: flex; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.ap-card.sel { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.ap-chk input { width: 20px; height: 20px; margin-top: 2px; }
.ap-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ap-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.ap-task { font-weight: 650; font-size: 15.5px; color: var(--ink); }
.ap-nums { display: flex; gap: 18px; align-items: flex-end; flex-wrap: wrap; padding: 8px 0; }
.ap-nums small { display: block; font-size: 11.5px; color: var(--muted); }
.ap-nums b { font-size: 17px; } .ap-nums b.big { font-size: 26px; color: var(--primary); margin-right: 6px; }
html.dark .ap-nums b.big { color: #9db2e6; }
.ap-nums .arrow { font-size: 20px; color: var(--muted); padding-bottom: 4px; }
.ap-act { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

/* projects */
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.pcard { border: 1px solid var(--line); border-radius: 11px; padding: 13px 14px; display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); }
.pc-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.pc-nums { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.pc-act { display: flex; gap: 6px; align-items: center; margin-top: 2px; }
.grp-row td .ic { width: 16px; height: 16px; }

/* gantt */
.gantt { border-radius: var(--radius); }
.g-scroll { overflow: auto; max-height: calc(100vh - 250px); position: relative; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.g-inner { position: relative; min-width: 100%; }
.g-hrow { display: flex; position: sticky; top: 0; z-index: 4; background: var(--surface-2); border-bottom: 1px solid var(--line-2); }
.g-name-h { position: sticky; left: 0; z-index: 5; width: var(--gname); flex: none; background: var(--surface-2); padding: 0 4px 0 12px; display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); border-right: 1px solid var(--line-2); }
.g-nh-t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-rsz { flex: none; width: 28px; height: 30px; margin-right: -2px; border: 1px solid var(--line-2); border-radius: 7px; background: var(--surface); color: var(--ink-2); cursor: col-resize; display: inline-flex; align-items: center; justify-content: center; padding: 0; touch-action: none; -webkit-user-select: none; user-select: none; }
.g-rsz svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.g-rsz:hover, .g-resizing .g-rsz { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.g-resizing, .g-resizing * { cursor: col-resize !important; -webkit-user-select: none; user-select: none; }
.g-resizing .g-name, .g-resizing .g-name-h { border-right: 2px solid var(--primary); }
.g-scale { position: relative; height: 48px; flex: none; }
.g-h1, .g-h2 { position: relative; height: 24px; }
.g-h2 { border-top: 1px solid var(--line); }
.g-hc { position: absolute; top: 0; height: 24px; font-size: 11.5px; display: flex; align-items: center; justify-content: center; color: var(--ink-2); border-left: 1px solid var(--line); overflow: hidden; white-space: nowrap; font-weight: 600; }
.g-hc.mo { justify-content: flex-start; padding-left: 6px; font-weight: 700; color: var(--ink); border-left-color: var(--line-2); }
.g-hc.mo span { position: sticky; left: calc(var(--gname) + 6px); }
.g-hc.d { font-size: 10.5px; font-weight: 500; } .g-hc.we { background: var(--surface-3); }
.g-hc.yr { font-weight: 700; color: var(--ink); justify-content: flex-start; padding-left: 6px; }
.g-body { position: relative; }
.g-lines { position: absolute; left: var(--gname); top: 0; bottom: 0; pointer-events: none; z-index: 0; }
.g-vl { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px solid var(--line); opacity: .7; }
.g-vl.strong { border-left-color: var(--line-2); opacity: 1; } .g-vl.faint { opacity: .35; } .g-vl.wk { opacity: .9; }
.g-today { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px solid var(--crit); z-index: 2; }
.g-today span { position: sticky; top: 50px; display: inline-block; background: var(--crit); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px; margin-left: -2px; white-space: nowrap; }
.g-row { display: flex; height: var(--rowh); border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); position: relative; }
.g-row:hover .g-name, .g-row:hover .g-track { background: color-mix(in srgb, var(--primary) 5%, var(--surface)); }
.g-row.grp .g-name { background: var(--surface-2); }
.g-row.g-sel .g-name, .g-row.g-sel .g-track { background: color-mix(in srgb, var(--primary) 12%, var(--surface)); }
/* утсан дээр хүрэхэд гарах товч мэдээлэл (v1.0.2) */
.g-peek { position: fixed; z-index: 90; background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 12px 32px rgba(10,20,40,.25); padding: 12px 14px 12px; font-size: 13px; animation: gpk .14s ease-out; }
@keyframes gpk { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.g-pk-x { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.g-pk-x .ic { width: 16px; height: 16px; }
.g-pk-name { font-weight: 700; font-size: 15px; line-height: 1.32; padding-right: 30px; overflow-wrap: break-word; }
.g-pk-path { color: var(--muted); font-size: 12px; margin-top: 3px; line-height: 1.35; }
.g-pk-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 9px; font-size: 12.5px; color: var(--ink-2); }
.g-pk-meta .ic { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }
.g-pk-meta .chip { font-size: 11.5px; padding: 2px 8px; }
.g-pk-who { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; font-size: 12.5px; }
.g-pk-who i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.g-pk-act { margin-top: 11px; display: flex; justify-content: flex-end; }
.g-name { position: sticky; left: 0; z-index: 3; width: var(--gname); flex: none; background: var(--surface); border-right: 1px solid var(--line-2); display: flex; align-items: center; padding: 0 8px 0 calc(6px + var(--d) * 16px); gap: 2px; font-size: 13px; min-width: 0; }
.g-nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); text-decoration: none !important; }
.g-nm.grp { font-weight: 650; } .g-nm.prj { font-weight: 750; color: var(--primary); }
.g-who { display: inline-flex; gap: 2px; flex: none; } .g-who i { width: 8px; height: 8px; border-radius: 2px; display: block; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.g-track { position: relative; flex: none; z-index: 1; }
.g-bar { position: absolute; top: 7px; height: calc(var(--rowh) - 14px); border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.18); cursor: pointer; overflow: hidden; touch-action: pan-y; }
.g-bar:hover { box-shadow: inset 0 0 0 1px rgba(0,0,0,.4), 0 2px 6px rgba(0,0,0,.18); }
.g-bar .g-prog { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(0,0,0,.32); border-right: 2px solid rgba(0,0,0,.45); }
.g-bar .g-prog[style*="width:0%"] { border-right: 0; }
html.dark .g-bar .g-prog { background: rgba(0,0,0,.45); }
.g-bar.grp { top: 11px; height: 10px; background: #5B6577; border-radius: 3px; }
html.dark .g-bar.grp { background: #8b96ab; }
.g-bar.grp .g-prog { background: var(--primary); border: 0; }
html.dark .g-bar.grp .g-prog { background: #2a3550; }
.g-bar.ed { cursor: grab; touch-action: none; } .g-bar.dragging { cursor: grabbing; opacity: .85; z-index: 6; }
.g-bar.dragging::after { content: attr(data-tip); position: fixed; transform: translateY(-28px); background: var(--ink); color: var(--surface); font-size: 11px; padding: 2px 6px; border-radius: 4px; white-space: nowrap; }
.g-h { position: absolute; top: 0; bottom: 0; width: 7px; cursor: ew-resize; z-index: 2; } .g-h.l { left: 0; } .g-h.r { right: 0; }
.g-h:hover { background: rgba(255,255,255,.35); }
.g-lab { position: absolute; top: 8px; font-size: 11px; font-weight: 700; color: var(--ink-2); white-space: nowrap; pointer-events: none; font-variant-numeric: tabular-nums; }
.g-lab.crit { color: var(--crit-t); } .g-lab.warn { color: var(--warn-t); }
.g-base { position: absolute; bottom: 2px; height: 3px; background: var(--muted); opacity: .55; border-radius: 2px; }
.g-ms { position: absolute; top: 8px; width: 16px; height: 16px; background: var(--primary); transform: rotate(45deg); border-radius: 2px; cursor: pointer; }
.g-hint { margin: -4px 0 10px; line-height: 1.4; } .g-hint .ic { width: 14px; height: 14px; vertical-align: -2px; }
.g-legend { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; align-items: center; }
.lg-btn { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font: inherit; font-size: 12.5px; cursor: pointer; color: var(--ink); }
.lg-btn.on { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.lg-today { display: inline-block; width: 2px; height: 12px; background: var(--crit); vertical-align: -2px; }
.lg-base { display: inline-block; width: 16px; height: 3px; background: var(--muted); opacity: .6; vertical-align: 2px; }
.gantt.month { --rowh: 28px; } .gantt.month .g-bar { top: 6px; } .gantt.month .g-lab { top: 6px; }

/* modal */
.modal-wrap { position: fixed; inset: 0; background: rgba(15,20,35,.45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; opacity: 0; transition: opacity .18s; }
.modal-wrap.in { opacity: 1; } .modal-wrap.out { opacity: 0; }
.modal { background: var(--surface); border-radius: 16px; width: min(560px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); transform: translateY(8px); transition: transform .18s; }
.modal-wrap.in .modal { transform: none; }
.modal.sm { width: min(420px, 100%); } .modal.md { width: min(560px, 100%); } .modal.lg { width: min(780px, 100%); } .modal.xl { width: min(1100px, 100%); }
.modal-hd { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px 20px; border-bottom: 1px solid var(--line); }
.modal-hd h3 { font-size: 17px; }
.modal-bd { padding: 16px 20px; overflow-y: auto; }
.modal-ft { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 20px 16px; border-top: 1px solid var(--line); align-items: center; }
.confirm-msg { font-size: 15px; margin: 0; }
body.modal-open { overflow: hidden; }
.pw-show { text-align: center; padding: 14px; background: var(--surface-2); border-radius: 10px; margin: 10px 0; }
.pw-show code { font-size: 22px; letter-spacing: 1px; background: transparent; }

/* popmenu, toast, busy */
.popmenu { position: fixed; z-index: 120; background: var(--surface); border: 1px solid var(--line-2); border-radius: 11px; box-shadow: var(--shadow-lg); padding: 5px; min-width: 220px; max-width: 320px; }
.popmenu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 11px; border: 0; background: transparent; font: inherit; font-size: 14px; color: var(--ink); border-radius: 7px; cursor: pointer; text-align: left; }
.popmenu button:hover { background: var(--surface-2); }
.popmenu button.danger { color: var(--crit-t); }
.popmenu hr { margin: 4px 0; }
#toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(560px, 92vw); }
.toast { background: #1b2233; color: #fff; padding: 11px 16px; border-radius: 11px; font-size: 14px; box-shadow: var(--shadow-lg); display: flex; gap: 9px; align-items: center; animation: tin .2s; transition: opacity .4s, transform .4s; pointer-events: auto; }
.toast.ok .ic { color: #6ee07c; } .toast.err { background: #8f1c15; }
.toast.out { opacity: 0; transform: translateY(8px); }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }
#busy { position: fixed; inset: 0; background: rgba(15,20,35,.4); z-index: 150; display: none; align-items: center; justify-content: center; }
#busy.on { display: flex; }
.busy-box { background: var(--surface); padding: 22px 26px; border-radius: 14px; display: flex; gap: 14px; align-items: center; font-weight: 600; box-shadow: var(--shadow-lg); max-width: 90vw; }

/* notifications */
.notif-list { display: flex; flex-direction: column; }
.notif { display: flex; gap: 10px; padding: 10px 6px; border-bottom: 1px solid var(--line); color: var(--ink); font-size: 14px; text-decoration: none !important; }
.notif.unread { background: color-mix(in srgb, var(--primary) 7%, transparent); }
.notif .ic { color: var(--primary); margin-top: 2px; }

/* import */
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 2px dashed var(--line-2); border-radius: 14px; padding: 34px 16px; text-align: center; cursor: pointer; background: var(--surface-2); transition: border-color .15s, background .15s; margin-bottom: 12px; }
.drop:hover, .drop.over { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 6%, var(--surface)); }
.drop .ic { width: 36px; height: 36px; color: var(--primary); }
.drop span { font-size: 13px; color: var(--muted); }
.bullets { padding-left: 18px; margin: 0 0 10px; } .bullets li { margin-bottom: 4px; }
.imp-wrap { max-height: 60vh; }
.tbl.imp .lvl { display: inline-block; width: 18px; text-align: center; font-weight: 700; font-size: 12px; }
.map-list { display: flex; flex-direction: column; gap: 6px; }
.map-row { display: grid; grid-template-columns: 1fr 1.2fr; gap: 10px; align-items: center; }

/* settings / misc */
.sys-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 8px; }
.sys-grid > div { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; min-width: 0; overflow-wrap: anywhere; }
.sys-grid small { display: block; font-size: 11.5px; color: var(--muted); } .sys-grid b { font-size: 15px; }
.urls { display: flex; flex-wrap: wrap; gap: 8px; } .urls code { font-size: 14px; padding: 5px 10px; }
.roles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.role-i p { margin: 6px 0 0; color: var(--ink-2); }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.theme-card { border: 2px solid var(--line); border-radius: 12px; background: var(--surface); padding: 10px; cursor: pointer; font: inherit; color: var(--ink); display: flex; flex-direction: column; gap: 8px; text-align: left; }
.theme-card.on { border-color: var(--primary); }
.th-prev { display: grid; grid-template-columns: 22px 1fr; grid-template-rows: 1fr 1fr; gap: 3px; height: 44px; border-radius: 7px; overflow: hidden; background: #F3F5F9; padding: 3px; }
.th-prev i:first-child { grid-row: 1 / 3; border-radius: 4px; } .th-prev i { background: #fff; border-radius: 3px; }
.th-prev.dk { background: #10141f; } .th-prev.dk i:not(:first-child) { background: #1d2434; }
.inst h4 { display: flex; gap: 8px; align-items: center; } .inst ol { margin: 4px 0 10px; padding-left: 22px; } .inst li { margin-bottom: 3px; }
.faq { border-bottom: 1px solid var(--line); padding: 10px 2px; } .faq summary { cursor: pointer; font-weight: 600; } .faq > div { padding: 8px 0 2px; color: var(--ink-2); font-size: 14px; }
.steps { padding-left: 20px; margin: 0; } .steps li { margin-bottom: 8px; }
.doc-link { display: flex; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 11px; margin-bottom: 10px; color: var(--ink); text-decoration: none !important; }
.doc-link:hover { border-color: var(--primary); }
.doc-link .ic { width: 30px; height: 30px; color: var(--crit); } .doc-link small { display: block; color: var(--muted); }
.perm-list { list-style: none; padding: 0; margin: 10px 0; } .perm-list li { display: flex; gap: 8px; align-items: center; padding: 3px 0; font-size: 14px; } .perm-list .ic { color: var(--good-t); width: 16px; height: 16px; }

/* report (screen preview + print) */
.rpt-preview { overflow-x: auto; }
.rpt { color: #141A26; background: #fff; font-size: 12.5px; max-width: 1000px; margin: 0 auto; }
html.dark .rpt-preview { background: #fff; }
.rpt-hd { display: flex; justify-content: space-between; align-items: center; border-bottom: 3px solid #344D85; padding-bottom: 10px; margin-bottom: 14px; }
.rpt-logo { height: 46px; }
.rpt-meta { text-align: right; font-size: 12px; color: #4a5468; }
.rpt-title { font-size: 21px; color: #263a68; margin: 4px 0; }
.rpt-sub { font-size: 14px; font-weight: 600; color: #3B4558; }
.rpt-desc { color: #4a5468; font-size: 12px; margin: 6px 0 0; }
.rpt h2 { font-size: 14.5px; color: #263a68; margin: 18px 0 8px; padding-bottom: 4px; border-bottom: 1px solid #d5dbe8; }
.rt { width: 100%; border-collapse: collapse; font-size: 11.5px; margin-bottom: 6px; }
.rt th { background: #344D85; color: #fff; padding: 5px 6px; text-align: left; font-weight: 600; }
.rt td { border-bottom: 1px solid #e3e7ef; padding: 4px 6px; vertical-align: top; }
.rt tr.b td { font-weight: 700; background: #F1F3F8; }
.rt .nw { white-space: nowrap; }
.rt .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rt .sm, .rpt .sm { font-size: 10.5px; color: #6A7487; }
.rt.xs { font-size: 10.5px; } .rt.xs td { padding: 2px 5px; }
.rt .sw { margin-right: 5px; }
.kpi-t td { width: 25%; border: 1px solid #dfe4ee; padding: 7px 9px; }
.kpi-t small { display: block; color: #6A7487; font-size: 10.5px; } .kpi-t b { font-size: 16px; color: #141A26; }
.rpt-bar { margin: 10px 0 4px; } .rpt-bar .pbar-fill { background: #344D85; }
.rpt-note { font-size: 10.5px; color: #6A7487; }
.rpt-ai { background: #F4F6FB; border-left: 3px solid #344D85; padding: 8px 12px; font-size: 12.5px; }
.rpt-ai h3 { font-size: 13px; margin: 8px 0 4px; color: #263a68; } .rpt-ai ul { margin: 4px 0; padding-left: 18px; }
.rpt .chart .axl, .rpt .chart .vl { fill: #4a5468; } .rpt .chart .grid { stroke: #e3e7ef; } .rpt .chart .ln-act { stroke: #344D85; } .rpt .chart .pt-a { fill: #344D85; }
.rpt .legend { color: #3B4558; } .rpt .lg-line { border-top-color: #344D85; }
.rt.gt { table-layout: fixed; font-size: 8.5px; }
.rt.gt th { padding: 2px 1px; text-align: center; font-size: 8px; } .rt.gt th:first-child { width: 230px; text-align: left; } .rt.gt th:nth-child(2) { width: 26px; }
.rt.gt td { padding: 1px 3px; border: 1px solid #edf0f5; height: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rt.gt td.c { padding: 0; } .rt.gt .now { box-shadow: inset 0 0 0 1px #E0A000; } .rt.gt th.now { background: #E0A000; }
.rpt-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 40px; margin-top: 28px; font-size: 12px; }
.rpt-sign div { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; align-items: end; }
.rpt-sign span { color: #4a5468; } .rpt-sign i { grid-column: 1 / -1; border-bottom: 1px solid #9aa3b5; height: 22px; }
.rpt-ft { margin-top: 24px; font-size: 10px; color: #8a93a6; border-top: 1px solid #e3e7ef; padding-top: 6px; text-align: center; }
#print-area { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1560px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi.hero { grid-column: span 1; }
}
@media (max-width: 1280px) {
  .sys-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1024px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-100%); transition: transform .22s; box-shadow: var(--shadow-lg); }
  body.drawer-open .sidebar { transform: none; }
  body.drawer-open .sb-scrim { display: block; position: fixed; inset: 0; background: rgba(15,20,35,.4); z-index: 35; }
  .only-m { display: inline-flex !important; }
  .bottomnav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line); height: calc(var(--bn-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); }
  .bn-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); border: 0; background: transparent; font-family: inherit; position: relative; text-decoration: none !important; cursor: pointer; }
  .bn-item .ic { width: 22px; height: 22px; }
  .bn-item.on { color: var(--primary); }
  html.dark .bn-item.on { color: #9db2e6; }
  .bn-item .nb { position: absolute; top: 6px; left: calc(50% + 6px); margin: 0; font-size: 10px; padding: 0 5px; }
  .view { padding: 16px 14px calc(var(--bn-h) + 30px); }
  .g-2-1, .g-1-1, .g-1-2 { grid-template-columns: 1fr; }
  .tb-proj select { min-width: 0; max-width: 46vw; }
  #toasts { bottom: calc(var(--bn-h) + 16px); }
}
@media (max-width: 720px) {
  body { font-size: 15px; }
  h1 { font-size: 19px; }
  .topbar { padding: 0 8px; gap: 4px; height: calc(56px + env(safe-area-inset-top)); }
  .tb-title { display: none; }
  .tb-proj { flex: 1; } .tb-proj select { max-width: 100%; width: 100%; }
  .kpis, .kpis.k4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi.hero, .kpis.k4 .kpi.hero { grid-column: 1 / -1; }
  .kpi { padding: 12px; } .kpi-v { font-size: 24px; } .kpi.hero .kpi-v { font-size: 34px; }
  .hide-s { display: none !important; }
  .only-s { display: block !important; }
  .form-grid { grid-template-columns: 1fr; }
  .page-hd { margin-bottom: 14px; }
  .hd-actions { width: 100%; }
  .hd-actions .btn { flex: 1 1 auto; }
  .card { padding: 14px; border-radius: 11px; }
  .tcards { grid-template-columns: 1fr; }
  .info { grid-template-columns: 1fr; }
  .slegend { grid-template-columns: 1fr; }
  .hb-row { grid-template-columns: 100px 1fr 70px; gap: 8px; }
  :root { --gname: 170px; }
  .gantt, .gantt.month { --rowh: 36px; }
  .g-name { font-size: 12px; padding-left: calc(2px + var(--d) * 10px); padding-right: 4px; }
  .g-nm { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.22; overflow-wrap: break-word; }
  .g-name .wbs { font-size: 10.5px; margin-right: 4px; }
  .g-tog { width: 20px; margin-right: 0; }
  .g-bar { top: 8px; height: calc(var(--rowh) - 16px); } .gantt.month .g-bar { top: 8px; }
  .g-bar.grp, .gantt.month .g-bar.grp { top: 13px; }
  .g-lab, .gantt.month .g-lab { top: 10px; } .g-ms { top: 10px; }
  .g-name-h { padding-left: 8px; }
  .g-who { display: none; }
  .g-scroll { max-height: calc(100vh - 300px); }
  .modal-wrap.as-sheet { align-items: flex-end; padding: 0; }
  .modal-wrap.as-sheet .modal { border-radius: 18px 18px 0 0; width: 100%; max-height: 92vh; transform: translateY(30px); }
  .modal-wrap.as-sheet.in .modal { transform: none; }
  .modal-wrap { padding: 10px; }
  .modal-ft { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .modal-ft .btn { flex: 1; }
  .login { grid-template-columns: 1fr; }
  .login-art { padding: 28px 22px 70px; min-height: auto; }
  .login-art h1 { font-size: 24px; } .login-art p { font-size: 14.5px; }
  .login-feats { display: none; }
  .login-logo { width: 240px; margin-bottom: 18px; }
  .login-card { margin: -50px auto 24px; padding: 26px 20px; }
  .login-author { margin-top: 18px; padding-top: 12px; font-size: 12.5px; }
  .tasks-wrap { max-height: none; }
  .toolbar .inp { min-width: 0; flex: 1 1 140px; }
  .search { max-width: none; flex-basis: 100%; }
  .ap-card { padding: 12px; } .ap-act .btn { flex: 1; }
  .map-row { grid-template-columns: 1fr; gap: 4px; }
  .sys-grid { grid-template-columns: 1fr 1fr; }
  .rpt-sign { grid-template-columns: 1fr; }
  .pcards { grid-template-columns: 1fr; }
  .aitem { flex-wrap: wrap; gap: 6px 10px; }
  .aitem .a-main { flex: 1 1 100%; order: 2; }
  .aitem > .btn { order: 3; }
}
@media (max-width: 900px) { .hide-m { display: none !important; } }

/* ---------- print ---------- */
@media print {
  @page { size: A4; margin: 12mm 11mm; }
  body.print-landscape { }
  body * { visibility: hidden; }
  #print-area, #print-area * { visibility: visible; }
  #print-area { display: block !important; position: absolute; left: 0; top: 0; width: 100%; }
  .rpt { max-width: none; font-size: 11px; }
  .rpt h2 { break-after: avoid; } .rpt h2.pb { break-before: page; }
  .rt tr, .kpi-t { break-inside: avoid; }
  .chart-wrap { break-inside: avoid; }
  .tip, .xhair { display: none !important; }
  .shell, #toasts, #busy, .modal-wrap { display: none !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media print { body.print-landscape { } }
