/* ============================================================
   TikintiPM — sadə dizayn sistemi
   Tokenlər → reset → layout → komponentlər → responsiv
   ============================================================ */

:root {
  color-scheme: light;

  /* Səthlər və mürəkkəb */
  --bg: #f3f3f0;
  --surface: #ffffff;
  --surface-2: #f9f9f7;
  --ink: #141413;
  --ink-2: #52514e;
  --muted: #898781;
  --line: #e6e5df;
  --line-2: #d4d3cb;

  /* Brend */
  --brand: #1b2838;        /* yan panel */
  --brand-2: #243447;
  --brand-ink: #c9d1dc;
  --accent: #f2a41b;       /* kəhrəba — tikinti vurğusu */
  --accent-ink: #7a5200;

  /* Məlumat rəngi (irəliləyiş, büdcə) */
  --blue: #2a78d6;
  --blue-100: #d6e6fa;
  --blue-600: #184f95;

  /* Status (yalnız məna daşıyanda) */
  --good: #0ca30c;  --good-bg: #e4f4e4;  --good-ink: #0a5c0a;
  --warn: #fab219;  --warn-bg: #fff3d4;  --warn-ink: #7a5200;
  --crit: #d03b3b;  --crit-bg: #fbe5e5;  --crit-ink: #9b2424;
  --neutral-bg: #ececea; --neutral-ink: #52514e;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20,20,19,.04), 0 1px 1px rgba(20,20,19,.03);
  --sidebar-w: 248px;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }
svg.ic { width: 18px; height: 18px; flex: 0 0 auto; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.main { min-width: 0; display: flex; flex-direction: column; }
.content { padding: 24px 28px 40px; max-width: 1440px; width: 100%; }

/* ---------- Yan panel ---------- */
.sidebar {
  background: var(--brand);
  color: var(--brand-ink);
  display: flex; flex-direction: column;
  padding: 18px 14px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: #fff; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; background: var(--accent); color: #1b2838;
  display: grid; place-items: center;
}
.brand-mark .ic { width: 20px; height: 20px; }
.brand-name { font-size: 17px; font-weight: 600; letter-spacing: .2px; }
.brand-name b { color: var(--accent); font-weight: 700; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; border-radius: 8px; font-weight: 500; font-size: 14px;
  color: var(--brand-ink); position: relative;
}
.nav-item .ic { opacity: .8; }
.nav-item:hover { background: var(--brand-2); color: #fff; }
.nav-item.is-active { background: var(--brand-2); color: #fff; }
.nav-item.is-active::before {
  content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--accent);
}
.nav-badge {
  margin-left: auto; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px;
  background: rgba(255,255,255,.12); color: #fff;
}
.nav-badge.crit { background: var(--crit); }
.nav-badge.accent { background: var(--accent); color: #1b2838; }

.sidebar-footer { margin-top: auto; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.08); }
.company { display: flex; align-items: center; gap: 10px; padding: 12px 8px 2px; }
.company-logo {
  width: 34px; height: 34px; border-radius: 8px; background: var(--brand-2); color: #fff;
  display: grid; place-items: center; font-weight: 600; font-size: 12px;
}
.company-name { color: #fff; font-weight: 500; font-size: 13px; }
.company-plan { font-size: 12px; color: var(--brand-ink); opacity: .8; }

/* ---------- Üst panel ---------- */
.topbar {
  display: flex; align-items: center; gap: 14px;
  height: 60px; padding: 0 28px;
  background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar-title { font-weight: 600; font-size: 15px; }
.search {
  margin-left: 12px; flex: 1; max-width: 420px;
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; height: 36px;
  color: var(--muted);
}
.search input { flex: 1; border: 0; background: transparent; outline: none; color: var(--ink); min-width: 0; }
.search input::placeholder { color: var(--muted); }
.search:focus-within { border-color: var(--blue); background: #fff; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center;
  color: var(--ink-2); position: relative;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn.has-dot::after {
  content: ""; position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--crit); box-shadow: 0 0 0 2px var(--surface);
}
.user { display: flex; align-items: center; gap: 10px; padding-left: 10px; border-left: 1px solid var(--line); }
.user-name { font-weight: 600; font-size: 13px; line-height: 1.2; }
.user-role { font-size: 12px; color: var(--muted); }

/* ---------- Düymələr ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 38px; padding: 0 14px; border-radius: 8px; font-weight: 600; font-size: 14px;
  border: 1px solid transparent; white-space: nowrap;
}
.btn .ic { width: 17px; height: 17px; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-600); }
.btn-ghost { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-link { height: auto; padding: 0; color: var(--blue); font-weight: 500; font-size: 13px; }
.btn-link:hover { text-decoration: underline; }

/* ---------- Səhifə başlığı ---------- */
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 700; letter-spacing: -.2px; }
.page-head p { color: var(--muted); margin-top: 2px; }
.page-actions { margin-left: auto; display: flex; gap: 8px; }

/* ---------- Kartlar ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px 12px; }
.card-head h2 { font-size: 15px; font-weight: 600; }
.card-head .count { color: var(--muted); font-weight: 500; }
.card-head .btn-link { margin-left: auto; }
.card-body { padding: 0 20px 18px; }

/* ---------- KPI sırası ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { padding: 16px 18px 16px; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; color: var(--ink-2); font-size: 13px; font-weight: 500; }
.kpi-icon {
  width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center;
  background: var(--blue-100); color: var(--blue-600);
}
.kpi-icon.warn { background: var(--warn-bg); color: var(--warn-ink); }
.kpi-icon.crit { background: var(--crit-bg); color: var(--crit-ink); }
.kpi-icon.good { background: var(--good-bg); color: var(--good-ink); }
.kpi-value { font-size: 30px; font-weight: 600; line-height: 1.1; margin-top: 10px; letter-spacing: -.3px; }
.kpi-value small { font-size: 15px; font-weight: 500; color: var(--ink-2); margin-left: 3px; }
.kpi-sub { margin-top: 6px; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.kpi-sub .ic { width: 15px; height: 15px; }
.delta-up { color: var(--good-ink); font-weight: 600; display: inline-flex; align-items: center; gap: 2px; }
.delta-down { color: var(--crit-ink); font-weight: 600; display: inline-flex; align-items: center; gap: 2px; }
.text-crit { color: var(--crit-ink); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.text-warn { color: var(--warn-ink); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }

/* ---------- Ölçü çubuqları ---------- */
.bar, .meter { height: 6px; border-radius: 999px; background: var(--blue-100); overflow: hidden; }
.bar span, .meter span { display: block; height: 100%; border-radius: 999px; background: var(--blue); }
.meter.warn { background: var(--warn-bg); } .meter.warn span { background: var(--warn); }
.meter.crit { background: var(--crit-bg); } .meter.crit span { background: var(--crit); }
.kpi .meter { margin-top: 12px; }

/* ---------- Status nişanları ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.active   { background: var(--blue-100); color: var(--blue-600); }
.badge.risk     { background: var(--warn-bg); color: var(--warn-ink); }
.badge.late     { background: var(--crit-bg); color: var(--crit-ink); }
.badge.planning { background: var(--neutral-bg); color: var(--neutral-ink); }
.badge.paused   { background: var(--neutral-bg); color: var(--neutral-ink); }
.badge.done     { background: var(--good-bg); color: var(--good-ink); }

/* ---------- Cədvəl ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px;
  padding: 8px 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface-2);
  white-space: nowrap;
}
.table td { padding: 13px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover { background: var(--surface-2); }
.table .num { font-variant-numeric: tabular-nums; }
.proj-cell { min-width: 240px; }
.proj-name { font-weight: 600; }
.proj-loc { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px; margin-top: 2px; white-space: nowrap; }
.proj-loc .ic { width: 13px; height: 13px; }
.progress-cell { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.progress-cell .bar { flex: 1; }
.progress-cell .val { width: 36px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.money-cell { min-width: 160px; }
.money-cell .money { display: flex; align-items: baseline; gap: 4px; font-variant-numeric: tabular-nums; }
.money-cell .money b { font-weight: 600; }
.money-cell .money span { color: var(--muted); font-size: 12px; }
.money-cell .meter { margin-top: 6px; }
.money-cell .over { font-size: 12px; margin-top: 4px; }
.money-cell .over .ic { width: 13px; height: 13px; }
.due { white-space: nowrap; }
.due .date { font-weight: 500; }
.due .cue { font-size: 12px; margin-top: 2px; }
.due .cue .ic { width: 13px; height: 13px; }
.due .cue.ok { color: var(--muted); }
.person { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--blue-100); color: var(--blue-600);
  display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: 0 0 auto;
}
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.row-arrow { color: var(--line-2); text-align: right; }
.table tbody tr:hover .row-arrow { color: var(--muted); }

/* ---------- İki sütunlu hissə ---------- */
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-top: 20px; }
.grid-2 > *, .kpi-grid > * { min-width: 0; }

/* Diqqət tələb edən tapşırıqlar */
.task { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.task:first-child { border-top: 0; }
.task-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.task-dot.crit { background: var(--crit); }
.task-dot.warn { background: var(--warn); }
.task-dot.ok { background: var(--blue); }
.task-body { min-width: 0; flex: 1; }
.task-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-meta { font-size: 12px; color: var(--muted); margin-top: 1px; }
.task-due { font-size: 12px; font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.task-due .ic { width: 13px; height: 13px; }
.task-due.crit { color: var(--crit-ink); }
.task-due.warn { color: var(--warn-ink); }
.task-due.ok { color: var(--muted); font-weight: 500; }

/* Son fəaliyyət lenti */
.feed-item { display: flex; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.feed-item:first-child { border-top: 0; }
.feed-icon {
  width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; flex: 0 0 auto;
  background: var(--neutral-bg); color: var(--ink-2);
}
.feed-icon.daily { background: var(--blue-100); color: var(--blue-600); }
.feed-icon.money { background: var(--good-bg); color: var(--good-ink); }
.feed-icon.issue { background: var(--crit-bg); color: var(--crit-ink); }
.feed-icon.chat { background: #efe9fb; color: #4b3aa0; }
.feed-icon.material { background: var(--warn-bg); color: var(--warn-ink); }
.feed-icon.doc { background: var(--neutral-bg); color: var(--ink-2); }
.feed-body { min-width: 0; flex: 1; }
.feed-text { line-height: 1.4; }
.feed-text b { font-weight: 600; }
.feed-text a { color: var(--blue); }
.feed-note { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.feed-time { font-size: 12px; color: var(--muted); white-space: nowrap; }

.empty { padding: 30px 0; text-align: center; color: var(--muted); }
.only-mobile { display: none; }
.overlay { display: none; position: fixed; inset: 0; background: rgba(20,20,19,.45); z-index: 29; }

/* ---------- Responsiv ---------- */
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-w); z-index: 30;
    transform: translateX(-100%); transition: transform .2s ease;
  }
  .sidebar.open { transform: none; }
  .overlay.show { display: block; }
  .only-mobile { display: grid; }
  .topbar { padding: 0 16px; }
  .content { padding: 18px 16px 32px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .user-meta { display: none; }
  .user { border-left: 0; padding-left: 0; }
}
@media (max-width: 640px) {
  .kpi-grid { grid-template-columns: minmax(0, 1fr); }
  .topbar .search { display: none; }
  .page-actions .btn-ghost { display: none; }
  .table th, .table td { padding-left: 14px; padding-right: 14px; }
}

/* ============================================================
   Tapşırıqlar səhifəsi: alət paneli, siyahı, lövhə, Gantt
   ============================================================ */

[hidden] { display: none !important; }
.muted { color: var(--muted); }

/* ---------- Alət paneli ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.field { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.field select {
  height: 36px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface);
  padding: 0 10px; font: inherit; color: var(--ink); max-width: 280px;
}
.toolbar .search { margin-left: 0; max-width: 240px; flex: 1 1 180px; }
.seg {
  display: inline-flex; gap: 2px; margin-left: auto;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 3px;
}
.seg button {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 6px; font-weight: 600; font-size: 13px; color: var(--ink-2);
}
.seg button .ic { width: 16px; height: 16px; }
.seg button:hover { color: var(--ink); }
.seg button.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* ---------- Tapşırıq status nişanları ---------- */
.badge.new      { background: var(--neutral-bg); color: var(--neutral-ink); }
.badge.progress { background: var(--blue-100); color: var(--blue-600); }
.badge.blocked  { background: var(--crit-bg); color: var(--crit-ink); }
.badge.ready    { background: var(--warn-bg); color: var(--warn-ink); }
.badge.approved { background: var(--good-bg); color: var(--good-ink); }

/* ---------- Siyahı ---------- */
.phase-row td { background: var(--surface-2); font-weight: 600; font-size: 13px; padding: 8px 20px; }
.phase-row .pct { color: var(--muted); font-weight: 500; margin-left: 10px; }
.dep { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 5px; margin-top: 3px; }
.dep .ic { width: 13px; height: 13px; flex: 0 0 auto; }
.dep.warn { color: var(--crit-ink); font-weight: 600; }
.ms-icon {
  display: inline-block; width: 9px; height: 9px; background: var(--ink);
  transform: rotate(45deg); border-radius: 2px; margin: 0 9px 0 2px; vertical-align: 1px;
}
.cue { font-size: 12px; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.cue .ic { width: 13px; height: 13px; }
.cue.ok { color: var(--muted); }

/* ---------- Lövhə (Kanban) ---------- */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: flex-start; }
.col {
  flex: 1 0 230px; max-width: 320px; display: flex; flex-direction: column;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); min-height: 320px;
}
.col-head {
  display: flex; align-items: center; gap: 8px; padding: 11px 12px;
  font-weight: 600; font-size: 13px; border-bottom: 1px solid var(--line);
}
.col-head .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.col-head .dot.progress { background: var(--blue); }
.col-head .dot.blocked  { background: var(--crit); }
.col-head .dot.ready    { background: var(--warn); }
.col-head .dot.approved { background: var(--good); }
.col-head .cnt { margin-left: auto; color: var(--muted); font-weight: 500; }
.col-body { flex: 1; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 90px; border-radius: 0 0 12px 12px; }
.col-body.over { background: var(--blue-100); box-shadow: inset 0 0 0 2px var(--blue); }
.tcard {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; box-shadow: var(--shadow); cursor: grab; user-select: none; touch-action: none;
}
.tcard:hover { border-color: var(--line-2); }
.tcard.dragging { opacity: .35; }
.tcard-ghost {
  position: fixed; z-index: 100; pointer-events: none; cursor: grabbing;
  transform: rotate(2deg); box-shadow: 0 12px 32px rgba(20,20,19,.22);
}
.tcard-name { font-weight: 600; font-size: 13px; line-height: 1.35; }
.tcard-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.tcard-note { font-size: 12px; color: var(--crit-ink); margin-top: 7px; display: flex; gap: 5px; align-items: flex-start; line-height: 1.35; }
.tcard-note .ic { width: 13px; height: 13px; flex: 0 0 auto; margin-top: 1px; }
.tcard-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.tcard-foot .avatar { flex: 0 0 auto; }
.tcard-foot .mini { flex: 1; height: 4px; border-radius: 999px; background: var(--blue-100); overflow: hidden; min-width: 30px; }
.tcard-foot .mini span { display: block; height: 100%; background: var(--blue); border-radius: 999px; }

/* ---------- Qrafik (Gantt) ---------- */
.gantt-legend {
  display: flex; gap: 18px; flex-wrap: wrap; padding: 12px 20px;
  font-size: 12px; color: var(--ink-2); border-bottom: 1px solid var(--line);
}
.gantt-legend span { display: inline-flex; align-items: center; gap: 7px; }
.lg { display: inline-block; width: 20px; height: 8px; border-radius: 3px; }
.lg-bar   { background: linear-gradient(to right, var(--blue) 60%, var(--blue-100) 60%); }
.lg-late  { background: linear-gradient(to right, var(--crit) 60%, var(--crit-bg) 60%); }
.lg-ms    { width: 9px; height: 9px; background: var(--ink); transform: rotate(45deg); border-radius: 2px; margin: 0 5px; }
.lg-dep   { height: 2px; background: var(--muted); }
.lg-today { width: 2px; height: 12px; background: var(--crit); margin: 0 9px; }

.gantt-scroll { overflow: auto; max-height: 72vh; border-radius: 0 0 var(--radius) var(--radius); }
.gantt-inner { --g-label: 280px; position: relative; width: max-content; min-width: 100%; }
.g-row { display: flex; height: 40px; border-top: 1px solid var(--line); }
.g-row.g-phase { height: 34px; }
.g-row.g-head { height: 34px; border-top: 0; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 3; background: var(--surface); }
.g-label {
  position: sticky; left: 0; z-index: 2;
  width: var(--g-label); flex: 0 0 var(--g-label);
  display: flex; align-items: center; gap: 8px; padding: 0 12px;
  font-size: 13px; background: var(--surface); border-right: 1px solid var(--line);
}
.g-phase .g-label, .g-phase .g-track { background-color: var(--surface-2); }
.g-phase .g-label { font-weight: 600; }
.g-head .g-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.g-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-pct { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; min-width: 32px; text-align: right; }
.g-track {
  position: relative; width: var(--g-width); flex: 0 0 var(--g-width);
  background-image: repeating-linear-gradient(to right, var(--line) 0 1px, transparent 1px 28px);
}
.g-head .g-track { background-image: none; display: flex; }
.g-month {
  border-left: 1px solid var(--line-2); padding: 8px 8px; font-size: 12px; font-weight: 600;
  color: var(--ink-2); white-space: nowrap; overflow: hidden; flex: 0 0 auto;
}
.g-bar { position: absolute; top: 11px; height: 18px; border-radius: 4px; background: var(--blue-100); }
.g-fill { display: block; height: 100%; border-radius: 4px; background: var(--blue); }
.g-bar.late { background: var(--crit-bg); }
.g-bar.late .g-fill { background: var(--crit); }
.g-pbar { position: absolute; top: 14px; height: 6px; border-radius: 3px; background: var(--ink-2); opacity: .45; }
.g-ms {
  position: absolute; top: 13px; width: 14px; height: 14px; margin-left: -7px;
  background: var(--ink); transform: rotate(45deg); border-radius: 2px;
}
.g-ms.late { background: var(--crit); }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--crit); opacity: .85; z-index: 1; pointer-events: none; }
.g-today span {
  position: sticky; top: 38px; display: inline-block; margin-left: -22px; margin-top: 38px;
  background: var(--crit); color: #fff; font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 999px; white-space: nowrap;
}
.g-svg { position: absolute; top: 0; left: var(--g-label); pointer-events: none; z-index: 1; overflow: visible; }
.g-svg path { fill: none; stroke: var(--muted); stroke-width: 1.5; }
.g-svg path.late { stroke: var(--crit); }
.g-svg marker path { fill: var(--muted); stroke: none; }
.g-svg #arrLate path { fill: var(--crit); }

/* ---------- Language switch ---------- */
.lang-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.lang-switch a { padding: 6px 9px; font-size: 12px; font-weight: 600; color: var(--muted); }
.lang-switch a + a { border-left: 1px solid var(--line); }
.lang-switch a.is-active { background: var(--surface-2); color: var(--ink); }

/* ---------- Public (auth) pages ---------- */
.auth-body { background: var(--bg); }
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card {
  width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 28px 28px 22px; box-shadow: 0 8px 30px rgba(20,20,19,.06);
}
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.auth-brand .brand-mark { background: var(--accent); color: var(--brand); width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; }
.auth-brand .brand-name { font-size: 18px; font-weight: 600; color: var(--ink); }
.auth-brand .brand-name b { color: var(--accent); }
.auth-card h1 { font-size: 21px; font-weight: 700; margin-bottom: 6px; }
.auth-sub { color: var(--muted); font-size: 13px; margin-bottom: 18px; line-height: 1.45; }
.form-field { margin-bottom: 14px; }
.form-field > label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.form-field input, .form-field select {
  width: 100%; height: 40px; border: 1px solid var(--line-2); border-radius: 8px; padding: 0 12px;
  font: inherit; color: var(--ink); background: var(--surface);
}
.form-field input:focus, .form-field select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-100); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.btn-block { width: 100%; justify-content: center; }
.btn-google { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.btn-google:hover { background: var(--surface-2); }
.auth-divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 16px 0; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.alert { padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; line-height: 1.4; }
.alert.error { background: var(--crit-bg); color: var(--crit-ink); }
.alert.success { background: var(--good-bg); color: var(--good-ink); }
.alert.info { background: var(--blue-100); color: var(--blue-600); }
.auth-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13px; margin-top: 16px; }
.auth-links a { color: var(--blue); }
.auth-foot { display: flex; justify-content: center; margin-top: 18px; }
.logout-form { display: contents; }
@media (max-width: 480px) { .form-row { grid-template-columns: 1fr; } .auth-card { padding: 22px 18px; } }

/* ---------- App forms, tabs, chips (Phase 1) ---------- */
.flash { margin-bottom: 16px; }
.flash .alert { margin-bottom: 8px; }
.link-box { margin-top: 8px; }
.link-box input { width: 100%; height: 34px; border: 1px solid var(--line-2); border-radius: 6px; padding: 0 10px; font: inherit; font-size: 12px; background: var(--surface); }
.crumbs { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.crumbs a { color: var(--blue); }
.page-head h1 .count { font-size: 16px; color: var(--muted); font-weight: 500; margin-left: 4px; }
.page-head h1 .badge { vertical-align: middle; margin-left: 6px; }
.page-head form { display: inline; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 9px 14px; font-size: 13px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); }
.tabs a.is-active { color: var(--ink); border-bottom-color: var(--accent); }
.form-card { padding: 20px 22px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid .span-2 { grid-column: span 2; }
.form-field textarea { width: 100%; border: 1px solid var(--line-2); border-radius: 8px; padding: 9px 12px; font: inherit; color: var(--ink); background: var(--surface); resize: vertical; }
.form-field textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-100); }
.form-field label a { color: var(--blue); }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.check-list { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--blue); }
.inline-form { display: inline-block; margin: 0; }
.inline-form select { height: 32px; border: 1px solid var(--line-2); border-radius: 6px; font: inherit; font-size: 13px; padding: 0 8px; background: var(--surface); }
.inline-input { width: 100%; border: 1px solid transparent; border-radius: 6px; padding: 4px 6px; font: inherit; font-weight: 600; background: transparent; }
.inline-input:hover { border-color: var(--line-2); }
.inline-input:focus { outline: none; border-color: var(--blue); background: var(--surface); }
.inline-row { display: flex; gap: 8px; }
.inline-row input[type=text], .inline-row select { flex: 1; height: 38px; border: 1px solid var(--line-2); border-radius: 8px; padding: 0 12px; font: inherit; background: var(--surface); min-width: 0; }
.table-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; white-space: nowrap; }
.table-actions form { margin: 0; }
.table .is-muted td { opacity: .55; }
.btn-xs { height: 28px; padding: 0 9px; font-size: 12px; }
.btn-danger { color: var(--crit-ink); border-color: var(--crit-bg); }
.btn-danger:hover { background: var(--crit-bg); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.chip { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--neutral-bg); color: var(--neutral-ink); white-space: nowrap; }
.chip-owner, .chip-manager { background: var(--blue-100); color: var(--blue-600); }
.chip-admin, .chip-engineer { background: #efe9fb; color: #4b3aa0; }
.chip-finance { background: var(--good-bg); color: var(--good-ink); }
.chip-foreman { background: var(--warn-bg); color: var(--warn-ink); }
.chip-contractor { background: var(--crit-bg); color: var(--crit-ink); }
.empty-state { padding: 40px 20px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty-state .ic { width: 36px; height: 36px; opacity: .5; }
.grid-2-wide { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.card-section { font-size: 13px; font-weight: 600; margin: 18px 0 8px; color: var(--ink-2); }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.settings-card { display: flex; align-items: center; gap: 14px; padding: 18px 20px; }
.settings-card:hover { border-color: var(--line-2); }
.settings-card .kpi-icon { width: 40px; height: 40px; flex: 0 0 auto; }
.settings-card > div { flex: 1; min-width: 0; }
.settings-title { font-weight: 600; margin-bottom: 2px; }
.settings-card > .ic { color: var(--muted); }
.feed-icon.task { background: var(--blue-100); color: var(--blue-600); }
.feed-icon.user { background: var(--good-bg); color: var(--good-ink); }
.feed-icon.project { background: var(--neutral-bg); color: var(--ink-2); }
@media (max-width: 1024px) { .grid-2-wide { grid-template-columns: minmax(0, 1fr); } .settings-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } .form-grid .span-2 { grid-column: span 1; } }

/* ---------- Task card (Phase 2) ---------- */
.task-head-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--ink-2); margin-top: 6px; }
.task-head-meta b { color: var(--ink); font-weight: 600; }
.status-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.status-actions form { margin: 0; }
.status-actions .note-form { display: flex; gap: 6px; width: 100%; }
.status-actions .note-form input { flex: 1; height: 36px; border: 1px solid var(--line-2); border-radius: 8px; padding: 0 10px; font: inherit; }
.progress-quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.progress-quick form { margin: 0; }
.progress-quick .btn.is-current { background: var(--blue-100); border-color: var(--blue); color: var(--blue-600); }
.thread { list-style: none; }
.thread li { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.thread li:first-child { border-top: 0; }
.thread .avatar { flex: 0 0 auto; }
.thread-body { flex: 1; min-width: 0; }
.thread-meta { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.thread-meta b { color: var(--ink); font-weight: 600; }
.thread-text { white-space: pre-wrap; line-height: 1.45; }
.thread-status { font-size: 13px; color: var(--ink-2); }
.thread-status .badge { margin: 0 2px; }
.comment-form textarea { width: 100%; min-height: 70px; }
.comment-form .form-actions { margin-top: 8px; }
.dep-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.dep-list li:first-child { border-top: 0; }
.dep-list a { font-weight: 600; }
.tcard.saving { opacity: .6; }
.tcard-name a { color: inherit; }
.tcard-num { color: var(--muted); font-weight: 500; margin-right: 4px; }
#toast.error { background: var(--crit); }
.activity-filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }

/* ---------- Budget (Phase 3) ---------- */
.text-right { text-align: right; }
.table td.num, .table th.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tfoot td { padding: 10px 20px; border-top: 1px solid var(--line); font-size: 13px; }
.table .total-row td { font-weight: 600; background: var(--surface-2); }
.table .total-row.grand td { font-size: 15px; border-top: 2px solid var(--line-2); }
.table tr.is-editing td { background: var(--blue-100); }
.budget-table .phase-row td:not(:first-child) { font-weight: 500; color: var(--ink-2); }
.chip-material { background: var(--blue-100); color: var(--blue-600); }
.chip-labor { background: var(--good-bg); color: var(--good-ink); }
.chip-machinery, .chip-transport { background: var(--warn-bg); color: var(--warn-ink); }
.chip-subcontract { background: #efe9fb; color: #4b3aa0; }
.page-actions .field select { max-width: 260px; }
.kpi-value.text-crit { color: var(--crit-ink); }
.form-field input[type=file] { width: 100%; font: inherit; font-size: 13px; }

/* ---------- Toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px);
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13px;
  opacity: 0; transition: opacity .2s, transform .2s; z-index: 200; pointer-events: none; max-width: 90vw;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1024px) {
  .seg { margin-left: 0; }
}
@media (max-width: 640px) {
  .gantt-inner { --g-label: 170px; }
  .g-label .avatar { display: none; }
  .seg { width: 100%; }
  .seg button { flex: 1; justify-content: center; }
  .col { flex-basis: 250px; }
}

/* ---------- Daily site log (Phase 4.1) ---------- */
.log-list { display: flex; flex-direction: column; gap: 14px; }
.log-card { padding: 0; }
.log-head { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.log-date { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 56px; padding: 6px 8px; border-radius: var(--radius-sm); background: var(--surface-2); line-height: 1.1; }
.log-date b { font-size: 22px; }
.log-date span { font-size: 11px; color: var(--muted); white-space: nowrap; margin-top: 3px; }
.log-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 1; min-width: 0; }
.log-author { color: var(--muted); font-size: 13px; }
.log-actions { display: flex; gap: 6px; margin-left: auto; }
.log-actions form { margin: 0; }
.log-body { padding: 14px 18px 16px; display: grid; gap: 12px; }
.log-body h3 { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 4px; }
.log-text { white-space: pre-line; }
.log-problem { display: flex; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--warn-bg); color: var(--warn-ink); }
.log-problem .ic { flex: 0 0 auto; margin-top: 2px; }
.log-problem h3 { color: var(--warn-ink); }
.log-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; }
.weather-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--blue-100); color: var(--blue-600); white-space: nowrap; }
.photo-strip { display: flex; gap: 8px; flex-wrap: wrap; }
.photo-strip a, .photo-thumb { position: relative; display: block; width: 96px; height: 96px; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.photo-strip img, .photo-grid img, .photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-more { display: flex; align-items: center; justify-content: center; width: 96px; height: 96px; border-radius: var(--radius-sm); background: var(--surface-2); font-weight: 600; color: var(--ink-2); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.photo-grid a { display: block; aspect-ratio: 4 / 3; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.photo-item { position: relative; }
.photo-x { position: absolute; top: 6px; right: 6px; margin: 0; }
.photo-x button, button.photo-x { width: 26px; height: 26px; border-radius: 50%; background: rgba(20,20,19,.65); color: #fff; font-size: 17px; line-height: 1; display: flex; align-items: center; justify-content: center; padding: 0; }
.photo-x button:hover, button.photo-x:hover { background: var(--crit); }
.photo-pick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.photo-add { cursor: pointer; }
.photo-preview { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.photo-preview:empty { display: none; }
.weather-pick { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.weather-opt { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 500; background: var(--surface); user-select: none; }
.weather-opt input { position: absolute; opacity: 0; width: 0; height: 0; margin: 0; }
.weather-opt .emoji { font-size: 18px; line-height: 1; }
.weather-opt:hover { border-color: var(--blue); }
.weather-opt:has(input:checked) { border-color: var(--blue); background: var(--blue-100); color: var(--blue-600); }
.weather-opt:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--blue-100); }
.form-field .temp-input { width: 90px; height: 40px; }
.month-nav { display: flex; align-items: center; gap: 6px; }
.month-nav select { height: 36px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); padding: 0 10px; font: inherit; color: var(--ink); min-width: 180px; }
.month-nav .icon-btn { font-size: 20px; font-weight: 600; }
.icon-btn.is-disabled { opacity: .3; pointer-events: none; }
.btn-lg { height: 46px; padding: 0 24px; font-size: 15px; }
@media (max-width: 640px) {
  .log-head { gap: 10px; padding: 12px 14px; }
  .log-body { padding: 12px 14px 14px; }
  .log-actions { margin-left: 0; width: 100%; }
  .daily-form .form-actions { flex-direction: column-reverse; }
  .daily-form .form-actions .btn { width: 100%; justify-content: center; }
  .photo-strip a, .photo-thumb, .photo-more { width: 72px; height: 72px; }
  .page-actions { flex-wrap: wrap; }
  .page-actions .field { width: 100%; }
  .page-actions .field select { flex: 1; max-width: none; min-width: 0; }
  .page-actions .btn-primary { flex: 1; justify-content: center; }
}

/* ---------- Issues and change orders (Phase 4.3) ---------- */
.issue-type { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 6px; vertical-align: middle; }
.issue-type .ic { width: 15px; height: 15px; }
.issue-type.issue { background: var(--crit-bg); color: var(--crit-ink); }
.issue-type.change { background: var(--blue-100); color: var(--blue-600); }
.page-head h1 .issue-type { width: 30px; height: 30px; border-radius: 8px; }
.page-head h1 .issue-type .ic { width: 18px; height: 18px; }
.chip.prio-high { background: var(--crit-bg); color: var(--crit-ink); }
.chip.prio-normal { background: var(--neutral-bg); color: var(--neutral-ink); }
.chip.prio-low { background: var(--surface-2); color: var(--muted); }
.issue-table .proj-loc a { color: var(--blue-600); }
.opt-chip { position: relative; display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 500; background: var(--surface); user-select: none; }
.opt-chip input { position: absolute; opacity: 0; width: 0; height: 0; margin: 0; }
.opt-chip .ic { width: 16px; height: 16px; }
.opt-chip:hover { border-color: var(--blue); }
.opt-chip:has(input:checked) { border-color: var(--blue); background: var(--blue-100); color: var(--blue-600); }
.opt-chip:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--blue-100); }
.detail-list { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0; font-size: 13px; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; }

.issue-table th, .issue-table td { padding-left: 12px; padding-right: 12px; }
.issue-table td { white-space: normal; }
.issue-table td:nth-child(2) { min-width: 220px; }
.issue-table td.num { white-space: nowrap; }
.issue-table td.impact { font-variant-numeric: tabular-nums; white-space: nowrap; line-height: 1.3; }
.issue-table .cue { display: block; margin-top: 2px; white-space: nowrap; }
.issue-table .person .avatar { flex: 0 0 auto; }

/* ---------- Materials (Phase 4.4) ---------- */
.seg a { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.seg a .ic { width: 15px; height: 15px; }
.seg a:hover { color: var(--ink); }
.seg a.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.items-table td, .deliver-table td { padding: 6px 8px; vertical-align: middle; }
.items-table th { padding-left: 8px; padding-right: 8px; }
.items-table input, .deliver-table input { width: 100%; height: 36px; border: 1px solid var(--line-2); border-radius: 8px; padding: 0 10px; font: inherit; background: var(--surface); min-width: 0; }
.items-table input:focus, .deliver-table input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-100); }
.items-table .icon-btn { font-size: 18px; }
.deliver-table tr:last-child td { border-bottom: 0; }
.material-table td { white-space: normal; }
.material-table th, .material-table td { padding-left: 12px; padding-right: 12px; }
.material-table td:nth-child(2) { min-width: 220px; }
.material-table .cue { display: block; margin-top: 2px; white-space: nowrap; }

