:root {
  --bg:           #f0f2f7;
  --panel:        #ffffff;
  --ink:          #0d1525;
  --muted:        #5e6e8a;
  --line:         #e3e8f0;
  --brand:        #4f6ef7;
  --brand-dark:   #3a55d4;
  --brand-glow:   rgba(79, 110, 247, 0.18);
  --green:        #16a34a;
  --green-bg:     #f0fdf4;
  --amber:        #d97706;
  --amber-bg:     #fffbeb;
  --red:          #e11d48;
  --red-bg:       #fff1f2;
  --purple:       #7c3aed;
  --purple-bg:    #f5f3ff;
  --shadow-xs:    0 1px 3px rgba(13,21,37,.06), 0 1px 2px rgba(13,21,37,.04);
  --shadow-sm:    0 2px 8px rgba(13,21,37,.07), 0 1px 3px rgba(13,21,37,.05);
  --shadow-md:    0 8px 24px rgba(13,21,37,.09), 0 2px 8px rgba(13,21,37,.06);
  --shadow-lg:    0 20px 48px rgba(13,21,37,.13), 0 8px 20px rgba(13,21,37,.07);
  --shadow-brand: 0 4px 16px rgba(79,110,247,.28);
  --shadow:       var(--shadow-md);
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 140ms var(--ease);
  --t-med:  220ms var(--ease);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, input, select, textarea { font: inherit; }
button {
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}
input, select, textarea {
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}
.hidden { display: none !important; }

/* ── Login ──────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(79, 110, 247, 0.10) 0%, transparent 70%),
    linear-gradient(180deg, #eef1f8 0%, #f0f2f7 100%);
}
.login-card {
  width: min(440px, 100%);
  display: grid;
  gap: 16px;
  background: #fff;
  border: 1px solid rgba(227, 232, 240, 0.9);
  border-radius: var(--r-xl);
  padding: 36px 32px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(79, 110, 247, 0.04);
}
.brand-mark, .brand-icon {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  font-weight: 900;
}
.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  font-size: 16px;
  box-shadow: var(--shadow-brand);
}
.login-card h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--ink);
}
.login-card p { margin: 0 0 4px; color: var(--muted); font-size: 14px; line-height: 1.5; }
label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
input, select, textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid #dde3ef;
  border-radius: var(--r-sm);
  padding: 8px 12px;
  background: #fff;
  color: var(--ink);
  font-size: 13.5px;
}
textarea { min-height: 72px; resize: vertical; }
.error { color: var(--red); font-size: 13px; }

/* ── App Layout ─────────────────────────────────────────── */
.app {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #fff;
  border-right: 1px solid var(--line);
  box-shadow: 1px 0 0 rgba(13,21,37,.03);
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.side-brand { display: flex; gap: 10px; align-items: center; padding: 4px; }
.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-size: 12px;
  box-shadow: var(--shadow-brand);
}
.side-brand strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.side-brand span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
nav { display: grid; gap: 3px; }
nav button {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  color: var(--muted);
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: -0.01em;
}
nav button:hover {
  background: var(--bg);
  color: var(--ink);
}
nav button.active {
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  box-shadow: var(--shadow-brand);
}
.profile-mini {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.profile-mini strong { display: block; font-size: 13px; font-weight: 700; color: var(--ink); }
.profile-mini span   { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; }
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  border: 2px solid rgba(79, 110, 247, 0.15);
  box-shadow: 0 2px 8px rgba(79, 110, 247, 0.25);
}

/* ── Topbar ─────────────────────────────────────────────── */
.main { min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 30px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(227, 232, 240, 0.8);
  box-shadow: 0 1px 0 rgba(13, 21, 37, 0.04);
}
.topbar p {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.topbar h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.top-actions, .actions, .row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.view { padding: 28px 30px; }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #fff;
  color: var(--ink);
  padding: 0 14px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -0.01em;
  box-shadow: var(--shadow-xs);
}
.btn:hover {
  background: #f8f9fc;
  border-color: #ccd3e0;
  box-shadow: var(--shadow-sm);
}
.btn:active {
  transform: translateY(1px);
  box-shadow: none;
}
.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: var(--shadow-brand);
}
.btn.primary:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  box-shadow: 0 6px 20px rgba(79, 110, 247, 0.36);
}
.btn.danger {
  color: var(--red);
  border-color: #fecdd3;
  background: #fff1f2;
  box-shadow: none;
}
.btn.danger:hover {
  background: #ffe4e6;
  border-color: #fca5a5;
}
.btn.icon { width: 34px; padding: 0; }

