:root {
  --bg-main: #f5f7f8;
  --bg-alt: #e7ecef;
  --surface: #ffffff;
  --surface-soft: #f8fafb;
  --line: #d7dee3;
  --text: #17212b;
  --text-soft: #66727c;
  --accent: #0b7f9d;
  --accent-soft: #e6f5f8;
  --danger: #b4232d;
  --ok-bg: #e9f7ef;
  --ok-line: #b8dec7;
  --ok-text: #155337;
  --info-bg: #e8f5f8;
  --info-line: #b8dbe4;
  --info-text: #15596b;
  --warn-bg: #fff5df;
  --warn-line: #e6cf90;
  --warn-text: #6f4e00;
  --shadow: 0 14px 34px rgba(17, 24, 31, 0.09);
}

:root[data-theme="dark"] {
  --bg-main: #0d1013;
  --bg-alt: #151a1f;
  --surface: #181d22;
  --surface-soft: #20262d;
  --line: #303943;
  --text: #edf3f6;
  --text-soft: #aab5bd;
  --accent: #18a8c7;
  --accent-soft: #123642;
  --danger: #ff7f88;
  --ok-bg: #123321;
  --ok-line: #2c6845;
  --ok-text: #b9f2d0;
  --info-bg: #102f3a;
  --info-line: #286274;
  --info-text: #c8f2fb;
  --warn-bg: #3a2e14;
  --warn-line: #7f6425;
  --warn-text: #f6d78a;
  --shadow: 0 18px 38px rgba(0, 0, 0, 0.42);
}

:root[data-theme="dark"] .availability-chip {
  border-color: #5cb7a8;
  background: #1f4f49;
  color: #c9fff2;
}

:root[data-theme="dark"] .availability-day.availability-high {
  border-color: #4a8e7f;
  background: #1c3a35;
}

:root[data-theme="dark"] .availability-day.availability-medium {
  border-color: #8f7a46;
  background: #3d3421;
}

:root[data-theme="dark"] .availability-day.availability-low {
  border-color: #8f4c59;
  background: #3f2630;
}

:root[data-theme="dark"] .undo-banner {
  border-color: #8a7742;
  background: #4c4328;
  color: #f6e7b3;
}

:root[data-theme="dark"] .undo-banner .btn {
  background: #6f6239;
  border-color: #a28f54;
  color: #fff3c9;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Sans", "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  background: linear-gradient(165deg, var(--bg-main) 0%, var(--bg-alt) 100%);
}

.bg-pattern {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 8% 18%, rgba(255, 255, 255, 0.22), transparent 34%),
    radial-gradient(circle at 92% 12%, rgba(11, 127, 157, 0.12), transparent 36%);
  z-index: -1;
}

:root[data-theme="dark"] .bg-pattern {
  background:
    radial-gradient(circle at 12% 16%, rgba(24, 168, 199, 0.08), transparent 30%),
    radial-gradient(circle at 90% 10%, rgba(255, 255, 255, 0.04), transparent 34%);
}

