:root {
  color-scheme: light;
  --ink: #14211d;
  --muted: #64716c;
  --line: #d8dfda;
  --paper: #f6f7f3;
  --panel: #ffffff;
  --green: #1d5b4c;
  --green-2: #2f8a63;
  --teal: #2c7886;
  --gold: #c28b2c;
  --red: #b64b4b;
  --blue: #315f9d;
  --shadow: 0 18px 48px rgba(25, 39, 34, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.is-locked {
  overflow: hidden;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.login-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
  background: #173b34;
}

.login-gate.is-hidden {
  display: none;
}

.login-card {
  width: min(420px, 100%);
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
}

.login-brand {
  align-items: flex-start;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
  color: var(--ink);
}

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

.login-card h1 {
  margin-bottom: 22px;
  font-size: 2.6rem;
}

.login-card label {
  display: block;
  margin: 14px 0 8px;
  color: var(--muted);
  font-weight: 800;
}

.login-card input {
  width: 100%;
  min-height: 54px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0;
}

.login-card .primary-action {
  width: 100%;
  margin-top: 12px;
}

.login-legal-links,
.sidebar-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.login-legal-links {
  justify-content: center;
  margin-top: 18px;
}

.login-legal-links a,
.sidebar-legal-links a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.sidebar-legal-links {
  margin-top: 14px;
}

.sidebar-legal-links a {
  color: rgba(247, 251, 247, 0.72);
}

.login-error {
  min-height: 22px;
  margin: 10px 0 0;
  color: var(--red);
  font-weight: 800;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 180ms ease;
}

.app-shell.is-sidebar-collapsed {
  grid-template-columns: 86px minmax(0, 1fr);
}

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

.sidebar-toggle {
  position: absolute;
  top: 16px;
  right: -16px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 32px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: #f2c46f;
  color: #16372f;
  font-size: 1.5rem;
  font-weight: 900;
  box-shadow: var(--shadow);
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: #f2c46f;
  color: #16372f;
  font-weight: 800;
}

.brand-logo {
  display: block;
  object-fit: contain;
  padding: 0;
}

.brand-logo-wide {
  display: block;
  width: 300px;
  max-width: 100%;
  height: auto;
  max-height: 118px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  object-fit: contain;
}

.sidebar > .brand {
  align-items: flex-start;
  flex-direction: column;
  gap: 10px;
}

.sidebar-logo {
  width: 238px;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.22));
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  margin-top: 2px;
  color: rgba(247, 251, 247, 0.7);
  font-size: 0.86rem;
}

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