/* ── Grids & Layout ─────────────────────────────────────── */
.grid { display: grid; gap: 18px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 16px; }

.stat-card, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
}
.stat-card {
  padding: 20px;
  transition: transform var(--t-med), box-shadow var(--t-med);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(79, 110, 247, 0.03) 0%, transparent 60%);
  pointer-events: none;
}
.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(79, 110, 247, 0.08);
}
.stat-card small {
  color: var(--muted);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--ink);
}
.panel { overflow: hidden; }
.panel-head {
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: rgba(248, 250, 255, 0.6);
}
.panel-head h2, .panel-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.panel-head p { margin: 3px 0 0; color: var(--muted); font-size: 12px; font-weight: 500; }
.panel-body { padding: 20px 22px; }
.project-list-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.project-list-filters {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}
.project-list-filter {
  display: grid;
  gap: 6px;
  min-width: 126px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.project-list-filter select {
  min-height: 36px;
  border-radius: var(--r-sm);
  font-weight: 700;
}
.user-maintenance-table td { vertical-align: top; }
.user-role-editor {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.user-role-editor select {
  min-height: 36px;
  min-width: 160px;
  border-radius: var(--r-sm);
  font-weight: 700;
}

/* ── Forms ──────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
}
.enhancement-form { align-items: start; }
.form-grid .wide { grid-column: span 2; }
.task-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
  align-items: end;
}
.task-form-grid .span-2  { grid-column: 1 / -1; }
.task-form-grid .wide-action { grid-column: 1 / -1; }

/* ── Modals ─────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 15, 30, 0.42);
  backdrop-filter: blur(8px) saturate(120%);
  -webkit-backdrop-filter: blur(8px) saturate(120%);
}
.modal-card {
  position: relative;
  width: min(1040px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  background: #fff;
  border: 1px solid rgba(227, 232, 240, 0.9);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(13, 21, 37, 0.04);
}
.modal-head {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.modal-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.modal-head p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.modal-body { padding: 20px 22px; }
.overload-warning-modal { z-index: 70; }
.overload-warning-card { width: min(720px, 100%); }
.overload-list,
.suggestion-list { display: grid; gap: 10px; }
.overload-item,
.suggestion-item {
  border: 1px solid #e3e8f0;
  border-radius: var(--r-sm);
  padding: 13px;
  background: #fafbff;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.suggestion-item {
  width: 100%;
  text-align: left;
  cursor: pointer;
}
.suggestion-item:hover {
  border-color: var(--brand);
  background: rgba(79, 110, 247, 0.05);
  color: var(--brand);
}
.overload-item { display: grid; gap: 4px; }
.overload-item strong { color: var(--red); }
.overload-item span,
.suggestion-item {
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}
.modal-body h3 { margin: 18px 0 10px; font-size: 14px; font-weight: 800; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

/* ── AI Components ──────────────────────────────────────── */
.ai-assignment-list { display: grid; gap: 10px; }
.ai-assignment-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(150px, .7fr) minmax(110px, .45fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid #e3e8f0;
  border-radius: var(--r-sm);
  background: #fafbff;
  transition: border-color var(--t-fast);
}
.ai-assignment-row:hover { border-color: rgba(79, 110, 247, 0.25); }
.ai-result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.ai-recommendation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.ai-recommendation-head h3 { margin: 0; font-weight: 800; letter-spacing: -0.02em; }
.ai-selection-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-card {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  padding: 14px;
  border: 1px solid #e3e8f0;
  border-radius: 11px;
  background: #fafbff;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.ai-card:hover {
  border-color: rgba(79, 110, 247, 0.25);
  box-shadow: 0 2px 10px rgba(79, 110, 247, 0.08);
}
.ai-card strong { color: var(--ink); font-weight: 700; }
.ai-card span,
.ai-card small { color: var(--muted); font-size: 12px; font-weight: 600; }
.ai-card.danger { border-color: #fecdd3; background: #fff5f6; }
.ai-card.danger strong { color: var(--red); }
.ai-decision-card { gap: 12px; }
.ai-decision-check {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}
.ai-decision-check input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--brand);
}
.ai-decision-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.ai-decision-side {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 14px;
  background: #fafbff;
}
.ai-decision-side strong { display: block; margin-bottom: 10px; font-weight: 800; }
.ai-decision-side dl { display: grid; gap: 8px; margin: 0; }
.ai-decision-side dl div {
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}
.ai-decision-side dt,
.ai-decision-side dd { margin: 0; font-size: 13px; line-height: 1.35; }
.ai-decision-side dt { color: var(--muted); font-weight: 700; }
.ai-decision-side dd { color: var(--ink); font-weight: 800; overflow-wrap: anywhere; }
.ai-decision-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.ai-decision-meta span { color: var(--muted); font-size: 12px; font-weight: 700; }

/* ── Tables ─────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  background: #f4f6fd;
  color: #8896aa;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 11px 16px;
}
td {
  padding: 13px 16px;
  border-top: 1px solid #f1f4fb;
  vertical-align: middle;
  font-size: 13.5px;
}
tr:hover td { background: #f8f9fd; }
.resource-table thead th { text-align: center; vertical-align: middle; }
.resource-table .resource-table-group-row th {
  font-size: 10px;
  letter-spacing: 0.08em;
  padding-top: 10px;
  padding-bottom: 6px;
}
.resource-table thead tr:last-child th { padding-top: 6px; padding-bottom: 10px; }
.resource-table td:nth-child(1),
.resource-table td:nth-child(8),
.resource-table td:nth-child(9),
.resource-table td:nth-child(10) { text-align: center; }
.muted { color: var(--muted); }
.empty { padding: 32px; color: var(--muted); text-align: center; }

/* ── Pills ──────────────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.pill.active    { background: rgba(79, 110, 247, 0.10); color: var(--brand);  border: 1px solid rgba(79, 110, 247, 0.22); }
.pill.completed { background: var(--green-bg);           color: var(--green);  border: 1px solid rgba(22, 163, 74, 0.20); }
.pill.delayed   { background: var(--red-bg);             color: var(--red);    border: 1px solid rgba(225, 29, 72, 0.20); }
.pill.draft     { background: #f1f4fb;                   color: var(--muted);  border: 1px solid var(--line); }
.pill.busy      { background: var(--amber-bg);           color: var(--amber);  border: 1px solid rgba(217, 119, 6, 0.20); }
.user-status-active {
  min-height: 28px;
  padding: 4px 14px;
  font-size: 13px;
}

/* ── Progress ───────────────────────────────────────────── */
.progress { display: flex; align-items: center; gap: 8px; }
.track {
  flex: 1;
  min-width: 70px;
  height: 6px;
  border-radius: 99px;
  background: #eaecf4;
  overflow: hidden;
}
.fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--brand), #6c8efa);
  transition: width 0.4s var(--ease);
}
.fill.over { background: linear-gradient(90deg, var(--red), #fb7185); }
.capacity-line {
  display: grid;
  grid-template-columns: 92px minmax(90px, 1fr) 72px;
  gap: 8px;
  align-items: center;
  margin: 5px 0;
  font-size: 12px;
}
.capacity-line span { color: var(--muted); font-weight: 700; }
.capacity-line strong { text-align: right; font-size: 11px; }
.hours-cell { white-space: nowrap; }
.hours-cell strong { display: block; color: var(--ink); font-size: 14px; line-height: 18px; }
.hours-cell span   { display: block; color: var(--muted); font-size: 11px; font-weight: 700; }
.hours-cell.negative strong { color: var(--red); }
.allocation-summary-cell { min-width: 116px; white-space: normal; }
.allocation-summary-cell strong { display: block; color: var(--ink); font-size: 14px; line-height: 18px; }
.allocation-summary-cell span   { display: block; color: var(--muted); font-size: 11px; font-weight: 700; line-height: 15px; }
.productivity-cell { min-width: 108px; white-space: normal; }
.productivity-cell strong { display: block; color: var(--ink); font-size: 14px; line-height: 18px; }
.productivity-cell span   { display: block; color: var(--muted); font-size: 11px; font-weight: 700; line-height: 15px; }
.actions-cell { text-align: center; }
.resource-table .actions-cell .row-actions { justify-content: center; width: 100%; flex-wrap: nowrap; }
.resource-table th:last-child,
.resource-table td:last-child { text-align: center; }

/* ── Detail & Split ─────────────────────────────────────── */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; }
.detail-header {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.detail-header h2 {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.detail-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }

/* ── Allocation Matrix ──────────────────────────────────── */
.gantt { min-width: 900px; }
.allocation-matrix { min-width: 1280px; }
.allocation-matrix-head,
.allocation-matrix-row {
  display: grid;
  grid-template-columns: 220px 118px repeat(12, minmax(74px, 1fr)) 130px;
}
.allocation-matrix-head div {
  background: #f4f6fd;
  color: #8896aa;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 11px 8px;
}
.allocation-matrix-row > div {
  min-height: 38px;
  border-bottom: 1px solid #f1f4fb;
  padding: 8px;
  font-size: 12px;
}
.allocation-matrix-row.group-start > div { border-top: 1px solid #dde3ef; }
.allocation-resource-name {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fff;
  font-weight: 800;
  display: grid;
  align-content: center;
}
.allocation-type { font-weight: 800; color: var(--muted); }
.allocation-type.alloc { color: var(--brand); }
.allocation-type.enhancement { color: var(--purple); }
.allocation-type.total-type { color: var(--ink); }
.simulation-badge {
  display: inline-grid;
  min-height: 30px;
  place-items: center;
  border-radius: 999px;
  background: rgba(79, 110, 247, 0.10);
  color: var(--brand);
  border: 1px solid rgba(79, 110, 247, 0.20);
  font-size: 12px;
  font-weight: 700;
  padding: 0 12px;
  white-space: nowrap;
}
.allocation-matrix-row:has(.allocation-type.total-type) > div {
  background: #f4f6fd;
  font-weight: 900;
}
.allocation-hour,
.allocation-avg {
  display: grid;
  align-content: center;
  text-align: right;
  color: var(--ink);
  font-weight: 900;
}
.allocation-hour span,
.allocation-avg strong {
  display: inline-grid;
  justify-self: end;
  min-width: 42px;
  min-height: 24px;
  place-items: center;
  border-radius: 999px;
  padding: 2px 8px;
}
.allocation-hour span[data-allocation-tooltip] { cursor: help; }
.allocation-hour .available,
.allocation-avg .available  { background: #ecfdf5; color: var(--green); }
.allocation-hour .busy,
.allocation-avg .busy        { background: #fefce8; color: var(--amber); }
.allocation-hour .over,
.allocation-avg .over        { background: #fff1f2; color: var(--red); }
.allocation-avg { background: #f4f6fd; }
.allocation-avg strong { color: var(--ink); }

/* ── Allocation Tooltip ─────────────────────────────────── */
.allocation-hover-tooltip {
  position: absolute;
  z-index: 1000;
  width: min(320px, calc(100vw - 24px));
  background: rgba(13, 21, 37, 0.97);
  color: #fff;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: 12px 14px;
  pointer-events: none;
}
.allocation-hover-title { font-size: 12px; font-weight: 800; margin-bottom: 8px; }
.allocation-hover-section + .allocation-hover-section {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.allocation-hover-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 6px;
}
.allocation-hover-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  line-height: 1.4;
}
.allocation-hover-item + .allocation-hover-item { margin-top: 6px; }
.allocation-hover-item span   { color: rgba(255, 255, 255, 0.88); }
.allocation-hover-item strong { color: #fff; white-space: nowrap; }

/* ── Schedule / Gantt ───────────────────────────────────── */
.schedule-panel { border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.schedule-panel-head { padding: 16px 20px 14px; }
.schedule-tools { display: flex; align-items: end; gap: 8px; }
.segmented {
  display: inline-flex;
  min-height: 34px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f2f4fb;
  gap: 2px;
}
.segmented button {
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  font-weight: 700;
  font-size: 12px;
}
.segmented button:hover { color: var(--ink); background: rgba(255,255,255,.6); }
.segmented button.active {
  background: #fff;
  color: var(--brand);
  box-shadow: 0 1px 6px rgba(13, 21, 37, 0.10), 0 0 0 1px rgba(227, 232, 240, 0.8);
}
.schedule-tools label { width: 112px; }
.schedule-tools input {
  min-height: 36px;
  border-radius: var(--r-sm);
  text-align: center;
  font-weight: 700;
}
.resource-panel-actions {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.resource-gantt-filter {
  width: 240px;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.resource-gantt-filter select { min-height: 36px; border-radius: var(--r-sm); font-weight: 700; }
.month-filter { width: 148px; }
.month-filter input { min-height: 36px; border-radius: var(--r-sm); font-weight: 700; }
.schedule-shell { padding: 18px 20px 20px; overflow-x: auto; }
.gantt-scroll-shell { overflow-x: auto; }
.schedule-grid {
  width: 100%;
  min-width: max-content;
  border: 1px solid #dde3ef;
  border-radius: var(--r-md);
  background: #f8f9fd;
  overflow: visible;
}
.schedule-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) repeat(12, minmax(58px, .48fr)) minmax(96px, .7fr) minmax(108px, .8fr) minmax(78px, .55fr);
}
.resource-gantt-panel-body { display: grid; gap: 14px; }
.resource-gantt-summary { display: grid; gap: 2px; }
.resource-gantt-summary strong { font-size: 16px; color: var(--ink); font-weight: 800; }
.resource-gantt-summary span   { color: var(--muted); font-size: 12px; font-weight: 600; }
.resource-gantt-shell { overflow-x: auto; }
.resource-gantt-grid { min-width: 1180px; }
.resource-gantt-head > div { min-height: 44px; }
.resource-gantt-section {
  grid-column: 1 / -1;
  padding: 12px 16px 8px;
  background: #f4f6fd;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-top: 1px solid #dde3ef;
  border-bottom: 1px solid #dde3ef;
}
.resource-gantt-row > div { min-height: 54px; }
.resource-gantt-label {
  position: sticky;
  left: 0;
  z-index: 7;
  background: #fff;
  display: grid;
  align-content: center;
  gap: 2px;
}
.resource-gantt-label strong { color: var(--ink); font-size: 13px; line-height: 1.2; font-weight: 700; }
.resource-gantt-label span   { color: var(--muted); font-size: 11px; font-weight: 600; line-height: 1.2; }
.resource-gantt-label.project strong    { color: var(--brand); }
.resource-gantt-label.enhancement strong { color: var(--purple); }
.resource-gantt-area { align-items: center; }
.resource-gantt-chip {
  position: relative;
  z-index: 2;
  justify-self: stretch;
  align-self: center;
  min-height: 28px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  padding: 0 6px;
  width: var(--resource-gantt-width, 100%);
  min-width: 42px;
  max-width: 100%;
  margin: 0 auto;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  border: 1px solid transparent;
}
.resource-gantt-chip.project {
  background: rgba(79, 110, 247, 0.10);
  border-color: rgba(79, 110, 247, 0.25);
  color: var(--brand);
}
.resource-gantt-chip.enhancement {
  background: var(--purple-bg);
  border-color: rgba(124, 58, 237, 0.25);
  color: var(--purple);
}
.resource-gantt-chip.busy { box-shadow: inset 0 0 0 999px rgba(251, 191, 36, 0.14); }
.resource-gantt-chip.over { box-shadow: inset 0 0 0 999px rgba(244, 63, 94, 0.12); }
.resource-gantt-chip[data-allocation-tooltip] { cursor: help; }
.task-schedule-grid { min-width: 980px; }
.task-schedule-row { grid-template-columns: minmax(240px, 1.6fr) repeat(12, minmax(58px, .48fr)) minmax(78px, .55fr); }
.schedule-head > div,
.schedule-row > div {
  position: relative;
  min-height: 54px;
  border-right: 1px solid #e3e8f0;
  border-bottom: 1px solid #e3e8f0;
  padding: 9px 10px;
  font-size: 12px;
  line-height: 18px;
}
.schedule-head > div { min-height: 42px; display: grid; place-items: center; }
.schedule-row:last-child > div { border-bottom: 0; }
.schedule-row > div:last-child { border-right: 0; }
.schedule-head > div {
  background: #f4f6fd;
  color: #64748b;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.05em;
}
.schedule-row > div:first-child {
  position: sticky;
  left: 0;
  z-index: 7;
  box-shadow: 1px 0 0 #e3e8f0;
}
.schedule-row > div:first-child::before {
  content: "";
  position: absolute;
  top: 0;
  right: 100%;
  bottom: 0;
  width: 56px;
  background: inherit;
}
.schedule-head > div:first-child { z-index: 12; }
.schedule-project {
  color: var(--ink);
  background: #fff;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-content: center;
  column-gap: 6px;
  row-gap: 1px;
}
.schedule-project .tree-toggle,
.schedule-project .tree-spacer {
  grid-column: 1;
  grid-row: 1 / 3;
  align-self: center;
  justify-self: start;
}
.schedule-project strong {
  grid-column: 2;
  display: block;
  min-width: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.schedule-project span {
  grid-column: 2;
  display: block;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.schedule-task-row > div { background: #fbfdff; }
.schedule-task-row .schedule-project { background: #fbfdff; }
.schedule-task-label { border-left: 3px solid #dbeafe; }
.schedule-task-label.level-1 { padding-left: 22px !important; }
.schedule-task-label.level-2 { padding-left: 42px !important; border-left-color: #e9d5ff; }
.schedule-task-label.level-3,
.schedule-task-label.level-4 { padding-left: 62px !important; border-left-color: #fde68a; }
.timeline-area,
.timeline-header-area {
  position: relative;
  display: grid;
  padding: 0 !important;
  overflow: hidden;
}
.timeline-area {
  min-height: 54px;
  grid-template-rows: 1fr 1fr;
  align-items: center;
}
.timeline-header-area { min-height: 42px; }
.timeline-header-area.weekly   { min-height: 64px; grid-template-rows: 32px 32px; }
.timeline-header-area.monthly  { grid-template-rows: 42px; }
.timeline-month-label,
.timeline-period-label,
.schedule-cell {
  background: #fff;
  position: relative;
  min-width: 0;
  height: 100%;
  border-right: 1px solid #e3e8f0;
}
.timeline-month-label,
.timeline-period-label {
  display: grid;
  place-items: center;
  background: #f4f6fd;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 6px;
}
.timeline-month-label { grid-row: 1; border-bottom: 1px solid #e3e8f0; }
.timeline-period-label { grid-row: 1; }
.timeline-header-area.weekly .timeline-period-label { grid-row: 2; }
.timeline-header-area > div:last-of-type,
.timeline-area > .schedule-cell:last-of-type { border-right: 0; }
.schedule-cell { grid-row: 1 / 3; }
.schedule-row:not(.schedule-head):hover > div { background-color: #f8f9fd; }
.schedule-row:not(.schedule-head):hover .timeline-area,
.schedule-row:not(.schedule-head):hover .schedule-cell { background-color: #f8f9fd; }
.today-cell {
  background-image: linear-gradient(90deg, rgba(225, 29, 72, .07), rgba(225, 29, 72, .07));
}

/* ── Timeline Bars ──────────────────────────────────────── */
.timeline-bar {
  display: block;
  height: 11px;
  border-radius: 999px;
  margin: 0 4px;
  min-width: 14px;
  position: relative;
  z-index: 3;
  align-self: end;
}
.timeline-bar.plan {
  grid-row: 1;
  background: linear-gradient(90deg, var(--brand), #7c9aff);
  box-shadow: 0 2px 8px rgba(79, 110, 247, 0.28);
}
.timeline-bar.plan.done {
  background: linear-gradient(90deg, #16a34a, #4ade80);
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.24);
}
.timeline-bar.plan.late {
  background: linear-gradient(90deg, #e11d48, #fb7185);
  box-shadow: 0 2px 8px rgba(225, 29, 72, 0.24);
}
.timeline-bar.actual {
  grid-row: 2;
  align-self: start;
  height: 8px;
  background: linear-gradient(90deg, #d97706, #fbbf24);
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.24);
}

/* ── Schedule Total / Tree ──────────────────────────────── */
.schedule-total {
  color: var(--ink);
  text-align: right;
  white-space: nowrap;
  font-weight: 800;
  display: grid;
  align-content: center;
}
.tree-toggle {
  width: 22px;
  height: 22px;
  border: 1px solid #dde3ef;
  border-radius: 6px;
  background: #fff;
  color: var(--brand);
  font-weight: 900;
  font-size: 12px;
  display: grid;
  place-items: center;
  margin-right: 8px;
  box-shadow: var(--shadow-xs);
  transition: background var(--t-fast), border-color var(--t-fast);
}
.tree-toggle:hover {
  background: rgba(79, 110, 247, 0.06);
  border-color: rgba(79, 110, 247, 0.25);
}
.tree-spacer { display: inline-block; width: 32px; }
.task-sequence-input {
  width: 68px;
  min-width: 68px;
  padding: 7px 10px;
  border: 1px solid #dde3ef;
  border-radius: var(--r-sm);
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  box-shadow: var(--shadow-xs);
}
.task-sequence-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}
.task-tree-table th:nth-child(2),
.task-tree-table td:nth-child(2) { width: 90px; text-align: center; }
.task-child-cell           { padding-left: 28px !important; }
.task-child-cell.level-1   { padding-left: 28px !important; }
.task-child-cell.level-2   { padding-left: 48px !important; }
.task-child-cell.level-3,
.task-child-cell.level-4   { padding-left: 68px !important; }

/* ── Simple Gantt ───────────────────────────────────────── */
.gantt-head, .gantt-row {
  display: grid;
  grid-template-columns: 240px repeat(12, 1fr) 90px;
}
.project-schedule-row { grid-template-columns: 240px repeat(12, 1fr) 110px 110px 90px; }
.gantt-head div {
  background: #f4f6fd;
  color: #8896aa;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 10px 7px;
  border-bottom: 1px solid var(--line);
}
.gantt-row div {
  min-height: 44px;
  border-bottom: 1px solid #f1f4fb;
  padding: 8px 7px;
  font-size: 12px;
}
.gantt-label { font-weight: 700; background: #fff; position: sticky; left: 0; }
.bar { height: 9px; border-radius: 99px; background: linear-gradient(90deg, var(--brand), #7c9aff); }
.bar.plan { background: #dde8ff; border: 1px solid rgba(79, 110, 247, 0.30); }
.bar.done { background: linear-gradient(90deg, var(--green), #4ade80); }
.bar.late { background: linear-gradient(90deg, #fca5a5, #fb7185); }

/* ── Resource Card ──────────────────────────────────────── */
.resource-card {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid #f1f4fb;
}

/* ── Heatmap ────────────────────────────────────────────── */
.heatmap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.heat {
  min-height: 88px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  color: #fff;
  display: grid;
  align-content: space-between;
  box-shadow: 0 4px 14px rgba(13, 21, 37, 0.10);
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.heat:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(13, 21, 37, 0.16);
}
.heat strong { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; }
.heat span   { font-size: 11px; font-weight: 700; opacity: 0.88; }

/* ── Monitoring Panel ───────────────────────────────────── */
.monitoring-panel .panel-body { display: grid; gap: 14px; }
.monitoring-panel .panel-head h2 { font-size: 14px; font-weight: 700; }
.monitoring-panel .panel-head p  { font-size: 12px; }
.monitoring-panel-head,
.monitoring-actions,
.monitoring-summary,
.monitoring-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.monitoring-actions { justify-content: flex-end; flex-wrap: nowrap; }
.monitoring-actions input[data-monitoring-week] { width: 180px; min-width: 180px; }
.monitoring-actions .btn { flex: 0 0 auto; }
.monitoring-summary strong { font-size: 15px; font-weight: 700; line-height: 1.25; }
.monitoring-summary span   { color: var(--muted); font-size: 12px; }
.monitoring-legend { justify-content: flex-start; }
.monitoring-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}
.swatch { width: 12px; height: 12px; border-radius: 999px; display: inline-block; }
.swatch.project-task  { background: linear-gradient(90deg, #3b5fc0, #4f6ef7); }
.swatch.enhancement   { background: linear-gradient(90deg, #1a6b2b, #22a642); }
.swatch.conflict      { background: linear-gradient(90deg, #f97316, #e11d48); }

/* ── Monitoring Board ───────────────────────────────────── */
.monitoring-board {
  overflow: auto;
  border: 1px solid #dde3ef;
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, #fafbff, #f7f9fe);
  box-shadow: var(--shadow-xs);
}
.monitoring-grid-head,
.monitoring-resource-row {
  display: grid;
  grid-template-columns: minmax(170px, 220px) minmax(0, 1fr);
}
.monitoring-head,
.monitoring-resource {
  padding: 12px 14px;
  border-right: 1px solid #d5ddf0;
}
.monitoring-head {
  background: #eef1fb;
  color: #3c4f6e;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  min-height: 68px;
}
.monitoring-head.resource {
  background: #e6edf8;
  display: grid;
  place-items: center start;
  border-bottom: 1px solid #d5ddf0;
}
.monitoring-head-row { display: grid; border-bottom: 1px solid #d5ddf0; }
.monitoring-head.day {
  display: grid;
  place-items: center;
  text-align: center;
  border-right: 1px solid rgba(13, 21, 37, .07);
}
.monitoring-head.day:last-child { border-right: 0; }
.monitoring-head.day strong {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
}
.monitoring-head.day span {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: none;
}
.monitoring-head.day.today,
.monitoring-cell.today {
  background-image: linear-gradient(90deg, rgba(79, 110, 247, .07), rgba(79, 110, 247, .07));
}
.monitoring-resource-row + .monitoring-resource-row { border-top: 1px solid #e3e8f0; }
.monitoring-resource {
  background: #e6edf8;
  display: grid;
  align-content: center;
  gap: 4px;
}
.monitoring-resource strong { font-size: 15px; font-weight: 700; line-height: 1.2; color: var(--ink); }
.monitoring-resource span   { color: var(--muted); font-size: 11px; font-weight: 600; }
.monitoring-resource-lanes { display: grid; gap: 0; background: #fff; }
.monitoring-lane {
  position: relative;
  display: grid;
  grid-auto-rows: 64px;
  min-height: 64px;
}
.monitoring-lane + .monitoring-lane { border-top: 1px dashed #d5ddf0; }
.monitoring-cell {
  grid-row: 1;
  min-height: 64px;
  border-right: 1px solid #e3e8f0;
  background: rgba(255,255,255,.78);
}
.monitoring-cell:last-of-type { border-right: 0; }

/* ── Monitoring Bars ────────────────────────────────────── */
.monitoring-bar {
  grid-row: 1;
  align-self: center;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
  min-height: 44px;
  margin: 0 4px;
  border-radius: var(--r-sm);
  border: none;
  color: #fff;
  padding: 6px 10px;
  text-align: center;
  position: relative;
  z-index: 2;
  box-shadow: 0 3px 12px rgba(13, 21, 37, 0.16);
  cursor: pointer;
  transition: filter var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.monitoring-bar:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(13, 21, 37, 0.22);
}
.monitoring-bar.project-task { background: linear-gradient(135deg, #3b5fc0, #4f6ef7); }
.monitoring-bar.enhancement  { background: linear-gradient(135deg, #1a6b2b, #22a642); }
.monitoring-bar.conflict {
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.38), 0 6px 16px rgba(225, 29, 72, 0.18);
}
.monitoring-bar-main {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}
.monitoring-bar-title {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.monitoring-bar-meta { font-size: 10px; font-weight: 600; opacity: .85; white-space: nowrap; }
.monitoring-bar-progress {
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
  color: rgba(255,255,255,.88);
  white-space: nowrap;
}
.monitoring-flag {
  flex: 0 0 auto;
  min-height: 18px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

/* ── Monitoring Quick-Editor ────────────────────────────── */
.monitoring-quick-editor {
  position: absolute;
  z-index: 1100;
  width: min(400px, calc(100vw - 40px));
  max-width: calc(100vw - 40px);
  box-sizing: border-box;
  background: #fff;
  border: 1px solid rgba(227, 232, 240, 0.9);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(13, 21, 37, 0.04);
  padding: 16px;
  overflow-x: hidden;
  overflow-y: visible;
  display: block;
}
.monitoring-quick-editor-form {
  display: grid;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  align-content: start;
}
.monitoring-quick-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}
.monitoring-quick-editor-head strong {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.monitoring-quick-editor-head span {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.monitoring-quick-editor-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 12px;
  color: #475569;
}
.monitoring-quick-editor-current {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: #f4f6fd;
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.monitoring-quick-editor-current strong { color: var(--ink); }
.monitoring-quick-editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  align-items: end;
  min-width: 0;
}
.monitoring-quick-editor-grid label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  min-width: 0;
}
.monitoring-quick-editor-grid input,
.monitoring-quick-editor-grid select { min-width: 0; }
.monitoring-editor-error {
  margin: 0;
  font-size: 12px;
}
.monitoring-quick-editor-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.monitoring-action-button {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #fff;
  color: var(--ink);
  width: 100%;
  height: 40px;
  min-width: 0;
  max-width: none;
  box-sizing: border-box;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  text-align: center !important;
  visibility: visible;
  opacity: 1;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: background var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}
.monitoring-action-button:hover {
  background: #f8f9fc;
  box-shadow: var(--shadow-sm);
}
.monitoring-action-button:active { transform: translateY(1px); }
.monitoring-action-button.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: var(--shadow-brand);
}
.monitoring-action-button.primary:hover {
  background: var(--brand-dark);
  box-shadow: 0 6px 20px rgba(79, 110, 247, 0.36);
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 640px) {
  .monitoring-quick-editor { width: min(360px, calc(100vw - 24px)); max-width: calc(100vw - 24px); }
  .monitoring-quick-editor-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1000px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .stats, .form-grid, .task-form-grid, .split, .ai-assignment-row, .ai-result-grid, .ai-decision-compare { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .task-form-grid .span-2 { grid-column: auto; }
  .task-form-grid .wide-action { grid-column: auto; }
  .ai-decision-side dl div { grid-template-columns: 1fr; gap: 2px; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .monitoring-grid-head,
  .monitoring-resource-row { grid-template-columns: 140px minmax(780px, 1fr); }
  .monitoring-actions { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .resource-gantt-filter { width: 100%; }
  .monitoring-resource strong { font-size: 14px; }
  .monitoring-bar { justify-items: start; text-align: left; }
  .monitoring-bar-main { justify-content: flex-start; }
  .monitoring-bar-meta { display: none; }
}
