:root {
  --navy: #152b52;
  --blue: #2e75b6;
  --blue-dark: #245d91;
  --blue-soft: #eef5fb;
  --line: #d8e1eb;
  --ink: #1d2939;
  --muted: #667085;
  --green: #18794e;
  --green-soft: #e8f5ed;
  --manager-green: #2f7d5b;
  --manager-green-dark: #27684c;
  --manager-green-soft: #e7f3ec;
  --red: #c81e1e;
  --burgundy: #7f0000;
  --burgundy-mid: #9c0006;
  --hr-red: #c00000;
  --red-soft: #fff0f0;
  --yellow: #a15c00;
  --yellow-soft: #fff7df;
  --shadow: 0 12px 30px rgba(21, 43, 82, .08);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  min-width: 1024px;
  background: #f5f7fa;
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

body.modal-open { overflow: hidden; }

button, input, select { font: inherit; }

button, .button-like, .file-button {
  border: 0;
  border-radius: 9px;
  padding: 9px 14px;
  background: var(--blue);
  color: white;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, opacity .15s ease;
  text-decoration: none;
}

button:hover:not(:disabled), .button-like:hover, .file-button:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
}

button:disabled { cursor: not-allowed; opacity: .42; }
button.secondary, .file-button.secondary {
  background: white;
  color: var(--navy);
  border: 1px solid #c8d4e3;
}
button.secondary:hover, .file-button.secondary:hover { background: var(--blue-soft); }
.hidden { display: none !important; }