.beta-nav {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.beta-nav-items {
  display: grid;
  gap: 8px;
}

.beta-nav-items[hidden] {
  display: none;
}

.beta-nav-items .nav-item {
  padding-left: 28px;
}

.beta-nav-toggle[aria-expanded="true"] {
  background: rgba(242, 196, 111, 0.16);
  color: #ffffff;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(247, 251, 247, 0.78);
  text-align: left;
  transition: background 160ms ease, color 160ms ease;
}

.nav-item span {
  display: grid;
  place-items: center;
  width: 24px;
  color: #f2c46f;
}

.nav-item.is-active,
.nav-item:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.sidebar-card {
  margin-top: auto;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-card p {
  margin: 8px 0 0;
  color: rgba(247, 251, 247, 0.72);
  line-height: 1.5;
}

.app-shell.is-sidebar-collapsed .sidebar {
  padding: 18px 12px;
}

.app-shell.is-sidebar-collapsed .sidebar-logo {
  width: 58px;
  filter: none;
}

.app-shell.is-sidebar-collapsed .brand div,
.app-shell.is-sidebar-collapsed .nav-item:not(.is-active)::after,
.app-shell.is-sidebar-collapsed .nav-item,
.app-shell.is-sidebar-collapsed .beta-nav,
.app-shell.is-sidebar-collapsed .sidebar-card {
  font-size: 0;
}

.app-shell.is-sidebar-collapsed .sidebar-card {
  display: none;
}

.app-shell.is-sidebar-collapsed .sidebar > .brand {
  align-items: center;
}

.app-shell.is-sidebar-collapsed .nav-item {
  justify-content: center;
  padding: 10px;
}

.app-shell.is-sidebar-collapsed .nav-item span {
  width: 100%;
  font-size: 1.05rem;
}

.app-shell.is-sidebar-collapsed .beta-nav {
  margin-top: 8px;
  padding-top: 8px;
}

.app-shell.is-sidebar-collapsed .beta-nav-items .nav-item {
  padding-left: 10px;
}

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

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

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

h1 {
  max-width: 860px;
  margin-bottom: 0;
  font-size: 2.55rem;
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.25rem;
}

h3 {
  margin-bottom: 8px;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--green-2);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.icon-button,
.primary-action,
.secondary-action {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  font-size: 1.1rem;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  font-weight: 800;
}

.primary-action {
  border-color: var(--green);
  background: var(--green);
  color: #ffffff;
}

.secondary-action {
  background: #f9faf8;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.view {
  display: none;
}

.view.is-visible {
  display: block;
}

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

.dashboard-priority {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-action-panel {
  border-top: 5px solid var(--green);
}

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

.dashboard-info-block {
  display: grid;
  gap: 12px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid #edf0ec;
}

.dashboard-info-block h3 {
  margin: 0;
  font-size: 1.45rem;
}

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

.dashboard-message-row {
  display: grid;
  gap: 4px;
  min-height: 72px;
  padding: 12px;
  border: 1px solid #edf0ec;
  border-left: 5px solid var(--teal);
  border-radius: 8px;
  background: #fbfcfa;
}

.dashboard-message-row span,
.dashboard-message-row small {
  color: var(--muted);
}

.compact-empty {
  min-height: 72px;
}

.admin-access-panel {
  border-color: #edf0ec;
  background: #fbfcfa;
}

.muted-copy {
  margin: 0 0 16px;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.5;
}

.subtle-admin-button {
  color: var(--muted);
}

.quick-card {
  display: grid;
  gap: 8px;
  min-height: 134px;
  padding: 16px;
  border: 1px solid #edf0ec;
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--ink);
  text-align: left;
}

.quick-card:hover {
  border-color: #cfe3d7;
}

.quick-card.is-warning {
  border-left: 5px solid var(--gold);
}

.quick-card span,
.quick-card small {
  color: var(--muted);
}

.quick-card span {
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.quick-card strong {
  font-size: 2rem;
}

.compact-company-facts {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.compact-company-facts .company-fact {
  grid-template-columns: 1fr;
  align-items: start;
}

.compact-company-facts .company-fact em {
  justify-self: start;
}

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

.summary-list article {
  display: grid;
  grid-template-columns: 220px 100px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  min-height: 64px;
  padding: 12px;
  border: 1px solid #edf0ec;
  border-radius: 8px;
  background: #fbfcfa;
}

.summary-list span,
.summary-list small {
  color: var(--muted);
}

.summary-list strong {
  font-size: 1.5rem;
}

.metric,
.panel,
.device-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metric {
  min-height: 138px;
  padding: 18px;
}

.metric span,
.metric small {
  display: block;
  color: var(--muted);
}

.metric strong {
  display: block;
  margin: 10px 0 4px;
  font-size: 2.35rem;
  letter-spacing: 0;
}

.metric-attendance {
  border-top: 5px solid var(--green-2);
}

.metric-hours {
  border-top: 5px solid var(--teal);
}

.metric-alert {
  border-top: 5px solid var(--gold);
}

.metric-payroll {
  border-top: 5px solid var(--blue);
}

.content-grid,
.reports-layout,
.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.85fr);
  gap: 18px;
}

.settings-grid,
.employee-layout,
.stacked-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.panel {
  padding: 20px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

select,
input {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
}

.shift-list,
.log-list,
.team-grid,
.team-list,
.location-stack,
.employee-list,
.vacation-summary,
.vacation-list,
.report-list,
.integration-list {
  display: grid;
  gap: 10px;
}

.location-stack {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.shift-row,
.log-row,
.team-card,
.location-row,
.company-fact,
.empty-state,
.employee-row,
.vacation-card,
.vacation-row,
.report-list div,
.integration-list article {
  display: grid;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 12px;
  border: 1px solid #edf0ec;
  border-radius: 8px;
  background: #fbfcfa;
}

.empty-state span {
  color: var(--muted);
}

.shift-row {
  grid-template-columns: 44px minmax(0, 1fr) auto auto;
}

.avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #e1f0e8;
  color: var(--green);
  font-weight: 800;
}

.person strong,
.person span {
  display: block;
}

.person span,
.shift-time,
.status-pill,
.log-row span,
.team-card p,
.device-card p {
  color: var(--muted);
}

.status-pill {
  min-width: 96px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #edf5ef;
  color: var(--green);
  font-size: 0.83rem;
  font-weight: 800;
  text-align: center;
}

.status-pill.warn {
  background: #fff5de;
  color: #8a5b0c;
}

.location-row {
  grid-template-columns: minmax(0, 1fr) minmax(120px, 1.4fr) 48px;
}

.company-fact {
  grid-template-columns: 170px minmax(0, 1fr) minmax(150px, auto);
  min-height: 82px;
  padding: 16px 18px;
}

.company-fact span,
.company-fact em {
  color: var(--muted);
}

.company-fact span {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.company-fact strong {
  overflow-wrap: anywhere;
  font-size: 1.06rem;
}

.company-fact em {
  justify-self: end;
  padding: 7px 10px;
  border-radius: 999px;
  background: #edf5ef;
  color: var(--green);
  font-style: normal;
  font-size: 0.8rem;
  font-weight: 800;
  text-align: right;
}

.company-fact.is-secure {
  background: #f7faf8;
}

.company-fact.is-secure em {
  background: #eef5f7;
  color: var(--teal);
}

.progress {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: #e9eee9;
}

.progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green-2), var(--teal));
}

.log-row {
  grid-template-columns: 92px minmax(0, 1fr) auto;
}

.employee-form {
  display: grid;
  gap: 10px;
}

.employee-form label {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  min-height: 58px;
  padding: 12px;
  border: 1px solid #edf0ec;
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--muted);
  font-weight: 800;
}