/* ---------- Documents and attachments (Phase 5.1) ---------- */
.doc-table td { white-space: normal; }
.doc-table th, .doc-table td { padding-left: 12px; padding-right: 12px; }
.doc-thumb-cell { width: 56px; }
.doc-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; display: block; flex: 0 0 auto; }
.doc-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 8px; background: var(--surface-2); color: var(--ink-2); flex: 0 0 auto; }
.doc-icon .ic { width: 20px; height: 20px; }
.doc-icon.ext-pdf { background: var(--crit-bg); color: var(--crit-ink); }
.doc-icon.ext-xls, .doc-icon.ext-xlsx, .doc-icon.ext-csv { background: var(--good-bg); color: var(--good-ink); }
.doc-icon.ext-doc, .doc-icon.ext-docx { background: var(--blue-100); color: var(--blue-600); }
.doc-icon.ext-dwg, .doc-icon.ext-dxf { background: var(--warn-bg); color: var(--warn-ink); }
.doc-preview { background: var(--surface-2); min-height: 240px; display: flex; align-items: center; justify-content: center; }
.doc-preview img { max-width: 100%; max-height: 70vh; display: block; }
.doc-preview iframe { width: 100%; height: 70vh; border: 0; background: #fff; }
.file-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.file-list li:last-child { border-bottom: 0; }
.file-list .file-body { flex: 1; min-width: 0; }
.file-list .file-body a { font-weight: 600; }
.file-list .file-body .muted { font-size: 12px; }
.file-list form { margin: 0; }
.file-list > li > .ic { color: var(--ink-2); flex: 0 0 auto; }
.doc-clip { color: var(--muted); vertical-align: middle; margin-left: 4px; }
.doc-clip .ic { width: 14px; height: 14px; }
.attach-form .photo-pick { align-items: center; }

/* ---------- Chat (Phase 5.2) ---------- */
.chat-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; height: calc(100vh - 64px - 56px); min-height: 480px; }
.chat-list { display: flex; flex-direction: column; overflow-y: auto; padding: 0; }
.chat-list-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 8px; }
.chat-list-head h2 { font-size: 15px; font-weight: 600; flex: 1; }
.chat-section { padding: 6px 8px 10px; border-top: 1px solid var(--line); }
.chat-section-head { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 6px 8px 4px; }
.chat-none { font-size: 12px; padding: 4px 8px 6px; }
.chat-item a { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm); }
.chat-item a:hover, .chat-item.is-active a { background: var(--surface-2); }
.chat-item.is-active a { box-shadow: inset 3px 0 0 var(--blue); }
.chat-avatar { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; font-size: 12px; font-weight: 700; background: var(--blue-100); color: var(--blue-600); }
.chat-avatar.group { background: var(--warn-bg); color: var(--warn-ink); }
.chat-avatar.dm { background: var(--good-bg); color: var(--good-ink); border-radius: 50%; }
.chat-avatar .ic { width: 16px; height: 16px; }
.chat-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-item-title { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item-preview { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item-time { font-size: 11px; color: var(--muted); white-space: nowrap; align-self: flex-start; }
.chat-new { padding: 4px 8px; }
.chat-new summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--blue-600); list-style: none; }
.chat-new summary::-webkit-details-marker { display: none; }
.chat-new summary .ic { width: 14px; height: 14px; }
.chat-new .check-list { max-height: 160px; overflow-y: auto; gap: 6px 14px; }
.chat-new-dm { padding: 4px 8px; }
.chat-new-dm select { width: 100%; height: 34px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); padding: 0 8px; font: inherit; font-size: 13px; color: var(--blue-600); }
.chat-pane { display: flex; flex-direction: column; padding: 0; min-height: 0; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.chat-head-body { flex: 1; min-width: 0; }
.chat-head-title { font-weight: 600; }
.chat-head-title a { margin-left: 8px; font-weight: 400; font-size: 13px; }
.chat-members summary { font-size: 12px; color: var(--muted); cursor: pointer; list-style: none; }
.chat-members summary::-webkit-details-marker { display: none; }
.chat-members-body { position: absolute; z-index: 20; margin-top: 6px; width: 320px; max-width: calc(100vw - 32px); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(20,20,19,.12); padding: 12px; }
.chat-members-body li { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 13px; }
.chat-members-body li .person { flex: 1; }
.chat-members-body form { margin: 0; }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.chat-empty { margin: auto; }
.msg { display: flex; gap: 10px; max-width: 78%; }
.msg.own { align-self: flex-end; flex-direction: row-reverse; }
.msg .avatar { flex: 0 0 auto; margin-top: 2px; }
.msg-body { background: var(--surface-2); border-radius: 14px; padding: 8px 12px; min-width: 0; }
.msg.own .msg-body { background: var(--blue-100); }
.msg-meta { display: flex; gap: 8px; align-items: baseline; font-size: 12px; margin-bottom: 2px; }
.msg-meta b { color: var(--blue-600); }
.msg.own .msg-meta b { display: none; }
.msg-meta time { color: var(--muted); font-size: 11px; }
.msg-text { white-space: pre-wrap; word-wrap: break-word; line-height: 1.45; }
.msg-text a { color: var(--blue-600); text-decoration: underline; }
.msg-text .mention { color: var(--blue-600); font-weight: 600; background: rgba(42,120,214,.1); border-radius: 4px; padding: 0 3px; }
.msg-task { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--good-ink); background: var(--good-bg); border-radius: 6px; padding: 3px 8px; }
.msg-actions { display: flex; gap: 10px; font-size: 11px; margin-top: 4px; opacity: 0; transition: opacity .15s; }
.msg:hover .msg-actions { opacity: 1; }
.msg-actions a, .msg-actions button { color: var(--muted); font-size: 11px; padding: 0; }
.msg-actions a:hover, .msg-actions button:hover { color: var(--blue-600); }
.msg-actions form { margin: 0; }
.msg-system { align-self: center; text-align: center; font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: baseline; }
.msg-system a { color: var(--blue-600); font-weight: 600; }
.msg-system time { font-size: 11px; }
.chat-composer { border-top: 1px solid var(--line); padding: 10px 16px 12px; }
.composer-box { position: relative; display: flex; gap: 8px; align-items: flex-end; }
.composer-box textarea { flex: 1; resize: none; max-height: 160px; border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 12px; font: inherit; background: var(--surface); min-height: 42px; }
.composer-box textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-100); }
.composer-box .btn { height: 42px; width: 42px; padding: 0; justify-content: center; border-radius: 12px; }
.chat-composer .form-hint { margin-top: 6px; font-size: 11px; }
.mention-menu { position: absolute; left: 0; bottom: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 8px 24px rgba(20,20,19,.12); padding: 4px; min-width: 240px; z-index: 30; }
.mention-menu button { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 6px 8px; border-radius: 7px; font-size: 13px; }
.mention-menu button small { color: var(--muted); margin-left: auto; font-size: 11px; }
.mention-menu button.is-active, .mention-menu button:hover { background: var(--blue-100); }
.chat-head .only-mobile { display: none; }
@media (max-width: 1024px) {
  .chat-layout { grid-template-columns: minmax(0, 1fr); height: calc(100vh - 64px - 32px); }
  .chat-layout.has-channel .chat-list { display: none; }
  .chat-layout:not(.has-channel) .chat-pane { display: none; }
  .chat-head .only-mobile { display: inline-flex; font-size: 22px; }
  .msg { max-width: 92%; }
}