.app-header {
  height: 68px;
  padding: 0 28px;
  background: var(--navy);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 5px 18px rgba(21, 43, 82, .2);
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { width: 46px; height: 46px; object-fit: cover; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255,255,255,.18); }
.brand-copy { display: grid; gap: 2px; }
.app-header h1 { margin: 0; font-size: 23px; letter-spacing: -.4px; }
.eyebrow, .step {
  margin: 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.25px;
  color: #6f92b8;
}
.app-header .eyebrow { color: #a9c8e8; }
.version { color: #c7daef; font-size: 12px; }
.session-controls { display: flex; align-items: center; gap: 12px; }
.session-controls #sessionUser { color: white; font-size: 12px; font-weight: 700; }
.header-logout { padding: 6px 10px; color: white; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.28); }

.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: white; }
.auth-card { width: min(430px, 94vw); padding: 36px 38px; border: 1px solid #e2e8f0; border-radius: 18px; background: white; box-shadow: 0 18px 55px rgba(21,43,82,.12); text-align: center; }
.auth-logo { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 5px #eff6fb; }
.auth-company { margin: 18px 0 5px; color: var(--blue-dark); font-size: 11px; font-weight: 900; letter-spacing: 1.5px; }
.auth-card h1 { margin: 0; color: var(--navy); font-size: 26px; }
.auth-card > p:not(.auth-company) { color: var(--muted); line-height: 1.5; }
.auth-form { margin-top: 24px; display: grid; gap: 14px; text-align: left; }
.auth-form input { width: 100%; min-height: 44px; border: 1px solid #cbd5e1; border-radius: 9px; padding: 9px 11px; }
.auth-form button { min-height: 44px; margin-top: 4px; }
.auth-password-help { padding: 10px; border-radius: 8px; background: #f1f7fc; color: #385b7c; font-size: 12px; line-height: 1.45; }
.auth-error { padding: 10px; border-radius: 8px; border: 1px solid #f1b6b6; background: #fff1f1; color: #a41f1f; font-size: 12px; font-weight: 700; }

main { padding: 14px 22px 26px; }

.global-workspace-toolbar {
  position: sticky;
  top: 0;
  z-index: 18;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: -2px 0 12px;
  padding: 7px;
  background: rgba(245, 247, 250, .96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(216, 225, 235, .9);
}
.global-workspace-toolbar .workspace-nav { margin-bottom: 0; }
.persistent-settings-button { min-width: 100px; box-shadow: 0 2px 8px rgba(21,43,82,.08); }

.workspace-nav { display: flex; gap: 7px; margin-bottom: 12px; padding: 5px; width: fit-content; background: #e8eef5; border-radius: 11px; }
.workspace-tab { background: transparent; color: var(--navy); padding: 8px 13px; }
.workspace-tab:hover:not(:disabled) { background: #dbe7f3; }
.workspace-tab.active { background: white; color: var(--blue-dark); box-shadow: 0 2px 8px rgba(21,43,82,.12); }
.phase2-workspace { display: grid; gap: 12px; }
.phase2-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; }
.phase2-toolbar h2 { margin: 3px 0 0; }
.range-controls { display: flex; align-items: center; gap: 8px; }
.range-controls select, .range-controls input { min-height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 7px; }
.phase2-view { padding: 18px; min-height: 450px; }
.operation-kpis { display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)); gap: 10px; margin-bottom: 18px; }
.operation-kpis > div { border: 1px solid #dce7f1; background: #f8fbfe; border-radius: 10px; padding: 13px; }
.operation-kpis span { display: block; color: var(--muted); font-size: 12px; }
.operation-kpis strong { display: block; color: var(--navy); font-size: 25px; margin-top: 4px; }
.operation-chart-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-bottom: 18px; }
.operation-chart-panel { min-width: 0; }
.chart-heading { min-height: 72px; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.chart-heading select { min-height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; background: white; color: var(--navy); font-weight: 700; }
.operation-chart-panel .chart-card { min-height: 315px; }
.chart-axis-label { fill: #66788a; font-size: 10px; }
.chart-grid-line { stroke: #dce5ed; stroke-width: 1; }
.chart-optimum-line { stroke: #1688c9; stroke-width: 3; stroke-dasharray: 8 5; }
.chart-lower-line { stroke: #e08a1e; stroke-width: 3; stroke-dasharray: 3 5; }
.chart-plan-line { stroke: #2f7d5b; stroke-width: 3; stroke-dasharray: 8 5; }
.chart-point { stroke: white; stroke-width: 1.5; }
.chart-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend-marker { width: 11px; height: 11px; display: inline-block; background: var(--legend-color); border: 1px solid rgba(21,43,82,.16); }
.marker-circle { border-radius: 50%; }
.marker-square { border-radius: 2px; }
.marker-diamond { transform: rotate(45deg); border-radius: 2px; }
.marker-triangle { width: 0; height: 0; background: transparent; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 11px solid var(--legend-color); border-top: 0; }
.marker-cross { position: relative; background: transparent; border: 0; }
.marker-cross::before, .marker-cross::after { content: ""; position: absolute; left: 5px; top: 0; width: 2px; height: 12px; background: var(--legend-color); }
.marker-cross::after { transform: rotate(90deg); }
.analytics-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.analytics-grid h3, .phase2-view h3 { margin: 0 0 9px; color: var(--navy); }
.chart-card { min-height: 190px; background: #f8fbfe; border: 1px solid #dce7f1; border-radius: 10px; padding: 14px; }
.comparison-chart svg { width: 100%; min-width: 620px; height: 250px; overflow: visible; }
.comparison-chart { overflow-x: auto; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 10px; font-size: 12px; }
.chart-legend span::before { content: ""; display: inline-block; width: 18px; height: 3px; margin-right: 6px; vertical-align: middle; background: var(--legend-color); border-radius: 3px; }
.bar-row { display: grid; grid-template-columns: 150px 1fr 42px; align-items: center; gap: 8px; margin: 9px 0; font-size: 12px; }
.bar-track { height: 13px; border-radius: 8px; background: #e1eaf3; overflow: hidden; }
.bar-fill { height: 100%; min-width: 2px; background: var(--blue); border-radius: 8px; }
.trend-columns { height: 155px; display: flex; align-items: end; gap: 7px; border-bottom: 1px solid var(--line); }
.active-reference-chart .trend-column { position: relative; }
.active-reference-chart .trend-column em { position: absolute; left: 0; right: 0; height: 3px; background: #20a464; border-radius: 3px; }
.trend-column { flex: 1; min-width: 22px; display: flex; flex-direction: column; justify-content: end; text-align: center; height: 100%; }
.trend-column i { display: block; margin: 0 auto; width: 70%; min-height: 2px; background: var(--blue); border-radius: 5px 5px 0 0; }
.trend-column small { font-size: 9px; margin-top: 5px; color: var(--muted); }
.analytics-table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.analytics-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.analytics-table th { background: var(--navy); color: white; text-align: left; padding: 9px; white-space: nowrap; }
.analytics-table td { border-top: 1px solid var(--line); padding: 9px; vertical-align: top; }
.data-scope-bar { display: flex; align-items: end; gap: 12px; margin-bottom: 14px; padding: 12px 16px; flex-wrap: wrap; }
.data-scope-bar > div:first-child { margin-right: auto; }
.data-scope-bar label { display: grid; gap: 4px; color: var(--muted); font-size: 11px; font-weight: 700; }
.data-scope-bar input, .data-scope-bar select { min-height: 38px; }
.data-coverage { flex-basis: 100%; border-radius: 8px; padding: 8px 11px; background: #eef8f3; color: #14754b; font-size: 12px; font-weight: 700; }
.data-coverage.warning { background: #fff2e8; color: #a54b16; border: 1px solid #f2c5a7; }
.data-coverage.loading { background: #e8f1fb; color: #1d5f9a; border: 1px solid #b9d4ef; }
.coverage-team { margin-top: 5px; font-weight: 600; }
.coverage-team strong { color: inherit; }
.missing-data-row { background: #fff8ef; }
.movement-button { border: 0; border-radius: 999px; padding: 5px 9px; background: #fff1d7; color: #8b5400; font-size: 11px; font-weight: 800; cursor: pointer; }
.movement-modal { width: min(780px, calc(100vw - 32px)); }
.movement-summary { background: #f5f9fc; border: 1px solid var(--line); border-radius: 9px; padding: 12px; margin-bottom: 12px; }
.movement-table { width: 100%; border-collapse: collapse; }
.movement-table th { background: var(--navy); color: white; text-align: left; padding: 9px; }
.movement-table td { border-bottom: 1px solid var(--line); padding: 9px; }
.movement-events { display: grid; gap: 10px; }
.movement-event { display: grid; grid-template-columns: 92px 1fr 92px 1fr; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fbfdff; }
.movement-event b { color: white; background: #1688c9; border-radius: 7px; padding: 8px; text-align: center; text-transform: uppercase; letter-spacing: .04em; }
.movement-event b.logout { background: #7f5360; }
.movement-event time { font-size: 20px; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }
.review-controls { display: grid; grid-template-columns: 180px 1fr; gap: 12px; margin: 14px 0; }
.review-controls label { display: grid; gap: 5px; font-size: 12px; font-weight: 700; color: var(--muted); }
.review-controls select, .review-controls textarea { min-height: 40px; }
.review-history-heading { display: flex; justify-content: space-between; align-items: end; gap: 12px; }
.review-history-heading select { min-height: 38px; }
.review-state { display: inline-block; border-radius: 999px; padding: 4px 8px; background: #fff0d7; color: #895100; font-weight: 800; font-size: 11px; }
.review-state.closed { background: #e9f4ed; color: #236747; }
.signal-pill { display: inline-block; padding: 3px 7px; border-radius: 10px; background: #fff0d9; color: #8a5200; font-weight: 700; font-size: 10px; }
.manager-note { width: 240px; border: 1px solid var(--line); border-radius: 7px; padding: 6px; }
.view-help { color: var(--muted); margin-top: 0; }
.person-detail-picker { max-width: 380px; margin-bottom: 15px; }
.person-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.timeline { max-height: 330px; overflow: auto; }
.archive-heading { display: flex; justify-content: space-between; align-items: center; }
.archive-heading h3, .archive-heading p { margin: 0 0 5px; }
.archive-list { display: grid; gap: 9px; margin-top: 15px; }
.archive-item { display: grid; grid-template-columns: 1.3fr 1fr .8fr auto auto; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; background: white; }
.archive-item small { color: var(--muted); display: block; margin-top: 3px; }
.holiday-add-actions { display: flex; gap: 8px; margin-top: 10px; }
.duration-section { margin: 5px 0 18px; }
.duration-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.duration-card { border: 1px solid #dce7f1; background: #f8fbfe; border-radius: 10px; padding: 13px; }
.duration-card h4 { margin: 0 0 3px; color: var(--navy); }
.duration-card .duration-stats { color: var(--muted); font-size: 11px; margin-bottom: 9px; }
.duration-buckets { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; text-align: center; }
.duration-buckets div { background: white; border: 1px solid var(--line); border-radius: 7px; padding: 7px 3px; }
.duration-buckets strong, .duration-buckets small { display: block; }
.duration-buckets small { color: var(--muted); font-size: 9px; margin-top: 3px; }
.historical-import { margin: 15px 0; display: grid; grid-template-columns: minmax(260px,1fr) auto auto auto; align-items: center; gap: 9px; padding: 13px; border: 1px dashed #9eb8d2; background: #f7fbff; border-radius: 10px; }
.historical-import h3, .historical-import p { margin: 0 0 4px; }
.historical-import input[type=file] { display: none; }
.historical-preview { grid-column: 1 / -1; padding: 10px; background: white; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; }
.leave-modal { width: min(1050px, 92vw); }
.leave-list { max-height: 440px; padding: 8px; }
.leave-row { display: grid; grid-template-columns: 1.2fr 1fr 1fr .8fr .8fr 1.4fr auto; gap: 8px; align-items: end; padding: 10px 5px; border-bottom: 1px solid var(--line); }
.leave-row .field span { white-space: nowrap; }
.pagination { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; padding: 12px 2px 2px; color: var(--muted); font-size: 12px; }
.pagination button { padding: 6px 10px; min-width: 34px; }
.pagination button.active { background: var(--navy); }
.pagination select { min-height: 34px; border: 1px solid var(--line); border-radius: 7px; padding: 5px 8px; background: white; }
.pagination .page-summary { margin-right: auto; font-weight: 700; }

.users-editor { max-height: 260px; display: grid; gap: 7px; }
.user-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 9px; padding: 9px; background: white; }
.user-row small { display: block; color: var(--muted); margin-top: 3px; }
.user-state { font-size: 10px; font-weight: 800; color: var(--green); }
.user-state.locked { color: var(--red); }
.user-form { display: grid; gap: 10px; margin-top: 12px; padding: 13px; border: 1px solid #b8cde0; border-radius: 10px; background: #f7fbff; }
.user-form h3 { margin: 0; color: var(--navy); }
.user-permissions { display: grid; gap: 7px; margin-top: 8px; }
.user-permission-row { display: grid; grid-template-columns: 1fr 150px; gap: 8px; align-items: center; }
.user-permission-row select { min-height: 36px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.user-form-actions { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; }
.audit-list { max-height: 240px; overflow: auto; display: grid; gap: 6px; font-size: 11px; }
.audit-event { padding: 8px; border-left: 3px solid var(--blue); background: white; border-radius: 5px; }
.audit-event.failed { border-left-color: var(--red); background: #fff7f7; }

.action-bar {
  min-height: 82px;
  padding: 11px 12px;
  display: grid;
  grid-template-columns: minmax(230px, 1fr) minmax(285px, 1.25fr) minmax(260px, .85fr) auto;
  align-items: center;
  gap: 12px;
  background: white;
  border: 1px solid #dce4ed;
  border-radius: 13px;
  box-shadow: var(--shadow);
}

.action-bar.dragging { outline: 2px dashed var(--blue); outline-offset: -5px; background: #f7fbff; }
.control-label { display: block; color: var(--muted); font-size: 10px; margin-bottom: 3px; }

details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }

.team-picker { position: relative; min-width: 0; }
.team-picker > summary {
  min-height: 52px;
  padding: 8px 34px 8px 11px;
  border: 1px solid #cfd9e5;
  border-radius: 9px;
  background: #f8fbfe;
  cursor: pointer;
  position: relative;
}
.team-picker > summary::after {
  content: "⌄";
  position: absolute;
  right: 12px;
  top: 17px;
  color: var(--blue-dark);
  font-weight: 900;
}
.team-picker > summary strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--navy);
  font-size: 12px;
}
.team-picker-menu {
  position: absolute;
  z-index: 12;
  top: calc(100% + 7px);
  left: 0;
  min-width: 320px;
  width: max-content;
  max-width: 520px;
  padding: 12px;
  background: white;
  border: 1px solid #cfd9e5;
  border-radius: 10px;
  box-shadow: 0 18px 38px rgba(21, 43, 82, .18);
}
.team-selector { display: grid; gap: 7px; max-height: 220px; overflow-y: auto; }
.team-choice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  border: 1px solid #d3deea;
  border-radius: 8px;
  background: #f8fbfe;
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.team-choice input { accent-color: var(--blue); }
.team-picker-menu small { display: block; margin-top: 8px; color: var(--muted); }

.file-control {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.file-control input[type="file"] { display: none; }
.file-button { white-space: nowrap; }
.file-summary { min-width: 0; }
.file-summary strong, .file-summary small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-summary strong { color: var(--navy); font-size: 12px; }
.file-summary small { color: var(--muted); font-size: 10px; margin-top: 2px; }
.file-summary small.warning { color: var(--yellow); font-weight: 700; }

.analysis-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 10px;
  padding: 5px 9px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}
.analysis-summary span:first-child { grid-column: 1 / -1; }
.analysis-summary b { font-weight: 600; }
.analysis-summary strong { color: var(--navy); }

.action-buttons { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.action-buttons > button, .action-buttons .button-like { white-space: nowrap; }
.export-menu { position: relative; }
.export-menu > summary { display: block; }
.export-menu > summary::after { content: " ▾"; font-size: 10px; }
.export-menu-panel {
  position: absolute;
  z-index: 14;
  top: calc(100% + 7px);
  right: 0;
  width: 255px;
  padding: 9px;
  display: grid;
  gap: 7px;
  background: white;
  border: 1px solid #cfd9e5;
  border-radius: 10px;
  box-shadow: 0 18px 38px rgba(21, 43, 82, .18);
}
.export-menu-panel button { width: 100%; }
.hr-action { background: var(--burgundy-mid); }
.hr-action:hover:not(:disabled) { background: var(--burgundy); }
.secondary-hr { background: white; color: var(--burgundy); border: 1px solid #d7a5a5; }
.secondary-hr:hover:not(:disabled) { color: white; }

.notice {
  margin-top: 10px;
  border-radius: 9px;
  padding: 10px 14px;
  background: var(--red-soft);
  border: 1px solid #ffc8c8;
  color: var(--red);
  font-size: 12px;
  font-weight: 650;
}
.notice.success { background: var(--green-soft); border-color: #b9e1c8; color: var(--green); }

.panel {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 0 12px 12px 12px;
  box-shadow: var(--shadow);
}

.report-workspace { margin-top: 13px; }
.report-heading-row {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 4px 8px;
}
.report-heading-row h2 { margin: 3px 0 0; color: var(--navy); font-size: 19px; }

.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(85px, 1fr));
  gap: 7px;
}
.compact-metrics { width: min(620px, 60vw); }
.metric {
  min-height: 46px;
  padding: 7px 9px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  text-align: center;
}
.metric span { display: block; color: var(--muted); font-size: 9px; }
.metric strong { display: block; color: var(--navy); font-size: 17px; margin-top: 2px; }
.metric.danger { border-bottom: 3px solid var(--red); }
.metric.warning { border-bottom: 3px solid #f0a000; }
.metric.success { border-bottom: 3px solid var(--green); }

.report-tabs { display: flex; gap: 6px; margin: 0; }
.report-tab {
  border-radius: 9px 9px 0 0;
  background: #dfe7f0;
  color: var(--navy);
  border: 1px solid #cdd8e5;
  border-bottom: 0;
  min-width: 145px;
  padding: 9px 15px;
}
.report-tab.active { background: var(--blue); color: white; }
.report-tab.hr-tab.active { background: var(--burgundy); }
.report-tab.manager-tab.active { background: var(--manager-green); }

.results-panel, .manager-panel {
  min-height: calc(100vh - 220px);
  overflow: hidden;
  position: relative;
}
.results-toolbar {
  min-height: 66px;
  padding: 11px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}
.results-toolbar h2 { margin: 3px 0 1px; color: var(--navy); font-size: 17px; }
.results-toolbar p { margin: 0; color: var(--muted); font-size: 11px; }
.toolbar-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.toolbar-actions select, .field input, .field select, td select, td input {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 7px 8px;
}
.toggle { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.toggle input { accent-color: var(--blue); }

.report-empty {
  min-height: calc(100vh - 290px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--muted);
  text-align: center;
}
.report-empty strong { color: var(--navy); font-size: 17px; }
.report-empty span { font-size: 12px; }
.empty-icon { font-size: 42px; color: #a8bad0; }

.table-wrap {
  overflow: auto;
  height: calc(100vh - 288px);
  min-height: 480px;
}
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; }
thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 9px 8px;
  background: var(--blue);
  color: white;
  text-align: center;
  border-right: 1px solid rgba(255, 255, 255, .25);
  white-space: nowrap;
}
.hr-panel .results-toolbar { border-top: 5px solid var(--burgundy); }
.hr-panel .results-toolbar h2 { color: var(--burgundy); }
.hr-table thead th { background: var(--hr-red); }
#resultsTable:not(.hr-table) thead th.minute-header {
  background: #15375f;
  color: #fff;
  font-weight: 900;
  letter-spacing: .02em;
  box-shadow: inset 0 -3px 0 #f8696b;
}
thead th.lunch-minute-header,
#resultsTable:not(.hr-table) thead th.lunch-minute-header {
  background: #d99a00;
  color: #fff;
  font-weight: 900;
  box-shadow: inset 0 -3px 0 #ffe08a;
}
.time-details-anchor { position: relative; }
.time-details-edge-toggle {
  position: absolute;
  right: -11px;
  top: 50%;
  z-index: 4;
  width: 22px;
  height: 30px;
  padding: 0;
  transform: translateY(-50%);
  border: 2px solid #fff;
  border-radius: 12px;
  background: #15375f;
  color: #fff;
  font: 900 19px/1 Arial, sans-serif;
  cursor: pointer;
  box-shadow: 0 1px 5px rgba(15, 41, 72, .35);
}
.time-details-edge-toggle:hover, .time-details-edge-toggle:focus-visible { background: #0f2948; outline: 2px solid #ffe08a; outline-offset: 1px; }
.hr-table tbody tr:nth-child(even) td { background: #fce4e4; }
.hr-table tbody tr:hover td { background: #f7d3d3; }
tbody td {
  padding: 7px;
  border-right: 1px solid #d8e1eb;
  border-bottom: 1px solid #d8e1eb;
  text-align: center;
  white-space: nowrap;
}
tbody tr:nth-child(even) td { background: #eef3f9; }
tbody tr:hover td { background: #e5f0fa; }
td.description-cell { min-width: 250px; }
td.description-cell input { width: 100%; min-width: 235px; }
td select { min-width: 165px; }
td.work-type select { min-width: 108px; }
.team-pill {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  background: #e7eef7;
  color: var(--navy);
  font-weight: 750;
}
.status-label { font-weight: 750; }
.minute-problem { background: #f8696b !important; color: white; font-weight: 800; }
.lunch-minute-cell { color: inherit; font-weight: 800; }
.lunch-minute-cell.has-delay { background: #ffd966 !important; }
.lunch-minute-editor { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px; min-width: 145px; }
.lunch-minute-editor input { width: 64px; min-width: 44px; padding: 5px; border: 1px solid #c89300; border-radius: 6px; background: #fffdf4; text-align: center; font-weight: 800; color: #6f5200; }
.lunch-minute-editor button { min-height: 27px; padding: 3px 7px; border: 1px solid #c89300; background: #fff8dc; color: #6f5200; }
.lunch-minute-editor small, .lunch-minute-value small { display: block; flex-basis: 100%; margin-top: 2px; font-size: 9px; color: #7a5b00; white-space: nowrap; }
.lunch-minute-value { display: inline-flex; flex-direction: column; align-items: center; }
.review-pill {
  display: inline-flex;
  align-items: center;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--yellow-soft);
  color: var(--yellow);
  font-weight: 800;
  cursor: help;
}
.ok-pill { color: var(--green); font-weight: 800; }
.manual-row td:first-child { box-shadow: inset 4px 0 0 #805ad5; }
.empty-filter { padding: 30px; text-align: center; color: var(--muted); }

.manager-panel { border-radius: 0 12px 12px 12px; padding-bottom: 18px; }
.manager-heading {
  padding: 15px 18px;
  background: var(--manager-green);
  border-bottom: 1px solid var(--manager-green-dark);
}
.manager-heading .step { color: #c8e6d7; }
.manager-heading h2 { margin: 4px 0 0; color: white; font-size: 18px; }
.manager-kpis {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 9px;
  padding: 15px 18px;
}
.manager-kpis > div {
  padding: 11px;
  border: 1px solid #c7dfd2;
  border-radius: 9px;
  background: var(--manager-green-soft);
  text-align: center;
}
.manager-kpis span { display: block; color: #4f6f60; font-size: 10px; }
.manager-kpis strong { display: block; margin-top: 4px; color: var(--manager-green-dark); font-size: 21px; }
.manager-table-wrap {
  margin: 0 18px;
  overflow: auto;
  border: 1px solid #cbded4;
  border-radius: 8px;
}
.manager-table { min-width: 900px; }
.manager-table thead th { background: var(--manager-green); }
.manager-table tbody tr:nth-child(even) td { background: var(--manager-green-soft); }
.manager-table tbody tr:hover td { background: #dceee4; }
.review-section { margin-top: 17px; }
.review-section h3 {
  margin: 0 18px 9px;
  padding: 9px;
  border-radius: 8px;
  background: #f4b183;
  color: #7f4125;
  text-align: center;
  font-size: 13px;
  text-transform: uppercase;
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(15, 32, 58, .34);
  backdrop-filter: blur(1px);
}
.settings-drawer {
  position: fixed;
  z-index: 31;
  top: 0;
  right: 0;
  width: min(590px, 52vw);
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f7f9fc;
  box-shadow: -18px 0 45px rgba(15, 32, 58, .2);
  transform: translateX(102%);
  transition: transform .22s ease;
}
.settings-drawer.open { transform: translateX(0); }
.drawer-header {
  height: 72px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--navy);
  color: white;
}
.drawer-header h2 { margin: 3px 0 0; }
.drawer-header .step { color: #a9c8e8; }
.icon-button {
  width: 38px;
  height: 38px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 25px;
  line-height: 1;
}
.drawer-content { flex: 1; overflow-y: auto; padding: 13px 15px 20px; }
.settings-section {
  margin-bottom: 10px;
  border: 1px solid #dce4ed;
  border-radius: 10px;
  background: white;
  box-shadow: 0 5px 15px rgba(21, 43, 82, .04);
}
.settings-section > summary {
  padding: 12px 38px 12px 14px;
  cursor: pointer;
  position: relative;
}
.settings-section > summary::after {
  content: "⌄";
  position: absolute;
  right: 14px;
  top: 17px;
  color: var(--blue-dark);
}
.settings-section[open] > summary::after { transform: rotate(180deg); }
.settings-section > summary span { display: block; color: var(--navy); font-weight: 800; }
.settings-section > summary small { display: block; color: var(--muted); margin-top: 3px; }
.settings-section-body { padding: 0 13px 13px; }
.drawer-footer {
  padding: 11px 15px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid #d7e0e9;
  background: white;
}

.scroll-editor {
  overflow-y: scroll;
  scrollbar-gutter: stable;
  border: 1px solid #dbe4ee;
  border-radius: 9px;
  background: #f8fafc;
}
.scroll-editor::-webkit-scrollbar { width: 13px; }
.scroll-editor::-webkit-scrollbar-track { background: #e6edf5; border-radius: 10px; }
.scroll-editor::-webkit-scrollbar-thumb {
  background: #758eaa;
  border: 3px solid #e6edf5;
  border-radius: 10px;
}
.teams-editor { max-height: 215px; min-height: 98px; padding: 7px; }
.people-editor { height: 285px; padding: 7px; }
.add-fixed-button { margin-top: 9px; width: 100%; }
.team-editor-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px auto auto;
  gap: 7px;
  align-items: end;
  padding: 8px;
  border-bottom: 1px solid #e1e8f0;
  background: white;
}
.team-editor-row:last-child { border-bottom: 0; }
.active-compliance-block { display: inline-flex; flex-direction: column; gap: 2px; padding: 4px 6px; border-radius: 7px; font-weight: 750; }
.active-compliance-block small { font-size: 10px; white-space: nowrap; }
.active-compliance-block.green { color: #17643e; background: #dff5e9; }
.active-compliance-block.blue { color: #155b91; background: #dceefa; }
.active-compliance-block.orange { color: #93500a; background: #fff0d5; }
.active-compliance-block.red { color: #9e1b1b; background: #ffe0e0; }
.active-compliance-block.neutral { color: #5d6877; background: #edf0f4; }
.publication-controls { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.publication-badge { padding: 7px 11px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.publication-badge.draft { color: #8a4b08; background: #fff1d6; border: 1px solid #f3c36f; }
.publication-badge.approved { color: #17643e; background: #dff5e9; border: 1px solid #8bd0a9; }
.publication-badge.saved { color: #17643e; background: #dff5e9; border: 1px solid #8bd0a9; }
.publication-badge.local { color: #5f3b91; background: #eee4ff; border: 1px solid #b99add; }
.publication-badge.queued { color: #8a4b08; background: #fff1d6; border: 1px solid #f3c36f; }
.save-report-button { min-width: 105px; background: #237a4b; }
.save-header { width: 78px; }
.row-save-cell { display: flex; justify-content: center; align-items: center; gap: 3px; }
.save-state-button, .row-revert-button { min-height: 25px; padding: 3px 6px; border-radius: 6px; font-size: 9px; }
.save-state-button.saved { background: #e7f3ec; color: #236343; }
.save-state-button.local { background: #eee4ff; color: #65408e; }
.save-state-button.queued { background: #fff1d6; color: #8a4b08; }
.row-revert-button { background: #fff; color: #65408e; border: 1px solid #b99add; }
.revision-list { display: grid; gap: 9px; }
.revision-list article { padding: 11px; border: 1px solid #dce4ed; border-radius: 9px; background: #f8fafc; }
.revision-list article > div { display: flex; justify-content: space-between; gap: 12px; }
.revision-list article span { color: var(--muted); font-size: 11px; }
.revision-list article p { margin: 7px 0 0; font-size: 12px; }
.revision-list article p small { display: block; margin-top: 4px; color: #755400; }
.conflict-header { background: #7f1d1d; }
.conflict-summary dl { display: grid; gap: 8px; }
.conflict-summary dl div { padding: 9px; border: 1px solid #e0e5eb; border-radius: 8px; background: #f8fafc; }
.conflict-summary dt { color: var(--muted); font-size: 11px; }
.conflict-summary dd { margin: 4px 0 0; font-weight: 750; white-space: pre-wrap; }
.conflict-actions .danger { background: #a92525; }

@media (max-width: 1440px) {
  #resultsTable { font-size: 11px; }
  #resultsTable tbody td, #resultsTable thead th { padding: 6px 5px; }
  #resultsTable td.description-cell { min-width: 170px; }
  #resultsTable td.description-cell input { min-width: 155px; }
  #resultsTable td select { min-width: 118px; max-width: 150px; }
  #resultsTable td.work-type select { min-width: 92px; }
}
.archive-heading-actions, .archive-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.archive-rule-legacy { color: #9b5b00 !important; font-weight: 800; }
.archive-lab, .system-events-section { margin-top: 18px; padding: 15px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; }
.archive-lab h3, .system-events-section h3 { margin: 0 0 5px; color: var(--navy); }
.archive-lab p, .system-events-section p { margin: 0 0 12px; color: var(--muted); font-size: 12px; }
.archive-lab-result { padding: 12px; border-radius: 8px; background: white; border: 1px solid #dce4ed; line-height: 1.5; }
.system-event { display: grid; grid-template-columns: 145px 90px minmax(0, 1fr); gap: 9px; padding: 8px 0; border-bottom: 1px solid #e1e8f0; font-size: 12px; }
.system-event:last-child { border-bottom: 0; }
.system-event.warning strong { color: #9a5900; }
.system-event.error strong { color: var(--red); }
.archive-item .publication-badge { justify-self: start; }
.chart-controls { display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.chart-controls button, .chart-controls select { min-height: 34px; font-size: 11px; padding: 6px 8px; }
.chart-grid-line.vertical { opacity: .24; }
.chart-crosshair line { stroke: #172b4d; stroke-width: 1; stroke-dasharray: 4 3; pointer-events: none; }
.crosshair-label-bg { fill: rgba(23, 43, 77, .9); rx: 4; pointer-events: none; }
.chart-crosshair-label { fill: white; font-size: 10px; font-weight: 700; pointer-events: none; }
.chart-zoom-selection { fill: rgba(36, 132, 198, .15); stroke: #2484c6; stroke-width: 1; stroke-dasharray: 4 3; pointer-events: none; }
.comparison-chart svg { cursor: crosshair; touch-action: none; }
.priority-badge { display: inline-block; padding: 4px 7px; border-radius: 999px; background: #e7edf4; color: var(--muted); font-size: 10px; font-weight: 800; }
.priority-badge.high { background: #ffe1e1; color: #a61b1b; border: 1px solid #f3a4a4; }
.person-count {
  align-self: center;
  padding: 5px 7px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}
.remove-team, .remove-person {
  background: white;
  color: var(--red);
  border: 1px solid #ffc5c5;
  padding: 7px 9px;
}
.person-list-row {
  width: 100%;
  margin-bottom: 6px;
  padding: 9px 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px minmax(115px, .7fr) 62px auto;
  align-items: center;
  gap: 8px;
  border: 1px solid #dce4ed;
  border-radius: 8px;
  background: white;
  color: var(--ink);
  text-align: left;
  font-weight: 500;
}
.person-list-row:hover { background: var(--blue-soft); transform: none; }
.person-list-row strong { color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-list-row .extension { color: var(--muted); font-size: 11px; }
.person-list-row .team-name { color: var(--blue-dark); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.active-dot { color: var(--green); font-size: 10px; font-weight: 800; }
.inactive-dot { color: var(--muted); font-size: 10px; }
.person-list-row .remove-person { justify-self: end; }

.rule-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field span { font-size: 11px; font-weight: 700; color: var(--muted); }
.holiday-card { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.holiday-card p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 32, 58, .56);
}
.modal {
  width: min(900px, 92vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: white;
  border-radius: 13px;
  box-shadow: 0 25px 70px rgba(15, 32, 58, .3);
}
.holiday-modal { width: min(720px, 86vw); }
.modal-header {
  min-height: 68px;
  padding: 12px 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.modal-header h2 { margin: 3px 0 0; color: var(--navy); }
.modal-body { overflow-y: auto; padding: 17px; }
.modal-footer {
  padding: 11px 17px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--line);
  background: #f8fafc;
}
.person-form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; }
.person-form-grid .field small { margin-top: 4px; color: var(--muted); line-height: 1.35; }
.active-duration-signals { margin-top: 14px; }
.active-person { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
.active-person input { accent-color: var(--blue); }
.modal-active { align-self: end; min-height: 34px; }
.person-schedule-editor { margin-top: 18px; display: grid; gap: 11px; }
.schedule-week {
  padding: 12px;
  border: 1px solid #dce4ed;
  border-radius: 9px;
  background: #f8fafc;
}
.schedule-week > strong { display: block; margin-bottom: 9px; color: var(--navy); }
.week-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.day-select { display: flex; flex-direction: column; gap: 4px; }
.day-select label { font-size: 10px; color: var(--muted); }
.day-select select { padding: 7px; border: 1px solid #cbd5e1; border-radius: 7px; }

.year-field { width: 170px; margin-bottom: 12px; }
.holiday-list { height: 330px; padding: 8px; }
.holiday-row {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  padding: 8px;
  border-bottom: 1px solid #e1e8f0;
  background: white;
}
.holiday-row:last-child { border-bottom: 0; }
.holiday-empty { padding: 35px 12px; text-align: center; color: var(--muted); }

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 60;
  max-width: 420px;
  padding: 12px 15px;
  border-radius: 9px;
  background: var(--navy);
  color: white;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .2);
  font-weight: 650;
}
.toast.error { background: #a61b1b; }

@media (max-width: 1280px) {
  .action-bar { grid-template-columns: minmax(210px, .9fr) minmax(260px, 1.15fr) minmax(200px, .7fr) auto; }
  .analysis-summary { grid-template-columns: 1fr; }
  .analysis-summary span:first-child { grid-column: auto; }
  .compact-metrics { width: 560px; }
  .manager-kpis { grid-template-columns: repeat(3, 1fr); }
  .operation-chart-grid { grid-template-columns: 1fr; }
}
