:root {
  --bg: #FAF9F7;
  --bg-card: #FFFFFF;
  --bg-muted: #F2F0EC;
  --primary: #1D6E91;
  --primary-dark: #155674;
  --primary-light: #E8F1F5;
  --secondary: #C7534B;
  --secondary-light: #FBEAE8;
  --text: #1C1C1C;
  --text-muted: #6B6B6B;
  --text-light: #9A9A9A;
  --border: #E8E5DF;
  --success: #4CAF50;
  --success-light: #E8F5E9;
  --warning: #FFA726;
  --warning-light: #FFF4E5;
  --danger: #C7534B;
  --danger-light: #FBEAE8;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  letter-spacing: -0.01em;
}

h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
h4 { font-size: 15px; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* === Layout === */
.app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 20px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
}

.sidebar-logo {
  padding: 0 20px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.sidebar-logo .brand {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.03em;
}
.sidebar-logo .sub {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2px;
}

.sidebar-nav { padding: 0 12px; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
}
.sidebar-nav a:hover {
  background: var(--bg-muted);
  text-decoration: none;
}
.sidebar-nav a.active {
  background: var(--primary-light);
  color: var(--primary);
}
.sidebar-nav a .icon { width: 18px; height: 18px; }

.sidebar-section {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-light);
  letter-spacing: 0.08em;
  padding: 16px 20px 6px;
  font-weight: 600;
}

.main {
  flex: 1;
  min-width: 0;
}

.topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-title h1 { font-size: 20px; }
.topbar-title .crumbs {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.content {
  padding: 28px 32px;
  max-width: 1400px;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.btn:hover { background: var(--bg-muted); text-decoration: none; }
.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary {
  background: var(--secondary);
  color: white;
  border-color: var(--secondary);
}
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--bg-muted); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn .icon { width: 15px; height: 15px; }

/* === Language switcher + Bell dropdown (shared: index + villa) === */
.lang-switcher { display: flex; gap: 3px; background: var(--bg-muted); padding: 3px; border-radius: 8px; }
.lang-chip { border: none; background: transparent; font-size: 11px; font-weight: 700; padding: 5px 9px; border-radius: 6px; cursor: pointer; color: var(--text-muted); letter-spacing: 0.03em; }
.lang-chip:hover { color: var(--text); }
.lang-chip.active { background: white; color: var(--primary); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

.bell-wrap { position: relative; }
.bell-btn { position: relative; }
.bell-btn .badge-dot {
  position: absolute;
  top: 4px; right: 4px;
  min-width: 15px; height: 15px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--danger);
  color: white;
  font-size: 9px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2px white;
}
.bell-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.16);
  z-index: 200;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.18s;
  pointer-events: none;
}
.bell-dropdown.open { max-height: 520px; opacity: 1; pointer-events: auto; }
.bell-head {
  padding: 12px 16px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 700;
  border-bottom: 1px solid var(--border);
}
.bell-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: background 0.1s;
}
.bell-item:hover { background: var(--bg-muted); text-decoration: none; }
.bell-item:last-child { border-bottom: none; }
.bell-item .bell-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}
.bell-item.critical .bell-dot { background: var(--danger); }
.bell-item.warning .bell-dot { background: var(--warning); }
.bell-item.info .bell-dot { background: #F59E0B; }
.bell-item .bell-title { font-size: 13px; font-weight: 700; margin-bottom: 3px; }
.bell-item .bell-sub { font-size: 11px; color: var(--text-muted); line-height: 1.4; }
.bell-item .bell-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.bell-item .bell-actions button {
  font-size: 10px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: white;
  cursor: pointer;
  color: var(--text);
}
.bell-item .bell-actions button:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }

/* === Cards === */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

/* === KPI === */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.kpi {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
}
.kpi-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}
.kpi-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
  margin-top: 6px;
}
.kpi-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}
.kpi-sub.positive { color: var(--success); }
.kpi-sub.negative { color: var(--danger); }

/* === Villa card === */
.villa-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}
.villa-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: all 0.2s;
  cursor: pointer;
}
.villa-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
  border-color: var(--primary-light);
}
.villa-photo {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  background: var(--bg-muted);
}
.villa-photo-wrap { position: relative; }
.villa-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.villa-badge.on_track { color: var(--success); }
.villa-badge.delayed { color: var(--warning); }
.villa-badge.at_risk { color: var(--danger); }
.villa-badge.live {
  background: var(--secondary);
  color: white;
}

.villa-body { padding: 16px 18px 18px; }
.villa-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.villa-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.progress {
  background: var(--bg-muted);
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}
.progress-bar {
  height: 100%;
  background: var(--primary);
  transition: width 0.4s;
}
.progress-bar.delayed { background: var(--warning); }
.progress-bar.at_risk { background: var(--danger); }

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.progress-label .phase {
  font-weight: 500;
  color: var(--text);
}

.villa-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 13px;
}
.villa-stats .stat {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
}
.villa-stats .stat .icon {
  width: 14px; height: 14px;
  color: var(--text-light);
}

