/* Brand fonts — Oswald (industrial, condensed) for headings, Barlow for body.
   Loaded from Google Fonts; falls back to a clean system stack if offline. */
@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600;700&family=Oswald:wght@500;600;700&display=swap');

:root {
  /* Charcoal & Safety Orange (DMB) */
  --bg: #f5f5f4;
  --surface: #ffffff;
  --border: #e6e4e1;
  --text: #1f2429;
  --muted: #6b7280;
  --primary: #ef6c00;       /* safety orange */
  --primary-dark: #c2410c;
  --header: #262b30;        /* charcoal topbar */
  --accent: #c2410c;        /* links / accent text */
  --ok: #15803d;
  --warn: #b45309;
  --danger: #b91c1c;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
  --font-body: 'Barlow', -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-head: 'Oswald', 'Barlow', "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; letter-spacing: .01em; }
h1 { font-size: 1.6rem; margin: 0 0 .15rem; text-transform: uppercase; letter-spacing: .03em; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; margin: 0 0 .6rem; text-transform: uppercase; letter-spacing: .02em; font-size: .95rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.xsmall { font-size: .78rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.over { color: var(--danger); }
.warn { color: var(--warn); }
.ok { color: var(--ok); }

/* ---- Top bar ---- */
.topbar {
  display: flex; align-items: center; gap: 1.5rem;
  background: var(--header);
  color: #fff; padding: 0 1.5rem; height: 56px;
  border-bottom: 3px solid var(--primary);
}
.brand { display: flex; align-items: center; gap: .55rem; color: #fff; font-family: var(--font-head); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.brand:hover { text-decoration: none; }
.logo {
  background: var(--primary); color: #fff; font-family: var(--font-head); font-weight: 700;
  padding: .2rem .45rem; border-radius: 6px; letter-spacing: .5px; font-size: .85rem;
}
.logo-lg { font-size: 1.4rem; padding: .4rem .7rem; }
.brand-logo { height: 38px; width: auto; display: block; background: #fff; border-radius: 7px; padding: 3px; }
.brand-logo-lg { height: 84px; width: auto; margin: 0 auto; display: block; }
.topnav { display: flex; gap: .3rem; flex: 1; }
.topnav a { color: #cdd5e0; padding: .4rem .75rem; border-radius: 6px; }
.topnav a:hover { color: #fff; text-decoration: none; background: rgba(255,255,255,.08); }
.topnav a.active { color: #fff; background: rgba(255,255,255,.14); }
.nav-count { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: .15rem; font-size: .72rem; font-weight: 700; line-height: 18px; text-align: center; color: #fff; background: var(--primary); border-radius: 99px; }
.topbar-user { display: flex; align-items: center; gap: .75rem; }
.user-name { font-size: .9rem; color: #e5e9f0; }

/* ---- Layout ---- */
.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 1.75rem 1.5rem; flex: 1; }
.sitefooter { text-align: center; color: var(--muted); font-size: .8rem; padding: 1.25rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.25rem; }
.head-actions { display: flex; gap: .5rem; }
.breadcrumb { font-size: .85rem; color: var(--muted); margin-bottom: .5rem; }
.project-desc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1.1rem; margin-bottom: 1.25rem; }
.pad { padding: 1rem; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-weight: 600; cursor: pointer;
  padding: .5rem .95rem; border-radius: 8px; border: 1px solid transparent;
  background: var(--surface); color: var(--text); border-color: var(--border);
  transition: background .12s, border-color .12s;
}
.btn:hover { text-decoration: none; background: #f0f1f4; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { background: #fff; color: var(--danger); border-color: #f1c4c4; }
.btn-danger:hover { background: #fdecec; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: rgba(0,0,0,.05); color: var(--text); }
.btn-sm { padding: .25rem .55rem; font-size: .82rem; }
.btn-block { width: 100%; }
.inline { display: inline; }

/* ---- Cards / grid ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.project-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem; box-shadow: var(--shadow); color: var(--text); transition: transform .1s, box-shadow .1s; }
.project-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 6px 16px rgba(16,24,40,.1); }
.project-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.project-card-head h3 { margin: 0; }
.card-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 1rem; gap: .5rem; }
.card-stats > div { min-width: 0; }
.card-stats .stat-label { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.card-stats .stat-value { font-weight: 700; font-size: .92rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* ---- Summary cards ---- */
.summary-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .75rem; margin-bottom: 1.5rem; }
.summary-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .85rem .9rem; box-shadow: var(--shadow); min-width: 0; }
.stat-label { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: .25rem; }
/* clamp font so millions of pesos fit without overflowing the card; tabular-nums
   keeps digits the same width across rows. */
.stat-big { display: block; font-family: var(--font-head); font-size: clamp(1.05rem, 3.6vw, 1.45rem); font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-sub { display: block; font-size: .76rem; color: var(--muted); overflow-wrap: anywhere; }

/* ---- Meter / progress ---- */
.meter { margin: .9rem 0 .25rem; }
.meter-bar { height: 8px; background: #eceef1; border-radius: 99px; overflow: hidden; }
.meter-bar span { display: block; height: 100%; background: var(--ok); border-radius: 99px; }
.meter-bar span.over { background: var(--danger); }
.meter-label { font-size: .78rem; color: var(--muted); margin-top: .3rem; }

/* ---- Badges / chips ---- */
.badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: .12rem .5rem; border-radius: 99px; background: #eceef1; color: #4b5563; text-transform: capitalize; }
.badge-admin { background: #ede9fe; color: #6d28d9; }
.chip { display: inline-block; font-size: .76rem; padding: .1rem .5rem; border-radius: 6px; background: #eef2f7; color: #41506b; }
.chip-consumable { background: #fef3c7; color: #92400e; }

/* ---- Project assignments card ---- */
.assignments-card { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem .75rem; padding: .7rem 1rem; margin-bottom: 1rem; }
.assignment-chip { display: inline-flex; align-items: center; gap: .25rem; padding: .15rem .5rem; background: #eef2f7; border-radius: 99px; font-size: .85rem; }
.assignment-chip .btn { padding: 0 .25rem; font-size: .75rem; }
.assignment-add { display: inline-flex; align-items: center; gap: .3rem; margin-left: auto; }
.assignment-add select { padding: .25rem .4rem; font-size: .85rem; margin: 0; }
.status-planning { background: #e0ecfb; color: #1e40af; }
.status-active { background: #dcfce7; color: #166534; }
.status-on_hold { background: #fef3c7; color: #92400e; }
.status-completed { background: #e5e7eb; color: #374151; }
.status-cancelled { background: #fee2e2; color: #991b1b; }
.sev-badge-low { background: #e0ecfb; color: #1e40af; }
.sev-badge-medium { background: #fef3c7; color: #92400e; }
.sev-badge-high { background: #ffedd5; color: #c2410c; }
.sev-badge-critical { background: #fee2e2; color: #991b1b; }

/* ---- Tabs ---- */
.tabs { display: flex; gap: .25rem; border-bottom: 2px solid var(--border); margin-bottom: 1.25rem; }
.tab { padding: .6rem 1rem; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tab:hover { text-decoration: none; color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.panel { display: none; }
.panel.active { display: block; }

/* ---- Forms ---- */
label { display: block; font-size: .85rem; font-weight: 600; color: #374151; margin-bottom: .25rem; }
input, select, textarea {
  width: 100%; font: inherit; padding: .5rem .6rem; border: 1px solid var(--border);
  border-radius: 8px; background: #fff; color: var(--text); margin-top: .2rem; font-weight: 400;
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(194,65,12,.35); border-color: var(--primary); }
textarea { resize: vertical; }
.stack label { margin-bottom: .75rem; }
.form-row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: .25rem; }
.form-row > label { flex: 0 0 auto; min-width: 130px; margin-bottom: .5rem; }
.form-row > label.grow { flex: 1 1 180px; }
.form-row > .btn { margin-bottom: .5rem; }
.form-card label { margin-bottom: .75rem; }
.form-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .5rem; }
.inline-form { background: #fbfbfc; }

/* ---- Tables ---- */
.data-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.data-table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #fafbfc; padding: .6rem .8rem; border-bottom: 1px solid var(--border); }
.data-table td { padding: .6rem .8rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tfoot td { padding: .6rem .8rem; background: #fafbfc; border-top: 1px solid var(--border); }
.row-done td { opacity: .6; }
.row-done strong { text-decoration: line-through; }
.row-actions { width: 1%; white-space: nowrap; }
.overdue { color: var(--danger); font-weight: 600; }
.status-select { width: auto; padding: .25rem .4rem; font-size: .82rem; font-weight: 600; margin: 0; }
.task-done { color: var(--ok); }
.task-blocked { color: var(--danger); }
.task-in_progress { color: var(--accent); }
.issue-open { color: var(--danger); }
.issue-in_progress { color: var(--warn); }
.issue-resolved, .issue-closed { color: var(--ok); }

/* ---- Split layout ---- */
.split { display: grid; grid-template-columns: 1fr 280px; gap: 1.25rem; align-items: start; }
@media (max-width: 800px) { .split { grid-template-columns: 1fr; } .form-row > label { min-width: 100%; } }

/* ---- Mobile / narrow-viewport tweaks ------------------------------------ */
@media (max-width: 768px) {
  /* Looser container padding; let cards breathe to the edges */
  .container { padding: 1rem .85rem; }

  /* Stack page heads (title + action button row) */
  .page-head { flex-direction: column; align-items: stretch; gap: .6rem; }
  .head-actions { flex-wrap: wrap; }

  /* Topbar reflows: brand + user row up top, nav wraps to the next row */
  .topbar { height: auto; padding: .5rem .85rem; flex-wrap: wrap; gap: .5rem 1rem; }
  .topnav { order: 3; flex-basis: 100%; flex-wrap: wrap; gap: .15rem; }
  .topnav a { padding: .35rem .55rem; font-size: .92rem; }
  .topbar-user { margin-left: auto; }
  .user-name { font-size: .82rem; }

  /* Tabs scroll horizontally if they don't fit */
  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; flex-wrap: nowrap; }
  .tab { white-space: nowrap; flex: 0 0 auto; }

  /* Wide tables → horizontal scroll within their card / section */
  .data-table { font-size: .85rem; }
  .panel, .card { max-width: 100%; }
  .panel .data-table, .card > .data-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
  .panel .data-table thead, .panel .data-table tbody, .card > .data-table thead, .card > .data-table tbody { width: max-content; min-width: 100%; }

  /* Forms: smaller inputs, single column rows */
  .form-row { gap: .5rem; }
  .form-row > label, .form-row > label.grow { min-width: 100%; flex-basis: 100%; }
  .form-row > .btn { width: 100%; margin-bottom: 0; }

  /* Tighter summary cards */
  .summary-cards { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .55rem; margin-bottom: 1rem; }
  .summary-card { padding: .7rem .8rem; }
}

/* Phones: single-column summary cards so values never collide */
@media (max-width: 480px) {
  .summary-cards { grid-template-columns: 1fr 1fr; }
  .stat-big { font-size: 1.1rem; }
  .container { padding: .75rem .6rem; }
  .brand { font-size: .9rem; }
}
.kv { display: grid; grid-template-columns: 1fr auto; gap: .35rem .5rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 600; }

/* ---- Issues ---- */
.issue-list { display: flex; flex-direction: column; gap: .6rem; }
.issue-item { display: flex; justify-content: space-between; gap: 1rem; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--muted); border-radius: var(--radius); padding: .8rem 1rem; box-shadow: var(--shadow); }
.issue-item.sev-low { border-left-color: #3b82f6; }
.issue-item.sev-medium { border-left-color: #f59e0b; }
.issue-item.sev-high { border-left-color: #f97316; }
.issue-item.sev-critical { border-left-color: #dc2626; }
.issue-closed { opacity: .6; }
.issue-title { display: flex; align-items: center; gap: .5rem; }
.issue-controls { display: flex; align-items: flex-start; gap: .4rem; }

/* ---- Auth ---- */
.auth-wrap { display: flex; justify-content: center; align-items: center; min-height: 70vh; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 2rem; width: 360px; text-align: center; }
.auth-brand { margin-bottom: .75rem; }
.auth-card h1 { margin-bottom: .1rem; }
.auth-card form { margin-top: 1.25rem; text-align: left; }

/* ---- Misc ---- */
.flash { padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-weight: 500; }
.flash-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.flash-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.flash-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.empty { text-align: center; padding: 3rem 1rem; }
.empty h1, .empty h2 { margin-bottom: .5rem; }
.empty .btn { margin-top: 1rem; }
.inline-menu { position: relative; display: inline-block; }
.inline-menu summary { list-style: none; display: inline-flex; }
.inline-menu summary::-webkit-details-marker { display: none; }
.popover { position: absolute; right: 0; top: 110%; z-index: 5; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); padding: .6rem; display: flex; gap: .4rem; width: 230px; }
.popover input { margin: 0; }

/* ---- Task meta pills (timeline table) ---- */
.task-link { color: var(--text); }
.task-meta { margin-top: .35rem; display: flex; gap: .35rem; flex-wrap: wrap; }
.meta-pill { font-size: .72rem; padding: .08rem .45rem; border-radius: 99px; background: #eef2f7; color: #41506b; }
.meta-pill.pill-warn { background: #fef3c7; color: #92400e; }
.linked-task a { font-weight: 600; }
.linked-task { color: var(--accent); }

/* ---- Task status badges ---- */
.task-badge-not_started { background: #e0ecfb; color: #1e40af; }
.task-badge-in_progress { background: #fef3c7; color: #92400e; }
.task-badge-blocked { background: #fee2e2; color: #991b1b; }
.task-badge-done { background: #dcfce7; color: #166534; }

/* ---- Daily logs ---- */
.daily-log-list { list-style: none; margin: .5rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.daily-log { border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: 8px; padding: .6rem .8rem; background: #fbfbfc; }
.daily-log-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .35rem; }
.daily-log-head .daily-log-del { margin-left: auto; padding: .1rem .4rem; }
.daily-log-body { display: grid; grid-template-columns: max-content 1fr; gap: .2rem .75rem; margin: 0; }
.daily-log-body dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); align-self: start; padding-top: .15rem; }
.daily-log-body dd { margin: 0; white-space: pre-wrap; }
.dlog-attachments { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; white-space: normal; }
.dlog-thumb { display: inline-block; width: 96px; height: 96px; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: #f8f9fa; }
.dlog-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dlog-doc { display: inline-flex; align-items: center; padding: .25rem .55rem; border: 1px solid var(--border); border-radius: 99px; background: #fbfbfc; font-size: .85rem; }
.dlog-doc:hover { text-decoration: none; background: #f0f1f4; }

/* ---- Pagination ---- */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: 1rem; padding-top: .75rem; border-top: 1px solid var(--border); }
.pagination-disabled { color: var(--muted); opacity: .5; pointer-events: none; }
.pagination-loading { opacity: .55; transition: opacity .12s; pointer-events: none; }

/* ---- Linked issues (task page) ---- */
.linked-issue-list { list-style: none; margin: 0 0 .75rem; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.linked-issue-list li { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-size: .88rem; }
.issue-status-badge { font-size: .68rem; }
.edit-task, .link-issue form { margin-top: .75rem; }
details > summary { cursor: pointer; }

/* ---- Purchase order status badges ---- */
.po-status-requested { background: #e0ecfb; color: #1e40af; }
.po-status-priced    { background: #fef3c7; color: #92400e; }
.po-status-ordered   { background: #ede9fe; color: #6d28d9; }
.po-status-delivered { background: #dcfce7; color: #166534; }
.po-status-cancelled { background: #fee2e2; color: #991b1b; }

/* ---- Approval badges + banners ---- */
.approval-pending  { background: #fef3c7; color: #92400e; }
.approval-approved { background: #dcfce7; color: #166534; }
.approval-rejected { background: #fee2e2; color: #991b1b; }
.banner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .7rem 1rem; border-radius: var(--radius); margin-bottom: 1.25rem; border: 1px solid var(--border); }
.banner-pending  { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.banner-approved { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.banner-rejected { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.banner-actions { display: flex; gap: .4rem; }

/* ---- Table header row with action ---- */
.table-head-row { display: flex; align-items: center; justify-content: space-between; margin: .5rem 0 .5rem; }
.table-head-row h3 { margin: 0; }

/* ---- Tables: extra alignment + pricing ---- */
.center { text-align: center; }
.price-input { width: 110px; padding: .3rem .4rem; margin: 0; }
.kv-total { border-top: 1px solid var(--border); padding-top: .35rem; font-weight: 700; }

/* ---- Section title between blocks ---- */
.section-title { margin: 1.75rem 0 .75rem; padding-top: 1rem; border-top: 2px solid var(--border); }

/* ---- Checkboxes / worker picker ---- */
.chk { display: inline-flex; align-items: center; gap: .4rem; font-weight: 500; }
.chk input { width: auto; margin: 0; }
.worker-picker { border: 1px solid var(--border); border-radius: 8px; padding: .6rem .8rem; margin: .5rem 0; display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
.worker-picker legend { font-size: .8rem; font-weight: 700; color: #374151; padding: 0 .3rem; }
.worker-chk { flex: 0 0 auto; border: 1px solid var(--border); border-radius: 99px; padding: .25rem .7rem; background: #fbfbfc; }

/* ---- Worker management cards ---- */
.worker-card { display: flex; align-items: flex-end; gap: .75rem; flex-wrap: wrap; }
.worker-card.inactive { opacity: .55; }
.worker-row { display: flex; align-items: flex-end; gap: .6rem; flex-wrap: wrap; flex: 1; }
.worker-row label { margin-bottom: 0; }
.worker-row .grow { flex: 1 1 140px; }
.hidden-form { display: none; }

/* ---- Phase status select colors ---- */
.phase-not_started { color: var(--muted); }
.phase-in_progress { color: var(--warn); }
.phase-done { color: var(--ok); }

/* ---- Trade settings rows ---- */
.trade-row { display: flex; gap: .4rem; align-items: center; margin-bottom: .4rem; }
.trade-row input[type="text"] { flex: 1; margin: 0; }
.trade-row input[type="number"] { width: 100px; margin: 0; }

/* ---- Invoice list ---- */
.invoice-list { list-style: none; margin: 0 0 .75rem; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.invoice-list li { display: flex; align-items: center; gap: .5rem; }
.invoice-list form { margin-left: auto; }

/* ---- Inline mini progress bar (per-phase row) ---- */
.mini-meter { display: inline-block; width: 80px; height: 6px; background: #eceef1; border-radius: 99px; overflow: hidden; vertical-align: middle; }
.mini-meter > span { display: block; height: 100%; background: var(--ok); border-radius: 99px; }

/* ---- Collapsible milestone task groups ---- */
.phase-group { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: .6rem; overflow: hidden; }
.phase-group[open] { border-left-color: var(--header); }
.phase-group-unassigned { border-left-color: var(--muted); }
.phase-group > summary { cursor: pointer; padding: .7rem 1rem; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; font-family: var(--font-head); list-style: none; }
.phase-group > summary::-webkit-details-marker { display: none; }
.phase-group > summary::before { content: '▸'; color: var(--muted); transition: transform .12s; display: inline-block; width: .8em; }
.phase-group[open] > summary::before { transform: rotate(90deg); }
.phase-group > summary:hover { background: #fafbfc; }
.phase-group-name { font-weight: 600; letter-spacing: .02em; text-transform: uppercase; font-size: .95rem; }
.phase-group-meta { margin-left: auto; }
.phase-group .data-table { border-radius: 0; border-left: 0; border-right: 0; border-bottom: 0; }
.phase-group .pad { padding: .9rem 1rem; }
