:root {
  color-scheme: light;
  --ink: #17211d;
  --muted: #66736e;
  --line: #d9e1dd;
  --bg: #f6f7f2;
  --panel: #ffffff;
  --panel-soft: #eef5f1;
  --accent: #0f7b63;
  --accent-2: #355c9a;
  --warn: #b85c1b;
  --danger: #ae2f45;
  --ok: #287a42;
  --shadow: 0 18px 45px rgba(28, 43, 36, 0.10);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
  color: var(--ink);
  background: var(--bg);
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #15342e;
}

.login-screen.hidden {
  display: none;
}

.login-panel {
  width: min(420px, 100%);
  display: grid;
  gap: 18px;
  border-radius: 8px;
  padding: 28px;
  color: var(--ink);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.login-brand span {
  color: var(--muted);
}

button,
input,
select {
  font: inherit;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 24px;
  color: #eef8f3;
  background: #15342e;
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-weight: 800;
  background: #e0b74f;
  color: #17312b;
}

.brand span,
.topbar p,
.sidebar-footer {
  color: rgba(238, 248, 243, 0.72);
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav button {
  min-height: 44px;
  border: 0;
  border-radius: 7px;
  padding: 0 14px;
  text-align: left;
  color: rgba(238, 248, 243, 0.82);
  background: transparent;
  cursor: pointer;
}

.nav button:hover,
.nav button.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.text-button {
  border: 0;
  padding: 0;
  color: rgba(238, 248, 243, 0.72);
  background: transparent;
  cursor: pointer;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #5ad18d;
  box-shadow: 0 0 0 4px rgba(90, 209, 141, 0.16);
}

.app {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 22px;
}

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

h1 {
  margin-bottom: 6px;
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 16px;
  font-size: 19px;
}

h3 {
  margin-bottom: 6px;
  font-size: 16px;
}

.topbar p {
  color: var(--muted);
  font-size: 15px;
}

.week-control {
  display: flex;
  align-items: end;
  gap: 10px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

input,
select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 11px;
  color: var(--ink);
  background: #fff;
}

.icon-button,
.primary,
.link-button,
.ghost {
  min-height: 40px;
  border: 0;
  border-radius: 7px;
  padding: 0 14px;
  cursor: pointer;
}

.icon-button {
  width: 42px;
  font-size: 22px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
}

.primary {
  color: #fff;
  background: var(--accent);
}

.ghost {
  color: var(--accent);
  background: var(--panel-soft);
}

.link-button {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

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

.view {
  display: none;
}

.view.active {
  display: block;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric,
.band,
.timesheet-card,
.employee-card,
.alert,
.timeline-item,
.list-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metric {
  padding: 16px;
}

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

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  line-height: 1;
}

.band {
  padding: 20px;
}

.two-col,
.clock-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.1fr);
  gap: 22px;
}

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

.section-head h2 {
  margin-bottom: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  color: var(--accent-2);
  background: #e9eef8;
  font-size: 12px;
  font-weight: 800;
}

.list,
.timeline,
.employee-list {
  display: grid;
  gap: 10px;
}

.list-item,
.timeline-item,
.employee-card {
  padding: 14px;
  box-shadow: none;
}

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

.meta {
  color: var(--muted);
  font-size: 13px;
}

.flag {
  color: var(--warn);
  font-weight: 800;
}

.danger {
  color: var(--danger);
}

.ok {
  color: var(--ok);
}

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

.segment-inputs,
.work-entry-inputs {
  display: grid;
  gap: 10px;
  max-height: 460px;
  overflow: auto;
  padding-right: 4px;
}

.segment-row {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfa;
}

.segment-row strong {
  color: var(--accent-2);
  font-size: 13px;
}

.segment-row input {
  width: 100%;
}

.work-entry-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(140px, 1fr) 94px 42px;
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfa;
}

.work-entry-row textarea {
  width: 100%;
  min-height: 74px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 11px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

.work-entry-note {
  grid-column: 1 / -1;
}

.note-toolbar {
  display: block;
}

.remove-entry {
  width: 42px;
  color: var(--danger);
  background: #f8e9ec;
}

.mic-button {
  width: 42px;
  border: 1px solid var(--line);
  color: var(--accent-2);
  background: #fff;
}

.mic-button.listening {
  color: #fff;
  background: var(--danger);
}

.extra-marker {
  display: none;
  width: fit-content;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  color: #fff;
  background: var(--warn);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.extra-marker.visible {
  display: inline-flex;
}

.day-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--panel-soft);
}

.day-total span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.day-total strong {
  font-size: 22px;
}

.dropdown-manager {
  display: grid;
  gap: 12px;
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}

.checkbox-label {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 40px;
  color: var(--ink);
  text-transform: none;
}

.checkbox-label input {
  min-height: auto;
}

.span-2 {
  grid-column: span 2;
}

.timesheets {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 14px;
}

.timesheet-card {
  overflow: hidden;
}

.timesheet-top {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.timesheet-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
}

.timesheet-stats div {
  padding: 13px;
  border-right: 1px solid var(--line);
}

.timesheet-stats div:last-child {
  border-right: 0;
}

.timesheet-stats span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.timesheet-stats strong {
  font-size: 20px;
}

.day-list {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.day-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.card-actions {
  display: flex;
  gap: 8px;
  padding: 14px;
  border-top: 1px solid var(--line);
}

.card-actions button {
  flex: 1;
}

.stack-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.danger-button {
  color: var(--danger);
  background: #f8e9ec;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

.payroll-table {
  min-width: 1500px;
  table-layout: fixed;
}

.payroll-table .col-employee {
  width: 170px;
}

.payroll-table .col-small,
.payroll-table .col-money,
.payroll-table .col-status {
  width: 95px;
}

.payroll-table .col-jobs {
  width: 180px;
}

.payroll-table .col-wide {
  width: 360px;
}

.payroll-table .col-flags {
  width: 160px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
  overflow-wrap: anywhere;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.alerts {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.alert {
  padding: 12px 14px;
  color: #fff;
  background: var(--accent-2);
  box-shadow: none;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1100px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
  }

  .metrics,
  .timesheets,
  .two-col,
  .clock-layout {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .app {
    padding: 18px;
  }

  .topbar,
  .section-head,
  .week-control {
    align-items: stretch;
    flex-direction: column;
  }

  .metrics,
  .timesheets,
  .two-col,
  .clock-layout,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: span 1;
  }

  .segment-row,
  .work-entry-row,
  .inline-form {
    grid-template-columns: 1fr;
  }

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