.employee-form input,
.employee-form select,
.setting-list input,
.setting-list select {
  width: 100%;
  min-width: 0;
}

.setting-hint {
  padding: 14px;
  border: 1px solid #edf0ec;
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--muted);
  font-weight: 800;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 8px;
}

.employee-row {
  grid-template-columns: 44px minmax(180px, 1fr) minmax(220px, 1.2fr) 92px auto;
}

.employee-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.danger-action {
  min-height: 42px;
  border: 1px solid #f1d4d4;
  border-radius: 8px;
  background: #fff4f4;
  color: var(--red);
  font-weight: 900;
  padding: 0 14px;
}

.danger-action:hover {
  background: #fbe9e9;
}

.vacation-card {
  grid-template-columns: 44px minmax(180px, 1.4fr) repeat(5, minmax(110px, 1fr));
}

.vacation-card div:not(:first-child) span,
.vacation-row span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.vacation-card div:not(:first-child) strong,
.vacation-row strong {
  display: block;
  margin-top: 3px;
}

.vacation-row {
  grid-template-columns: minmax(220px, 1.3fr) minmax(220px, 1fr) 90px 110px auto;
}

.vacation-row em {
  justify-self: start;
  padding: 7px 10px;
  border-radius: 999px;
  background: #fff5de;
  color: #8a5b0c;
  font-style: normal;
  font-weight: 900;
}

.vacation-row em.is-approved {
  background: #edf5ef;
  color: var(--green);
}

.vacation-row em.is-rejected {
  background: #fff0ef;
  color: var(--red);
}

.calendar-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.calendar-controls strong {
  min-width: 160px;
  text-align: center;
  text-transform: capitalize;
}

.vacation-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.calendar-weekday {
  padding: 8px 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.calendar-day {
  min-height: 128px;
  padding: 10px;
  border: 1px solid #edf0ec;
  border-radius: 8px;
  background: #fbfcfa;
}

.calendar-day.is-empty {
  background: transparent;
  border-color: transparent;
}

.calendar-day.has-entry {
  background: #f7faf8;
  border-color: #d7eadf;
}

.calendar-day > strong {
  display: block;
  margin-bottom: 8px;
}

.calendar-chip,
.calendar-more {
  display: block;
  margin-top: 5px;
  padding: 5px 7px;
  border-radius: 8px;
  background: #edf5ef;
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1.2;
}

.calendar-chip.is-sick {
  background: #fff0ef;
  color: var(--red);
}

.calendar-chip.is-special {
  background: #eef5f7;
  color: var(--teal);
}

.calendar-more {
  background: #fff5de;
  color: #8a5b0c;
}

.employee-row strong,
.employee-row span,
.employee-row small {
  display: block;
}

.employee-row span,
.employee-row small {
  color: var(--muted);
}

.employee-row em {
  color: var(--green);
  font-style: normal;
  font-weight: 800;
}

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

.team-card {
  grid-template-columns: 160px 110px minmax(0, 1fr) minmax(180px, 0.8fr);
  min-height: 72px;
}

.team-card strong {
  font-size: 1.4rem;
}

.team-card .progress {
  width: 100%;
}

.report-list div,
.integration-list article {
  grid-template-columns: 180px minmax(0, 1fr) 120px;
}

.report-list span,
.report-list em,
.integration-list span,
.integration-list em {
  color: var(--muted);
}

.report-list em,
.integration-list em {
  font-style: normal;
  font-weight: 800;
}

.chart {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 12px;
  height: 280px;
  padding-top: 20px;
}

.chart div {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 36px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, var(--teal), var(--green));
}