.app-header {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 18px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(135deg, #151515 0%, #101418 56%, #102a33 100%);
  backdrop-filter: blur(6px);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: flex-start;
}

.brand {
  margin: 0;
  font-size: 1.42rem;
  font-weight: 800;
  color: #f6fbfc;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 2px rgba(9, 31, 40, 0.35);
}

.logo-slot {
  width: 220px;
  height: 66px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: grid;
  place-items: center;
  background: #171717;
  padding: 0;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.logo-link {
  text-decoration: none;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.logo-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(9, 31, 40, 0.24);
}

.brand-logo {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.branding-preview {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.admin-mobile-only {
  display: none;
}

.desktop-only-workspace {
  display: block;
}

.admin-mobile-notice {
  gap: 16px;
}

.admin-mobile-notice h1 {
  margin: 0;
}

.admin-mobile-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.admin-mobile-status-grid article {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: var(--surface-soft);
}

.admin-mobile-status-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-mobile-status-grid strong {
  display: block;
  margin-top: 6px;
  font-size: 1.35rem;
}

.admin-mobile-action-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 899px) {
  body.admin-control-mode .desktop-only-workspace {
    display: none !important;
  }

  body.admin-control-mode .admin-mobile-only {
    display: grid;
  }

  .admin-mobile-notice {
    margin-top: 0;
  }

  .admin-mobile-action-list {
    grid-template-columns: 1fr;
  }

  .admin-mobile-action-list .btn {
    width: 100%;
    justify-content: center;
  }

  .admin-mobile-status-grid {
    grid-template-columns: 1fr;
  }
}

.branding-preview-frame {
  display: flex;
  align-items: center;
  gap: 16px;
  width: min(100%, 760px);
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: linear-gradient(135deg, #151515 0%, #101418 56%, #102a33 100%);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.18);
}

.branding-preview-frame .brand {
  color: #f6fbfc;
}

.branding-logo-preview {
  width: 220px;
  height: 66px;
  flex: 0 0 auto;
}

.main-nav {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  justify-self: center;
  width: fit-content;
  max-width: 100%;
  padding: 7px;
  border: 1px solid rgba(203, 213, 225, 0.72);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.14);
  position: relative;
}

.nav-group {
  position: relative;
  border: 0;
  border-radius: 13px;
}

.nav-group-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  min-width: 126px;
  padding: 10px 11px;
  border: 1px solid transparent;
  border-radius: 13px;
  color: #273548;
  background: transparent;
  cursor: pointer;
  list-style: none;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  user-select: none;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.nav-group-label::-webkit-details-marker {
  display: none;
}

.nav-group-label:hover,
.nav-group[open] .nav-group-label {
  color: #0a6075;
  border-color: #c7e5ec;
  background: #e8f5f8;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.nav-group-chevron {
  color: #718091;
  font-size: 1.15rem;
  line-height: 1;
  margin-top: -1px;
  transition: transform 140ms ease;
}

.nav-group[open] .nav-group-chevron {
  transform: rotate(90deg);
}

.nav-group-panel {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 70;
  min-width: 220px;
  display: grid;
  gap: 3px;
  padding: 8px;
  border: 1px solid rgba(203, 213, 225, 0.84);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

.nav-group-panel a,
.main-nav > a {
  display: flex;
  align-items: center;
  min-height: 38px;
  text-decoration: none;
  color: #273548;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 9px 10px;
  font-size: 0.9rem;
  font-weight: 800;
  white-space: nowrap;
  line-height: 1;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.nav-group-panel .nav-overview {
  color: #0a6075;
  background: #e8f5f8;
  border-color: #c7e5ec;
}

.nav-group-panel a:hover,
.main-nav > a:hover {
  border-color: #dce5ec;
  background: #f4f7f9;
  color: #101820;
}

:root[data-theme="dark"] .main-nav {
  border-color: #26323c;
  background: rgba(20, 26, 31, 0.96);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.32);
}

:root[data-theme="dark"] .nav-group-label {
  color: #e9f0f4;
}

:root[data-theme="dark"] .nav-group-label:hover,
:root[data-theme="dark"] .nav-group[open] .nav-group-label {
  color: #d5f8ff;
  border-color: #286274;
  background: #123642;
}

:root[data-theme="dark"] .nav-group-chevron {
  color: #9badb8;
}

:root[data-theme="dark"] .nav-group-panel {
  border-color: #303b45;
  background: rgba(20, 26, 31, 0.98);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.42);
}

:root[data-theme="dark"] .nav-group-panel a,
:root[data-theme="dark"] .main-nav > a {
  color: #e9f0f4;
}

:root[data-theme="dark"] .nav-group-panel .nav-overview {
  color: #d5f8ff;
  background: #123642;
  border-color: #286274;
}

:root[data-theme="dark"] .nav-group-panel a:hover,
:root[data-theme="dark"] .main-nav > a:hover {
  border-color: #3c4854;
  background: #202932;
  color: #ffffff;
}

.header-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  position: relative;
}

.user-chip {
  margin: 0;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  color: #0b6076;
  font-weight: 700;
}

.user-menu {
  position: relative;
}

.user-menu summary {
  list-style: none;
}

.user-menu summary::-webkit-details-marker {
  display: none;
}

.user-menu .user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.user-menu-chevron {
  font-size: 1.15rem;
  line-height: 1;
  transition: transform 140ms ease;
}

.user-menu[open] .user-menu-chevron {
  transform: rotate(90deg);
}

.user-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 80;
  min-width: 190px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.user-menu-panel form {
  margin: 0;
}

.user-menu-item {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 10px 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.user-menu-item:hover {
  background: var(--surface-soft);
}

.user-menu-panel .user-menu-item:last-child {
  border-bottom: 0;
}

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

.app-header .btn-light {
  background: #f6fbfc;
  border-color: rgba(255, 255, 255, 0.32);
  color: #0b6076;
  font-weight: 800;
}

.app-header .btn-light:hover {
  background: #e4f4f8;
}

.content {
  width: min(1840px, 98%);
  margin: 14px auto 30px;
  display: grid;
  gap: 14px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.panel-small {
  width: min(560px, 96%);
}

h1,
h2 {
  margin: 0 0 10px;
}

h1 {
  font-size: 1.24rem;
}

h2 {
  font-size: 1rem;
}

.muted {
  color: var(--text-soft);
}

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

label {
  margin-top: 6px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  min-height: 42px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

input:focus,
select:focus,
textarea:focus {
  outline: 0;
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

input[type="checkbox"] {
  width: auto;
  min-height: auto;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.checkbox-grid {
  display: grid;
  gap: 4px;
}

.mini-link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.mini-link:hover {
  color: color-mix(in srgb, var(--accent) 82%, #0d2c4d);
}

.maps-link,
.phone-link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.maps-link:hover,
.phone-link:hover {
  color: color-mix(in srgb, var(--accent) 78%, #0d2c4d);
}

ul {
  margin: 0;
  padding-left: 18px;
}

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border-radius: 10px;
  padding: 10px 13px;
  min-height: 42px;
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(11, 127, 157, 0.18);
}

.btn:hover {
  filter: brightness(0.97);
}

.btn-light {
  background: var(--accent-soft);
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
  box-shadow: none;
}

.btn-danger {
  background: color-mix(in srgb, var(--danger) 88%, #ffffff);
  border-color: color-mix(in srgb, var(--danger) 60%, #000000);
  color: #fff;
}

.btn-danger:hover {
  filter: brightness(0.95);
}

.inline-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.inline-actions form {
  margin: 0;
}

.split-export {
  display: inline-flex;
  align-items: stretch;
  position: relative;
}

.split-export > .btn {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.split-export-menu {
  position: relative;
}

.split-export-toggle {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  min-width: 36px;
  padding-inline: 10px;
}

.split-export-toggle::-webkit-details-marker {
  display: none;
}

.split-export-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 132px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  display: grid;
  overflow: hidden;
  z-index: 50;
}

.split-export-dropdown a {
  color: var(--text);
  text-decoration: none;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.split-export-dropdown a:last-child {
  border-bottom: 0;
}

.split-export-dropdown a:hover {
  background: var(--surface-soft);
}

.export-all-form {
  margin-top: 6px;
}

.mail-all-form {
  margin-top: 14px;
}

.command-box {
  margin: 10px 0 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--text);
  padding: 12px;
  overflow-x: auto;
}

.info-box {
  margin-top: 12px;
  border: 1px solid var(--info-line);
  border-radius: 12px;
  background: var(--info-bg);
  color: var(--info-text);
  padding: 12px;
}

.info-box p {
  margin: 0 0 6px;
}

.info-box p:last-child {
  margin-bottom: 0;
}

.schedule-form {
  display: grid;
  grid-template-columns: 1fr;
  align-items: end;
  gap: 10px;
  margin: 12px 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface-soft);
}

.schedule-enabled {
  min-height: 42px;
  align-items: center;
}

.schedule-summary p {
  max-width: 760px;
}

.employee-shift-card {
  display: grid;
  gap: 8px;
}

.employee-shift-card p {
  margin: 0;
}

.employee-shift-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.employee-shift-site {
  font-size: 0.96rem;
  line-height: 1.35;
}

.employee-month-shift {
  display: grid;
  gap: 5px;
}

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

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

.history-table th,
.history-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 9px;
  text-align: left;
  vertical-align: top;
}

.history-table th {
  color: var(--text);
  background: var(--accent-soft);
  font-size: 0.86rem;
}

.history-table tbody tr:hover {
  background: color-mix(in srgb, var(--accent-soft) 46%, transparent);
}

.history-table form {
  margin: 0;
}

.history-table .btn {
  min-height: 34px;
  padding-inline: 10px;
}

.status-pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.78rem;
  font-weight: 800;
  border: 1px solid var(--line);
}

.status-sent {
  color: var(--ok-text);
  background: var(--ok-bg);
  border-color: var(--ok-line);
}

.status-failed {
  color: color-mix(in srgb, var(--danger) 78%, #5b0e19);
  background: color-mix(in srgb, var(--danger) 14%, var(--surface));
  border-color: color-mix(in srgb, var(--danger) 42%, var(--line));
}

.status-skipped {
  color: var(--warn-text);
  background: var(--warn-bg);
  border-color: var(--warn-line);
}

.week-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.week-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.undo-slot-floating {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  pointer-events: none;
}

.undo-banner {
  border: 1px solid #e0c97a;
  background: #fff4cd;
  color: #6f5612;
  border-radius: 14px;
  padding: 10px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  flex-wrap: nowrap;
  width: min(420px, calc(100vw - 36px));
  max-width: 100%;
  line-height: 1.25;
  box-shadow: 0 18px 34px rgba(53, 42, 13, 0.18);
  pointer-events: auto;
}

.undo-banner-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.undo-banner-copy strong {
  font-size: 0.88rem;
  color: inherit;
}

.undo-banner-meta {
  color: inherit;
  font-size: 0.8rem;
  opacity: 0.92;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.undo-banner p {
  margin: 0;
}

.undo-banner form {
  margin: 0;
  margin-left: auto;
}

.undo-banner .btn {
  padding: 8px 11px;
  line-height: 1.1;
  background: #f2de97;
  border-color: #d3b862;
  color: #5d4b14;
  white-space: nowrap;
}

.undo-time {
  font-weight: 700;
}

.month-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
  min-width: 900px;
}

.month-weekdays span {
  text-align: center;
  font-weight: 700;
  color: var(--text-soft);
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  min-width: 900px;
}

.month-day {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  padding: 10px;
  min-height: 120px;
}

.month-day.out-month {
  opacity: 0.55;
}

.month-date {
  margin: 0 0 8px;
  font-weight: 700;
}

.month-shift-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.month-shift-list li {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  background: var(--surface);
  font-size: 0.85rem;
}

.tiny {
  font-size: 0.8rem;
}

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

.calendar-scroll {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 0;
  overflow-x: visible;
  padding-bottom: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.month-scroll {
  overflow-x: auto;
  padding-bottom: 4px;
}

.day-card {
  background: #f0f3f6;
  border-right: 1px solid var(--line);
  padding: 0;
  min-height: 230px;
}

.calendar-scroll .day-card:last-child {
  border-right: 0;
}

.day-card h2 {
  font-size: 0.92rem;
  background: #303942;
  color: #f7fafc;
  padding: 10px;
  margin: 0;
  border-bottom: 1px solid #242c33;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.day-heading-text {
  display: grid;
  gap: 2px;
}

.day-weekday {
  font-weight: 700;
  line-height: 1.1;
}

.day-date {
  font-size: 0.88em;
  line-height: 1.15;
}

.day-availability-count {
  font-size: 0.74rem;
  font-weight: 700;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.16);
  color: #f7fafc;
  padding: 2px 8px;
  white-space: nowrap;
}

.day-card.day-availability-high {
  background: #eef8f9;
}

.day-card.day-availability-high h2 {
  background: #0b7f9d;
  border-bottom-color: #08677f;
}

.day-card.day-availability-medium {
  background: #fff7e9;
}

.day-card.day-availability-medium h2 {
  background: #b39658;
  border-bottom-color: #957d47;
}

.day-card.day-availability-low {
  background: #fdeff1;
}

.day-card.day-availability-low h2 {
  background: #ac6871;
  border-bottom-color: #8f555d;
}

:root[data-theme="dark"] .day-card.day-availability-high {
  background: #142329;
}

:root[data-theme="dark"] .day-card.day-availability-high h2 {
  background: #126f86;
  border-bottom-color: #1b91ad;
}

:root[data-theme="dark"] .day-card.day-availability-medium {
  background: #312817;
}

:root[data-theme="dark"] .day-card.day-availability-medium h2 {
  background: #7e6a3a;
  border-bottom-color: #9c8448;
}

:root[data-theme="dark"] .day-card.day-availability-low {
  background: #351b22;
}

:root[data-theme="dark"] .day-card.day-availability-low h2 {
  background: #8a4c57;
  border-bottom-color: #ac5f6c;
}

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

.shift-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background: var(--surface-soft);
}

.shift-drag {
  cursor: grab;
}

.shift-drag:active {
  cursor: grabbing;
}

.shift-drag.drag-active {
  opacity: 0.72;
}

.shift-item p {
  margin: 0 0 6px;
}

.compact-shift-card {
  position: relative;
  overflow: hidden;
  border-color: #d5e0eb;
  background: var(--surface);
  box-shadow: 0 3px 10px rgba(33, 62, 98, 0.06);
}

.compact-shift-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: #0b7f9d;
}

.shift-card-fd::before {
  background: #0b7f9d;
}

.shift-card-am::before {
  background: #1f9d70;
}

.shift-card-pm::before {
  background: #c9831f;
}

.shift-status-warning::before {
  background: #d14f56;
}

.holiday-blocker::before {
  background: #7a8697;
}

.compact-shift-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 22%, transparent);
}

.shift-card-open {
  width: 100%;
  display: grid;
  gap: 5px;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 8px 9px 8px 12px;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.shift-card-open:hover {
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}

.shift-card-open:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 68%, #ffffff);
  outline-offset: -2px;
}

.shift-card-topline,
.shift-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.period-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 7px;
  background: var(--accent-soft);
  color: color-mix(in srgb, var(--accent) 78%, #0d2c4d);
  font-size: 0.74rem;
  font-weight: 800;
}

.state-dot {
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.state-ok {
  color: #178052;
}

.state-warning {
  color: #9a1f26;
}

.state-muted,
.state-empty {
  color: var(--text-soft);
}

.shift-card-title {
  overflow: hidden;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shift-card-meta {
  justify-content: flex-start;
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 700;
}

.shift-detail-source {
  display: none;
}

.shift-detail-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 14px;
  min-height: 240px;
  align-self: start;
}

.shift-detail-panel h2,
.shift-detail-panel h3 {
  margin-bottom: 8px;
}

.panel-eyebrow {
  margin: 0 0 4px;
  color: var(--text-soft);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.shift-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.shift-detail-grid {
  grid-template-columns: 98px 1fr;
  margin-bottom: 12px;
  font-size: 0.92rem;
}

.detail-section {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 12px;
}

.detail-assignment-list {
  margin-bottom: 0;
}

.detail-actions {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 12px;
}

.detail-blocker-note {
  margin-top: 8px;
}

.detail-panel-close {
  margin-top: 12px;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  padding: 0;
}

.assignment-wrap {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
}

.assignment-chip {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 6px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.assignment-drag {
  cursor: grab;
}

.assignment-drag:active {
  cursor: grabbing;
}

.remove-btn {
  border: 1px solid var(--line);
  background: color-mix(in srgb, #d14f56 18%, var(--surface));
  color: var(--text);
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 700;
  width: 24px;
  height: 24px;
  cursor: pointer;
}

.shift-item a {
  color: var(--accent);
  font-weight: 700;
}

.danger-link {
  border: 0;
  background: transparent;
  padding: 0;
  color: #ffe8eb;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.danger-link:hover {
  color: #ffffff;
}

.danger-inline {
  border: 0;
  background: transparent;
  color: var(--danger);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  padding: 0;
}

.form-divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 16px 0;
}

.details-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 8px;
  margin: 0 0 16px;
}

dt {
  font-weight: 700;
}

dd {
  margin: 0;
}

.message {
  background: var(--info-bg);
  color: var(--info-text);
  border: 1px solid var(--info-line);
  border-radius: 10px;
  padding: 11px 12px;
  box-shadow: 0 6px 16px rgba(42, 111, 179, 0.08);
}

.message-success {
  background: var(--ok-bg);
  color: var(--ok-text);
  border-color: var(--ok-line);
}

.message-warning {
  background: var(--warn-bg);
  color: var(--warn-text);
  border-color: var(--warn-line);
}

.message-error {
  background: color-mix(in srgb, var(--danger) 14%, var(--surface));
  color: color-mix(in srgb, var(--danger) 78%, #5b0e19);
  border-color: color-mix(in srgb, var(--danger) 42%, var(--line));
}

#message-stack:empty {
  display: none;
}

.error {
  color: var(--danger);
  margin: 0;
}

.pdf-export-form {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr;
  align-items: end;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface-soft);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.mail-console {
  display: grid;
  gap: 14px;
}

.mail-console-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.mail-console-head h1,
.mail-console-head p {
  margin-bottom: 0;
}

.mail-status-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.mail-status-strip > div {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--surface-soft);
}

.week-publication-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.week-publication-bar strong {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: 1.15rem;
  line-height: 1.1;
}

.week-publication-bar small {
  display: block;
  margin-top: 3px;
  color: var(--text-soft);
  font-size: 0.78rem;
}

.week-publication-bar .inline-actions {
  justify-content: flex-end;
}

.mail-status-strip strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 1.15rem;
  line-height: 1.1;
}

.mail-status-strip small,
.compact-history-table small {
  display: block;
  margin-top: 3px;
  color: var(--text-soft);
  font-size: 0.78rem;
}

.mail-action-grid,
.mail-two-column {
  display: grid;
  gap: 12px;
}

.mail-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface-soft);
}

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

.mail-inline-fields,
.mail-schedule-compact {
  display: grid;
  gap: 10px;
}

.section-head.compact {
  margin-bottom: 8px;
}

.section-head.compact h2 {
  margin: 0;
  font-size: 1rem;
}

.compact-copy {
  margin: 0;
}

.compact-panel {
  padding-block: 16px;
}

.compact-definition-list {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
}

.compact-definition-list div {
  display: grid;
  grid-template-columns: minmax(120px, 0.35fr) minmax(0, 1fr);
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.compact-definition-list dt {
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.compact-definition-list dd {
  margin: 0;
}

.compact-table-scroll {
  max-height: 360px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

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

.compact-history-table th,
.compact-history-table td {
  padding: 8px 10px;
}

.compact-history-table th {
  font-size: 0.76rem;
  text-transform: uppercase;
}

.btn-small {
  min-height: 30px;
  padding: 6px 9px;
  font-size: 0.82rem;
}

.empty-compact {
  margin: 8px 0 0;
  color: var(--text-soft);
}

.balance-shortcuts {
  margin: 12px 0;
}

.balance-filter-form {
  display: grid;
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface-soft);
}

.balance-table-scroll {
  max-height: 520px;
}

.planning-layout {
  display: grid;
  gap: 12px;
  transition: opacity 0.16s ease, filter 0.16s ease;
}

.planning-layout.is-updating {
  opacity: 0.72;
  filter: saturate(0.9);
  pointer-events: none;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.dashboard-columns {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.metric-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  background: var(--surface-soft);
  box-shadow: 0 6px 16px rgba(33, 62, 98, 0.06);
}

.metric-card strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 2rem;
  line-height: 1;
}

.metric-label {
  color: var(--text-soft);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-card-warning {
  border-color: var(--warn-line);
  background: var(--warn-bg);
}

.metric-card-danger {
  border-color: color-mix(in srgb, var(--danger) 42%, var(--line));
  background: color-mix(in srgb, var(--danger) 10%, var(--surface));
}

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

.issue-list,
.compact-list,
.status-list {
  list-style: none;
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.issue-item,
.status-list li,
.compact-list li {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: var(--surface-soft);
}

.issue-item strong,
.issue-item span,
.issue-item p {
  display: block;
  margin: 0;
}

.issue-item span,
.issue-item p,
.compact-list li {
  color: var(--text-soft);
  font-size: 0.9rem;
}

.issue-error {
  border-color: color-mix(in srgb, var(--danger) 42%, var(--line));
  background: color-mix(in srgb, var(--danger) 10%, var(--surface));
}

.issue-warning {
  border-color: var(--warn-line);
  background: color-mix(in srgb, var(--warn-bg) 74%, var(--surface));
}

.issue-info {
  border-color: var(--info-line);
  background: color-mix(in srgb, var(--info-bg) 72%, var(--surface));
}

.issue-item .week-head {
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.status-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.status-list-large {
  margin-top: 14px;
}

.support-check-item {
  display: grid !important;
  grid-template-columns: minmax(150px, 0.8fr) minmax(0, 1.4fr) auto;
  align-items: center;
}

.support-check-main {
  color: var(--text);
  font-weight: 800;
}

.support-check-message {
  color: var(--text-soft);
  overflow-wrap: anywhere;
}

.planner-top-panel {
  display: grid;
  gap: 10px;
  align-content: start;
}

.fold-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-soft) 84%, #ffffff);
  padding: 9px;
  min-width: 0;
}

.fold-panel summary {
  cursor: pointer;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}

.fold-panel > .muted {
  margin: 0 0 8px;
  font-size: 0.84rem;
}

.availability-board {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.availability-day {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px;
  background: var(--surface-soft);
}

.availability-day.availability-high {
  border-color: #8bc9b8;
  background: #eefaf6;
}

.availability-day.availability-medium {
  border-color: #e3c989;
  background: #fff7e7;
}

.availability-day.availability-low {
  border-color: #e3a1a8;
  background: #fff0f2;
}

.availability-day[open] {
  background: color-mix(in srgb, var(--surface-soft) 86%, #ffffff);
}

.availability-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
  cursor: pointer;
  list-style: none;
}

.availability-head::-webkit-details-marker {
  display: none;
}

.availability-day[open] .availability-head {
  margin-bottom: 6px;
}

.availability-title {
  margin: 0;
  font-weight: 700;
}

.availability-count {
  min-width: 28px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 2px 8px;
}

.availability-high .availability-count {
  border-color: #8bc9b8;
  background: #dcf3eb;
  color: #166251;
}

.availability-medium .availability-count {
  border-color: #e3c989;
  background: #fff0cd;
  color: #7c5b16;
}

.availability-low .availability-count {
  border-color: #e3a1a8;
  background: #ffe0e4;
  color: #8c2f3a;
}

.availability-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.availability-day .muted {
  margin: 0;
}

.availability-chip {
  font-size: 0.78rem;
  border-radius: 999px;
  border: 1px solid #9dcfc4;
  background: #e4f7f2;
  color: #1f6b5f;
  padding: 3px 8px;
}

.day-chip {
  font-size: 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 3px 7px;
  background: var(--surface);
}

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

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

.shift-type-pool {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 8px;
}

.project-drag {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: var(--surface);
  cursor: grab;
}

.shift-type-drag {
  border: 1px solid #96bde5;
  border-radius: 10px;
  padding: 10px 8px;
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  text-align: center;
  cursor: grab;
  line-height: 1.2;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.shift-type-drag strong {
  display: block;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.project-drag p {
  margin: 0 0 4px;
}

.project-drag:active {
  cursor: grabbing;
}

.shift-type-drag:active {
  cursor: grabbing;
}

.trash-zone {
  margin-top: 2px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 12px;
  background: color-mix(in srgb, var(--surface) 75%, transparent);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.trash-title {
  margin: 0 0 6px;
  font-weight: 700;
}

.trash-zone.trash-hover {
  border-color: #d14f56;
  box-shadow: 0 0 0 2px rgba(209, 79, 86, 0.25);
}

.employee-drag {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: var(--surface-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  cursor: grab;
  flex-direction: column;
  align-items: stretch;
}

.employee-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.employee-main span:first-child {
  font-weight: 700;
  line-height: 1.2;
}

.employee-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
  width: 100%;
}

.employee-meta .skill-badge {
  margin-right: auto;
}

.employee-links {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}

.load-badge {
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 3px 7px;
}

.employee-drag:active {
  cursor: grabbing;
}

.employee-drag.drag-active {
  opacity: 0.55;
}

.employee-drag.active-filter {
  border-color: #4d86be;
  box-shadow: 0 0 0 2px rgba(42, 111, 179, 0.2);
}

.project-drag.drag-active {
  opacity: 0.55;
}

.shift-type-drag.drag-active {
  opacity: 0.55;
}

.skill-badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--accent) 15%, var(--surface));
}

:root[data-theme="dark"] .compact-shift-card {
  border-color: #324a64;
  background: #203149;
}

:root[data-theme="dark"] .shift-card-open:hover {
  background: #273b57;
}

:root[data-theme="dark"] .shift-card-title {
  color: var(--text);
}

.drop-hint {
  margin: 2px 0 10px;
  font-size: 0.8rem;
  color: var(--text-soft);
}

.driver-ok,
.driver-missing {
  margin: 0 0 6px;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 8px;
  padding: 4px 7px;
  display: inline-flex;
}

.driver-ok {
  color: #0f5e3f;
  background: #ddf3e8;
  border: 1px solid #9fcdb6;
}

.driver-missing {
  color: #8b2a2f;
  background: #fde9ea;
  border: 1px solid #efb7bc;
}

.holiday-blocker {
  background: #5d6d80;
  border-color: #4f5f72;
}

.blocker-note {
  display: inline-flex;
  margin: 0 0 8px;
  border-radius: 8px;
  padding: 4px 7px;
  background: rgba(255, 255, 255, 0.18);
  color: #f6fbff;
  font-size: 0.82rem;
  font-weight: 700;
}

.drop-zone {
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.drop-zone.drop-hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent);
}

.day-drop-zone.day-drop-hover {
  box-shadow: inset 0 0 0 2px rgba(61, 143, 114, 0.55);
}

.hidden-form {
  display: none;
}

.pdf-export-button-wrap {
  display: flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
}

.employee-list-head .inline-actions {
  transform: translateY(-4px);
}

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

.employee-list-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: var(--surface-soft);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.employee-list-item p {
  margin: 0 0 5px;
}

.login-page .content {
  margin-top: 0;
  min-height: calc(100vh - 124px);
}

.login-shell {
  min-height: inherit;
  display: flex;
  justify-content: center;
  align-items: center;
}

.login-panel {
  margin: 0 auto;
  width: min(520px, 96%);
  border-color: color-mix(in srgb, var(--accent) 18%, var(--line));
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 92%, #eef5fc) 0%, var(--surface) 100%);
}

.login-panel h1 {
  color: var(--accent);
}

.login-panel .muted {
  max-width: 36ch;
}

.fade-in {
  animation: fadeIn 260ms ease-out;
}

.delay-1 {
  animation-delay: 100ms;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 760px) {
  .app-header {
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 20px 28px;
  }

  .header-actions {
    justify-content: flex-end;
  }

  .pdf-export-form {
    grid-template-columns: 2fr 1fr 1fr auto;
  }

  .schedule-form {
    grid-template-columns: minmax(190px, 1.1fr) 1fr 1fr auto;
    align-items: end;
  }

  .mail-action-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
    align-items: stretch;
  }

  .mail-two-column {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 0.85fr);
    align-items: start;
  }

  .mail-inline-fields {
    grid-template-columns: minmax(260px, 1.4fr) minmax(150px, 0.5fr) minmax(150px, 0.5fr);
    align-items: end;
  }

  .mail-schedule-compact {
    grid-template-columns: minmax(170px, 0.8fr) minmax(150px, 1fr) minmax(130px, 0.7fr) auto;
    align-items: end;
  }

  .balance-filter-form {
    grid-template-columns: minmax(280px, 1fr) minmax(150px, 0.35fr) minmax(150px, 0.35fr) auto;
  }

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

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

}


@media (min-width: 1080px) {
  .mail-action-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(230px, 0.65fr) minmax(230px, 0.65fr);
  }

  .planning-layout {
    grid-template-columns: minmax(260px, 310px) minmax(0, 1fr) minmax(280px, 320px);
    align-items: start;
  }

  .planner-top-panel {
    grid-column: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    position: sticky;
    top: 14px;
    max-height: calc(100vh - 28px);
    overflow-y: auto;
    padding-right: 2px;
    overscroll-behavior: contain;
  }

  .planner-top-panel .fold-panel {
    overflow: hidden;
  }

  .planner-top-panel .shift-type-pool,
  .planner-top-panel .project-pool,
  .planner-top-panel .employee-pool {
    max-height: 160px;
    overflow-y: auto;
    padding-right: 4px;
    overscroll-behavior: contain;
  }

  .planner-top-panel .employee-pool {
    max-height: 220px;
  }

  .planner-top-panel .project-drag,
  .planner-top-panel .employee-drag {
    padding: 6px 7px;
  }

  .planner-top-panel .trash-zone {
    margin-top: 8px;
    padding: 8px;
  }

  .admin-calendar-grid {
    grid-column: 2;
  }

  .shift-detail-panel {
    grid-column: 3;
    position: sticky;
    top: 14px;
  }

  .calendar-scroll {
    grid-template-columns: repeat(6, minmax(150px, 1fr));
  }

  .month-day {
    min-height: 132px;
  }
}

/* Employee mobile polish */
@media (max-width: 759px) {
  body {
    background: var(--bg-main);
  }

  .app-header {
    gap: 12px;
    padding: 12px;
  }

  .header-brand {
    justify-content: space-between;
    gap: 10px;
  }

  .logo-slot {
    width: 150px;
    height: 45px;
  }

  .brand {
    font-size: 1rem;
    line-height: 1.15;
    text-align: right;
  }

  .main-nav {
    justify-content: flex-start;
    gap: 6px;
    overflow-x: auto;
    width: 100%;
    padding: 7px 8px;
    flex-wrap: nowrap;
    scroll-snap-type: x proximity;
    border-radius: 16px;
  }

  .nav-group {
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  .nav-group-label {
    min-width: 106px;
    min-height: 40px;
    gap: 5px;
    padding: 9px 8px;
    font-size: 0.62rem;
  }

  .nav-group-panel {
    position: fixed;
    left: 10px;
    right: 10px;
    top: auto;
    min-width: 0;
    width: auto;
    grid-template-columns: 1fr;
    margin-top: 8px;
  }

  .nav-group-panel a,
  .main-nav > a {
    padding: 9px 10px;
    font-size: 0.84rem;
  }

  .header-actions {
    justify-content: flex-start;
  }

  .user-menu {
    width: 100%;
  }

  .user-chip {
    width: 100%;
    justify-content: space-between;
  }

  .user-menu-panel {
    left: 0;
    right: auto;
    width: min(100%, 320px);
  }

  .content {
    width: min(100% - 20px, 1180px);
    margin: 14px auto 36px;
  }

  .panel {
    border-radius: 10px;
    padding: 12px;
  }

  .week-head {
    display: grid;
    gap: 12px;
  }

  .week-head h1 {
    font-size: 1.28rem;
    line-height: 1.25;
  }

  .undo-slot-floating {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }

  .undo-banner {
    width: 100%;
    flex-wrap: wrap;
  }

  .undo-banner form {
    margin-left: 0;
  }

  .undo-banner-meta {
    white-space: normal;
  }

  .week-head .inline-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .week-head .inline-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .employee-hero-panel .week-head {
    gap: 14px;
  }

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

  .employee-quick-actions .btn {
    min-height: 44px;
    padding: 9px 8px;
    font-size: 0.9rem;
  }

  .employee-quick-actions .btn:first-child {
    grid-column: 1 / -1;
  }

  .calendar-scroll {
    border-radius: 10px;
  }

  .day-card {
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .calendar-scroll .day-card:last-child {
    border-bottom: 0;
  }

  .shift-list {
    padding: 8px;
  }

  .shift-item {
    border-radius: 8px;
    padding: 11px;
  }

  .shift-item a {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
  }

  .employee-shift-card {
    gap: 10px;
    padding: 12px;
  }

  .employee-shift-card-head {
    align-items: flex-start;
  }

  .employee-shift-card-head .mini-link {
    min-height: 32px;
    align-items: center;
  }

  .employee-shift-site {
    font-size: 1rem;
  }

  .month-scroll {
    overflow-x: visible;
  }

  .month-weekdays {
    display: none;
  }

  .month-grid {
    min-width: 0;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .month-day {
    min-height: 0;
    padding: 11px;
  }

  .month-day.out-month {
    display: none;
  }

  .month-date {
    margin-bottom: 7px;
  }

  .month-shift-list li {
    padding: 8px;
  }

  .table-scroll {
    border: 1px solid var(--line);
    border-radius: 10px;
  }

  .history-table {
    min-width: 720px;
  }

  .support-check-item {
    grid-template-columns: 1fr auto;
  }

  .support-check-message {
    grid-column: 1 / -1;
  }

  .details-grid {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .details-grid dt {
    color: var(--text-soft);
    font-size: 0.82rem;
  }
}

/* Release 1 admin overview surfaces */
.dashboard-head {
  align-items: flex-start;
}

.panel-eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.dashboard-action-card {
  display: grid;
  gap: 8px;
  min-height: 118px;
  padding: 14px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-soft) 90%, white) 0%, var(--surface) 100%);
  box-shadow: 0 10px 22px rgba(33, 62, 98, 0.06);
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.dashboard-action-card:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  box-shadow: 0 14px 28px rgba(33, 62, 98, 0.1);
}

.dashboard-action-card span {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 0.72rem;
  font-weight: 900;
}

.dashboard-action-card strong {
  font-size: 1rem;
}

.dashboard-action-card small {
  color: var(--text-soft);
  font-size: 0.86rem;
  line-height: 1.35;
}

.collapsible-panel {
  padding: 0;
  overflow: hidden;
}

.collapsible-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  cursor: pointer;
  list-style: none;
}

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

.collapsible-summary h2,
.collapsible-summary p {
  margin-top: 0;
}

.collapsible-summary p {
  margin-bottom: 0;
}

.collapsible-summary::after {
  content: "Zuklappen";
  flex: 0 0 auto;
  align-self: flex-start;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-soft);
  background: var(--surface-soft);
  font-size: 0.72rem;
  font-weight: 900;
}

.collapsible-panel:not([open]) .collapsible-summary::after {
  content: "Aufklappen";
}

.collapsible-panel:not([open]) .collapsible-summary {
  align-items: center;
}

.collapsible-panel:not([open]) .collapsible-summary p {
  display: none;
}

.collapsible-content {
  padding: 0 16px 16px;
}

.collapsible-content > .section-head:first-child {
  margin-top: -4px;
}

.release-dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.dashboard-stat-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.dashboard-stat-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 12px;
  min-height: 92px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  box-shadow: 0 8px 20px rgba(33, 62, 98, 0.05);
}