/* ---------- Notifications (Phase 5.3) ---------- */
.bell-link { position: relative; }
.bell-count { position: absolute; top: -4px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--crit); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.notif-list li { display: flex; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.notif-list li:last-child { border-bottom: 0; }
.notif.is-unread { background: var(--surface-2); }
.notif.is-unread .notif-title { font-weight: 700; }
.notif-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.notif-title { font-weight: 500; }
.notif-text { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-meta { font-size: 12px; color: var(--muted); }
.notif.is-unread::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); margin-top: 14px; flex: 0 0 auto; }
.notif::before { content: ""; width: 8px; flex: 0 0 auto; }

/* ---------- Reports on screen (Phase 6.1); the print page uses assets/css/print.css ---------- */
.report-screen .card-body { padding-top: 18px; }
.report h2 { font-size: 15px; font-weight: 600; margin: 22px 0 10px; }
.report h2 small { font-weight: 500; font-size: 13px; }
.report .crit { color: var(--crit-ink); font-weight: 600; }
.report-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 16px; }
.report-kpis .rk { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--surface-2); }
.report-kpis .rk span { display: block; font-size: 12px; color: var(--muted); }
.report-kpis .rk b { font-size: 20px; }
.report-kpis .rk.crit b { color: var(--crit-ink); }
.report-meta { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 6px; }
.report-meta th { text-align: left; color: var(--muted); font-weight: 500; padding: 4px 10px 4px 0; white-space: nowrap; vertical-align: top; width: 14%; }
.report-meta td { padding: 4px 16px 4px 0; vertical-align: top; }
.report-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.report-table th, .report-table td { border-bottom: 1px solid var(--line); padding: 7px 10px; text-align: left; vertical-align: top; }
.report-table thead th { background: var(--surface-2); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.report-table tfoot th { font-weight: 700; border-top: 2px solid var(--line-2); }
.report-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.report-table .pre { white-space: pre-line; }
.report-table tr.is-late td { background: #fff7f7; }
.report-table tr.is-done td { color: var(--muted); }
.rbar { height: 6px; background: var(--blue-100); border-radius: 999px; overflow: hidden; display: inline-block; width: 70%; vertical-align: middle; margin-right: 8px; }
.rbar span { display: block; height: 100%; background: var(--blue); }
.report-note { color: var(--ink-2); margin-bottom: 12px; }
.report-foot-stats { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 13px; color: var(--ink-2); margin-top: 18px; }
.period-form { gap: 6px; }
.period-form input[type=date] { height: 36px; border: 1px solid var(--line-2); border-radius: 8px; padding: 0 8px; font: inherit; background: var(--surface); }
.quick-links { display: inline-flex; gap: 10px; font-size: 13px; }
.quick-links a { color: var(--blue-600); }
.quick-links a.is-active { font-weight: 700; text-decoration: underline; }
@media (max-width: 640px) { .report-table { font-size: 12px; } .report-table th, .report-table td { padding: 6px; } }

/* ---------- Task card: executor vs management (2026-10-25) ---------- */
.task-owner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 4px; font-size: 13px; }
.task-owner .person { font-weight: 600; }
.behalf { margin-top: 10px; }
.behalf summary { cursor: pointer; color: var(--blue-600); font-size: 13px; font-weight: 600; list-style: none; }
.behalf summary::-webkit-details-marker { display: none; }
.behalf summary::before { content: '+ '; }
.behalf[open] summary::before { content: '− '; }

/* ---------- Şirkət profili (6.2) ---------- */
.company-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 8px; }
.company-logo.has-img { background: #fff; padding: 2px; }
.company-logo.lg { width: 72px; height: 72px; font-size: 22px; border-radius: 14px; }
.stack { display: grid; gap: 16px; align-content: start; }
.logo-box { display: flex; align-items: center; justify-content: center; min-height: 120px; border: 1px dashed var(--line-2); border-radius: 10px; background: var(--surface-2); margin-bottom: 14px; padding: 12px; }
.logo-box img { max-width: 100%; max-height: 140px; object-fit: contain; }
.logo-form { margin-bottom: 10px; }
.logo-form input[type=file] { width: 100%; font: inherit; font-size: 13px; margin-bottom: 6px; }
.logo-form .form-actions { margin-top: 8px; }

/* ---------- Platforma (6.3) ---------- */
.sync-counts { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; }
.history-title { font-size: 13px; font-weight: 600; margin: 16px 0 6px; }
.history-list { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.history-list li { padding: 5px 0; border-top: 1px solid var(--line); }
.toolbar select { height: 36px; border: 1px solid var(--line-2); border-radius: 8px; padding: 0 10px; font: inherit; font-size: 13px; background: var(--surface); color: var(--ink); }
.page-head h1 .chip, .page-head h1 .badge { vertical-align: middle; margin-left: 6px; }
.table .nowrap { white-space: nowrap; }
.table .small { font-size: 12px; }

/* ---------- Səsli qeyd (7.2) ---------- */
.voice-box { background: var(--surface-2); border: 1px dashed var(--line-2); border-radius: 10px; padding: 12px 14px; }
.voice-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.voice-btn.is-recording { background: var(--crit); border-color: var(--crit); color: #fff; }
.voice-btn.is-recording .ic { animation: voice-pulse 1s ease-in-out infinite; }
@keyframes voice-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.voice-status { font-size: 13px; }
.voice-status.ok { color: var(--good-ink); font-weight: 600; }
.voice-file { cursor: pointer; font-size: 13px; }
.voice-result { margin-top: 10px; }
.voice-result summary { font-size: 13px; font-weight: 600; cursor: pointer; }
.voice-result p { white-space: pre-line; font-size: 13px; color: var(--ink-2); margin: 6px 0 0; }
.file-list audio { display: block; width: 100%; max-width: 420px; height: 36px; margin-top: 6px; }

/* Labels: only the direct label of a field is a block; chips and inline labels keep their own layout (7.2 fix) */
.form-field label.weather-opt, .form-field label.opt-chip { margin: 0; }
.voice-row label.voice-file { display: inline; margin: 0; font-weight: 500; }
.voice-status { display: block; margin-top: 8px; font-size: 13px; }
.voice-status:empty { display: none; }

/* ---------- Topbar: search form, New menu, profile link (8.1) ---------- */
form.search { margin: 0; }
a.user { color: inherit; text-decoration: none; }
a.user:hover .user-name { color: var(--blue); }
.dropdown { position: relative; }
.dropdown > summary { list-style: none; cursor: pointer; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 28px rgba(20,20,19,.10); padding: 6px; z-index: 30; }
.dropdown-menu a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--ink); white-space: nowrap; }
.dropdown-menu a:hover { background: var(--surface-2); }
.dropdown-menu .ic { width: 16px; height: 16px; color: var(--muted); }
.search-groups { display: grid; gap: 16px; }
.search-list { list-style: none; margin: 0; padding: 0 20px 10px; }
.search-list li { border-top: 1px solid var(--line); }
.search-list a { display: block; padding: 10px 0; color: var(--ink); }
.search-list a:hover .search-title { color: var(--blue); }
.search-title { display: block; font-weight: 600; }
.search-sub { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.card-head h2 .ic { width: 16px; height: 16px; vertical-align: -3px; color: var(--muted); margin-right: 4px; }

/* ---------- Mobile pass + PWA (8.2) ---------- */
.topbar-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sidebar-lang { display: none; gap: 2px; padding: 0 8px 10px; }
.sidebar-lang a { padding: 6px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--brand-ink); opacity: .7; }
.sidebar-lang a.is-active { background: rgba(255,255,255,.1); color: #fff; opacity: 1; }
.install-banner { display: flex; align-items: center; gap: 12px; background: var(--brand); color: #fff; border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; }
.install-banner .install-icon { width: 36px; height: 36px; border-radius: 9px; background: var(--accent); color: var(--brand); display: grid; place-items: center; flex: 0 0 auto; }
.install-banner .install-icon .ic { width: 20px; height: 20px; }
.install-banner .install-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.install-banner .install-sub { color: var(--brand-ink); font-size: 12px; }
.install-banner .install-close { color: #fff; background: transparent; border: 0; font-size: 20px; line-height: 1; width: 32px; height: 32px; cursor: pointer; flex: 0 0 auto; }
@media (min-width: 1025px) { .install-banner { display: none !important; } }
@media (max-width: 1024px) { .sidebar-lang { display: flex; } }
@media (max-width: 640px) {
  .topbar { gap: 8px; }
  .topbar .lang-switch { display: none; }
  .dropdown > summary span { display: none; }
  .dropdown > summary { padding: 0 10px; }
  .topbar .logout-form { display: none; }
}

/* ---------- Modal dialoq (confirm əvəzinə) ---------- */
.modal { border: 0; border-radius: 14px; padding: 0; width: min(440px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: 0 24px 60px rgba(20,20,19,.28); }
.modal::backdrop { background: rgba(20,20,19,.45); backdrop-filter: blur(2px); }
.modal[open] { animation: modal-in .16s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-box { padding: 22px 22px 18px; }
.modal-title { font-size: 16px; font-weight: 700; margin: 0 0 8px; }
.modal-text { margin: 0; color: var(--ink-2); line-height: 1.55; font-size: 14px; white-space: pre-line; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.btn-danger { background: var(--crit); color: #fff; border-color: var(--crit); }
.btn-danger:hover { filter: brightness(.94); }
@media (max-width: 640px) { .modal { width: calc(100vw - 24px); } .modal-actions { flex-direction: column-reverse; } .modal-actions .btn { width: 100%; justify-content: center; } }

/* ---------- Cədvəl xanaları xana olaraq qalır (text-crit / table-actions td-ni flex edirdi və sütunlar sürüşürdü) ---------- */
td.text-crit, td.text-warn, th.text-crit, th.text-warn { display: table-cell; }
td.table-actions { display: table-cell; text-align: right; white-space: nowrap; }
td.table-actions > * { display: inline-flex; vertical-align: middle; }
td.table-actions > * + * { margin-left: 6px; }
.btn-icon { width: 30px; padding: 0; justify-content: center; }
.btn-icon .ic { width: 15px; height: 15px; }
.budget-table th, .budget-table td { padding-left: 12px; padding-right: 12px; }
.budget-table td:nth-child(2) { min-width: 150px; }
.budget-table .phase-row td { padding-left: 12px; }
.budget-table .line-type { margin-top: 3px; }
.budget-table .line-type .chip { font-size: 10px; padding: 1px 6px; }
@media (max-width: 1500px) { .budget-grid { grid-template-columns: minmax(0, 1fr); } }
