:root {
  --blue: #0057b8;
  --ink: #172033;
  --muted: #667085;
  --line: #d9e0ea;
  --surface: #ffffff;
  --soft: #f3f6fa;
  --good: #0057b8;
  --warn: #667085;
  --bad: #172033;
  font-family: "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  color: var(--ink);
  background: #eef2f6;
}

button, input, select, textarea {
  font: inherit;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #eef2f6;
}

.login-panel {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 20px 60px rgba(23, 32, 51, .14);
}

.login-panel img {
  width: 230px;
  max-width: 100%;
  display: block;
  margin-bottom: 20px;
}

.login-options {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 12px 0;
}

h1, h2, p { margin-top: 0; }

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 11px;
  color: var(--ink);
  background: #fff;
}

.compact-select {
  width: auto;
  min-width: 120px;
}

textarea {
  min-height: 90px;
  resize: vertical;
}

input:disabled, select:disabled, textarea:disabled {
  background: #edf1f5;
  color: #8a94a6;
  cursor: not-allowed;
}

.form-error, .validation-summary {
  color: var(--bad);
  background: #fff1f0;
  border: 1px solid #ffd2cc;
  border-radius: 6px;
  padding: 10px 12px;
}

.startup-error {
  margin: 16px;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand img {
  width: 190px;
  max-width: 35vw;
}

.brand span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.topbar-actions, .entry-actions, .list-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 10px 24px 0;
  background: #fff;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.tab {
  border: 0;
  background: transparent;
  padding: 13px 16px;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  cursor: pointer;
}

.tab.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
  font-weight: 700;
}

.subtabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.subtab {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  padding: 10px 14px;
  cursor: pointer;
}

.subtab.active {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
  font-weight: 700;
}

.period-controls {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
}

.personnel-pane {
  display: none;
}

.active-personnel-pane {
  display: grid;
  gap: 18px;
}

main {
  padding: 24px;
}

.view { display: none; }
.active-view { display: block; }

.dashboard-title {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 22px;
}

.dashboard-title h1 {
  margin-bottom: 6px;
}

.dashboard-title p {
  color: var(--muted);
  margin-bottom: 0;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.global-search-panel {
  margin-bottom: 18px;
}

.global-results {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.search-result {
  display: grid;
  gap: 3px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 10px 12px;
  color: var(--ink);
  cursor: pointer;
}

.search-result span {
  color: var(--muted);
  font-size: 13px;
}

.metric-card, .panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.metric-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  font-size: clamp(18px, 1.55vw, 24px);
  line-height: 1.12;
  margin-top: 6px;
  white-space: nowrap;
  letter-spacing: 0;
}

.metric-card em {
  display: block;
  color: #8a94a6;
  font-size: 12px;
  font-style: normal;
  margin-top: 6px;
}

.two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.wide-panel {
  min-height: 360px;
}

.full-panel {
  grid-column: 1 / -1;
}

.donut-layout {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 24px;
  align-items: center;
}

.donut-chart {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  position: relative;
  background: conic-gradient(var(--line) 0 100%);
}

.donut-chart::after {
  content: "";
  position: absolute;
  inset: 42px;
  border-radius: 50%;
  background: #fff;
}

.compact-list {
  display: grid;
  gap: 10px;
}

.compact-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.compact-row span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.compact-row i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.monthly-chart {
  min-height: 300px;
}

.monthly-bars {
  position: relative;
  height: 260px;
  display: grid;
  grid-template-columns: repeat(12, minmax(34px, 1fr));
  gap: 12px;
  align-items: end;
  padding: 18px 4px 0;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(to top, transparent 24%, rgba(217, 224, 234, .45) 25%, transparent 26%),
    linear-gradient(to top, transparent 49%, rgba(217, 224, 234, .45) 50%, transparent 51%),
    linear-gradient(to top, transparent 74%, rgba(217, 224, 234, .45) 75%, transparent 76%);
}

.month-group {
  position: relative;
  z-index: 1;
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 8px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.month-bars {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: end;
  gap: 4px;
}

.month-bar {
  width: 38%;
  min-height: 0;
  border-radius: 5px 5px 0 0;
  background: var(--blue);
  opacity: .9;
}

.month-bar.hours {
  background: var(--blue);
}

.month-bar.target {
  background: #9aa8ba;
}

.month-target {
  position: absolute;
  left: 12%;
  right: 12%;
  height: 3px;
  background: #9aa8ba;
  border-radius: 999px;
  box-shadow: 0 0 0 3px rgba(154, 168, 186, .15);
}

.chart-legend {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin-top: 14px;
  color: var(--muted);
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend-box {
  width: 24px;
  height: 10px;
  border-radius: 2px;
  background: var(--blue);
}

.legend-box.hours {
  background: var(--blue);
}

.legend-box.target {
  background: #9aa8ba;
}

.legend-line {
  width: 26px;
  height: 3px;
  border-radius: 999px;
  background: #9aa8ba;
}

.legend-dashed {
  width: 30px;
  height: 0;
  border-top: 3px dashed var(--blue);
}

.cumulative-line {
  position: absolute;
  inset: 18px 4px 24px;
  width: calc(100% - 8px);
  height: calc(100% - 42px);
  z-index: 2;
  pointer-events: none;
  overflow: visible;
}

.cumulative-line polyline {
  fill: none;
  stroke: var(--blue);
  stroke-width: 1.4;
  stroke-dasharray: 4 3;
  vector-effect: non-scaling-stroke;
}

.cumulative-line circle {
  fill: #fff;
  stroke: var(--blue);
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
}

.funnel-list, .rank-list, .risk-list {
  display: grid;
  gap: 12px;
}

.funnel-row {
  display: grid;
  gap: 7px;
}

.funnel-row div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.funnel-row span {
  color: var(--muted);
}

.funnel-track {
  height: 16px;
  background: #e6ebf2;
  border-radius: 999px;
  overflow: hidden;
}

.funnel-track span {
  display: block;
  height: 100%;
  background: var(--blue);
}

.rank-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.1fr) minmax(120px, 2fr) auto;
  gap: 12px;
  align-items: center;
}

.rank-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-row strong {
  white-space: nowrap;
}

.risk-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--warn);
  border-radius: 6px;
}

