/* 瑁呬慨绠″ 鈥?design system */
:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --line: #e3e8f0;
  --line-strong: #cbd5e1;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #7b8aa1;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-soft: #e8efff;
  --ok: #16a34a;
  --ok-soft: #e7f7ec;
  --warn: #d97706;
  --warn-soft: #fef4e6;
  --danger: #dc2626;
  --danger-soft: #fdeaea;
  --info: #0891b2;
  --info-soft: #e6f6fa;
  --purple: #7c3aed;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px -16px rgba(15, 23, 42, .28);
  --shadow-lg: 0 20px 50px -24px rgba(15, 23, 42, .45);
  --sidebar-w: 236px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
a { color: var(--brand); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* The `hidden` attribute is only `display:none` in the UA stylesheet, so ANY author
   `display` rule silently wins over it. That made #login-screen keep painting after a
   successful login and pushed the whole app below the fold. These two rules make the
   hidden state actually win, for every element. */
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- login */
.login-screen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(1200px 600px at 15% -10%, #dbeafe 0%, transparent 60%),
              radial-gradient(900px 500px at 100% 0%, #ede9fe 0%, transparent 55%),
              var(--bg);
}
.login-card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 26px;
  box-shadow: var(--shadow-lg);
  display: grid;
  gap: 14px;
}
.login-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 4px; }
.login-brand h1 { font-size: 20px; }
.login-brand p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.login-card label { display: grid; gap: 6px; font-size: 13px; color: var(--text-2); font-weight: 550; }
.login-card input {
  padding: 11px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff;
}
.login-card input:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.login-hint { margin: 0; font-size: 12px; color: var(--muted); text-align: center; }
.login-error { margin: 0; color: var(--danger); font-size: 13px; text-align: center; }

.boot-error {
  background: var(--danger-soft);
  border-bottom: 1px solid #fecaca;
  color: #b91c1c;
  padding: 9px 16px;
  font-size: 13px;
  line-height: 1.5;
}
.boot-error.login-boot-error {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  border-bottom: 1px solid #fecaca;
  text-align: center;
}