.chart span {
  padding-bottom: 10px;
  color: #ffffff;
  font-weight: 800;
}

.report-board {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.7fr);
  gap: 18px;
  align-items: stretch;
}

.report-summary {
  display: grid;
  gap: 10px;
}

.time-check-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.report-summary article,
.time-check-summary article {
  display: grid;
  align-content: center;
  min-height: 86px;
  padding: 14px;
  border: 1px solid #edf0ec;
  border-radius: 8px;
  background: #fbfcfa;
}

.report-summary span,
.report-summary small,
.time-check-summary span,
.time-check-summary small {
  color: var(--muted);
}

.report-summary strong,
.time-check-summary strong {
  margin: 6px 0 2px;
  font-size: 1.6rem;
}

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

.message-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.time-check-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 1.4fr) 110px auto;
  gap: 12px;
  align-items: center;
  min-height: 76px;
  padding: 14px;
  border: 1px solid #edf0ec;
  border-left: 5px solid var(--gold);
  border-radius: 8px;
  background: #fbfcfa;
}

.time-check-row.is-error {
  border-left-color: var(--red);
  background: #fffafa;
}

.time-check-row span,
.time-check-row p {
  color: var(--muted);
}

.time-check-row p {
  margin: 0;
}

.time-check-row em {
  justify-self: start;
  padding: 7px 10px;
  border-radius: 999px;
  background: #fff5de;
  color: #8a5b0c;
  font-style: normal;
  font-weight: 900;
}

.time-check-row.is-error em {
  background: #fff0ef;
  color: var(--red);
}

.employee-work-overview {
  display: grid;
  gap: 12px;
}

.employee-work-row {
  display: grid;
  gap: 0;
  padding: 0;
  border: 1px solid #edf0ec;
  border-left: 6px solid var(--green);
  border-radius: 8px;
  background: #fbfcfa;
  overflow: hidden;
}

.employee-work-row.is-warning {
  border-left-color: var(--gold);
}

.employee-work-row.is-error {
  border-left-color: var(--red);
  background: #fffafa;
}

