/* Sysglob Project Dashboard — design tokens + components (light and dark). */
/* Layout: collapsible light sidebar · frosted top bar · content grid of cards. */
/* Palette and type follow the SysGlob website (sysglob.in): SysGlob blue #0c73e3 on a cool white ground,
   navy ink, the same blue and neutral ramps; Outfit for headings, Public Sans for text, Geist Mono for codes.
   Semantic status colours (ok / warn / bad) stay as they were so health ratings read the same. */
:root {
  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --surface-3: #eceff4;
  --glass: rgba(255, 255, 255, .88);
  --border: #dde2ea;
  --border-strong: #c1c9d4;
  --text: #0f1c2e;
  --text-2: #4b5563;
  --text-3: #5f6a7a;
  --brand: #0c73e3;
  --brand-600: #0a5cb8;
  --brand-50: #eaf3fe;
  --brand-100: #cfe4fd;
  --on-brand: #ffffff;
  --brand-glow: transparent;
  --accent: #0c73e3;
  --accent-50: #eaf3fe;
  --navy: #0a2a50;
  --chart-1: #0a2a50;
  --chart-2: #0c73e3;
  --ok: #0f6b3f;      --ok-bg: #e7f4ec;
  --warn: #b45309;    --warn-bg: #fdf3e2;
  --bad: #b3261e;     --bad-bg: #fbeceb;
  --info: #0a5cb8;    --info-bg: #eaf3fe;
  --muted-bg: #eceff4;
  --shadow-sm: 0 1px 2px rgba(15, 28, 46, .05);
  --shadow: 0 1px 2px rgba(15, 28, 46, .05), 0 8px 24px -8px rgba(15, 28, 46, .12);
  --shadow-lg: 0 20px 48px -12px rgba(15, 28, 46, .25);
  --radius: 8px;
  --radius-sm: 6px;
  --font: "Public Sans Variable", "Public Sans", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --display: "Outfit Variable", "Outfit", var(--font);
  --mono: "Geist Mono Variable", "Geist Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #061323;
  --surface: #0b1b2f;
  --surface-2: #0e2139;
  --surface-3: #132a46;
  --glass: rgba(11, 27, 47, .88);
  --border: #1c3554;
  --border-strong: #2a4a70;
  --text: #eef3f9;
  --text-2: #a9b8cb;
  --text-3: #8b9bb0;
  --brand: #4d9cf0;
  --brand-600: #6fadf4;
  --brand-50: #0f2a4a;
  --brand-100: #163a63;
  --on-brand: #04101e;
  --brand-glow: transparent;
  --accent: #4d9cf0;
  --accent-50: #0f2a4a;
  --navy: #04101e;
  --chart-1: #cfe4fd;
  --chart-2: #4d9cf0;
  --ok: #4ade80;      --ok-bg: #0f2a1d;
  --warn: #fbbf24;    --warn-bg: #2d220b;
  --bad: #f87171;     --bad-bg: #331616;
  --info: #6fadf4;    --info-bg: #0f2a4a;
  --muted-bg: #132a46;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -8px rgba(0, 0, 0, .6);
  --shadow-lg: 0 20px 48px -12px rgba(0, 0, 0, .75);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; font-feature-settings: "ss01", "cv11";
}
a { color: var(--text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-family: var(--display); line-height: 1.25; letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-size: 24px; font-weight: 750; }
h2 { font-size: 16px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0 0 .5em; }
code { font-family: var(--mono); font-size: .92em; }
.num, .tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--brand-100); }

.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.icon.sm { width: 15px; height: 15px; }
.icon.lg { width: 24px; height: 24px; }