.risk-row.bad {
  border-left-color: var(--bad);
}

.risk-row span {
  font-weight: 700;
}

.risk-row em {
  grid-column: 1 / -1;
  color: var(--muted);
  font-style: normal;
}

.dashboard-table table {
  min-width: 1000px;
}

.compact-table table {
  min-width: 760px;
}

.compact-table th,
.compact-table td {
  padding: 9px 10px;
  font-size: 13px;
}

.rejected-summary {
  margin-bottom: 12px;
}

.empty-state {
  color: var(--muted);
  display: inline-block;
  padding: 8px 0;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(150px, 220px) 1fr auto;
  gap: 12px;
  align-items: center;
  margin: 12px 0;
}

.bar-track {
  height: 12px;
  background: #e6ebf2;
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--blue);
}

.entry-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  margin-bottom: 16px;
}

.form-grid {
  display: grid;
  gap: 16px;
}

.form-section {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.form-section.locked {
  opacity: .74;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.wide-field { grid-column: span 2; }
.full-field { grid-column: 1 / -1; }

.primary-button, .ghost-button, .icon-button {
  min-height: 38px;
  border-radius: 6px;
  border: 1px solid var(--line);
  padding: 8px 12px;
  cursor: pointer;
}

.danger-button {
  min-height: 38px;
  border-radius: 6px;
  border: 1px solid #172033;
  padding: 8px 12px;
  cursor: pointer;
  background: #172033;
  color: #fff;
  font-weight: 700;
}

.primary-button {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  font-weight: 700;
}

.ghost-button, .icon-button {
  background: #fff;
  color: var(--ink);
}

.icon-button {
  width: 40px;
  padding: 0;
}

.session-badge, .status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 10px;
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.status-pill.done { background: #e8eef7; color: var(--good); }
.status-pill.warn { background: #f1f3f6; color: var(--warn); }
.status-pill.bad { background: #e5e7eb; color: var(--bad); }

.traffic-light {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.traffic-light i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.traffic-light.good { background: #eef7f0; color: #166534; }
.traffic-light.good i { background: #22c55e; }
.traffic-light.warn { background: #fff7db; color: #8a5a00; }
.traffic-light.warn i { background: #f2b705; }
.traffic-light.bad { background: #fde8e8; color: #991b1b; }
.traffic-light.bad i { background: #dc2626; }

.forecast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.forecast-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--soft);
}

.forecast-card span,
.forecast-card em {
  color: var(--muted);
  display: block;
  font-style: normal;
  font-size: 12px;
}

.forecast-card strong {
  display: block;
  font-size: 20px;
  margin: 5px 0;
}

.report-actions {
  justify-content: flex-end;
  margin: 0 0 14px;
}

.delete-area {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}

.confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: rgba(23, 32, 51, .35);
  padding: 18px;
}

.confirm-box {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  box-shadow: 0 20px 60px rgba(23, 32, 51, .22);
}

.masterdata-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
  margin-top: 18px;
}

.list-toolbar {
  margin-bottom: 14px;
}

.list-toolbar input {
  max-width: 420px;
}

.table-wrap {
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

.table-input {
  min-width: 150px;
  padding: 8px 9px;
}

.table-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.absence-calendar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.year-calendar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.year-month {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.year-month h3 {
  margin: 0 0 10px;
}

.year-month-items {
  display: grid;
  gap: 6px;
}

.absence-item {
  display: grid;
  gap: 4px;
  border-left: 5px solid var(--blue);
  border-radius: 6px;
  background: #f7f9fc;
  padding: 12px;
}

.absence-item span {
  color: var(--muted);
  font-size: 13px;
}

.absence-badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
}

.absence-sick { border-color: #334155; background: #e8edf4; color: #111827; }
.absence-vacation { border-color: #0057b8; background: #e8f1fb; color: #0057b8; }
.absence-training { border-color: #64748b; background: #eef2f6; color: #334155; }
.absence-other { border-color: #9aa8ba; background: #f3f6fa; color: #334155; }

.hours-grid-table {
  min-width: 2200px;
}

.hours-grid-table th,
.hours-grid-table td {
  padding: 7px;
  vertical-align: middle;
}

.day-input {
  width: 58px;
  padding: 7px 6px;
  text-align: right;
}

.hours-master {
  min-width: 150px;
  width: 100%;
}

.hours-grid-table th:nth-child(1),
.hours-grid-table td:nth-child(1),
.hours-grid-table th:nth-child(2),
.hours-grid-table td:nth-child(2) {
  min-width: 150px;
}

.hours-grid-table th:nth-child(3),
.hours-grid-table td:nth-child(3) {
  min-width: 210px;
}

.hours-grid-table th:nth-child(4),
.hours-grid-table td:nth-child(4) {
  min-width: 180px;
}

.sticky-col {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #f7f9fc;
}

.sticky-col.second {
  left: 140px;
}

.small-button {
  padding: 8px 10px;
  font-size: 13px;
}

th, td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: #f7f9fc;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.sort-header {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  letter-spacing: inherit;
  padding: 0;
  text-align: left;
  text-transform: inherit;
}

.sort-header::after {
  content: "↕";
  display: inline-block;
  font-size: 11px;
  margin-left: 6px;
  opacity: .45;
}

.sort-header.active-sort::after {
  content: "↑";
  opacity: .95;
}

.sort-header.active-sort[data-sort-dir="desc"]::after {
  content: "↓";
}

.settings-panel {
  max-width: 760px;
}

.small-note {
  color: var(--muted);
  font-size: 13px;
  margin-top: 14px;
}

@media (max-width: 900px) {
  .topbar, .entry-header, .two-column, .dashboard-title {
    display: block;
  }

  .topbar-actions {
    margin-top: 12px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .wide-panel, .full-panel {
    grid-column: auto;
  }

  .donut-layout {
    grid-template-columns: 1fr;
  }

  .monthly-bars {
    overflow-x: auto;
    grid-template-columns: repeat(12, minmax(44px, 1fr));
  }

  .field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  main, .topbar {
    padding: 16px;
  }

  .brand {
    display: block;
  }

  .brand img {
    width: 150px;
    max-width: 100%;
    margin-bottom: 10px;
  }

  .tabs {
    padding-left: 12px;
    padding-right: 12px;
  }

  .tab {
    padding: 11px 10px;
    white-space: nowrap;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .wide-field {
    grid-column: auto;
  }

  .bar-row {
    grid-template-columns: 1fr;
  }

  .rank-row {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .masterdata-form {
    grid-template-columns: 1fr;
  }
}

.dark-theme {
  --blue: #6aa8ff;
  --ink: #f5f7fb;
  --muted: #aab4c4;
  --line: #2a3444;
  --surface: #111827;
  --soft: #0f1623;
  --good: #6aa8ff;
  --warn: #c3cad6;
  --bad: #f5f7fb;
  background: #0b1120;
  color: var(--ink);
}

.dark-theme .login-view,
.dark-theme body {
  background: #0b1120;
}

.dark-theme .login-panel,
.dark-theme .topbar,
.dark-theme .tabs,
.dark-theme .subtab,
.dark-theme .metric-card,
.dark-theme .panel,
.dark-theme .form-section,
.dark-theme .table-wrap,
.dark-theme .search-result,
.dark-theme .confirm-box {
  background: var(--surface);
  border-color: var(--line);
}

.dark-theme input,
.dark-theme select,
.dark-theme textarea {
  color: var(--ink);
  background: #111c2d;
  border-color: #526178;
}

.dark-theme input::placeholder,
.dark-theme textarea::placeholder {
  color: #91a0b7;
}

.dark-theme input:focus,
.dark-theme select:focus,
.dark-theme textarea:focus {
  outline: 2px solid rgba(106, 168, 255, .55);
  border-color: #8fc4ff;
  background: #152238;
}

.dark-theme input:disabled,
.dark-theme select:disabled,
.dark-theme textarea:disabled {
  background: #223047;
  color: #c3ccda;
  border-color: #40506a;
  opacity: 1;
}

.dark-theme th,
.dark-theme td {
  border-color: var(--line);
}

.dark-theme th,
.dark-theme .absence-item {
  background: #151e2d;
}

.dark-theme .year-month,
.dark-theme .sticky-col {
  background: #151e2d;
}

.dark-theme .subtab.active {
  background: var(--blue);
  color: #06101f;
}

.dark-theme .form-section.locked {
  opacity: 1;
  background: #101827;
  border-color: #35445a;
}

.dark-theme .form-section.locked .section-title h2,
.dark-theme .form-section.locked label {
  color: #cfd8e6;
}

.dark-theme .section-title {
  border-bottom: 1px solid #253247;
  padding-bottom: 10px;
}

.dark-theme .donut-chart::after {
  background: var(--surface);
}

.dark-theme .bar-track,
.dark-theme .funnel-track {
  background: #263244;
}

.dark-theme .status-pill.done {
  background: #12365f;
  color: #d7ebff;
  border: 1px solid #4e91d6;
}

.dark-theme .status-pill.warn {
  background: #2d3545;
  color: #f3f6fb;
  border: 1px solid #7f8da3;
}

.dark-theme .status-pill.bad {
  background: #303744;
  color: #fff;
  border: 1px solid #9aa8ba;
}

.dark-theme .traffic-light.good {
  background: #11331f;
  color: #bbf7d0;
  border: 1px solid #2f8f55;
}

.dark-theme .traffic-light.warn {
  background: #332b12;
  color: #fde68a;
  border: 1px solid #8a6a10;
}

.dark-theme .traffic-light.bad {
  background: #3a1b1b;
  color: #fecaca;
  border: 1px solid #8f3333;
}

.dark-theme .forecast-card {
  background: #101827;
  border-color: #2a3444;
}

.dark-theme .form-error,
.dark-theme .validation-summary {
  background: #2a1820;
  border-color: #5c2a33;
  color: #ffd6dc;
}

.dark-theme main,
.dark-theme .app-shell {
  background: #0b1120;
}

.dark-theme label,
.dark-theme h1,
.dark-theme h2,
.dark-theme h3,
.dark-theme strong,
.dark-theme td,
.dark-theme .tab.active,
.dark-theme .metric-card strong,
.dark-theme .rank-row strong,
.dark-theme .compact-row strong {
  color: var(--ink);
}

.dark-theme .tab,
.dark-theme .subtab,
.dark-theme .dashboard-title p,
.dark-theme .metric-card span,
.dark-theme .metric-card em,
.dark-theme .brand span,
.dark-theme .small-note,
.dark-theme .search-result span,
.dark-theme .absence-item span {
  color: var(--muted);
}

.dark-theme .tab.active {
  border-bottom-color: var(--blue);
}

.dark-theme th {
  color: #d7deea;
  background: #1a2433;
}

.dark-theme tr:hover td {
  background: rgba(106, 168, 255, .06);
}

.dark-theme .year-month,
.dark-theme .absence-item,
.dark-theme .sticky-col,
.dark-theme .sticky-col.second,
.dark-theme .search-result,
.dark-theme .subtab {
  background: #101827;
  border-color: #2a3444;
}

.dark-theme .primary-button {
  background: #6aa8ff;
  color: #06101f;
}

.dark-theme .ghost-button {
  background: #101827;
  color: #e7edf7;
  border-color: #35445a;
}

.dark-theme .ghost-button:hover,
.dark-theme .search-result:hover,
.dark-theme .subtab:hover {
  background: #162236;
}

.dark-theme .danger-button {
  background: #3b4452;
  color: #fff;
}

.dark-theme .absence-badge {
  border: 1px solid transparent;
}

.dark-theme .absence-sick {
  border-color: #94a3b8;
  background: #1f2937;
  color: #f8fafc;
}

.dark-theme .absence-vacation {
  border-color: #6aa8ff;
  background: #0f2744;
  color: #b9dcff;
}

.dark-theme .absence-training {
  border-color: #8aa0b8;
  background: #172236;
  color: #d7deea;
}

.dark-theme .absence-other {
  border-color: #64748b;
  background: #202a38;
  color: #e7edf7;
}

.dark-theme a {
  color: #9dccff;
}

@media print {
  body {
    background: #fff;
  }

  .topbar, .tabs, #startupError, .ghost-button, .primary-button, .danger-button {
    display: none !important;
  }

  main {
    padding: 0;
  }

  .view {
    display: none !important;
  }

  #dashboard {
    display: block !important;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .panel, .metric-card {
    break-inside: avoid;
    box-shadow: none;
  }

  @page {
    size: A4;
    margin: 10mm;
  }
}

@media print {
  body.print-hours {
    background: #fff !important;
    color: #000 !important;
    zoom: 1;
  }

  body.print-hours .topbar,
  body.print-hours .tabs,
  body.print-hours main > .view:not(#personnel),
  body.print-hours #personnel > .entry-header,
  body.print-hours #personnel > .subtabs,
  body.print-hours #personnel-certificates,
  body.print-hours #personnel-absence,
  body.print-hours #personnel-hours > .panel:first-child,
  body.print-hours .ghost-button,
  body.print-hours .primary-button,
  body.print-hours .danger-button {
    display: none !important;
  }

  body.print-hours #personnel,
  body.print-hours #personnel-hours,
  body.print-hours #hoursPrintArea {
    display: block !important;
  }

  body.print-hours main {
    padding: 0;
  }

  body.print-hours #hoursPrintArea {
    border: 0;
    padding: 0;
    box-shadow: none;
  }

  body.print-hours .table-wrap {
    overflow: visible;
    border: 0;
  }

  body.print-hours .hours-grid-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    font-size: 5.5px;
    line-height: 1.05;
  }

  body.print-hours .hours-grid-table th,
  body.print-hours .hours-grid-table td {
    padding: 1px;
    overflow: hidden;
    text-overflow: clip;
    white-space: normal;
    word-break: break-word;
  }

  body.print-hours .table-input,
  body.print-hours .day-input {
    border: 0;
    padding: 0;
    width: 100%;
    min-width: 0;
    font-size: 5.5px;
    line-height: 1.05;
    background: transparent;
    color: #000;
  }

  body.print-hours .hours-grid-table th:last-child,
  body.print-hours .hours-grid-table td:last-child {
    display: none;
  }

  body.print-hours .sticky-col,
  body.print-hours .sticky-col.second {
    position: static;
    left: auto;
  }

}
