:root {
  --navy: #12304a;
  --navy-2: #173d5f;
  --blue: #176b87;
  --blue-soft: #e8f4f7;
  --teal: #0f8a80;
  --ink: #172633;
  --muted: #647784;
  --line: #dce5ea;
  --surface: #ffffff;
  --canvas: #f2f6f8;
  --shadow: 0 8px 28px rgba(28, 54, 71, 0.08);
  --radius: 14px;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 14px;
}
button, input, select { font: inherit; }
button { color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.app-shell { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  background: linear-gradient(178deg, var(--navy) 0%, #10283d 100%);
  color: #d9e7ef;
  z-index: 40;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 2px 8px 25px; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: #20a4a1; color: white; box-shadow: 0 7px 20px rgba(16, 177, 169, .25); }
.brand-mark svg { width: 25px; height: 25px; fill: currentColor; stroke: none; }
.brand strong { display: block; color: white; font-size: 20px; letter-spacing: .08em; }
.brand span { display: block; color: #9bb0bd; font-size: 12px; margin-top: 2px; }
.main-nav { display: grid; gap: 6px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 13px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #b9cbd5;
  text-align: left;
  cursor: pointer;
  transition: .2s ease;
  text-decoration: none;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: white; }
.nav-item.active { background: #1e536f; color: white; box-shadow: inset 3px 0 #30c2b7; }
.nav-item svg { width: 19px; height: 19px; }
.sidebar-note { position: absolute; left: 16px; right: 16px; bottom: 22px; padding: 15px; border: 1px solid rgba(255,255,255,.1); border-radius: 12px; background: rgba(255,255,255,.05); }
.sidebar-note span, .sidebar-note small { display: block; color: #96adb9; font-size: 11px; }
.sidebar-note strong { display: block; color: white; font-size: 18px; margin: 5px 0 2px; }

.main-content { min-width: 0; }
.topbar { height: 64px; padding: 0 28px; background: white; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 16px; }
.breadcrumbs { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; }
.breadcrumbs b { color: #aebdc5; font-weight: 400; }
.breadcrumbs strong { color: var(--ink); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.today { color: var(--muted); font-size: 13px; }
.avatar { border: 0; width: 36px; height: 36px; border-radius: 50%; background: #dff2f1; color: #14766f; font-weight: 700; cursor: pointer; }
.icon-button { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 9px; background: white; cursor: pointer; }
.icon-button:disabled { opacity: .4; cursor: default; }
.menu-button { display: none; }

.content { padding: 28px; max-width: 1900px; margin: 0 auto; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 22px; }
.eyebrow { margin: 0 0 5px; color: var(--teal); font-size: 11px; font-weight: 800; letter-spacing: .12em; }
h1 { margin: 0; font-size: clamp(25px, 2.4vw, 34px); line-height: 1.2; letter-spacing: -.025em; }
.subtitle { margin: 7px 0 0; color: var(--muted); }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 9px; padding: 10px 15px; font-weight: 650; cursor: pointer; white-space: nowrap; }
.primary-button { border: 1px solid #155f79; background: var(--blue); color: white; box-shadow: 0 5px 14px rgba(23,107,135,.18); }
.primary-button:hover { background: #115b73; }
.primary-button .chevron { width: 16px; height: 16px; transition: transform .18s ease; }
.page-actions { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.add-project-button svg { width: 18px; height: 18px; }
.export-button { min-height: 42px; padding: 10px 14px; }
.export-button .chevron { width: 16px; height: 16px; transition: transform .18s ease; }
.export-menu { position: relative; flex: 0 0 auto; }
.export-menu.open .chevron { transform: rotate(180deg); }
.export-options {
  position: absolute;
  z-index: 70;
  top: calc(100% + 8px);
  right: 0;
  width: 285px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  box-shadow: 0 16px 45px rgba(23, 48, 64, .18);
}
.export-options[hidden] { display: none; }
.export-options > button {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.export-options > button:hover, .export-options > button:focus-visible { background: #f0f6f8; outline: none; }
.export-options > button:disabled { opacity: .55; cursor: progress; }
.export-options strong, .export-options small { display: block; }
.export-options strong { color: #253b47; font-size: 13px; }
.export-options small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.format-icon { display: grid; place-items: center; flex: 0 0 auto; width: 42px; height: 34px; border-radius: 7px; color: white; font-size: 10px; font-weight: 800; letter-spacing: .03em; }
.format-icon.pdf { background: #d45149; }
.format-icon.excel { background: #237a57; }
.format-icon.word { background: #356cb2; }
.export-note { margin: 6px 4px 1px; padding: 9px 8px 4px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.secondary-button { border: 1px solid var(--line); background: white; color: #405462; padding: 8px 12px; font-size: 13px; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.staff-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.staff-filters { grid-template-columns: minmax(300px, 1.5fr) minmax(190px, .7fr) auto; }
.staff-table-wrap { max-height: calc(100vh - 380px); }
.staff-table th { cursor: default; }
.staff-role { display: inline-flex; padding: 5px 8px; border-radius: 999px; background: #e8f4f7; color: #176b87; font-size: 11px; font-weight: 650; }
.staff-link { color: #176b87; text-decoration: none; }
.staff-link:hover { text-decoration: underline; }
.staff-actions { white-space: nowrap; }
.staff-edit-button { border: 1px solid #b8d4dc; border-radius: 7px; padding: 6px 10px; background: #f5fbfc; color: #176b87; font-size: 12px; font-weight: 650; cursor: pointer; }
.staff-edit-button:hover { border-color: #5e9daf; background: #e7f4f6; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); gap: 20px; }
.dashboard-panel { min-height: 320px; }
.dashboard-list { display: grid; gap: 3px; margin-top: 15px; }
.dashboard-list-item { display: grid; grid-template-columns: minmax(0, 1fr) 56px; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid #edf1f3; }
.dashboard-list-item:last-child { border-bottom: 0; }
.dashboard-list-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #2d4654; font-size: 13px; }
.dashboard-list-item span { display: inline-grid; place-items: center; min-width: 32px; padding: 4px 7px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); font-size: 12px; font-weight: 750; }
.attention-table td:first-child { min-width: 300px; }
.attention-name { color: #294a59; font-weight: 700; }
.attention-sub { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.attention-date { color: #546d79; white-space: nowrap; }
.dashboard-link { color: var(--blue); font-size: 12px; font-weight: 700; text-decoration: none; }
.dashboard-link:hover { text-decoration: underline; }
.dashboard-empty { padding: 25px 0; color: var(--muted); text-align: center; }
.home-page .content { max-width: 1600px; padding-top: 22px; }
.home-heading { align-items: center; min-height: 116px; margin-bottom: 16px; padding: 21px 24px; border: 1px solid #dbe7eb; border-radius: 16px; background: linear-gradient(112deg, #fff 0%, #f2f8f8 100%); box-shadow: 0 7px 24px rgba(32, 78, 94, .06); }
.home-heading h1 { font-size: clamp(24px, 2vw, 31px); }
.home-heading .subtitle { max-width: 650px; }
.home-sync { display: inline-flex; align-items: center; gap: 6px; color: #27836f; font-size: 11px; font-weight: 750; white-space: nowrap; }
.home-sync::first-letter { color: #20a88b; }
.home-page .metrics { gap: 12px; margin-bottom: 16px; }
.home-page .metric-card { min-height: 96px; padding: 15px 17px; border-radius: 13px; transition: transform .18s ease, box-shadow .18s ease; }
.home-page .metric-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(32,60,75,.1); }
.home-page .metric-card strong { font-size: 27px; }
.home-page .panel { border-radius: 15px; box-shadow: 0 7px 22px rgba(32,60,75,.05); }
.home-page .dashboard-panel { min-height: 270px; }
.home-page .dashboard-list { margin: 3px 20px 13px; }
.home-page .dashboard-list-item { padding: 10px 0; }
.home-page .attention-panel .dashboard-list-item { grid-template-columns: minmax(0, 1fr) auto; padding: 13px 0; }
.home-page .attention-panel .dashboard-list-item span { min-width: 42px; padding: 5px 8px; background: #f2f7f8; }
.dashboard-progress > div { min-width: 0; }
.dashboard-progress strong { display: block; margin-bottom: 7px; }
.dashboard-progress i { display: block; height: 5px; overflow: hidden; border-radius: 999px; background: #e4eef1; }
.dashboard-progress i b { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #198a85, #46b3a6); }
.home-page .attention-table tr:hover { background: #f1f8f8; }
.home-page .attention-table td { padding-top: 12px; padding-bottom: 12px; }
.construction-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.construction-filters { grid-template-columns: minmax(300px, 1.5fr) auto; }
.sync-badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 999px; background: #e8f5f2; color: #267b69; font-size: 11px; font-weight: 750; }
.construction-overdue, .construction-ontrack { display: inline-flex; padding: 5px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.construction-overdue { background: #fff0ef; color: #b74740; }.construction-ontrack { background: #e7f2fa; color: #236c96; }
.construction-page .table-wrap { min-height: 0; max-height: calc(100vh - 405px); }
.construction-table { width: 100%; min-width: 900px; table-layout: fixed; }
.construction-table th, .construction-table td { padding: 9px 10px; vertical-align: middle; }
.construction-table th:nth-child(1), .construction-table td:nth-child(1) { width: 52px; min-width: 52px; text-align: center; }
.construction-table th:nth-child(2), .construction-table td:nth-child(2) { width: 34%; }
.construction-table th:nth-child(3), .construction-table td:nth-child(3) { width: 12%; }
.construction-table th:nth-child(4), .construction-table td:nth-child(4) { width: 20%; }
.construction-table th:nth-child(5), .construction-table td:nth-child(5) { width: 13%; text-align: center; white-space: nowrap; }
.construction-table th:nth-child(6), .construction-table td:nth-child(6) { width: 11%; text-align: center; white-space: nowrap; }
.construction-table th:nth-child(7), .construction-table td:nth-child(7) { width: 12%; text-align: center; white-space: nowrap; }
.construction-table td:first-child { background: #fafcfd; color: #58707d; font-weight: 750; }
.construction-table .construction-project-name { -webkit-line-clamp: 2; color: #1f3440; font-weight: 700; }
.construction-table .assessment, .construction-table .construction-overdue, .construction-table .construction-ontrack { justify-content: center; }
@media (max-width: 1050px) { .dashboard-grid { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .home-heading { align-items: flex-start; padding: 18px; } .home-heading .page-actions { width: 100%; justify-content: space-between; } .home-page .metrics { gap: 10px; } .home-page .metric-card { min-height: 88px; } }
@media (max-width: 700px) { .construction-metrics, .construction-filters { grid-template-columns: 1fr; } }

/* Trang chủ: phong cách BAMFLOW, phạm vi riêng cho trang tổng quan. */
.home-page { --bf-blue: #1d4ed8; --bf-blue-dark: #133c9f; --bf-ink: #0b1633; --bf-text: #42505f; --bf-line: #e2e8f0; --bf-alt: #f2f5fa; background: #fff; font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif; }
.home-page .app-shell { background: #fff; }
.home-page .sidebar { background: rgba(255,255,255,.88); border-right: 1px solid var(--bf-line); box-shadow: 8px 0 32px -28px rgba(0,60,120,.35); }
.home-page .brand { color: var(--bf-ink); }.home-page .brand-mark { background: linear-gradient(145deg, #2f63e6, #133c9f); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 8px 20px -12px rgba(29,78,216,.65); }
.home-page .main-nav .nav-item { color: #475569; border-radius: 10px; }.home-page .main-nav .nav-item:hover { background: #f1f5f9; color: var(--bf-blue); }.home-page .main-nav .nav-item.active { background: #eaf2ff; color: var(--bf-blue); box-shadow: inset 3px 0 0 var(--bf-blue); }
.home-page .sidebar-note { border-color: #bfdbfe; background: #eef4ff; }.home-page .sidebar-note strong { color: var(--bf-blue); }
.home-main { background: linear-gradient(180deg, #f8fbfe 0, #fff 390px); }.home-page .topbar { border-bottom-color: rgba(11,20,32,.1); background: rgba(255,255,255,.86); backdrop-filter: blur(16px) saturate(160%); }.home-page .breadcrumbs strong { color: var(--bf-ink); }.home-page .today { color: #64748b; }.home-help { display:grid; place-items:center; width:28px; height:28px; border:1px solid #bfdbfe; border-radius:999px; color:var(--bf-blue); font-weight:800; text-decoration:none; }.home-page .avatar { background: linear-gradient(180deg,#1d4ed8,#133c9f); }
.home-content { max-width: 1440px; padding-top: 26px; padding-bottom: 38px; }
.home-hero { position:relative; isolation:isolate; overflow:hidden; display:grid; grid-template-columns:minmax(0,1fr) minmax(460px,.85fr); gap:32px; min-height:262px; padding:32px 36px; border-radius:24px; color:#fff; background: radial-gradient(ellipse 100% 170% at 92% -10%, #2f7ae0 0%, #1749b8 43%, #10358c 74%, #0a1430 100%); box-shadow:0 18px 40px -25px rgba(29,78,216,.7), inset 0 1px 0 rgba(255,255,255,.22); }
.home-hero::after { content:""; position:absolute; z-index:-1; inset:auto -13% -150px auto; width:65%; height:300px; border-radius:50%; background:radial-gradient(ellipse,rgba(159,214,255,.38),rgba(159,214,255,0) 68%); }.home-hero-dots { position:absolute; inset:0; z-index:-1; opacity:.48; background-image:radial-gradient(circle,rgba(255,255,255,.42) 0 .7px,transparent 1px); background-size:16px 16px; mask-image:linear-gradient(120deg,#000,transparent 73%); }
.home-hero-copy { align-self:center; max-width:670px; }.home-date { margin:0 0 7px; font-size:11px; font-weight:700; letter-spacing:.08em; color:#9fd6ff; }.home-hero h1 { margin:0; color:#fff; font-size:clamp(28px,3vw,45px); line-height:1.12; letter-spacing:-.035em; }.home-hero-copy > p:not(.home-date) { max-width:605px; margin:12px 0 19px; color:rgba(255,255,255,.88); font-size:14px; line-height:1.58; }.home-hero-actions { display:flex; flex-wrap:wrap; gap:9px; }.home-hero-actions a { display:inline-flex; align-items:center; gap:9px; padding:10px 16px; border-radius:999px; font-size:13px; font-weight:700; text-decoration:none; }.home-hero-primary { color:#0b3f8c; background:#fff; box-shadow:inset 0 1px 0 #fff,0 12px 30px -14px rgba(0,0,0,.48); }.home-hero-primary:hover { background:#eef5ff; }.home-hero-primary span { font-size:17px; }.home-hero-secondary { border:1px solid rgba(255,255,255,.66); color:#fff; background:rgba(19,60,159,.34); }.home-hero-secondary:hover { color:#133c9f; background:#fff; }
.home-hero-kpis { display:grid; grid-template-columns:repeat(3,minmax(110px,1fr)); gap:10px; align-self:center; }.home-hero-kpis article { min-height:104px; padding:15px 14px; border:1px solid rgba(255,255,255,.22); border-radius:16px; background:rgba(255,255,255,.10); box-shadow:inset 0 1px 0 rgba(255,255,255,.17); backdrop-filter:blur(10px); }.home-hero-kpis span { display:block; color:rgba(255,255,255,.82); font-size:11px; line-height:1.4; }.home-hero-kpis strong { display:block; margin-top:10px; color:#fff; font-size:31px; letter-spacing:-.04em; line-height:1; }
.home-shortcuts { display:flex; align-items:center; gap:24px; margin:-22px 20px 20px; padding:17px 20px; border:1px solid rgba(255,255,255,.85); border-radius:18px; background:rgba(255,255,255,.83); box-shadow:0 1px 2px rgba(11,20,32,.05),0 14px 32px -18px rgba(0,60,120,.22),inset 0 1px 0 rgba(255,255,255,.95); backdrop-filter:blur(22px) saturate(160%); }.shortcut-heading { flex:0 0 150px; }.shortcut-heading p { margin:0 0 2px; color:#64748b; font-size:10px; font-weight:800; letter-spacing:.08em; }.shortcut-heading h2 { margin:0; color:var(--bf-ink); font-size:15px; }.shortcut-list { display:flex; flex-wrap:wrap; gap:10px; }.shortcut-card { display:flex; align-items:center; gap:9px; min-width:140px; padding:8px 10px; border:1px solid transparent; border-radius:12px; color:#334155; font-size:11px; font-weight:700; line-height:1.35; text-decoration:none; }.shortcut-card:hover { border-color:#93c5fd; background:#eef4ff; color:var(--bf-blue); }.shortcut-card i { display:grid; place-items:center; width:30px; height:30px; border-radius:10px; color:#fff; background:linear-gradient(145deg,#2f63e6,#133c9f); font-size:17px; font-style:normal; box-shadow:0 8px 18px -11px rgba(29,78,216,.8); }
.home-page .metrics { gap:13px; }.home-page .metric-card { border-color:var(--bf-line); border-radius:18px; background:rgba(255,255,255,.86); box-shadow:0 1px 2px rgba(11,20,32,.05),0 14px 32px -18px rgba(0,60,120,.22),inset 0 1px 0 rgba(255,255,255,.95); }.home-page .metric-card span,.home-page .metric-card small { color:#64748b; }.home-page .metric-card strong { color:var(--bf-ink); }.home-page .accent-blue,.home-page .accent-violet,.home-page .accent-amber,.home-page .accent-green { color:var(--bf-blue); }.home-page .metric-card::after { background:#1d4ed8; }
.home-page .panel { border-color:var(--bf-line); border-radius:18px; box-shadow:0 1px 2px rgba(11,20,32,.05),0 14px 32px -18px rgba(0,60,120,.22); }.home-page .panel-heading h2,.home-page .attention-name { color:var(--bf-ink); }.home-page .dashboard-link { color:var(--bf-blue); }.home-page .dashboard-list-item span { color:var(--bf-blue); background:#eef4ff; }.home-page .dashboard-progress i { background:#dbeafe; }.home-page .dashboard-progress i b { background:linear-gradient(90deg,#1d4ed8,#4f8fe2); }.home-page .attention-table tr:hover,.home-page .attention-table tr:hover td { background:#f1f5f9; }.home-page .assessment.active { color:#1d4ed8; background:#eaf2ff; }.home-page .assessment.future { color:#92400e; background:#fef3c7; }.home-page .assessment.done { color:#15803d; background:#dcfce7; }
@media (max-width:1100px) { .home-hero { grid-template-columns:1fr; }.home-hero-kpis { max-width:620px; }.home-shortcuts { margin-left:0; margin-right:0; }.shortcut-heading { flex-basis:130px; } }
@media (max-width:700px) { .home-content { padding-top:16px; }.home-hero { gap:23px; min-height:0; padding:26px 20px; border-radius:18px; }.home-hero-kpis { grid-template-columns:repeat(3,1fr); }.home-hero-kpis article { min-height:83px; padding:12px 9px; }.home-hero-kpis strong { font-size:25px; }.home-shortcuts { align-items:flex-start; flex-direction:column; gap:12px; margin:-10px 0 16px; padding:15px; }.shortcut-list { display:grid; width:100%; grid-template-columns:1fr 1fr; }.shortcut-card { min-width:0; }.home-page .metrics { grid-template-columns:1fr 1fr; } }
.plan-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.plan-panel { margin-bottom: 18px; }
.plan-filters { grid-template-columns: minmax(260px, 1.4fr) repeat(2, minmax(170px, .7fr)) auto; }
.plan-table-wrap { max-height: 520px; }
.plan-table th { cursor: default; }
.plan-summary-row td { padding: 12px 14px; background: #e4f1f3; color: #174e5c; font-size: 13px; font-weight: 750; }
.plan-summary-row span, .main-work-row span { display: inline-flex; margin-right: 8px; padding: 3px 7px; border-radius: 999px; background: rgba(23,107,135,.13); color: #176b87; font-size: 10px; font-weight: 750; text-transform: uppercase; }
.main-work-row td { padding: 10px 14px; background: #f3f7f8; color: #385766; font-size: 12px; font-weight: 750; }
.main-work-row small { margin-left: 8px; color: #778b95; font-size: 11px; font-weight: 600; }
.sub-work-row td:nth-child(2) { min-width: 310px; padding-left: 22px; }
.sub-work-marker { display: inline-block; margin-right: 8px; color: #5e9cab; font-size: 16px; font-weight: 700; vertical-align: -1px; }
.progress-cell { min-width: 100px; }
.progress-cell > span { display: block; margin-bottom: 5px; color: #526875; font-size: 11px; font-weight: 700; text-align: right; }
.progress-cell > i { display: block; height: 6px; overflow: hidden; border-radius: 999px; background: #e4edf0; }
.progress-cell > i > b { display: block; height: 100%; border-radius: inherit; background: #17877f; }
.assessment { display: inline-flex; padding: 5px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.assessment.done { background: #e6f5ef; color: #16745d; }.assessment.active { background: #e7f2fa; color: #236c96; }.assessment.future { background: #f2ecfb; color: #7152a8; }.assessment.overdue { background: #fff0ef; color: #b74740; }
.gantt-wrap { overflow-x: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); min-width: 0; }
.gantt-head, .gantt-row { display: grid; min-width: 780px; }
.gantt-head { grid-template-columns: minmax(240px, 1fr) repeat(4, minmax(130px, .55fr)); }
.gantt-row { grid-template-columns: minmax(240px, 1fr) minmax(520px, 2.2fr); }
.gantt-head { position: sticky; top: 0; z-index: 1; background: #edf3f6; color: #405966; font-size: 11px; font-weight: 750; }
.gantt-head > span { padding: 11px; border-right: 1px solid #d9e2e7; text-align: center; }
.gantt-head > span:first-child { text-align: left; }
.gantt-row { min-height: 42px; border-top: 1px solid #edf2f4; }
.gantt-row > span { overflow: hidden; padding: 10px 12px; border-right: 1px solid #edf2f4; color: #354e5b; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.gantt-line { position: relative; margin: 0; background: repeating-linear-gradient(90deg, #fff 0, #fff calc(25% - 1px), #e8eef1 calc(25% - 1px), #e8eef1 25%); }
.gantt-bar { position: absolute; top: 13px; height: 16px; border-radius: 5px; background: #7dabb9; box-shadow: inset 0 -1px rgba(0,0,0,.08); }.gantt-bar.complete { background: #29927e; }
.timeline-legend { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; white-space: nowrap; }.timeline-legend i { margin-left: 7px; }.legend-plan, .legend-done { display: inline-block; width: 11px; height: 11px; border-radius: 3px; background: #7dabb9; }.legend-done { background: #29927e; }
.metric-card { position: relative; overflow: hidden; display: flex; align-items: center; gap: 14px; min-height: 110px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: 0 4px 16px rgba(32,60,75,.045); }
.metric-card::after { content: ""; position: absolute; width: 90px; height: 90px; border-radius: 50%; right: -35px; top: -37px; background: currentColor; opacity: .055; }
.metric-icon { display: grid; place-items: center; flex: 0 0 auto; width: 43px; height: 43px; border-radius: 11px; background: currentColor; }
.metric-icon svg { color: white; width: 22px; height: 22px; }
.metric-card span, .metric-card small { display: block; color: var(--muted); }
.metric-card span { font-size: 12px; font-weight: 650; }
.metric-card strong { display: block; margin: 3px 0 1px; color: var(--ink); font-size: 25px; line-height: 1; }
.metric-card small { font-size: 11px; }
.accent-blue { color: #2878a0; } .accent-violet { color: #695bb2; } .accent-amber { color: #b97917; } .accent-green { color: #187c66; }

.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 14px; }
.panel-heading h2 { margin: 0; font-size: 18px; }
.panel-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.filters { display: grid; grid-template-columns: minmax(260px, 1.5fr) repeat(3, minmax(155px, .7fr)) auto; gap: 9px; padding: 0 20px 16px; }
.filters input, .filters select { width: 100%; height: 40px; border: 1px solid var(--line); border-radius: 9px; background: white; color: #314551; outline: none; }
.filters input:focus, .filters select:focus { border-color: #56a5b9; box-shadow: 0 0 0 3px rgba(57,147,170,.12); }
.filters select { padding: 0 32px 0 11px; }
.search-field { position: relative; }
.search-field svg { position: absolute; left: 12px; top: 10px; width: 19px; color: #7e929d; }
.search-field input { padding: 0 12px 0 40px; }
.filter-chip { height: 40px; border: 1px solid var(--line); border-radius: 9px; background: white; padding: 0 13px; color: #586b76; cursor: pointer; white-space: nowrap; }
.filter-chip span { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #d85e55; }
.filter-chip[aria-pressed="true"] { border-color: #d85e55; background: #fff1ef; color: #a9433c; }

.table-wrap { width: 100%; overflow: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); max-height: calc(100vh - 425px); min-height: 330px; position: relative; }
table { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; }
th { position: sticky; top: 0; z-index: 7; min-width: 135px; padding: 12px 11px; background: #edf3f6; border-bottom: 1px solid #cfdae0; border-right: 1px solid #d9e2e7; color: #344d5a; font-size: 11px; line-height: 1.35; text-align: left; text-transform: none; vertical-align: middle; cursor: pointer; }
th small { color: #72858f; font-weight: 500; }
.edit-project-button { min-height: 34px; border: 1px solid #155f79; border-radius: 7px; padding: 6px 11px; background: #176b87; color: #fff; font-size: 12px; font-weight: 650; cursor: pointer; }
.edit-project-button:hover { background: #eaf5f8; }
td { max-width: 320px; padding: 11px; border-bottom: 1px solid #e5ecef; border-right: 1px solid #edf2f4; background: white; color: #30434e; vertical-align: top; line-height: 1.45; }
tbody tr { cursor: pointer; }
tbody tr:hover td { background: #f5fafb; }
tbody tr:last-child td { border-bottom: 0; }
.sticky-col { position: sticky; z-index: 6; }
th.sticky-col { z-index: 9; }
.col-tt { left: 0; min-width: 56px; width: 56px; text-align: center; }
.col-name { left: 56px; min-width: 310px; max-width: 310px; }
th.col-name { background: #e6eff3; }
td.col-tt { background: #fafcfd; text-align: center; font-weight: 700; color: #58707d; }
td.col-name { background: #fbfdfd; font-weight: 650; color: #1f3440; }
tbody tr:hover td.col-tt, tbody tr:hover td.col-name { background: #eef7f8; }
.number { text-align: right; font-variant-numeric: tabular-nums; }
.muted { color: #91a1a9; }
.clamp { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.file-pill { display: inline-flex; align-items: center; gap: 5px; max-width: 155px; padding: 5px 8px; border-radius: 7px; background: #edf5f7; color: #22667a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-pill svg { flex: 0 0 auto; width: 14px; height: 14px; }
.status { display: inline-flex; align-items: center; gap: 6px; max-width: 170px; padding: 5px 8px; border-radius: 999px; font-size: 11px; font-weight: 650; white-space: normal; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-done { background: #e6f5ef; color: #16745d; }
.status-build { background: #e7f2fa; color: #236c96; }
.status-plan { background: #f2ecfb; color: #7152a8; }
.status-wait { background: #fff3df; color: #9c6819; }
.status-default { background: #eef1f3; color: #5f7079; }
.days { display: inline-flex; min-width: 58px; justify-content: flex-end; font-weight: 700; }
.days.overdue { color: #c44a43; }
.days.soon { color: #b77717; }
.days.ok { color: #26735f; }
.sort { display: inline-block; margin-left: 4px; color: #90a1aa; }
th.sorted-asc .sort::after { content: "↑"; color: var(--blue); }
th.sorted-desc .sort::after { content: "↓"; color: var(--blue); }
.empty-state { position: absolute; inset: 60px 0 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; background: white; color: var(--muted); }
.empty-state[hidden] { display: none; }
.empty-state svg { width: 38px; height: 38px; color: #9bb0ba; }
.empty-state strong { color: #405763; font-size: 15px; }

.table-footer { min-height: 62px; padding: 12px 18px; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: var(--muted); font-size: 12px; }
.table-footer select { margin: 0 4px; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.pagination { display: flex; align-items: center; gap: 6px; }
.pagination .icon-button { width: 33px; height: 33px; }
.page-numbers { display: flex; gap: 4px; }
.page-number { min-width: 33px; height: 33px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #586e7a; cursor: pointer; }
.page-number.active { border-color: #176b87; background: #176b87; color: white; }

.overlay { position: fixed; inset: 0; z-index: 80; background: rgba(13,31,43,.38); backdrop-filter: blur(2px); }
.detail-drawer { position: fixed; z-index: 90; top: 0; right: 0; width: min(560px, 100%); height: 100vh; background: white; box-shadow: -15px 0 50px rgba(20,43,57,.18); transform: translateX(102%); transition: transform .24s ease; overflow-y: auto; }
.detail-drawer.open { transform: translateX(0); }
.drawer-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 22px 24px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(8px); }
.drawer-header span { color: var(--teal); font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.drawer-header h2 { margin: 5px 0 0; font-size: 19px; line-height: 1.35; }
.drawer-content { padding: 22px 24px 90px; }
.drawer-footer { position: sticky; bottom: 0; z-index: 3; display: flex; justify-content: flex-end; gap: 8px; padding: 12px 24px; border-top: 1px solid var(--line); background: rgba(255,255,255,.97); backdrop-filter: blur(8px); }
.drawer-close-button { min-height: 34px; border: 1px solid #cbd8de; border-radius: 7px; padding: 6px 11px; background: #fff; color: #526773; font-size: 12px; font-weight: 650; cursor: pointer; }
.drawer-close-button:hover { background: #f2f7f8; }
.detail-status { margin-bottom: 20px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.detail-item { padding-bottom: 13px; border-bottom: 1px solid #edf1f3; }
.detail-item.wide { grid-column: 1 / -1; }
.detail-item dt { margin-bottom: 5px; color: var(--muted); font-size: 11px; }
.detail-item dd { margin: 0; color: #263c48; line-height: 1.5; overflow-wrap: anywhere; }
.detail-file { display: flex; align-items: center; gap: 9px; padding: 10px; border-radius: 9px; background: #f2f7f8; color: #28677a; }
.detail-file svg { flex: 0 0 auto; }

.project-dialog {
  width: min(820px, calc(100% - 30px));
  max-height: min(88vh, 850px);
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: white;
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(11, 34, 48, .3);
  overflow: hidden;
}
.project-dialog::backdrop { background: rgba(13,31,43,.5); backdrop-filter: blur(3px); }
.project-dialog form { display: flex; flex-direction: column; max-height: min(88vh, 850px); }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px 24px 18px; border-bottom: 1px solid var(--line); }
.dialog-header > div > span { color: var(--teal); font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.dialog-header h2 { margin: 5px 0 4px; font-size: 21px; }
.dialog-header p { margin: 0; color: var(--muted); font-size: 12px; }
.dialog-body { padding: 20px 24px; overflow-y: auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.form-field { display: grid; gap: 7px; min-width: 0; }
.form-field.wide { grid-column: 1 / -1; }
.form-field > span { color: #405662; font-size: 12px; font-weight: 650; }
.form-field > span b { color: #c44a43; }
.form-field input, .form-field textarea, .form-field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: #263c48;
  outline: none;
}
.form-field input { height: 42px; padding: 0 12px; }
.form-field textarea { padding: 10px 12px; resize: vertical; line-height: 1.45; }
.form-field select { padding: 7px 9px; }
.manager-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; max-height: 162px; overflow-y: auto; padding: 3px; }
.manager-choice { display: flex; align-items: center; gap: 7px; min-width: 0; min-height: 32px; padding: 6px 8px; border: 1px solid #dbe5e9; border-radius: 7px; background: #fbfdfd; color: #38515e; font-size: 12px; cursor: pointer; }
.manager-choice:hover { border-color: #78adbd; background: #f1f8f9; }
.manager-choice input { width: 15px; height: 15px; margin: 0; accent-color: #176b87; }
.manager-choice span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.form-field small { color: var(--muted); font-size: 11px; line-height: 1.35; }
.form-field input:focus, .form-field textarea:focus, .form-field select:focus { border-color: #56a5b9; box-shadow: 0 0 0 3px rgba(57,147,170,.12); }
.form-field input:user-invalid { border-color: #d56c65; }
.dialog-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 24px; border-top: 1px solid var(--line); background: #f8fafb; }
.dialog-footer p { margin: 0; color: var(--muted); font-size: 11px; }
.dialog-footer > div { display: flex; gap: 8px; }
.dialog-footer .primary-button, .dialog-footer .secondary-button { min-height: 40px; }

.toast { position: fixed; left: 50%; bottom: 25px; z-index: 120; transform: translate(-50%, 20px); padding: 10px 15px; border-radius: 9px; background: #1d3949; color: white; opacity: 0; pointer-events: none; transition: .2s ease; box-shadow: 0 8px 25px rgba(0,0,0,.2); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1200px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .filters { grid-template-columns: minmax(260px, 1.4fr) repeat(2, minmax(155px, .7fr)); }
  .filter-chip { grid-column: auto; }
  .table-wrap { max-height: none; }
}
@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; transform: translateX(-105%); transition: transform .22s ease; width: 244px; }
  .sidebar.open { transform: translateX(0); box-shadow: 12px 0 35px rgba(12,30,42,.28); }
  .menu-button { display: inline-grid; }
  .topbar { padding: 0 18px; }
  .content { padding: 22px 18px; }
  .filters { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .today, .breadcrumbs span, .breadcrumbs b { display: none; }
  .content { padding: 18px 12px; }
  .page-heading { align-items: stretch; flex-direction: column; }
  .page-actions { align-self: stretch; }
  .page-actions > button, .page-actions .export-menu, .page-actions .export-button { flex: 1; }
  .export-options { left: 0; right: auto; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 9px; }
  .metric-card { min-height: 104px; padding: 14px; gap: 10px; }
  .metric-icon { width: 36px; height: 36px; }
  .metric-card strong { font-size: 21px; }
  .filters { grid-template-columns: 1fr; padding-left: 14px; padding-right: 14px; }
  .search-field { grid-column: auto; }
  .panel-heading { padding-left: 14px; padding-right: 14px; }
  .panel-heading .secondary-button { display: none; }
  .table-footer { align-items: flex-start; flex-direction: column; }
  .pagination { width: 100%; justify-content: space-between; }
  .page-numbers { display: none; }
  .col-name { min-width: 250px; max-width: 250px; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-item.wide { grid-column: auto; }
  .project-dialog { width: calc(100% - 18px); max-height: 94vh; }
  .project-dialog form { max-height: 94vh; }
  .dialog-header, .dialog-body, .dialog-footer { padding-left: 16px; padding-right: 16px; }
  .form-grid { grid-template-columns: 1fr; gap: 13px; }
  .form-field.wide { grid-column: auto; }
  .dialog-footer { align-items: stretch; flex-direction: column; }
  .dialog-footer > div { justify-content: flex-end; }
}