/* --------------------------------------------------------------- layout */
#app { display: flex; min-height: 100dvh; }
.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  background: #0f172a; color: #cbd5e1;
  display: flex; flex-direction: column; gap: 6px;
  padding: 14px 12px; position: sticky; top: 0; height: 100dvh;
}
.sidebar-head { display: flex; align-items: center; gap: 10px; padding: 4px 6px 12px; }
.logo {
  width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center;
  background: linear-gradient(140deg, #2563eb, #7c3aed); border-radius: 10px; font-size: 17px;
}
.sidebar-title { display: grid; min-width: 0; }
.sidebar-title strong { color: #f8fafc; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-title span { font-size: 11.5px; color: #94a3b8; }
.nav { display: grid; gap: 2px; overflow-y: auto; flex: 1; }
.nav button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: none; border: 0; color: #cbd5e1; cursor: pointer;
  padding: 9px 10px; border-radius: 9px; font-size: 13.5px; text-align: left;
}
.nav button:hover { background: rgba(148, 163, 184, .14); color: #f1f5f9; }
.nav button.active { background: linear-gradient(90deg, rgba(37, 99, 235, .9), rgba(124, 58, 237, .65)); color: #fff; font-weight: 600; }
.nav button .ic { width: 18px; text-align: center; font-size: 15px; }
.nav button .cnt {
  margin-left: auto; font-size: 11px; background: rgba(148, 163, 184, .22);
  border-radius: 99px; padding: 1px 7px; font-variant-numeric: tabular-nums;
}
.nav button.active .cnt { background: rgba(255, 255, 255, .25); }
.sidebar-foot { border-top: 1px solid rgba(148, 163, 184, .2); padding-top: 10px; display: grid; gap: 8px; }
.side-user { display: flex; align-items: center; gap: 9px; padding: 0 4px; }
.side-user strong { display: block; color: #f1f5f9; font-size: 13px; }
.side-user span { font-size: 11px; color: #94a3b8; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand); color: #fff; font-weight: 600; font-size: 13px; flex: 0 0 30px;
}
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; background: rgba(244, 246, 251, .86);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar-title { display: grid; min-width: 0; }
.topbar h1 { font-size: 17px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.sync { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.sync i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); display: inline-block; }
.sync.stale i { background: var(--warn); }
.sync em { font-style: normal; }
.chip {
  background: var(--brand-soft); color: var(--brand-dark); border-radius: 99px;
  padding: 4px 11px; font-size: 12.5px; font-weight: 650; font-variant-numeric: tabular-nums;
}
.view { padding: 16px 18px 60px; display: grid; gap: 14px; align-content: start; }
.drawer-mask { display: none; }

/* ---------------------------------------------------------------- cards */
.grid { display: grid; gap: 14px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpis { grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px; min-width: 0;
}
.card.pad-0 { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-head h3 { font-size: 14.5px; }
.card-head .spacer { flex: 1; }
.card-sub { font-size: 12px; color: var(--muted); }

.kpi { display: grid; gap: 6px; }
.kpi .label { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi .value { font-size: 25px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .value small { font-size: 13px; font-weight: 500; color: var(--text-2); margin-left: 3px; }
.kpi .foot { font-size: 12px; color: var(--muted); }
/* used when money exists but is missing from the headline figure, e.g. an expense
   with no linked budget item — it must not disappear silently */
.kpi .kpi-warn {
  font-size: 11.5px; line-height: 1.5; color: #b45309; background: #fffbeb;
  border: 1px solid #fde68a; border-radius: 7px; padding: 5px 7px; margin-top: 2px;
}
.hint-inline { font-style: normal; font-size: 11.5px; color: var(--muted); font-weight: 400; }
.kpi.tone-ok .value { color: var(--ok); }
.kpi.tone-warn .value { color: var(--warn); }
.kpi.tone-danger .value { color: var(--danger); }
.kpi.tone-brand .value { color: var(--brand); }

.bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #7c3aed); border-radius: 99px; transition: width .3s; }
.bar.ok > span { background: linear-gradient(90deg, #16a34a, #4ade80); }
.bar.warn > span { background: linear-gradient(90deg, #d97706, #fbbf24); }
.bar.danger > span { background: linear-gradient(90deg, #dc2626, #f87171); }
.bar.slim { height: 6px; }
.stack { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.stack > i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--text-2); }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 5px; }

/* --------------------------------------------------------------- badges */
.badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600;
  padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line);
  white-space: nowrap;
}
.badge.ok { background: var(--ok-soft); color: #15803d; border-color: #bbf7d0; }
.badge.warn { background: var(--warn-soft); color: #b45309; border-color: #fde68a; }
.badge.danger { background: var(--danger-soft); color: #b91c1c; border-color: #fecaca; }
.badge.brand { background: var(--brand-soft); color: var(--brand-dark); border-color: #c7d7fe; }
.badge.info { background: var(--info-soft); color: #0e7490; border-color: #a5f3fc; }
.badge.purple { background: #f3e8ff; color: #6d28d9; border-color: #e9d5ff; }
.badge.tiny { font-size: 10.5px; padding: 1px 6px; }

/* --------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: left; font-weight: 600; color: var(--text-2); font-size: 12px;
  padding: 9px 10px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
tbody td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafcff; }
tbody tr.row-done { background: #fbfefc; }
tbody tr.row-done td { color: var(--text-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tfoot td { padding: 9px 10px; font-weight: 650; background: var(--surface-2); border-top: 1px solid var(--line); }
.cell-actions { display: flex; gap: 4px; justify-content: flex-end; }
.editable { cursor: text; border-radius: 6px; padding: 2px 4px; }
.editable:hover { background: var(--brand-soft); box-shadow: inset 0 0 0 1px #c7d7fe; }
/* inline edits save on blur with no button, so the save must be visible */
.editable.saving { background: var(--surface-2); color: var(--muted); box-shadow: none; cursor: progress; }
.editable.save-ok { background: #dcfce7; color: #15803d; box-shadow: inset 0 0 0 1px #86efac; animation: save-pop .35s ease-out; }
.editable.save-ok::after { content: ' ✓'; font-weight: 700; }
.editable.save-fail { background: var(--danger-soft); color: #b91c1c; box-shadow: inset 0 0 0 1px #fecaca; }
@keyframes save-pop { 0% { transform: scale(1); } 45% { transform: scale(1.06); } 100% { transform: scale(1); } }
/* topbar confirmation: the edited cell is usually re-rendered away, so the
   "已保存" signal has to live somewhere stable */
.sync.just-saved { color: #15803d; }
.sync.just-saved em { font-weight: 600; }
.sync.just-saved i { background: #16a34a; box-shadow: 0 0 0 3px rgba(22, 163, 74, .18); }
input.inline, select.inline {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 6px; padding: 4px 6px; background: #fff; font-size: 12.5px;
}
input.inline:focus, select.inline:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
td input.inline.num { text-align: right; }

/* -------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  padding: 8px 13px; border-radius: 9px; cursor: pointer; font-size: 13px; font-weight: 550;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); border-color: var(--line-strong); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: rgba(148, 163, 184, .16); }
.btn.danger { color: var(--danger); border-color: #fecaca; background: #fff; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.small { padding: 5px 9px; font-size: 12px; border-radius: 7px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.icon-btn {
  border: 1px solid var(--line); background: var(--surface); border-radius: 9px;
  width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer; color: var(--text-2);
}
.icon-btn:hover { background: var(--surface-2); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar .spacer { flex: 1; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 9px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: none; padding: 7px 12px; cursor: pointer; font-size: 12.5px; color: var(--text-2); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.active { background: var(--brand); color: #fff; font-weight: 600; }
select, input[type="text"], input[type="date"], input[type="number"], input[type="search"], input[type="password"], textarea {
  border: 1px solid var(--line-strong); border-radius: 9px; padding: 8px 10px; background: #fff; min-width: 0;
}
select:focus, input:focus, textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.field { display: grid; gap: 5px; font-size: 12.5px; color: var(--text-2); font-weight: 550; }
.field > span { display: flex; align-items: center; gap: 5px; }

/* ----------------------------------------------------------------- misc */
.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 90; }
.toast {
  background: #0f172a; color: #f8fafc; border-radius: 10px; padding: 10px 14px; font-size: 13px;
  box-shadow: var(--shadow-lg); animation: slide-in .18s ease-out; max-width: 360px;
}
.toast.err { background: #991b1b; }
.toast.ok { background: #166534; }
@keyframes slide-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .48); z-index: 100;
  display: grid; place-items: center; padding: 18px;
}
.modal {
  background: var(--surface); border-radius: 16px; width: min(680px, 100%);
  max-height: 88dvh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); overflow: hidden;
}
.modal header { display: flex; align-items: center; gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.modal header h3 { font-size: 15.5px; }
.modal .body { padding: 16px 18px; overflow-y: auto; display: grid; gap: 12px; }
.modal footer { padding: 13px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; background: var(--surface-2); }
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
textarea { resize: vertical; min-height: 76px; width: 100%; }

.empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.empty .big { font-size: 28px; display: block; margin-bottom: 6px; }
.list { display: grid; gap: 8px; }
.row-card {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff;
}
.row-card:hover { border-color: var(--line-strong); }
.row-card .grow { flex: 1; min-width: 0; }
.row-card .title { font-weight: 600; font-size: 13.5px; }
.row-card .meta { font-size: 11.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }

/* -------------------------------------------------------------- phases */
.phase-list { display: grid; gap: 8px; }
.phase-card {
  display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center;
  padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
}
.phase-card.expanded { background: #fbfdff; }
.phase-card .idx {
  width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--text-2); font-weight: 650; font-size: 12.5px; border: 1px solid var(--line);
}
.phase-card .idx.done { background: var(--ok-soft); color: #15803d; border-color: #bbf7d0; }
.phase-card .idx.doing { background: var(--brand-soft); color: var(--brand-dark); border-color: #c7d7fe; }
.phase-main { display: grid; gap: 6px; min-width: 0; }
.phase-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.phase-title strong { font-size: 14px; }
.phase-facts { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); }
.phase-body { grid-column: 1 / -1; display: grid; gap: 10px; padding-top: 4px; }

/* --------------------------------------------------------------- gantt */
.gantt { overflow-x: auto; }
.gantt-inner { min-width: 900px; position: relative; }
.gantt-head { display: flex; position: sticky; top: 0; background: #fff; z-index: 2; border-bottom: 1px solid var(--line); }
.gantt-head .label-col { width: 190px; flex: 0 0 190px; }
.gantt-head .track { flex: 1; position: relative; height: 30px; }
.gantt-head .track span {
  position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--line);
  font-size: 10.5px; color: var(--muted); padding: 7px 0 0 4px; white-space: nowrap;
}
.gantt-row { display: flex; border-bottom: 1px solid var(--line); }
.gantt-row:hover { background: #fafcff; }
.gantt-row .label-col {
  width: 190px; flex: 0 0 190px; padding: 8px 10px; font-size: 12.5px;
  border-right: 1px solid var(--line); background: #fff;
}
.gantt-row .track { flex: 1; position: relative; height: 38px; }
.gantt-bar {
  position: absolute; top: 8px; height: 20px; border-radius: 6px;
  background: linear-gradient(90deg, #93c5fd, #bfdbfe); border: 1px solid #93c5fd; cursor: grab;
  display: flex; align-items: center; overflow: hidden;
}
.gantt-bar.actual { background: linear-gradient(90deg, #2563eb, #3b82f6); border-color: #1d4ed8; color: #fff; }
.gantt-bar.late { background: linear-gradient(90deg, #dc2626, #f87171); border-color: #b91c1c; color: #fff; }
.gantt-bar .fill { position: absolute; inset: 0 auto 0 0; background: rgba(22, 163, 74, .55); }
.gantt-bar em { position: relative; font-style: normal; font-size: 10.5px; padding: 0 5px; white-space: nowrap; }
.gantt-row .today-line, .gantt-head .today-line { position: absolute; top: 0; bottom: 0; width: 2px; background: #ef4444; z-index: 3; }
.gantt-legend { display: flex; gap: 12px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }

/* ----------------------------------------------------------- floorplan */
.plan-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 268px; gap: 14px; }
.plan-stage { position: relative; background: #fbfcfe; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.plan-stage svg { display: block; width: 100%; height: auto; touch-action: none; }
.plan-room { cursor: pointer; transition: opacity .15s; }
.plan-room rect, .plan-room polygon { transition: fill-opacity .15s; }
.plan-room:hover rect, .plan-room:hover polygon { fill-opacity: .78 !important; }
.plan-room.sel rect, .plan-room.sel polygon { stroke-width: 3; stroke: #0f172a; }
.plan-label { font-size: 15px; font-weight: 650; fill: #0f172a; pointer-events: none; paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.plan-sub { font-size: 12px; fill: #334155; pointer-events: none; paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.plan-side { display: grid; gap: 10px; align-content: start; }
.bp-img { filter: grayscale(.35) contrast(.95); }
.editor-vertex { fill: #fff; stroke: #dc2626; stroke-width: 2; cursor: grab; }
.editor-bg { cursor: crosshair; }

.defect-mini { display: flex; flex-wrap: wrap; gap: 4px; }
.defect-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* ------------------------------------------------------------- kanban */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: start; }
.kanban .col { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; display: grid; gap: 8px; }
.kanban .col h4 { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.kanban .col .count { margin-left: auto; color: var(--muted); font-weight: 500; }
.kanban .ticket { background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; display: grid; gap: 6px; cursor: grab; }
.kanban .ticket:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.kanban .col.over { outline: 2px dashed var(--brand); outline-offset: -3px; }
.kanban .ticket.dragging { opacity: .5; }
.sev-high { border-left: 3px solid var(--danger); }
.sev-medium { border-left: 3px solid var(--warn); }
.sev-low { border-left: 3px solid var(--info); }

/* -------------------------------------------------------------- photos */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.photo { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; display: grid; }
.photo img { width: 100%; height: 118px; object-fit: cover; display: block; background: var(--surface-2); }
.photo .cap { padding: 6px 8px; font-size: 11.5px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.photo .cap .right { margin-left: auto; }
.dropzone {
  border: 2px dashed var(--line-strong); border-radius: var(--radius); padding: 22px; text-align: center;
  color: var(--muted); background: var(--surface-2); cursor: pointer;
}
.dropzone.over { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }

/* -------------------------------------------------------------- utils */
.util-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.cp-row { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.cp-row.checked { background: var(--ok-soft); border-color: #bbf7d0; }
.cp-row .grow { flex: 1; min-width: 0; font-size: 13px; }
.cp-row .grow small { display: block; color: var(--muted); font-size: 11.5px; }

.timeline { display: grid; gap: 10px; }
.tl-item { display: grid; grid-template-columns: 16px 1fr; gap: 10px; }
.tl-dot { width: 9px; height: 9px; margin-top: 5px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.tl-item .txt { font-size: 12.5px; }
.tl-item .txt time { color: var(--muted); font-size: 11.5px; margin-left: 6px; }

.chart { display: grid; gap: 6px; }
.chart .c-row { display: grid; grid-template-columns: 96px 1fr 74px; gap: 8px; align-items: center; font-size: 12px; }
.chart .c-row .val { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); }
.cbar { height: 14px; background: var(--surface-2); border-radius: 5px; position: relative; border: 1px solid var(--line); overflow: hidden; }
.cbar > i { position: absolute; top: 0; bottom: 0; left: 0; display: block; }
.cbar .planned { background: #c7d7fe; }
.cbar .actual { background: #2563eb; opacity: .85; }

.only-mobile { display: none; }

/* -------------------------------------------------------- responsive */
@media (max-width: 1080px) {
  .plan-wrap { grid-template-columns: minmax(0, 1fr); }
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kanban { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .cols-2, .cols-3 { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; z-index: 60; left: 0; top: 0; transform: translateX(-104%);
    transition: transform .22s ease; box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  .drawer-mask.show { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 50; }
  .only-mobile { display: grid; }
  .view { padding: 12px 12px 72px; }
  .topbar { padding: 10px 12px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kanban { grid-template-columns: minmax(0, 1fr); }
  .gantt-head .label-col, .gantt-row .label-col { width: 120px; flex-basis: 120px; }
  .chart .c-row { grid-template-columns: 78px 1fr 62px; }
}