/* === Activity feed === */
.feed-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.feed-item:last-child { border-bottom: none; }
.feed-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.feed-dot .icon { width: 16px; height: 16px; }
.feed-dot.problem { background: var(--danger-light); color: var(--danger); }
.feed-dot.delivery { background: var(--success-light); color: var(--success); }
.feed-dot.photo { background: var(--primary-light); color: var(--primary); }
.feed-body { flex: 1; min-width: 0; }
.feed-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 3px;
}
.feed-meta .villa-ref {
  color: var(--primary);
  font-weight: 500;
}
.feed-text { font-size: 14px; color: var(--text); }
.feed-photo {
  margin-top: 8px;
  width: 180px;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

/* === Tabs === */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  overflow-x: auto;
}
.tab {
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tab:hover { color: var(--text); }
.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.tab .icon { width: 15px; height: 15px; }

/* === View switcher === */
.view-switcher {
  display: inline-flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.view-btn {
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.view-btn:hover { color: var(--text); }
.view-btn.active {
  background: var(--primary);
  color: white;
}
.view-btn .icon { width: 14px; height: 14px; }

/* === Modal === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-overlay.open { display: flex; }
.modal {
  background: white;
  border-radius: 16px;
  padding: 28px;
  width: 500px;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
}
.modal h3 { margin-bottom: 18px; }

/* === Form === */
.form-row {
  margin-bottom: 14px;
}
.form-row label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.form-row input, .form-row select, .form-row textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: white;
  color: var(--text);
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: none;
  border-color: var(--primary);
}

/* === Stages timeline === */
.stages-timeline {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 0;
}
.stage-pill {
  flex: 0 0 auto;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  font-size: 12px;
  min-width: 140px;
}
.stage-pill.done {
  background: var(--success-light);
  border-color: rgba(76, 175, 80, 0.3);
}
.stage-pill.in_progress {
  background: var(--primary-light);
  border-color: rgba(29, 110, 145, 0.3);
}
.stage-pill.pending {
  background: var(--bg-muted);
  color: var(--text-light);
}
.stage-pill .stage-num {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.stage-pill .stage-name {
  font-weight: 500;
  margin-top: 2px;
}
.stage-pill .stage-progress {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* === Matrix table === */
.matrix-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: white;
}
.matrix {
  border-collapse: collapse;
  font-size: 12px;
  min-width: 100%;
}
.matrix th, .matrix td {
  border: 1px solid var(--border);
  padding: 6px 8px;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}
.matrix th {
  background: var(--bg-muted);
  font-weight: 600;
  position: sticky;
  top: 0;
  color: var(--text);
}
.matrix th.month {
  background: var(--primary-light);
  color: var(--primary);
}
.matrix td.phase-name {
  text-align: left;
  min-width: 240px;
  position: sticky;
  left: 0;
  background: white;
  font-weight: 500;
  z-index: 2;
}
.matrix tr.section td.phase-name {
  background: var(--bg-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--primary);
}
.matrix td.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

/* === Gantt overrides === */
.gantt-container { font-family: 'Inter', sans-serif; }
.gantt .grid-header { fill: var(--bg-muted); }
.gantt .grid-row { fill: white; }
.gantt .grid-row:nth-child(even) { fill: var(--bg); }
.gantt .bar { fill: var(--primary); }
.gantt .bar-progress { fill: var(--primary-dark); }
.gantt .bar-label { fill: white; font-weight: 500; font-size: 12px; }
.gantt .row-line { stroke: var(--border); }

/* === Utility === */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: 10px; }
.gap-3 { gap: 16px; }
.text-muted { color: var(--text-muted); }
.text-small { font-size: 12px; }
.text-primary { color: var(--primary); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }

/* === Hint strip (light tutorial) === */
.hint-strip {
  background: linear-gradient(135deg, #E8F1F5 0%, #F3F8FA 100%);
  border: 1px solid rgba(29, 110, 145, 0.2);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  position: relative;
}
.hint-strip .hint-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hint-strip .hint-icon .icon { width: 16px; height: 16px; }
.hint-strip .hint-body { flex: 1; }
.hint-strip .hint-title {
  font-weight: 600;
  color: var(--primary);
  font-size: 13px;
  margin-bottom: 2px;
}
.hint-strip .hint-text {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}
.hint-strip .hint-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  border-radius: 4px;
  flex-shrink: 0;
}
.hint-strip .hint-close:hover { background: rgba(0,0,0,0.05); }
.hint-strip .hint-close .icon { width: 16px; height: 16px; }

/* === Alert bar (above topbar) === */
.alert-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(90deg, #FBEAE8 0%, #FEF4F2 100%);
  border-bottom: 1px solid rgba(199, 83, 75, 0.3);
  padding: 10px 32px;
  font-size: 13px;
  color: var(--danger);
  text-decoration: none;
  transition: background 0.15s;
}
.alert-bar:hover { background: #FBEAE8; text-decoration: none; }
.alert-bar .icon { width: 16px; height: 16px; }
.alert-bar strong { font-weight: 600; }
.alert-bar .alert-bar-sub { color: rgba(199, 83, 75, 0.75); font-weight: 400; }
.alert-bar .alert-bar-cta {
  margin-left: auto;
  font-weight: 600;
}

/* === Nav badges === */
.sidebar-nav a .nav-badge {
  margin-left: auto;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}
.sidebar-nav a .nav-badge.urgent { background: var(--danger); color: white; }
.sidebar-nav a.active .nav-badge { background: white; }

/* === Issue card === */
.issue-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 12px;
  display: flex;
  gap: 14px;
  cursor: pointer;
  transition: all 0.15s;
}
.issue-card:hover { border-color: var(--primary-light); }
.issue-card.critical { border-left: 4px solid var(--danger); }
.issue-card.warning { border-left: 4px solid var(--warning); }
.issue-card.info { border-left: 4px solid var(--primary); }
.issue-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.issue-card.critical .issue-icon { background: var(--danger-light); color: var(--danger); }
.issue-card.warning .issue-icon { background: var(--warning-light); color: var(--warning); }
.issue-card.info .issue-icon { background: var(--primary-light); color: var(--primary); }
.issue-body { flex: 1; min-width: 0; }
.issue-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.issue-sub { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.issue-chain {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}
.issue-chain .arrow { color: var(--text-light); }
.issue-chain .active-step {
  background: var(--warning-light);
  color: var(--warning);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}
.issue-right {
  text-align: right;
  flex-shrink: 0;
  min-width: 120px;
}
.issue-right .age {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.issue-right .impact {
  font-size: 12px;
  font-weight: 600;
  color: var(--danger);
}

/* === Today cards === */
.today-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}
.today-section {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 18px;
}
.today-section h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.today-section h3 .badge {
  background: var(--bg-muted);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: auto;
}
.today-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--border);
}
.today-row:last-child { border-bottom: none; }
.today-villa-name { font-weight: 600; min-width: 140px; font-size: 14px; }
.today-villa-name .loc { font-size: 11px; color: var(--text-muted); font-weight: 400; }
.today-work { flex: 1; font-size: 13px; color: var(--text-muted); }
.today-work strong { color: var(--text); }
.today-crew {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}
.today-status {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.today-status.ok { background: var(--success-light); color: var(--success); }
.today-status.warn { background: var(--warning-light); color: var(--warning); }
.today-status.stop { background: var(--danger-light); color: var(--danger); }

/* === Villa hero mini (for new villa overview) === */
.villa-current-phase {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
}
.phase-info .phase-label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-bottom: 4px;
}
.phase-info .phase-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.phase-info .phase-sub { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.phase-progress-ring {
  position: relative;
  width: 80px;
  height: 80px;
}
.phase-progress-ring svg { transform: rotate(-90deg); }
.phase-progress-ring .pct {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: var(--primary);
}
.phase-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 10px;
}
.phase-breadcrumb .crumb { padding: 3px 10px; border-radius: 10px; background: var(--bg-muted); }
.phase-breadcrumb .crumb.done { color: var(--success); background: var(--success-light); }
.phase-breadcrumb .crumb.current { background: var(--primary); color: white; font-weight: 600; }
.phase-breadcrumb .crumb.next { background: var(--bg-muted); color: var(--text-muted); }
.phase-breadcrumb .arrow { color: var(--text-light); }

.today-work-box {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
}
.work-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}
.work-item:last-child { border-bottom: none; }
.work-check {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.work-check.done { background: var(--success); border-color: var(--success); color: white; }
.work-text { flex: 1; font-size: 14px; }
.work-text.done { text-decoration: line-through; color: var(--text-muted); }
.work-crew { font-size: 12px; color: var(--text-muted); }

/* === Geo verified badge === */
.geo-verified {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--success-light);
  color: var(--success);
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.geo-verified .icon { width: 11px; height: 11px; }
.geo-unverified {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--danger-light);
  color: var(--danger);
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

/* === Team hierarchy === */
.team-tree {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}
.team-node {
  position: relative;
  padding-left: 28px;
  margin-bottom: 18px;
}
.team-node::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 22px;
  bottom: -10px;
  width: 1px;
  background: var(--border);
}
.team-node.last::before { display: none; }
.team-node-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-muted);
  border-radius: 10px;
  margin-bottom: 10px;
}
.team-node.level-0 > .team-node-head { background: var(--primary-light); }
.team-node.level-1 > .team-node-head { background: var(--bg-muted); }
.team-node-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--primary);
}
.team-node-name { font-weight: 600; font-size: 14px; }
.team-node-name .role { font-size: 11px; color: var(--text-muted); font-weight: 400; margin-left: 6px; }
.team-node-stats {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
}
.team-children { padding-left: 20px; }

/* === Responsive === */
@media (max-width: 1024px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .sidebar { width: 200px; }
}
@media (max-width: 768px) {
  .sidebar { display: none; }
  .content { padding: 20px; }
  .topbar { padding: 12px 20px; }
  .kpi-grid { grid-template-columns: 1fr; }
}