.dashboard-stat-card strong {
  font-size: 1.72rem;
  line-height: 1;
}

.dashboard-stat-label {
  color: var(--text-soft);
  font-size: 0.84rem;
  font-weight: 800;
}

.dashboard-stat-card.status-error {
  background: color-mix(in srgb, var(--danger) 9%, var(--surface));
}

.dashboard-stat-card.status-warning {
  background: color-mix(in srgb, var(--warn-bg) 74%, var(--surface));
}

.dashboard-stat-card.status-info {
  background: color-mix(in srgb, var(--info-bg) 70%, var(--surface));
}

.issue-meta {
  font-size: 0.86rem;
}

.issue-error,
.status-error {
  border-color: color-mix(in srgb, var(--danger) 42%, var(--line));
}

.issue-warning,
.status-warning {
  border-color: var(--warn-line);
}

.issue-info,
.status-info {
  border-color: var(--info-line);
}

.status-ok {
  border-color: var(--ok-line);
}

.status-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.status-error.status-pill,
.status-error .status-pill {
  color: color-mix(in srgb, var(--danger) 78%, #5b0e19);
  background: color-mix(in srgb, var(--danger) 14%, var(--surface));
  border-color: color-mix(in srgb, var(--danger) 42%, var(--line));
}

.status-warning.status-pill,
.status-warning .status-pill {
  color: var(--warn-text);
  background: var(--warn-bg);
  border-color: var(--warn-line);
}

.status-info.status-pill,
.status-info .status-pill {
  color: var(--info-text);
  background: var(--info-bg);
  border-color: var(--info-line);
}

:root[data-theme="dark"] .issue-error {
  background: color-mix(in srgb, var(--danger) 16%, var(--surface));
}

:root[data-theme="dark"] .issue-warning {
  background: color-mix(in srgb, var(--warn-bg) 90%, var(--surface));
}

:root[data-theme="dark"] .issue-info {
  background: color-mix(in srgb, var(--info-bg) 88%, var(--surface));
}

:root[data-theme="dark"] .dashboard-stat-card.status-error {
  background: color-mix(in srgb, var(--danger) 14%, var(--surface));
}

:root[data-theme="dark"] .dashboard-stat-card.status-warning {
  background: color-mix(in srgb, var(--warn-bg) 84%, var(--surface));
}

:root[data-theme="dark"] .dashboard-stat-card.status-info {
  background: color-mix(in srgb, var(--info-bg) 84%, var(--surface));
}

:root[data-theme="dark"] .status-error.status-pill,
:root[data-theme="dark"] .status-error .status-pill {
  color: #ffd9de;
  background: color-mix(in srgb, var(--danger) 22%, var(--surface));
  border-color: color-mix(in srgb, var(--danger) 48%, var(--line));
}

:root[data-theme="dark"] .undo-slot-floating {
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.32));
}