.employee-work-summary {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(110px, 0.35fr) minmax(90px, 0.25fr) minmax(260px, 0.9fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 78px;
  padding: 13px 16px;
  cursor: pointer;
  list-style: none;
}

.employee-work-summary::-webkit-details-marker {
  display: none;
}

.employee-work-summary::after {
  content: "Details";
  justify-self: end;
  color: var(--teal);
  font-size: 0.88rem;
  font-weight: 900;
}

.employee-work-row[open] .employee-work-summary::after {
  content: "Schließen";
}

.employee-work-person {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.employee-work-person > div:last-of-type,
.employee-work-mini {
  display: grid;
  gap: 3px;
}

.employee-work-person span,
.employee-work-mini span,
.employee-work-values span,
.employee-work-details span,
.employee-work-details small,
.employee-event-list span,
.employee-event-list em {
  color: var(--muted);
}

.employee-work-summary > em {
  justify-self: end;
  padding: 7px 11px;
  border-radius: 999px;
  background: #edf5ef;
  color: var(--green);
  font-style: normal;
  font-weight: 900;
}

.employee-work-mini strong {
  overflow-wrap: anywhere;
}

.employee-work-row.is-warning .employee-work-summary > em {
  background: #fff4df;
  color: #8a5b0c;
}

.employee-work-row.is-error .employee-work-summary > em {
  background: #fbe9e9;
  color: var(--red);
}

.employee-work-expanded {
  display: grid;
  gap: 12px;
  padding: 0 16px 16px;
  border-top: 1px solid #edf0ec;
}

.employee-work-values {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.employee-work-values div {
  display: grid;
  gap: 4px;
  min-height: 68px;
  padding: 12px;
  border: 1px solid #edf0ec;
  border-radius: 8px;
  background: #ffffff;
}

.employee-work-values strong {
  font-size: 1.2rem;
}

.employee-work-details {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.employee-work-details > div {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid #edf0ec;
  border-radius: 8px;
  background: #ffffff;
}

.employee-event-list {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.employee-event-list li {
  display: grid;
  grid-template-columns: minmax(170px, 0.9fr) minmax(120px, 0.7fr) minmax(110px, auto);
  gap: 10px;
  align-items: center;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid #edf0ec;
  border-radius: 8px;
  background: #ffffff;
}

.employee-event-list em {
  font-style: normal;
  text-align: right;
}

.message-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 110px 130px auto;
  gap: 12px;
  align-items: center;
  min-height: 72px;
  padding: 14px;
  border: 1px solid #edf0ec;
  border-radius: 8px;
  background: #fbfcfa;
}

.message-row.is-inactive {
  opacity: 0.68;
}

.message-row span,
.message-row small {
  display: block;
  color: var(--muted);
}

.message-row em {
  justify-self: start;
  padding: 7px 10px;
  border-radius: 999px;
  background: #edf5ef;
  color: var(--green);
  font-style: normal;
  font-weight: 900;
}

.message-row.is-inactive em {
  background: #f2f3f1;
  color: var(--muted);
}

.schedule-board {
  display: grid;
  gap: 16px;
}

.beta-note {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid #f0dfbb;
  border-left: 5px solid var(--gold);
  border-radius: 8px;
  background: #fffaf0;
}

.beta-note strong {
  color: #8a5b0c;
}

.beta-note span {
  color: var(--muted);
}

.schedule-department {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #edf0ec;
  border-radius: 8px;
  background: #fbfcfa;
}

.schedule-department-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.schedule-department-head h3 {
  margin: 0;
  font-size: 1.4rem;
}

.schedule-department-head span {
  color: var(--muted);
  font-weight: 800;
}

.schedule-week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(150px, 1fr));
  gap: 8px;
  overflow-x: auto;
}

.schedule-cell {
  min-height: 86px;
  padding: 10px;
  border: 1px solid #edf0ec;
  border-radius: 8px;
  background: #fbfcfa;
}

.schedule-day-status {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 5px 8px;
  border-radius: 999px;
  background: #edf5ef;
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 900;
}

.schedule-day-status.is-empty,
.schedule-day-status.is-low {
  background: #fff4df;
  color: #8a5b0c;
}

.schedule-day-status.is-ok {
  background: #edf5ef;
  color: var(--green);
}

.schedule-head {
  min-height: 44px;
  background: #eef5f1;
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.schedule-shift,
.schedule-empty {
  width: 100%;
  border: 1px solid #dfe8e1;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
}

.schedule-shift {
  display: grid;
  gap: 3px;
  margin-bottom: 6px;
  padding: 8px;
  border-left: 5px solid var(--green-2);
}

.schedule-shift.is-off {
  border-left-color: var(--muted);
}

.schedule-shift.is-vacation {
  border-left-color: var(--teal);
}

.schedule-shift.is-sick {
  border-left-color: var(--red);
}

.schedule-shift span,
.schedule-shift small {
  color: var(--muted);
}

.schedule-people {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.schedule-person {
  border: 1px solid #dfe8e1;
  border-radius: 999px;
  background: #f4faf6;
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1.2;
  padding: 6px 8px;
}

.schedule-empty {
  display: grid;
  place-items: center;
  min-height: 46px;
  color: var(--muted);
  font-weight: 900;
  text-align: center;
}

.check-list {
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.check-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 12px;
  border: 1px solid #edf0ec;
  border-radius: 8px;
}

.check-list strong {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #e5f1ec;
  color: var(--green);
}

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

.admin-table {
  display: grid;
  gap: 8px;
}

.admin-table > div,
.admin-table > div {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(0, 1.8fr) 92px;
  gap: 12px;
  align-items: center;
  min-height: 56px;
  padding: 12px;
  border: 1px solid #edf0ec;
  border-radius: 8px;
  background: #fbfcfa;
}

.backup-table {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.backup-list {
  display: grid;
  gap: 8px;
}

.backup-table-header,
.backup-row {
  display: grid;
  grid-template-columns: 170px minmax(360px, 1fr) 90px 90px;
  gap: 12px;
  align-items: center;
  min-height: 56px;
  padding: 12px;
  border: 1px solid #edf0ec;
  border-radius: 8px;
  background: #fbfcfa;
}

.admin-table em {
  color: var(--green);
  font-style: normal;
  font-weight: 800;
}

.backup-table em {
  color: var(--green);
  font-style: normal;
  font-weight: 800;
}

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

.token-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid #edf0ec;
  border-radius: 8px;
  background: #fbfcfa;
}

.token-box code {
  overflow-wrap: anywhere;
  color: var(--green);
  font-weight: 800;
}

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

.setting-list label {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  min-height: 58px;
  padding: 12px;
  border: 1px solid #edf0ec;
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--muted);
  font-weight: 800;
}

.setting-list input[type="checkbox"] {
  width: 22px;
  height: 22px;
  min-height: 0;
}

.device-card {
  min-height: 230px;
  padding: 22px;
}

.device-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 22px;
  border-radius: 8px;
  background: #e5f1ec;
  color: var(--green);
  font-size: 1.8rem;
}

.booking-modal {
  width: min(620px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

.booking-modal::backdrop {
  background: rgba(12, 24, 20, 0.5);
}

.booking-modal form {
  padding: 22px;
}

.modal-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

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

.form-grid label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

.booking-modal menu {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0;
  margin: 22px 0 0;
}

.cookie-banner {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 120;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  width: min(calc(100% - 36px), 720px);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 70px rgba(20, 38, 32, 0.2);
}

.cookie-banner[hidden] {
  display: none;
}

.cookie-banner p {
  margin: 6px 0 0;
  color: var(--muted);
}

.cookie-banner a {
  color: var(--teal);
  font-weight: 900;
}

.cookie-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .sidebar {
    padding: 18px 12px;
  }

  .sidebar-logo {
    width: 78px;
    padding: 0;
  }

  .brand div:not(.brand-mark):not(.brand-logo-wide),
  .nav-item:not(.is-active)::after,
  .nav-item {
    font-size: 0;
  }

  .nav-item {
    justify-content: center;
  }

  .nav-item span {
    font-size: 1rem;
  }

  .sidebar-card {
    display: none;
  }

  .summary-grid,
  .dashboard-actions,
  .team-grid,
  .location-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-grid,
  .reports-layout,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2.25rem;
  }

}

@media (max-width: 720px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    inset: auto 0 0;
    z-index: 10;
    height: auto;
    padding: 8px;
  }

  .brand,
  .sidebar-card,
  .sidebar-toggle {
    display: none;
  }

  .nav-list {
    grid-template-columns: repeat(6, 1fr);
  }

  .nav-item {
    min-height: 48px;
    padding: 8px;
  }

  .main {
    padding: 18px 14px 82px;
  }

  .topbar {
    display: grid;
  }

  .topbar-actions {
    justify-content: space-between;
  }

  h1 {
    font-size: 1.9rem;
  }

  .summary-grid,
  .team-grid,
  .team-list,
  .location-stack,
  .device-grid,
  .form-grid,
  .report-board,
  .time-check-summary,
  .employee-work-summary,
  .employee-work-person,
  .employee-work-values,
  .employee-work-details,
  .employee-event-list li,
  .summary-list article,
  .report-list div,
  .time-check-row,
  .message-row,
  .vacation-card,
  .vacation-row,
  .vacation-calendar,
  .integration-list article,
  .backup-table-header,
  .backup-row,
  .cookie-banner {
    grid-template-columns: 1fr;
  }

  .cookie-actions {
    align-items: stretch;
  }

  .cookie-actions .primary-action,
  .cookie-actions .secondary-action {
    flex: 1;
  }

  .shift-row {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .shift-time,
  .status-pill {
    grid-column: 2;
  }

  .panel-heading,
  .location-row,
  .company-fact,
  .log-row,
  .employee-row,
  .employee-form label,
  .admin-table > div,
  .team-card,
  .employee-row-actions,
  .token-box,
  .setting-list label {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .panel-heading {
    display: grid;
  }

  .calendar-controls {
    justify-content: stretch;
  }

  .calendar-controls strong,
  .calendar-controls button {
    width: 100%;
  }

  .backup-table span {
    white-space: normal;
  }

  .employee-work-summary::after,
  .employee-work-summary > em {
    justify-self: start;
  }

}