/* ---------- Motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(10px) scale(.97); opacity: 0; } }
@keyframes slide-in { from { transform: translateX(100%); } }
@keyframes shimmer { to { background-position: -200% 0; } }
.content > * { animation: rise .45s var(--ease) both; }
.content > *:nth-child(2) { animation-delay: .04s; }
.content > *:nth-child(3) { animation-delay: .08s; }
.content > *:nth-child(4) { animation-delay: .12s; }
.content > *:nth-child(5) { animation-delay: .16s; }
.content > *:nth-child(n+6) { animation-delay: .2s; }
.grid > .card { animation: rise .5s var(--ease) both; }
.grid > .card:nth-child(2) { animation-delay: .05s; }
.grid > .card:nth-child(3) { animation-delay: .1s; }
.grid > .card:nth-child(4) { animation-delay: .15s; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- App shell ---------- */
.shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; transition: grid-template-columns .25s var(--ease); }
.sidebar {
  background: var(--surface); border-right: 1px solid var(--border); color: var(--text-2);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 30; overflow: hidden;
}
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 18px 18px 14px; min-height: 72px; }
/* The SysGlob logo is two pills (blue "SYS", white "GLOB"), so it reads on light and dark grounds alike. */
.brand-logo { display: block; height: 34px; width: auto; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 6px; display: grid; place-items: center; color: #fff; flex: none;
  background: var(--brand); color: var(--on-brand); position: relative;
}
.brand-mark .icon { width: 20px; height: 20px; }
.brand-mark::after { content: ""; position: absolute; right: -3px; top: -3px; width: 10px; height: 10px; border-radius: 3px; background: var(--accent); border: 2px solid var(--surface); }
.brand-name { color: var(--text); font-weight: 750; font-size: 15px; line-height: 1.2; white-space: nowrap; letter-spacing: -.01em; }
.brand-sub { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.tricolour { display: none; }
.nav { padding: 6px 12px; flex: 1; overflow-y: auto; overflow-x: hidden; }
.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); padding: 16px 10px 6px; font-weight: 700; white-space: nowrap; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 9px 11px; border-radius: 6px; color: var(--text-2);
  font-weight: 600; margin-bottom: 2px; text-decoration: none; transition: background .15s, color .15s; white-space: nowrap; position: relative;
}
.nav a:hover { background: var(--surface-3); color: var(--text); }
.nav a.active { background: var(--surface-3); color: var(--text); }
.nav a.active .icon { color: var(--accent); }
.nav a .count { margin-left: auto; font-size: 11px; font-weight: 700; background: var(--accent); color: #fff; padding: 0 7px; border-radius: 99px; }
.sidebar-foot { padding: 12px; border-top: 1px solid var(--border); display: flex; gap: 8px; align-items: center; }
.sidebar-foot .who { font-size: 12px; color: var(--text-3); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.collapse-btn { margin-left: auto; }
/* Collapsed rail */
.shell.collapsed { grid-template-columns: 76px 1fr; }
.shell.collapsed .brand-name, .shell.collapsed .brand-sub, .shell.collapsed .nav a .lbl,
.shell.collapsed .nav-label, .shell.collapsed .sidebar-foot .who { display: none; }
.shell.collapsed .nav a { justify-content: center; padding: 10px; }
.shell.collapsed .brand { align-items: center; padding-inline: 0; }
/* Collapsed rail: show only the blue "SYS" end of the logo. */
.shell.collapsed .brand-logo { width: 34px; height: 34px; object-fit: cover; object-position: left center; border-radius: 17px; }
.shell.collapsed .sidebar-foot { justify-content: center; }
.shell.collapsed .nav-label + a, .shell.collapsed .nav hr { margin-top: 14px; }
.shell.collapsed .collapse-btn .icon { transform: rotate(180deg); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 28px; background: var(--glass);
  backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20;
}
.topbar .menu-btn { display: none; }
.search {
  flex: 1; min-width: 0; max-width: 440px; display: flex; align-items: center; gap: 10px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 6px; padding: 0 8px 0 12px; height: 40px; color: var(--text-3);
  cursor: pointer; font: inherit; text-align: left; transition: border-color .15s, box-shadow .15s;
}
.search:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.search span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
kbd { font-family: var(--font); font-size: 11px; font-weight: 700; color: var(--text-3); background: var(--surface-3); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; border-radius: 6px; cursor: pointer; position: relative; border: 0; background: none; color: inherit; font: inherit; }
.user-chip:hover { background: var(--surface-3); }
.user-chip .meta { text-align: left; line-height: 1.2; }
.user-chip .meta b { display: block; font-size: 13px; }
.user-chip .meta span { font-size: 11.5px; color: var(--text-3); }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 50; animation: pop .16s var(--ease);
}
.dropdown a, .dropdown button {
  display: flex; width: 100%; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 6px; color: var(--text);
  background: none; border: 0; font: inherit; cursor: pointer; text-align: left;
}
.dropdown a:hover, .dropdown button:hover { background: var(--surface-3); text-decoration: none; }
.dropdown hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }

.content { padding: 28px; max-width: 1500px; width: 100%; margin: 0 auto; flex: 1; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .sub { color: var(--text-3); margin-top: 4px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { font-size: 12.5px; color: var(--text-3); margin-bottom: 10px; display: flex; gap: 6px; align-items: center; }
.crumbs a { color: var(--text-3); }
.app-footer { padding: 16px 28px; color: var(--text-3); font-size: 12px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- Buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 650;
  cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .2s, transform .1s; text-decoration: none !important;
  box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--surface-3); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 6px; }
.btn.icon-only { width: 38px; padding: 0; }
.btn.sm.icon-only { width: 32px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.seg { display: inline-flex; background: var(--surface-3); border-radius: 6px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 0 12px; height: 32px; border-radius: 6px; font: inherit; font-weight: 600; color: var(--text-3); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: background .15s, color .15s; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: all .15s;
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.chip .x { opacity: .7; }

label.field { display: block; }
.field > span { display: block; font-size: 12.5px; font-weight: 650; color: var(--text-2); margin-bottom: 6px; }
.field > span .req { color: var(--bad); }
.field .hint { font-size: 11.5px; color: var(--text-3); margin-top: 5px; }
.input, select.input, textarea.input {
  width: 100%; height: 40px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  border-radius: 6px; padding: 0 12px; font: inherit; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 92px; padding: 10px 12px; resize: vertical; }
.input:focus { border-color: var(--text-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--text) 10%, transparent); }
.input.sm { height: 32px; font-size: 13px; }
input[type=range] { accent-color: var(--accent); width: 100%; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.check { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }
.form-section { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); font-weight: 750; padding-top: 10px; border-top: 1px solid var(--border); margin-top: 4px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .input { width: auto; min-width: 150px; }
.toolbar .grow { flex: 1; min-width: 200px; }
.input-icon { position: relative; flex: 1; min-width: 200px; }
.input-icon .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.input-icon .input { padding-left: 38px; width: 100%; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 0; }
.card-head h2 { display: flex; gap: 8px; align-items: center; }
.card-head .sub { color: var(--text-3); font-size: 12.5px; margin-top: 3px; }
.card-body { padding: 16px 20px 20px; }
.card.pad { padding: 20px; }
.grid { display: grid; gap: 18px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.mt { margin-top: 18px; }
.align-start { align-items: start; }
.next-ms { display: flex; gap: 7px; align-items: flex-start; line-height: 1.4; }
.next-ms .icon { margin-top: 1px; color: var(--accent); }

.kpi { padding: 18px 20px; display: flex; gap: 14px; align-items: flex-start; position: relative; overflow: hidden; transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; }
.kpi.clickable { cursor: pointer; }
.kpi.clickable:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.kpi .kpi-icon { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; flex: none; }
.kpi .kpi-label { color: var(--text-3); font-size: 12.5px; font-weight: 650; }
.kpi .kpi-value { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.15; margin-top: 3px; }
.kpi .kpi-foot { font-size: 12px; color: var(--text-3); margin-top: 5px; }
.kpi .kpi-bar { margin-top: 10px; }
.tone-brand { background: var(--brand-50); color: var(--brand); }
.tone-ok { background: var(--ok-bg); color: var(--ok); }
.tone-warn { background: var(--warn-bg); color: var(--warn); }
.tone-bad { background: var(--bad-bg); color: var(--bad); }
.tone-info { background: var(--info-bg); color: var(--info); }
.tone-accent { background: var(--accent-50); color: var(--accent); }
.tone-muted { background: var(--muted-bg); color: var(--text-2); }

.hero {
  border-radius: var(--radius); padding: 22px 24px; background: var(--surface); border: 1px solid var(--border);
  display: flex; justify-content: space-between; gap: 24px; align-items: center; flex-wrap: wrap; margin-bottom: 18px;
}
.hero h1 { font-size: 24px; }
.hero p { margin: 4px 0 0; color: var(--text-3); }
.hero-stats { display: flex; gap: 0; flex-wrap: wrap; }
.hero-stats div { padding: 4px 22px; border-left: 1px solid var(--border); min-width: 120px; }
.hero-stats div:first-child { border-left: 0; }
.hero-stats div b { display: block; font-size: 24px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.hero-stats div > span { font-size: 12px; color: var(--text-3); }

/* ---------- Badges, progress, avatars ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 99px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.progress { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; min-width: 60px; }
.progress > i { display: block; height: 100%; border-radius: inherit; background: var(--brand); transition: width .8s var(--ease); }
.progress.ok > i { background: var(--ok); }
.progress.warn > i { background: var(--warn); }
.progress.bad > i { background: var(--bad); }
.progress.thin { height: 5px; }
.progress-row { display: flex; align-items: center; gap: 10px; }
.progress-row .progress { flex: 1; }
.progress-row b { font-size: 12.5px; font-variant-numeric: tabular-nums; min-width: 38px; text-align: right; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 650; color: #fff; flex: none; letter-spacing: .02em; }
.avatar.sm { width: 26px; height: 26px; font-size: 10.5px; }
.avatar.lg { width: 60px; height: 60px; font-size: 20px; }
img.avatar { object-fit: cover; background: var(--surface-3); display: inline-block; }
.avatar.xl { width: 88px; height: 88px; font-size: 28px; }
.photo-edit { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.photo-edit .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.avatars { display: flex; }
.avatars .avatar { border: 2px solid var(--surface); margin-left: -8px; }
.avatars .avatar:first-child { margin-left: 0; }
.ring { position: relative; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring circle { transition: stroke-dashoffset 1s var(--ease); }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); font-weight: 700; padding: 11px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tr.click { cursor: pointer; }
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--text); }
.table th.sorted { color: var(--accent); }
.table .right { text-align: right; }
.cell-title b { display: block; font-weight: 650; }
.cell-title span { font-size: 12px; color: var(--text-3); }

/* ---------- Lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 12px; align-items: flex-start; padding: 11px 8px; margin: 0 -8px; border-radius: 6px; transition: background .12s; }
.list li:hover { background: var(--surface-2); }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 650; color: var(--text); }
.list a.title:hover { color: var(--accent); text-decoration: none; }
.list .meta { font-size: 12px; color: var(--text-3); }
.date-chip { min-width: 48px; text-align: center; border-radius: 6px; padding: 5px 0; line-height: 1.1; background: var(--surface-3); }
.date-chip b { display: block; font-size: 16px; font-weight: 800; }
.date-chip span { font-size: 10.5px; text-transform: uppercase; color: var(--text-3); font-weight: 650; }
.date-chip.late { background: var(--bad-bg); color: var(--bad); }
.date-chip.late span { color: var(--bad); }
.empty { text-align: center; padding: 40px 16px; color: var(--text-3); }
.empty .icon { width: 36px; height: 36px; opacity: .5; margin-bottom: 8px; }

.skeleton { border-radius: var(--radius); background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }

/* ---------- Project cards ---------- */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.pcard { padding: 20px; display: flex; flex-direction: column; gap: 14px; cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; color: inherit; text-decoration: none !important; position: relative; overflow: hidden; }
.pcard:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.pcard .top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.pcard .code { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); }
.pcard h3 { margin-top: 4px; font-size: 16px; color: var(--text); }
.pcard .agency { color: var(--text-3); font-size: 12.5px; display: flex; align-items: center; gap: 6px; margin-top: 5px; }
.pcard .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; background: var(--surface-2); border-radius: 6px; padding: 10px 12px; }
.pcard .stats div span { display: block; font-size: 11px; color: var(--text-3); font-weight: 600; }
.pcard .stats div b { font-size: 14px; font-variant-numeric: tabular-nums; }
.pcard .open-hint { position: absolute; right: 16px; top: 16px; opacity: 0; transform: translateX(-6px); transition: all .2s var(--ease); color: var(--accent); }
.pcard:hover .open-hint { opacity: 1; transform: none; }
.health-bar { position: absolute; left: 0; right: 0; top: 0; height: 3px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; margin-bottom: 20px; overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 5px; scrollbar-width: none; }
.tabs button {
  border: 0; background: none; font: inherit; padding: 8px 13px; color: var(--text-3); font-weight: 650; cursor: pointer; border-radius: 6px;
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; transition: background .15s, color .15s;
}
.tabs button:hover { color: var(--text); background: var(--surface-2); }
.tabs button.on { color: var(--text); background: var(--surface-3); }
.tabs button .count { font-size: 11px; background: var(--surface-3); color: var(--text-2); padding: 0 7px; border-radius: 99px; }
.tabs button.on .count { background: var(--accent); color: #fff; }

/* ---------- Project header ---------- */
.proj-head { padding: 24px 26px; display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; margin-bottom: 16px; position: relative; overflow: hidden; }
.proj-head h1 { font-size: 26px; }
.proj-head .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.proj-head .facts { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 16px; }
.proj-head .facts div span { display: block; font-size: 11.5px; color: var(--text-3); font-weight: 600; }
.proj-head .facts div b { font-size: 13.5px; font-weight: 650; }
.dl { display: grid; grid-template-columns: 160px 1fr; gap: 10px 14px; margin: 0; }
.dl dt { color: var(--text-3); font-size: 12.5px; font-weight: 600; }
.dl dd { margin: 0; font-weight: 550; }

/* ---------- Kanban ---------- */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.kcol { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 240px; transition: outline-color .15s, background .15s; outline: 2px dashed transparent; outline-offset: -4px; }
.kcol-head { display: flex; align-items: center; gap: 8px; padding: 14px 14px 10px; font-weight: 750; font-size: 13.5px; }
.kcol-head .count { margin-left: auto; font-size: 11.5px; color: var(--text-3); background: var(--surface-3); padding: 0 8px; border-radius: 99px; }
.kcol-body { padding: 0 10px 10px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.kcol.drop { outline-color: var(--accent); background: var(--accent-50); }
.kcard { background: var(--surface); border: 1px solid var(--border); border-radius: 13px; padding: 12px 13px; box-shadow: var(--shadow-sm); cursor: pointer; transition: transform .15s var(--ease), box-shadow .15s, border-color .15s; animation: rise .3s var(--ease) both; }
.kcard[draggable="true"] { cursor: grab; }
.kcard:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-2px); }
.kcard.dragging { opacity: .45; transform: rotate(2deg); }
.kcard .t { font-weight: 650; font-size: 13.5px; flex: 1; }
.kcard .m { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--text-3); }
.kcard.done .t { text-decoration: line-through; color: var(--text-3); }
.tick { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--surface); display: grid; place-items: center; flex: none; cursor: pointer; padding: 0; color: transparent; transition: all .15s; }
.tick:hover { border-color: var(--ok); color: var(--ok); }
.tick.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.tick .icon { width: 12px; height: 12px; stroke-width: 3; }
.quick-add { display: flex; gap: 6px; }
.quick-add .input { height: 36px; font-size: 13px; background: var(--surface); }
.add-row { border: 1px dashed var(--border-strong); background: transparent; border-radius: 6px; height: 36px; color: var(--text-3); font: inherit; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; transition: all .15s; }
.add-row:hover { color: var(--text); border-color: var(--text-3); background: var(--surface); }
.prio { display: inline-block; width: 8px; height: 8px; border-radius: 3px; }

/* ---------- Gantt ---------- */
.gantt { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.gantt-inner { min-width: 860px; position: relative; }
.g-row { display: grid; grid-template-columns: 260px 1fr; border-bottom: 1px solid var(--border); min-height: 42px; transition: background .12s; }
.g-row:hover { background: var(--surface-2); }
.g-row:last-child { border-bottom: 0; }
.g-row.group { background: var(--surface-2); font-weight: 700; }
.g-label { padding: 10px 14px; border-right: 1px solid var(--border); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.g-track { position: relative; }
.g-head .g-track { display: flex; }
.g-head { position: sticky; top: 0; background: var(--surface); z-index: 2; font-size: 11.5px; color: var(--text-3); font-weight: 700; }
.g-month { border-left: 1px solid var(--border); padding: 10px 6px; white-space: nowrap; overflow: hidden; }
.g-bar { position: absolute; top: 10px; height: 22px; border-radius: 6px; background: var(--brand-100); min-width: 6px; transition: transform .15s; }
.g-bar:hover { transform: scaleY(1.12); }
.g-bar > i { position: absolute; inset: 0 auto 0 0; background: var(--chart-1); border-radius: inherit; }
.g-bar span { position: absolute; left: 100%; top: 0; padding-left: 7px; font-size: 11px; color: var(--text-2); line-height: 22px; white-space: nowrap; font-weight: 650; }
.g-diamond { position: absolute; top: 14px; width: 14px; height: 14px; transform: translateX(-7px) rotate(45deg); background: var(--accent); border-radius: 3px; box-shadow: 0 0 0 3px var(--surface); }
.g-diamond.done { background: var(--ok); }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--bad); z-index: 1; pointer-events: none; }
.g-today::before { content: "Today"; position: absolute; top: -1px; left: 4px; font-size: 10px; font-weight: 700; color: #fff; background: var(--bad); padding: 0 5px; border-radius: 4px; }
.g-grid { position: absolute; top: 0; bottom: 0; border-left: 1px dashed var(--border); pointer-events: none; }

/* ---------- Feed ---------- */
.feed { list-style: none; margin: 0; padding: 0; position: relative; }
.feed li { display: flex; gap: 14px; padding-bottom: 16px; position: relative; animation: rise .35s var(--ease) both; }
.feed li::before { content: ""; position: absolute; left: 17px; top: 40px; bottom: 2px; width: 2px; background: var(--border); }
.feed li:last-child::before { display: none; }
.feed .ficon { width: 36px; height: 36px; border-radius: 6px; display: grid; place-items: center; flex: none; }
.feed .fbody { flex: 1; min-width: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 12px 15px; }
.feed .fhead { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--text-3); margin-bottom: 4px; }
.feed .fhead b { color: var(--text); }
.feed .ftext { white-space: pre-wrap; word-wrap: break-word; }
.composer { display: flex; gap: 12px; align-items: flex-start; }
.composer textarea { min-height: 52px; transition: min-height .2s var(--ease); }
.composer textarea:focus { min-height: 100px; }

.ms-list { display: flex; flex-direction: column; }
.ms { display: grid; grid-template-columns: 34px 1fr auto; gap: 14px; padding: 15px 0; border-bottom: 1px solid var(--border); align-items: start; }
.ms:last-child { border-bottom: 0; }
.ms .mark { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--border-strong); color: var(--text-3); background: var(--surface); padding: 0; font: inherit; transition: all .2s var(--ease); }
button.mark { cursor: pointer; }
button.mark:hover { border-color: var(--ok); color: var(--ok); transform: scale(1.08); }
.ms.completed .mark { background: var(--ok); border-color: var(--ok); color: #fff; }
.ms.in_progress .mark { border-color: var(--brand); color: var(--brand); }
.ms.late .mark { border-color: var(--bad); color: var(--bad); }

/* ---------- Risk matrix ---------- */
.matrix { display: grid; grid-template-columns: 26px repeat(5, 1fr); gap: 5px; font-size: 11px; }
.matrix .cell { aspect-ratio: 1.5; border-radius: 6px; display: grid; place-items: center; font-weight: 800; font-size: 14px; color: rgba(0,0,0,.65); transition: transform .15s; }
.matrix .cell:hover { transform: scale(1.06); }
.matrix .axis { display: grid; place-items: center; color: var(--text-3); font-weight: 600; }

/* ---------- Modal, drawer, toast ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(8, 12, 26, .45); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 100; padding: 16px; animation: fade .18s; }
.modal { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-lg); width: 100%; max-width: 640px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; animation: pop .22s var(--ease); border: 1px solid var(--border); }
.modal.wide { max-width: 880px; }
.modal.narrow { max-width: 440px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 20px 20px; }
.modal-foot .left { margin-right: auto; }
.modal-backdrop.drawer { place-items: stretch end; padding: 0; }
.modal.drawer { max-width: 520px; height: 100vh; max-height: 100vh; border-radius: 20px 0 0 20px; animation: slide-in .28s var(--ease); }
.modal.drawer .modal-body { flex: 1; }
.modal.drawer .modal-foot { border-radius: 0 0 0 20px; }
.toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 200; }
.toast { background: var(--text); color: var(--surface); padding: 11px 18px; border-radius: 14px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: center; max-width: 420px; animation: pop .25s var(--ease); font-weight: 600; transition: opacity .3s, transform .3s; }
.toast.err { background: var(--bad); color: #fff; }
.toast.ok .icon { color: #6ee7a0; }
.alert { border-radius: 13px; padding: 12px 15px; display: flex; gap: 10px; align-items: flex-start; font-size: 13px; }
.alert.warn { background: var(--warn-bg); color: var(--warn); }
.alert.info { background: var(--info-bg); color: var(--info); }
.alert.bad { background: var(--bad-bg); color: var(--bad); }
.secret { font-family: var(--mono); font-size: 17px; background: var(--surface-3); padding: 12px 16px; border-radius: 6px; letter-spacing: .06em; user-select: all; }

/* ---------- Command palette ---------- */
.palette-backdrop { place-items: start center; padding-top: 12vh; }
.palette { max-width: 620px; overflow: hidden; }
.palette .pal-input { display: flex; align-items: center; gap: 12px; padding: 4px 18px; border-bottom: 1px solid var(--border); }
.palette .pal-input input { flex: 1; border: 0; outline: 0; background: transparent; font: inherit; font-size: 16px; height: 56px; color: var(--text); min-width: 0; }
.pal-list { max-height: 420px; overflow-y: auto; padding: 8px; }
.pal-group { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); font-weight: 700; padding: 10px 10px 4px; }
.pal-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 6px; cursor: pointer; color: var(--text); }
.pal-item .pi { width: 32px; height: 32px; border-radius: 6px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); flex: none; }
.pal-item .grow { flex: 1; min-width: 0; }
.pal-item .grow div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-item.sel { background: var(--surface-3); }
.pal-item.sel .pi { background: var(--brand); color: var(--on-brand); }
.pal-foot { display: flex; gap: 14px; padding: 10px 18px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); background: var(--surface-2); }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: var(--surface); }
.login .blob, .login .grid-bg { display: none; }
.login-wrap { display: contents; }
.login-art {
  padding: 44px; display: flex; flex-direction: column; justify-content: space-between; gap: 30px; color: #fafafa; position: relative; overflow: hidden;
  background-color: var(--navy);
  background-image:
    repeating-radial-gradient(circle at 78% 30%, transparent 0 22px, rgba(255,255,255,.07) 22px 23px),
    repeating-radial-gradient(circle at 15% 85%, transparent 0 30px, rgba(255,255,255,.05) 30px 31px);
}
.login-brand img { display: block; height: 40px; width: auto; }
.login-brand .tagline { font-size: 12.5px; color: #a6cdfa; margin-top: 10px; }
.login-art h1 { font-size: 34px; line-height: 1.12; letter-spacing: -.035em; max-width: 520px; }
.login-art p { color: #cfe4fd; font-size: 15px; margin-top: 12px; max-width: 460px; }
.login-art ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.login-art li { display: flex; gap: 12px; align-items: center; color: #eaf3fe; font-size: 14px; }
.login-art li .icon { color: #6fadf4; }
.login-art .coords { font-family: var(--mono); font-size: 11.5px; color: #6fadf4; margin-top: 18px; }
.login-form { padding: 44px 40px; display: grid; place-items: center; }
.login-box { width: 100%; max-width: 380px; }
.login-box h2 { font-size: 28px; font-weight: 700; letter-spacing: -.03em; margin-bottom: 4px; }
.login-box form { display: grid; gap: 15px; margin-top: 26px; }
.pw-wrap { position: relative; }
.pw-wrap .btn { position: absolute; right: 5px; top: 5px; height: 30px; width: 30px; box-shadow: none; }

/* ---------- Map ---------- */
.map { height: 580px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); z-index: 0; background: var(--surface-3); }
.map.small { height: 280px; }
.leaflet-popup-content { font-family: var(--font); font-size: 13px; }
.map-legend { background: var(--surface); color: var(--text); padding: 10px 12px; border-radius: 6px; box-shadow: var(--shadow); font-size: 12px; line-height: 1.7; }
.map-note { font-size: 11.5px; color: var(--text-3); margin-top: 8px; }

.chart-box { position: relative; height: 270px; }
.chart-box.tall { height: 330px; }
.filter-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.filter-bar .lbl { font-size: 12.5px; color: var(--text-3); font-weight: 650; margin-right: 2px; }

/* ---------- Notifications ---------- */
.bell { position: relative; }
.bell-count { position: absolute; top: 4px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--surface); line-height: 1; }
.notif-panel { position: absolute; right: 0; top: calc(100% + 8px); width: 380px; max-width: calc(100vw - 24px); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); z-index: 60; animation: pop .16s var(--ease); overflow: hidden; }
.np-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.np-head .seg button { height: 28px; font-size: 12.5px; }
.np-list { max-height: 440px; overflow-y: auto; padding: 6px; }
.np-item { display: flex; gap: 11px; width: 100%; text-align: left; background: none; border: 0; padding: 10px; border-radius: 6px; cursor: pointer; font: inherit; color: var(--text); position: relative; }
.np-item:hover { background: var(--surface-3); }
.np-item.unread::after { content: ""; position: absolute; right: 10px; top: 16px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.np-icon { width: 32px; height: 32px; border-radius: 6px; display: grid; place-items: center; flex: none; }
.np-text { flex: 1; min-width: 0; padding-right: 14px; }
.np-text b { display: block; font-weight: 600; font-size: 13px; line-height: 1.35; }
.np-item:not(.unread) .np-text b { font-weight: 500; color: var(--text-2); }
.np-text span { display: block; font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-text small { font-size: 11.5px; color: var(--text-3); }
.np-foot { border-top: 1px solid var(--border); padding: 8px; display: flex; justify-content: center; }

/* ---------- Calendar ---------- */
.cal-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-title { font-size: 20px; margin-left: 8px; min-width: 170px; }
.cal-filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cal { overflow: hidden; }
.cal-head { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--border); }
.cal-head div { padding: 10px 12px; font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: minmax(118px, auto); }
.cal-day { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 8px; min-width: 0; transition: background .12s; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day:nth-last-child(-n+7) { border-bottom: 0; }
.cal-day.weekend { background: var(--surface-2); }
.cal-day.out { background: var(--surface-2); }
.cal-day.out .cal-num { color: var(--border-strong); }
.cal-day.drop { background: var(--accent-50); box-shadow: inset 0 0 0 2px var(--accent); }
.cal-num { font-size: 12.5px; font-weight: 600; color: var(--text-2); width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.cal-day.today .cal-num { background: var(--accent); color: #fff; }
.cal-evs { display: flex; flex-direction: column; gap: 3px; }
.ev { display: flex; align-items: center; gap: 6px; width: 100%; min-width: 0; text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: 7px; padding: 3px 7px; font: inherit; font-size: 12px; font-weight: 550; color: var(--text); cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.ev span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ev:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.ev[draggable="true"] { cursor: grab; }
.ev.dragging { opacity: .4; }
.ev.done span { text-decoration: line-through; color: var(--text-3); }
.ev.late { border-color: color-mix(in srgb, var(--bad) 45%, transparent); background: var(--bad-bg); }
.ev.ev-milestone { font-weight: 650; }
.ev.ev-start, .ev.ev-end { background: transparent; border-style: dashed; color: var(--text-2); }
.ev .icon { width: 13px; height: 13px; }
.ev-diamond { display: inline-block; width: 8px; height: 8px; transform: rotate(45deg); background: var(--accent); border-radius: 1.5px; flex: none; }
.ev-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; flex: none; }
.ev-more { border: 0; background: none; font: inherit; font-size: 11.5px; font-weight: 600; color: var(--text-3); text-align: left; padding: 2px 4px; cursor: pointer; }
.ev-more:hover { color: var(--text); }
.cal-legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.cal-legend span { display: inline-flex; gap: 6px; align-items: center; }
.cal-legend .late-key::before { content: ""; width: 12px; height: 12px; border-radius: 3px; background: var(--bad-bg); border: 1px solid var(--bad); }
.cal-pop { position: fixed; z-index: 90; width: 320px; max-width: calc(100vw - 24px); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 14px 16px; animation: pop .14s var(--ease); }
.cal-pop-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.cal-pop-list { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.agenda { padding: 6px 0; }
.ag-day { display: grid; grid-template-columns: 110px 1fr; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.ag-day:last-child { border-bottom: 0; }
.ag-day.past { opacity: .6; }
.ag-day.today .ag-date b { color: var(--accent); }
.ag-date b { display: block; font-size: 22px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ag-date span { font-size: 12px; color: var(--text-3); }
.ag-items { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ag-item { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ag-item .ev { width: auto; align-self: flex-start; max-width: 100%; font-size: 13px; padding: 5px 9px; }
@media (max-width: 760px) {
  .cal-grid { grid-auto-rows: minmax(70px, auto); }
  .cal-day { padding: 4px; }
  .ev span { display: none; }
  .ev { width: auto; padding: 3px 5px; }
  .ag-day { grid-template-columns: 70px 1fr; padding: 12px 14px; }
}

/* ---------- Comments, documents, viewer ---------- */
.comments { display: flex; flex-direction: column; gap: 12px; margin: 12px 0; }
.comment { display: flex; gap: 10px; align-items: flex-start; }
.comment .grow { flex: 1; min-width: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 8px 12px; }
.comment .ctext { white-space: pre-wrap; word-wrap: break-word; margin-top: 2px; }
.comment-box { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.comment-box textarea { min-height: 60px; }
.link-btn { border: 0; background: none; padding: 0; font: inherit; color: var(--accent); cursor: pointer; font-weight: 600; }
.link-btn:hover { text-decoration: underline; }
.comment .link-btn { font-size: 12px; margin-left: 6px; color: var(--text-3); font-weight: 500; }
.dropzone { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; border: 1.5px dashed var(--border-strong); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; background: var(--surface); transition: border-color .15s, background .15s; }
.dropzone.over { border-color: var(--accent); background: var(--accent-50); }
.dropzone.busy { opacity: .6; pointer-events: none; }
.dz-main { display: flex; gap: 14px; align-items: center; }
.dz-main > .icon { width: 26px; height: 26px; color: var(--text-3); }
.dz-opts { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.thumb { border: 1px solid var(--border); border-radius: 6px; overflow: hidden; padding: 0; background: var(--surface-2); cursor: zoom-in; text-align: left; font: inherit; color: var(--text); }
.thumb img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--surface-3); }
.thumb span { display: block; padding: 6px 9px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.viewer { text-align: center; }
.viewer img { max-width: 100%; max-height: 65vh; border-radius: 6px; }

/* ---------- Tasks page ---------- */
.quick-task { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.qt-title { display: flex; align-items: center; gap: 10px; color: var(--text-3); }
.qt-title .input { border: 0; box-shadow: none; padding: 0; height: 34px; font-size: 15px; }
.qt-title .input:focus { box-shadow: none; }
.qt-opts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.qt-opts .input { width: auto; max-width: 240px; }
.task-list { display: flex; flex-direction: column; }
.task-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) 90px 140px 150px 170px; gap: 14px; align-items: center; padding: 11px 16px; border-bottom: 1px solid var(--border); }
.task-row:last-child { border-bottom: 0; }
.task-row:hover { background: var(--surface-2); }
.tr-title { font-weight: 600; color: var(--text); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-row.done .tr-title { text-decoration: line-through; color: var(--text-3); }
.tr-meta { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-meta .code { font-family: var(--mono); }
.tr-meta .icon { width: 12px; height: 12px; }
.tr-prio { font-size: 12px; color: var(--text-2); display: inline-flex; gap: 6px; align-items: center; }
.tr-due.late, .tr-due-ro.late { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); font-weight: 600; }
.tr-who { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; min-width: 0; }
.tr-who span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
span.tick { cursor: default; }
@media (max-width: 1000px) {
  .task-row { grid-template-columns: 24px minmax(0, 1fr) 130px; }
  .tr-prio, .tr-who { display: none; }
  .tr-due, .tr-due-ro { grid-column: 3; }
  .tr-status, .task-row > .badge { grid-column: 2; justify-self: start; }
}

/* ---------- Import ---------- */
.imp-steps { margin: 0; padding-left: 20px; display: grid; gap: 18px; }
.imp-steps li::marker { font-weight: 700; }
.imp-drop { margin: 10px 0 0; cursor: pointer; }
.imp-summary { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 6px; background: var(--ok-bg); color: var(--text); }
.imp-summary > .icon { color: var(--ok); margin-top: 2px; }
.imp-summary.has-errors { background: var(--bad-bg); }
.imp-summary.has-errors > .icon { color: var(--bad); }
.imp-summary > div { flex: 1; }
.imp-table { max-height: 260px; overflow: auto; border: 1px solid var(--border); border-radius: 6px; }
.imp-table .table td, .imp-table .table th { padding: 7px 10px; font-size: 12.5px; }
.imp-bad { background: var(--bad-bg); }
.imp-err { color: var(--bad); font-size: 12px; font-weight: 600; }

/* ---------- Status report ---------- */
.report-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.report { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 36px 44px; max-width: 980px; margin: 0 auto; }
.rep-head { display: flex; justify-content: space-between; gap: 16px; border-bottom: 2px solid var(--text); padding-bottom: 12px; margin-bottom: 20px; }
.rep-org { font-weight: 700; font-size: 16px; }
.rep-meta { display: flex; flex-direction: column; align-items: flex-end; font-size: 12.5px; color: var(--text-2); }
.rep-meta b { color: var(--text); font-size: 14px; }
.rep-title { font-size: 26px; }
.rep-sub { color: var(--text-2); margin-top: 4px; }
.rep-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; border: 1px solid var(--border); border-radius: 6px; margin: 20px 0 10px; }
.rep-kpis div { padding: 12px 14px; border-left: 1px solid var(--border); }
.rep-kpis div:first-child { border-left: 0; }
.rep-kpis span { display: block; font-size: 11.5px; color: var(--text-3); font-weight: 600; }
.rep-kpis b { font-size: 22px; font-variant-numeric: tabular-nums; }
.rep-kpis .badge { font-size: 12px; margin-top: 6px; }
.report .ok { color: var(--ok); } .report .warn { color: var(--warn); } .report .bad { color: var(--bad); }
.rep-note { color: var(--text-2); }
.report h2 { font-size: 15px; margin: 26px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.report h3 { font-size: 13px; margin: 12px 0 6px; color: var(--text-2); }
.rep-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rep-table th, .rep-table td { text-align: left; padding: 7px 9px; border-bottom: 1px solid var(--border); vertical-align: top; }
.rep-table thead th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
.rep-table.kv th { width: 22%; color: var(--text-3); font-weight: 600; }
.rep-table .r { text-align: right; }
.rep-table.compact td { padding: 5px 8px; }
.rep-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.rep-update { padding: 8px 0; border-bottom: 1px dashed var(--border); white-space: pre-wrap; }
.rep-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 40px; }
.rep-sign div { border-top: 1px solid var(--text-3); padding-top: 8px; display: flex; flex-direction: column; }
.rep-sign span { font-size: 11.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.rep-sign em { font-style: normal; font-size: 12px; color: var(--text-3); }
.rep-foot { margin-top: 20px; }
@media (max-width: 760px) {
  .report { padding: 20px 16px; }
  .rep-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rep-kpis div { border-left: 0; border-top: 1px solid var(--border); }
  .rep-cols, .rep-sign { grid-template-columns: 1fr; }
}
/* Attendance register and project reports */
.att-grid th, .att-grid td { padding-left: 4px; padding-right: 4px; }
.att-grid .att-name { white-space: nowrap; padding-left: 16px; }
.att-day { width: 26px; text-align: center; font-size: 11px; }
.att-mark { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 4px; font-size: 10.5px; font-weight: 700; }
#reportCount { background: var(--bad); }
.report-body { display: grid; gap: 8px; margin-top: 8px; }
.report-body b { font-size: 12px; color: var(--text-3); font-weight: 650; }
.report-body p { margin: 2px 0 0; white-space: pre-wrap; }

@media print {
  .report { border: 0; padding: 0; max-width: none; }
  .report h2 { break-after: avoid; }
  .rep-table tr { break-inside: avoid; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main { grid-template-columns: 1fr; }
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .shell, .shell.collapsed { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; transform: translateX(-100%); transition: transform .25s var(--ease); }
  .shell.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .collapse-btn { display: none; }
  .topbar .menu-btn { display: inline-flex; }
  .topbar { padding: 0 16px; gap: 8px; }
  .search kbd { display: none; }
  .content { padding: 18px 16px; }
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-form { padding: 32px 24px; }
  .proj-head { grid-template-columns: 1fr; }
  .user-chip .meta, .user-chip > .icon { display: none; }
}
@media (max-width: 640px) {
  .g-2, .g-3, .g-4, .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 1fr; gap: 2px 0; }
  .dl dd { margin-bottom: 8px; }
  .kanban { grid-template-columns: repeat(4, 270px); }
  .hero { padding: 20px; }
  .hero-stats div { flex: 1 1 40%; min-width: 0; }
  .map { height: 420px; }
  .modal.drawer { border-radius: 0; }
}

/* ---------- Print ---------- */
@media print {
  .sidebar, .topbar, .page-actions, .no-print, .app-footer, .toasts, .filter-bar { display: none !important; }
  .shell { display: block; }
  body { background: #fff; color: #000; font-size: 12px; }
  .content { padding: 0; max-width: none; }
  .content > * { animation: none; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  .print-only { display: block !important; }
}
.print-only { display: none; }