@media (min-width: 900px) {
  .release-dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.mobile-day-jump {
  display: none;
}

.next-shift-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.next-shift-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.next-shift-main strong,
.next-shift-main span,
.next-shift-main a {
  overflow-wrap: anywhere;
}

.employee-contact-line {
  overflow-wrap: anywhere;
}

.mobile-assign-form {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.mobile-assign-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

@media (max-width: 899px) {
  .app-header {
    position: sticky;
    top: 0;
    z-index: 80;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
  }

  .header-brand {
    min-width: 0;
    justify-content: flex-start;
  }

  .logo-slot {
    width: 92px;
    height: 38px;
    flex: 0 0 auto;
  }

  .brand {
    min-width: 0;
    max-width: 52vw;
    font-size: 0.95rem;
    line-height: 1.12;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .header-actions {
    grid-column: 2;
    justify-content: flex-end;
    min-width: 0;
  }

  .user-menu {
    width: auto;
  }

  .user-chip {
    width: auto;
    min-height: 40px;
    max-width: 34vw;
    padding: 8px 10px;
  }

  .user-chip span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .user-menu-panel {
    position: fixed;
    left: auto;
    right: 10px;
    top: 58px;
    width: min(280px, calc(100vw - 20px));
  }

  .main-nav {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
    padding: 6px;
    overflow: visible;
    border-radius: 12px;
    scroll-snap-type: none;
  }

  .main-nav > a {
    justify-content: center;
    min-height: 40px;
  }

  .nav-group {
    min-width: 0;
  }

  .nav-group-label {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    gap: 8px;
    padding: 8px 7px;
    font-size: 0.68rem;
    letter-spacing: 0.03em;
  }

  .nav-group-chevron {
    font-size: 1rem;
  }

  .nav-group-panel {
    position: fixed;
    left: 10px;
    right: 10px;
    top: 108px;
    z-index: 120;
    width: auto;
    max-height: min(58vh, 380px);
    overflow-y: auto;
    padding: 8px;
    border-radius: 12px;
  }

  .nav-group-panel a,
  .main-nav > a {
    min-height: 42px;
    justify-content: flex-start;
    padding: 10px 11px;
    font-size: 0.9rem;
  }

  .content {
    width: min(100% - 16px, 1180px);
    margin: 10px auto 28px;
  }

  .panel {
    padding: 12px;
    border-radius: 9px;
  }

  .mobile-first-panel {
    display: grid;
    gap: 12px;
  }

  .week-head {
    display: grid !important;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .mobile-action-grid,
  .employee-quick-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }

  .mobile-action-grid .btn,
  .employee-quick-actions .btn {
    min-height: 44px;
    width: 100%;
    justify-content: center;
    padding-inline: 8px;
  }

  .mobile-action-grid .btn:first-child {
    grid-column: 1 / -1;
  }

  .week-head .employee-quick-actions.mobile-action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    justify-self: stretch;
  }

  .week-head .employee-quick-actions.mobile-action-grid .btn:first-child {
    grid-column: 1 / -1;
  }

  .next-shift-card {
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
    margin-top: 0;
    padding: 12px;
  }

  .next-shift-card .btn {
    width: 100%;
    justify-content: center;
    min-height: 42px;
  }

  .calendar-scroll {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    border: 0;
    border-radius: 0;
    overflow: visible;
    padding-bottom: 0;
  }

  .day-card {
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    min-height: 0;
    background: var(--surface);
  }

  .day-card h2 {
    min-height: 48px;
    padding: 10px 11px;
  }

  .employee-day-card .shift-list,
  .admin-calendar-grid .shift-list {
    padding: 10px;
  }

  .employee-shift-card {
    border-radius: 10px;
    padding: 12px;
  }

  .employee-shift-site {
    display: grid;
    gap: 4px;
  }

  .employee-shift-site a,
  .employee-month-shift a {
    overflow-wrap: anywhere;
  }

  .empty-day-note {
    margin: 0;
    padding: 14px;
    color: var(--text-soft);
    font-weight: 700;
  }

  .employee-month-panel {
    padding: 10px;
  }

  .employee-month-grid {
    gap: 8px;
  }

  .employee-month-day {
    display: grid;
    gap: 8px;
    border-radius: 10px;
    background: var(--surface);
  }

  .employee-month-day .month-date {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 0;
  }

  .employee-month-day .month-date span {
    color: var(--text-soft);
    font-weight: 800;
  }

  .employee-month-shift {
    display: grid;
    gap: 5px;
  }

  .week-publication-bar {
    position: sticky;
    top: 108px;
    z-index: 50;
    display: grid;
    gap: 10px;
    padding: 11px;
    margin: 12px 0;
    border-radius: 10px;
  }

  .week-head > .inline-actions:not(.employee-quick-actions) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    justify-self: stretch;
  }

  .week-head > .inline-actions:not(.employee-quick-actions) .btn,
  .week-head > .inline-actions:not(.employee-quick-actions) form {
    width: 100%;
  }

  .week-head > .inline-actions:not(.employee-quick-actions) .btn {
    justify-content: center;
    min-height: 42px;
    padding-inline: 8px;
  }

  .week-publication-bar .inline-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }

  .week-publication-bar form,
  .week-publication-bar .btn {
    width: 100%;
  }

  .week-publication-bar .btn {
    min-height: 40px;
    justify-content: center;
    padding-inline: 8px;
  }

  .pdf-export-form,
  .export-all-form {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-soft);
  }

  .pdf-export-button-wrap,
  .export-all-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pdf-export-button-wrap .btn,
  .export-all-form .btn {
    width: 100%;
    min-height: 42px;
    justify-content: center;
  }

  .mobile-day-jump {
    position: sticky;
    top: 108px;
    z-index: 45;
    display: grid;
    grid-template-columns: repeat(6, minmax(48px, 1fr));
    gap: 5px;
    margin: 10px 0;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(10px);
  }

  .mobile-day-jump a {
    display: grid;
    gap: 2px;
    min-height: 42px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--text);
    text-decoration: none;
    font-size: 0.72rem;
    line-height: 1;
  }

  .mobile-day-jump strong {
    font-size: 0.78rem;
  }

  .planning-layout {
    gap: 10px;
  }

  .planner-top-panel {
    order: 2;
    display: grid;
    gap: 8px;
  }

  .planner-top-panel .fold-panel {
    padding: 10px;
    border-radius: 10px;
  }

  .planner-top-panel .fold-panel[open] {
    max-height: 280px;
    overflow: auto;
  }

  .shift-type-pool,
  .project-pool,
  .employee-pool {
    max-height: 210px;
    overflow-y: auto;
    padding-right: 2px;
  }

  .admin-calendar-grid {
    order: 1;
  }

  .compact-shift-card {
    border-radius: 10px;
  }

  .shift-card-open {
    min-height: 72px;
    padding: 11px 12px 11px 16px;
  }

  .shift-detail-panel {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: 8px;
    top: auto;
    z-index: 110;
    max-height: 72vh;
    overflow: auto;
    border-radius: 12px;
    transform: translateY(calc(100% + 16px));
    transition: transform 180ms ease;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
  }

  .shift-detail-panel.is-open {
    transform: translateY(0);
  }

  .shift-detail-empty {
    display: none;
  }

  .detail-panel-close {
    position: static;
    width: 100%;
    min-height: 44px;
    margin-top: 12px;
    border-top: 1px solid var(--line);
  }

  .detail-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

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

  .mobile-assign-row .btn {
    width: 100%;
    min-height: 42px;
    justify-content: center;
  }

  .detail-actions .btn,
  .detail-actions form {
    width: 100%;
  }

  .mail-console-head,
  .mail-status-strip,
  .mail-action-grid,
  .mail-two-column {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .mail-console-head .inline-actions,
  .section-head.compact {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .mail-status-strip {
    padding: 0;
  }

  .mail-status-strip > div {
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface-soft);
  }

  .mail-card {
    padding: 11px;
  }

  .mail-inline-fields,
  .mail-schedule-compact {
    grid-template-columns: 1fr !important;
  }

  .compact-definition-list div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .dashboard-action-grid,
  .dashboard-stat-list,
  .dashboard-grid,
  .release-dashboard-grid {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }

  .dashboard-action-card,
  .dashboard-stat-card,
  .metric-card {
    min-height: 0;
    padding: 12px;
  }

  .collapsible-summary,
  .section-head {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
  }

  .status-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .employee-list {
    gap: 10px;
  }

  .employee-list-item {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
  }

  .employee-list-item .inline-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .employee-list-item .btn {
    width: 100%;
    justify-content: center;
  }

  .balance-filter-form {
    grid-template-columns: 1fr !important;
  }

  .support-check-item,
  .status-list li {
    grid-template-columns: 1fr !important;
    display: grid !important;
    align-items: start;
  }

  .history-table,
  .compact-history-table {
    min-width: 620px;
  }

  .table-scroll,
  .compact-table-scroll,
  .balance-table-scroll {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  input,
  select,
  textarea,
  button,
  .btn {
    font-size: 16px;
  }
}
/* ==========================================================================
   Design upgrade 2026
   A calm, full-width operations interface shared by every product surface.
   ========================================================================== */

:root {
  color-scheme: light;
  --bg-main: #f3f6f7;
  --bg-alt: #eaf0f2;
  --surface: #ffffff;
  --surface-soft: #f7f9fa;
  --surface-raised: #ffffff;
  --line: #d8e2e5;
  --line-strong: #c3d0d5;
  --text: #17272e;
  --text-soft: #62727a;
  --muted: #62727a;
  --accent: #0b7285;
  --accent-strong: #075b6b;
  --accent-soft: #e3f2f4;
  --danger: #b83a48;
  --ok-bg: #e7f6ee;
  --ok-line: #b7ddc8;
  --ok-text: #17613e;
  --info-bg: #e6f3f6;
  --info-line: #b7d8df;
  --info-text: #175c6a;
  --warn-bg: #fff5df;
  --warn-line: #e8ce8c;
  --warn-text: #765413;
  --radius-sm: 9px;
  --radius-md: 13px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(23, 39, 46, 0.04), 0 7px 18px rgba(23, 39, 46, 0.045);
  --shadow: 0 1px 2px rgba(23, 39, 46, 0.05), 0 16px 40px rgba(23, 39, 46, 0.065);
  --shadow-lg: 0 24px 70px rgba(23, 39, 46, 0.14);
  --page-gutter: clamp(12px, 2.4vw, 40px);
  --header-height: 72px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg-main: #0d1519;
  --bg-alt: #101c21;
  --surface: #152126;
  --surface-soft: #1a282e;
  --surface-raised: #1d2c32;
  --line: #2c3d44;
  --line-strong: #3c5058;
  --text: #ecf3f5;
  --text-soft: #a6b5bb;
  --muted: #a6b5bb;
  --accent: #43b2c3;
  --accent-strong: #6bc6d3;
  --accent-soft: #17383f;
  --danger: #f07984;
  --ok-bg: #143325;
  --ok-line: #2f6a4b;
  --ok-text: #bcebd0;
  --info-bg: #14343c;
  --info-line: #346b78;
  --info-text: #c8edf2;
  --warn-bg: #392f1c;
  --warn-line: #79622e;
  --warn-text: #f0d48a;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.22), 0 9px 24px rgba(0, 0, 0, 0.18);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.24), 0 18px 46px rgba(0, 0, 0, 0.24);
  --shadow-lg: 0 28px 80px rgba(0, 0, 0, 0.46);
}

html {
  min-width: 320px;
  background: var(--bg-main);
  scrollbar-gutter: stable;
}

body {
  min-width: 320px;
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.94rem;
  line-height: 1.5;
  background:
    radial-gradient(circle at 8% -10%, color-mix(in srgb, var(--accent) 11%, transparent), transparent 30rem),
    linear-gradient(160deg, var(--bg-main), var(--bg-alt));
  background-attachment: fixed;
}

.bg-pattern {
  opacity: 0.45;
  background:
    linear-gradient(color-mix(in srgb, var(--line) 24%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--line) 20%, transparent) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 58%);
}

:root[data-theme="dark"] .bg-pattern {
  opacity: 0.18;
  background:
    linear-gradient(color-mix(in srgb, var(--line) 42%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--line) 34%, transparent) 1px, transparent 1px);
  background-size: 48px 48px;
}

::selection {
  color: #ffffff;
  background: var(--accent);
}

a,
button,
input,
select,
textarea,
summary {
  -webkit-tap-highlight-color: transparent;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 10000;
  padding: 0.7rem 1rem;
  border-radius: 0.5rem;
  color: #fff;
  background: #063f47;
  font-weight: 700;
  transform: translateY(-200%);
  transition: transform 120ms ease-out;
}

.skip-link:focus {
  transform: translateY(0);
}

h1,
h2,
h3,
.brand,
.dashboard-stat-card strong {
  text-wrap: balance;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(1.45rem, 1.1rem + 0.8vw, 2.15rem);
  line-height: 1.13;
  letter-spacing: -0.028em;
}

h2 {
  font-size: clamp(1.04rem, 0.96rem + 0.25vw, 1.3rem);
  line-height: 1.25;
  letter-spacing: -0.012em;
}

p {
  text-wrap: pretty;
}

.muted {
  color: var(--text-soft);
}

/* Full-width application shell */
.content {
  width: auto;
  max-width: none;
  margin: clamp(14px, 2vw, 26px) var(--page-gutter) 48px;
  gap: clamp(12px, 1.35vw, 20px);
}

.panel {
  min-width: 0;
  padding: clamp(16px, 1.65vw, 26px);
  border-color: color-mix(in srgb, var(--line) 92%, transparent);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: var(--shadow-sm);
}

.panel-small {
  width: min(100%, 620px);
}

/* Compact, product-first header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(180px, 1fr);
  align-items: center;
  gap: clamp(14px, 2vw, 30px);
  min-height: var(--header-height);
  padding: 9px var(--page-gutter);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: 0 8px 26px rgba(23, 39, 46, 0.055);
  backdrop-filter: blur(18px) saturate(1.3);
}

:root[data-theme="dark"] .app-header {
  border-bottom-color: rgba(255, 255, 255, 0.07);
  background: color-mix(in srgb, #101b20 90%, transparent);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.22);
}

.header-brand {
  min-width: 0;
  gap: 13px;
}

.logo-slot {
  width: 126px;
  height: 46px;
  flex: 0 0 auto;
  padding: 4px 7px;
  border-color: var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
  box-shadow: none;
}

.logo-link {
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.logo-link:hover {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  background: var(--accent-soft);
  box-shadow: none;
}

.brand-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.brand {
  overflow: hidden;
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  font-weight: 760;
  line-height: 1.22;
  letter-spacing: -0.015em;
  text-overflow: ellipsis;
  text-shadow: none;
  white-space: nowrap;
}

.brand-context {
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.main-nav {
  gap: 3px;
  padding: 4px;
  border-color: var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  box-shadow: none;
}

.nav-group {
  border-radius: 10px;
}

.nav-group-label {
  min-width: 108px;
  min-height: 38px;
  gap: 8px;
  padding: 8px 11px;
  border-radius: 10px;
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.nav-group-label:hover,
.nav-group[open] .nav-group-label,
.nav-group.is-current .nav-group-label {
  border-color: transparent;
  color: var(--accent-strong);
  background: var(--accent-soft);
  box-shadow: none;
}

.nav-group.is-current .nav-group-label::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--accent);
}

.nav-group-chevron,
.user-menu-chevron {
  color: currentColor;
  font-size: 1rem;
  opacity: 0.65;
}

.nav-group-panel,
.user-menu-panel {
  top: calc(100% + 9px);
  padding: 7px;
  border-color: var(--line);
  border-radius: 14px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg);
}

.nav-group-panel a,
.main-nav > a,
.user-menu-item {
  min-height: 40px;
  padding: 9px 11px;
  border-radius: 9px;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 650;
}

.nav-group-panel a:hover,
.nav-group-panel a.is-active,
.main-nav > a:hover,
.main-nav > a.is-active,
.user-menu-item:hover {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.nav-group-panel a.is-active,
.main-nav > a.is-active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.header-actions {
  min-width: 0;
}

.user-chip {
  min-height: 40px;
  padding: 8px 11px;
  border-color: var(--line);
  border-radius: 11px;
  color: var(--text);
  background: var(--surface-soft);
  box-shadow: none;
  font-weight: 700;
}

.user-chip::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #38a169;
  box-shadow: 0 0 0 3px color-mix(in srgb, #38a169 15%, transparent);
}

.user-menu-item.theme-toggle::before,
.app-header .theme-toggle::before {
  content: "◐";
  margin-right: 7px;
  font-size: 0.95em;
}

/* Shared controls */
.btn {
  min-height: 40px;
  padding: 9px 14px;
  border-radius: 10px;
  background: var(--accent);
  box-shadow: 0 7px 18px color-mix(in srgb, var(--accent) 19%, transparent);
  font-size: 0.88rem;
  font-weight: 700;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.btn:hover {
  filter: none;
  background: var(--accent-strong);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 23%, transparent);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-light,
.app-header .btn-light {
  border-color: var(--line);
  color: var(--text);
  background: var(--surface);
  box-shadow: none;
}

.btn-light:hover,
.app-header .btn-light:hover,
.btn-light.is-active {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  color: var(--accent-strong);
  background: var(--accent-soft);
  box-shadow: none;
}

.btn-danger {
  border-color: color-mix(in srgb, var(--danger) 72%, var(--line));
  background: var(--danger);
}

label {
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 700;
}

input,
select,
textarea {
  min-height: 44px;
  padding: 10px 12px;
  border-color: var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

input:hover,
select:hover,
textarea:hover {
  border-color: color-mix(in srgb, var(--accent) 36%, var(--line-strong));
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent);
}

.message {
  border-width: 1px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.status-pill,
.skill-badge,
.load-badge,
.availability-chip,
.day-chip {
  font-weight: 720;
  letter-spacing: 0;
}

/* Dashboard */
.dashboard-hero {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(115deg, color-mix(in srgb, var(--accent-soft) 70%, var(--surface)), var(--surface) 56%);
}

.dashboard-hero::after {
  content: "";
  position: absolute;
  top: -130px;
  right: -90px;
  width: 330px;
  height: 330px;
  pointer-events: none;
  border: 52px solid color-mix(in srgb, var(--accent) 7%, transparent);
  border-radius: 50%;
}

.dashboard-hero > * {
  position: relative;
  z-index: 1;
}

.panel-eyebrow {
  margin-bottom: 7px;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.11em;
}

.dashboard-action-grid {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: clamp(10px, 1.1vw, 16px);
  margin-top: clamp(18px, 2vw, 28px);
}

.dashboard-action-card {
  position: relative;
  min-height: 134px;
  gap: 9px;
  padding: 18px;
  border-color: var(--line);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: none;
}

.dashboard-action-card::after {
  content: "→";
  position: absolute;
  top: 16px;
  right: 17px;
  color: var(--accent);
  font-size: 1.15rem;
  transition: transform 140ms ease;
}

.dashboard-action-card:hover {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.dashboard-action-card:hover::after {
  transform: translateX(3px);
}

.dashboard-action-card span {
  padding: 4px 8px;
  font-size: 0.68rem;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.dashboard-action-card strong {
  padding-right: 28px;
  font-size: 1.04rem;
}

.dashboard-stat-list {
  grid-template-columns: minmax(210px, 1.4fr) repeat(5, minmax(130px, 1fr));
  gap: 10px;
  margin-top: clamp(16px, 1.7vw, 24px);
}

.dashboard-stat-card {
  position: relative;
  min-height: 98px;
  overflow: hidden;
  padding: 14px;
  border-color: var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: none;
}

.dashboard-stat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--line-strong);
}

.dashboard-stat-card strong {
  font-size: clamp(1.45rem, 1.2rem + 0.55vw, 2rem);
}

.dashboard-stat-primary {
  color: #ffffff;
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
}

.dashboard-stat-primary::before {
  display: none;
}

.dashboard-stat-primary .dashboard-stat-label {
  color: rgba(255, 255, 255, 0.76);
}

.dashboard-stat-open::before,
.dashboard-stat-warning::before {
  background: #d49b2c;
}

.dashboard-stat-error::before,
.dashboard-stat-mail::before {
  background: var(--danger);
}

.release-dashboard-grid {
  gap: clamp(12px, 1.35vw, 20px);
  align-items: start;
}

.collapsible-panel {
  border-radius: var(--radius-lg);
}

.collapsible-summary {
  padding: clamp(17px, 1.55vw, 24px);
}

.collapsible-summary::after {
  border-color: var(--line);
  color: var(--text-soft);
  background: var(--surface-soft);
}

.collapsible-content {
  padding: 0 clamp(17px, 1.55vw, 24px) clamp(17px, 1.55vw, 24px);
}

/* Planner and calendars */
.planner-command-panel,
.calendar-command-panel {
  background:
    linear-gradient(120deg, color-mix(in srgb, var(--accent-soft) 58%, var(--surface)), var(--surface) 44%);
}

.planner-date-range {
  margin: -2px 0 16px;
  font-weight: 600;
}

.week-publication-bar {
  padding: 14px 16px;
  border-color: color-mix(in srgb, var(--accent) 22%, var(--line));
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--accent-soft) 58%, var(--surface));
}

.planning-layout {
  gap: clamp(12px, 1.25vw, 20px);
}

.planner-top-panel,
.shift-detail-panel {
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.fold-panel {
  padding: 10px;
  border-color: var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
}

.fold-panel summary {
  position: relative;
  padding-right: 20px;
  font-size: 0.88rem;
  font-weight: 750;
}

.fold-panel summary::after {
  content: "⌄";
  position: absolute;
  right: 2px;
  color: var(--text-soft);
}

.fold-panel:not([open]) summary::after {
  content: "›";
}

.project-drag,
.employee-drag,
.shift-type-drag {
  border-color: var(--line);
  border-radius: 9px;
  box-shadow: 0 1px 0 rgba(23, 39, 46, 0.025);
}

.project-drag:hover,
.employee-drag:hover,
.shift-type-drag:hover {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 46%, var(--surface));
}

.shift-type-drag {
  min-height: 42px;
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.trash-zone {
  border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
  border-radius: 11px;
  color: var(--text-soft);
  background: color-mix(in srgb, var(--danger) 4%, var(--surface-soft));
}

.calendar-scroll {
  border-color: var(--line);
  border-radius: var(--radius-md);
  background: var(--line);
  gap: 1px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-color: var(--line-strong) transparent;
}

.day-card {
  min-width: 0;
  border: 0;
  background: var(--surface-soft);
}

.day-card h2 {
  min-height: 60px;
  padding: 11px 12px;
  border-bottom-color: var(--line);
  color: var(--text);
  background: var(--surface);
}

.day-card.day-availability-high,
.day-card.day-availability-medium,
.day-card.day-availability-low {
  background: var(--surface-soft);
}

.day-card.day-availability-high h2 {
  border-top: 3px solid #2a9d7c;
  border-bottom-color: var(--line);
  color: var(--text);
  background: color-mix(in srgb, #2a9d7c 8%, var(--surface));
}

.day-card.day-availability-medium h2 {
  border-top: 3px solid #d29a32;
  border-bottom-color: var(--line);
  color: var(--text);
  background: color-mix(in srgb, #d29a32 9%, var(--surface));
}

.day-card.day-availability-low h2 {
  border-top: 3px solid #ca6270;
  border-bottom-color: var(--line);
  color: var(--text);
  background: color-mix(in srgb, #ca6270 9%, var(--surface));
}

.day-availability-count {
  border-color: var(--line);
  color: var(--text-soft);
  background: var(--surface-soft);
}

.day-availability-count-empty {
  border-color: var(--ok-line);
  color: var(--ok-text);
  background: var(--ok-bg);
}

.empty-day-state {
  display: flex;
  min-height: 168px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 22px 12px;
  color: var(--text-soft);
  text-align: center;
}

.empty-day-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--ok-line);
  border-radius: 50%;
  color: var(--ok-text);
  background: var(--ok-bg);
}

.empty-day-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.empty-day-copy {
  display: grid;
  gap: 3px;
}

.empty-day-copy strong {
  color: var(--text);
  font-size: 0.84rem;
  line-height: 1.2;
}

.empty-day-copy > span {
  font-size: 0.72rem;
  line-height: 1.35;
}

.shift-list {
  gap: 9px;
  padding: 10px;
}

.compact-shift-card {
  border-color: var(--line);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(23, 39, 46, 0.045);
}

.compact-shift-card::before {
  width: 3px;
}

.shift-card-open {
  padding: 10px 10px 10px 14px;
}

.shift-card-open:hover {
  background: color-mix(in srgb, var(--accent-soft) 62%, var(--surface));
}

:root[data-theme="dark"] .compact-shift-card {
  border-color: var(--line);
  background: var(--surface-raised);
}

:root[data-theme="dark"] .shift-card-open:hover {
  background: var(--accent-soft);
}

.shift-detail-panel {
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.month-scroll {
  border-radius: var(--radius-md);
  scrollbar-color: var(--line-strong) transparent;
}

.month-weekdays {
  position: sticky;
  top: 0;
  z-index: 2;
  gap: 1px;
  margin-bottom: 1px;
  border-radius: 11px 11px 0 0;
  overflow: hidden;
  background: var(--line);
}

.month-weekdays span {
  padding: 10px;
  color: var(--text-soft);
  background: var(--surface-soft);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.month-grid {
  gap: 1px;
  padding: 1px;
  background: var(--line);
}

.month-day {
  min-height: 156px;
  padding: 10px;
  border: 0;
  border-radius: 0;
  background: var(--surface);
}

.month-day.out-month {
  opacity: 1;
  background: color-mix(in srgb, var(--surface-soft) 78%, var(--bg-main));
}

.month-day.out-month > * {
  opacity: 0.52;
}

.month-date {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-bottom: 9px;
  border-radius: 999px;
  font-size: 0.82rem;
}

.month-shift-list {
  gap: 5px;
}

.month-shift-list li {
  padding: 7px 8px;
  border-color: color-mix(in srgb, var(--accent) 18%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent-soft) 38%, var(--surface));
  font-size: 0.78rem;
}

/* Lists, tables and system surfaces */
.employee-list {
  gap: 11px;
}

.employee-list-item {
  padding: 14px 16px;
  border-color: var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.employee-list-item:hover {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.table-scroll,
.compact-table-scroll,
.balance-table-scroll {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.history-table,
.compact-history-table {
  border-collapse: separate;
  border-spacing: 0;
}

.history-table th,
.compact-history-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--text-soft);
  background: var(--surface-soft);
  font-size: 0.72rem;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.history-table th,
.history-table td,
.compact-history-table th,
.compact-history-table td {
  padding: 11px 12px;
  border-color: var(--line);
}

.history-table tbody tr:hover,
.compact-history-table tbody tr:hover {
  background: color-mix(in srgb, var(--accent-soft) 44%, var(--surface));
}

.issue-item,
.status-list li,
.compact-list li,
.info-box,
.metric-card,
.mail-card,
.support-check-item {
  border-radius: var(--radius-md);
}

.issue-item,
.status-list li,
.compact-list li {
  padding: 11px 12px;
}

/* Employee experience */
.employee-hero-panel {
  overflow: hidden;
  background:
    linear-gradient(120deg, color-mix(in srgb, var(--accent-soft) 76%, var(--surface)), var(--surface) 58%);
}

.next-shift-card {
  padding: 16px;
  border-color: color-mix(in srgb, var(--accent) 26%, var(--line));
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.employee-shift-card {
  border-color: var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.login-page .app-header {
  position: relative;
  background: transparent;
  box-shadow: none;
}

.login-page .content {
  width: auto;
  min-height: calc(100vh - var(--header-height) - 48px);
  margin-inline: var(--page-gutter);
}

.login-panel {
  padding: clamp(24px, 4vw, 42px);
  box-shadow: var(--shadow);
}

@media (min-width: 1200px) {
  .planning-layout {
    grid-template-columns: minmax(245px, 285px) minmax(0, 1fr) minmax(280px, 300px);
    gap: clamp(14px, 1.2vw, 22px);
  }

  .planner-top-panel {
    top: calc(var(--header-height) + 14px);
    max-height: calc(100vh - var(--header-height) - 28px);
  }

  .shift-detail-panel {
    top: calc(var(--header-height) + 14px);
  }

  .calendar-scroll {
    grid-template-columns: repeat(6, minmax(110px, 1fr));
  }
}

@media (min-width: 900px) and (max-width: 1199px) {
  .planning-layout {
    grid-template-columns: minmax(235px, 280px) minmax(0, 1fr);
  }

  .planner-top-panel {
    grid-column: 1;
  }

  .admin-calendar-grid {
    grid-column: 2;
    min-width: 0;
  }

  .shift-detail-panel {
    grid-column: 1 / -1;
  }

  .calendar-scroll {
    grid-template-columns: repeat(6, minmax(150px, 1fr));
    overflow-x: auto;
  }

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

  .dashboard-stat-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .support-check-item {
    grid-template-columns: minmax(190px, 0.8fr) minmax(0, 1.45fr) 92px;
    column-gap: 16px;
  }

  .support-check-item .status-pill {
    min-width: 64px;
    justify-self: end;
    text-align: center;
  }
}

@media (max-width: 899px) {
  :root {
    --page-gutter: 12px;
    --header-height: auto;
  }

  body {
    font-size: 0.92rem;
    background: var(--bg-main);
  }

  .app-header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    min-height: 0;
    padding: 8px var(--page-gutter);
  }

  .header-brand {
    gap: 9px;
  }

  .logo-slot {
    width: 84px;
    height: 36px;
    padding: 3px 5px;
    border-radius: 9px;
  }

  .brand {
    max-width: 48vw;
    color: var(--text);
    font-size: 0.88rem;
  }

  .brand-context {
    display: none;
  }

  .header-actions {
    grid-column: 2;
    grid-row: 1;
  }

  .user-chip {
    min-height: 38px;
    max-width: 34vw;
    padding: 7px 9px;
  }

  .main-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    gap: 4px;
    padding: 4px;
    border-radius: 11px;
  }

  .nav-group-label {
    min-height: 38px;
    padding: 7px 6px;
    font-size: 0.72rem;
  }

  .nav-group.is-current .nav-group-label::before {
    width: 5px;
    height: 5px;
  }

  .nav-group-panel {
    top: 101px;
    border-radius: 13px;
  }

  .user-menu-panel {
    top: 54px;
  }

  .content {
    width: auto;
    margin: 12px var(--page-gutter) 32px;
    gap: 11px;
  }

  .panel {
    padding: 14px;
    border-radius: 14px;
  }

  h1 {
    font-size: 1.42rem;
  }

  .btn {
    min-height: 44px;
    padding: 10px 13px;
  }

  .dashboard-hero::after {
    display: none;
  }

  .dashboard-action-grid,
  .dashboard-stat-list,
  .release-dashboard-grid {
    grid-template-columns: 1fr !important;
  }

  .dashboard-action-card {
    min-height: 0;
    padding: 14px;
  }

  .dashboard-stat-card {
    min-height: 84px;
  }

  .week-publication-bar {
    padding: 12px;
  }

  .calendar-scroll {
    gap: 10px;
    background: transparent;
  }

  .day-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
  }

  .day-card h2 {
    min-height: 54px;
    border-radius: 12px 12px 0 0;
  }

  .empty-day-state {
    min-height: 0;
    flex-direction: row;
    justify-content: flex-start;
    gap: 11px;
    padding: 13px;
    text-align: left;
  }

  .empty-day-icon {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
  }

  .empty-day-icon svg {
    width: 18px;
    height: 18px;
  }

  .month-day {
    min-height: 136px;
  }

  .next-shift-card {
    padding: 14px;
  }

  .employee-list-item {
    padding: 13px;
  }

  input,
  select,
  textarea,
  button,
  .btn {
    font-size: 16px;
  }
}

@media (max-width: 520px) {
  .brand {
    max-width: 38vw;
  }

  .user-chip {
    max-width: 30vw;
  }

  .user-chip::before {
    display: none;
  }

  .dashboard-head .inline-actions,
  .calendar-command-panel .inline-actions,
  .planner-command-panel .inline-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .dashboard-head .btn,
  .calendar-command-panel .btn,
  .planner-command-panel .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
.brand-logo-fallback {
  align-items: center;
  background: var(--accent, #0084a8);
  border-radius: 10px;
  color: #fff;
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 800;
  justify-content: center;
  letter-spacing: 0.04em;
  min-height: 36px;
  min-width: 36px;
}
