:root {
  color-scheme: light;
  --festma-red: #ed1c24;
  --festma-blue: #073a5c;
  --festma-blue-2: #0b4e78;
  --ink: #09243a;
  --muted: #5f7182;
  --line: #d8dee6;
  --row: #e8edf4;
  --row-2: #f4f6f9;
  --surface: #ffffff;
  --green: #16806f;
  --green-soft: #e7f4f1;
  --amber: #c3811d;
  --amber-soft: #fff2d9;
  --red-soft: #f9dcdc;
  --radius: 4px;
  font-family: "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: #fff;
  color: var(--ink);
}

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

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(237, 28, 36, 0.2);
  outline-offset: 2px;
}

.servicebar {
  width: 100%;
  border-bottom: 1px solid #eef2f6;
  background: white;
}

.servicebar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 1170px;
  min-height: 52px;
  margin: 0 auto;
  padding: 8px 34px;
}

.topbar {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  max-width: 1170px;
  min-height: 260px;
  margin: 0 auto;
  padding: 0 34px 34px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08), rgba(0, 28, 48, 0.16)),
    url("assets/mainheader.jpg") center 42% / cover;
}

.site-logo {
  position: absolute;
  top: 0;
  left: 150px;
  width: 180px;
  height: 116px;
  object-fit: cover;
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--festma-red);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: clamp(34px, 4vw, 48px);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 24px;
  font-weight: 400;
}

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

.subtitle {
  margin-bottom: 0;
  color: var(--muted);
}

.top-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

[dir="rtl"] .top-actions {
  justify-content: flex-start;
}

.app-shell {
  max-width: 1170px;
  margin: 0 auto 36px;
}

.page-title {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 30px 18px 26px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.section-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  background: var(--festma-red);
}

.tab-button {
  min-height: 52px;
  background: var(--festma-red);
  color: white;
  font-size: 16px;
  font-weight: 400;
}

.tab-button:hover,
.tab-button.active {
  background: white;
  color: var(--festma-red);
}

.view-panel {
  display: none;
  padding: 32px 0 0;
}

.view-panel.active {
  display: grid;
  gap: 22px;
}

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

.panel-heading,
.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.panel-heading span,
.calendar-head span,
.month-title span,
.fineprint {
  color: var(--muted);
  font-size: 13px;
}

.clock-panel {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 22px;
  border: 0;
  background: var(--festma-blue);
  color: white;
}

.clock-copy {
  display: grid;
  gap: 6px;
  padding: 28px;
}

.clock-copy span,
.clock-copy small {
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
}

.clock-copy strong {
  font-size: clamp(42px, 6vw, 68px);
  font-weight: 300;
  line-height: 1;
}

.clock-actions {
  display: grid;
  min-width: 290px;
  grid-template-columns: 1fr;
}

.start-button,
.stop-button {
  min-height: 84px;
  padding: 0 26px;
  color: white;
  font-size: 18px;
  font-weight: 600;
}

.start-button {
  background: var(--green);
}

.stop-button {
  background: var(--festma-red);
}

.focus-panel,
.toolbar-panel,
.calendar-panel,
.shifts-panel,
.breakdown-panel,
.vessel-panel,
.settings-panel {
  padding: 24px;
}

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

.quick-card,
.stat-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--row-2);
  padding: 16px;
}

.quick-card span,
.stat-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.quick-card strong,
.stat-card strong {
  font-size: 28px;
  font-weight: 600;
}

.stat-card.good {
  border-color: #a8d5ca;
  background: var(--green-soft);
}

.stat-card.warn {
  border-color: #e7c27a;
  background: var(--amber-soft);
}

.stat-card.info {
  border-color: #bfd0df;
  background: #e8edf4;
}

.stat-card.bad {
  border-color: #e5a0a0;
  background: var(--red-soft);
}

.toolbar-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.stats-toolbar-panel {
  margin-bottom: 18px;
}

.top-actions,
.toolbar-actions,
.month-title,
.legend {
  display: flex;
  align-items: center;
  gap: 10px;
}

.month-title h2 {
  min-width: 210px;
  font-size: 28px;
}

.vessel-heading {
  align-items: end;
}

.vessel-actions {
  display: grid;
  grid-template-columns: minmax(260px, 360px) auto;
  gap: 10px;
  align-items: end;
}

.vessel-api-field {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.vessel-api-field input {
  min-height: 42px;
}

.vessel-map {
  width: 100%;
  min-height: 420px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #e8edf4;
}

.vessel-map.map-unavailable {
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.vessel-ship-div-icon {
  background: transparent;
  border: 0;
}

.vessel-ship-marker {
  --vessel-color: #005e8a;
  position: relative;
  display: block;
  width: 22px;
  height: 22px;
  transform: rotate(var(--course));
  transform-origin: center;
  filter: drop-shadow(0 2px 3px rgba(0, 23, 39, 0.48));
}

.vessel-ship-marker::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 15px;
  height: 20px;
  background: var(--vessel-color);
  border: 2px solid #ffffff;
  clip-path: polygon(50% 0%, 96% 76%, 62% 100%, 50% 86%, 38% 100%, 4% 76%);
  transform: translateX(-50%);
}

.vessel-ship-marker.is-still {
  width: 14px;
  height: 14px;
  margin: 5px;
  transform: none;
  filter: drop-shadow(0 1px 2px rgba(0, 23, 39, 0.38));
}

.vessel-ship-marker.is-still::before {
  top: 0;
  width: 12px;
  height: 12px;
  border-width: 2px;
  border-radius: 50%;
  clip-path: none;
}

.vessel-ship-marker.tone-high {
  --vessel-color: #007f8f;
}

.vessel-ship-marker.tone-medium {
  --vessel-color: #58a65c;
}

.vessel-ship-marker.tone-low {
  --vessel-color: #5f7890;
}

.vessel-table-wrap {
  margin-top: 18px;
}

.icon-button,
.primary-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: var(--radius);
  padding: 0 16px;
  font-weight: 600;
  white-space: nowrap;
}

.icon-button {
  width: 42px;
  padding: 0;
  background: #f1f3f6;
  color: var(--festma-blue);
  font-size: 24px;
}

.primary-button {
  background: var(--festma-blue);
  color: white;
}

.secondary-button {
  background: #eef2f6;
  color: var(--festma-blue);
}

.danger-button {
  background: var(--red-soft);
  color: #941f25;
}

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

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cfd7e1;
  border-radius: var(--radius);
  background: white;
  color: var(--ink);
  padding: 9px 11px;
}

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

.settings-groups {
  display: grid;
  gap: 18px;
}

.settings-group {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.settings-group h3 {
  padding: 16px 18px;
  background: var(--festma-blue);
  color: white;
  font-weight: 600;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 16px;
  padding: 18px;
}

.tariff-template-grid {
  align-items: end;
}

.template-action {
  display: flex;
  align-items: end;
}

.template-action button {
  width: 100%;
  min-height: 42px;
}

.tariff-preview {
  margin: 0 18px 14px;
  border: 1px solid #ccd8e4;
  border-radius: var(--radius);
  background: #f4f7fb;
  padding: 14px;
}

.tariff-preview-title {
  display: block;
  margin-bottom: 12px;
  color: var(--festma-blue);
  font-size: 16px;
}

.tariff-preview dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
  margin: 0;
}

.tariff-preview dl > div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  padding: 10px;
}

.tariff-preview dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.tariff-preview dd {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
}

.fineprint {
  margin: 0;
  padding: 0 18px 18px;
  line-height: 1.45;
}

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

.weekday-row {
  gap: 4px;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.calendar-grid {
  gap: 4px;
}

.day-cell {
  min-height: 108px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  padding: 9px;
  cursor: pointer;
}

.day-cell:nth-child(odd) {
  background: #fbfcfd;
}

.day-cell.outside {
  opacity: 0.46;
}

.day-cell.today {
  border-color: var(--festma-red);
  box-shadow: inset 0 0 0 1px var(--festma-red);
}

.day-cell.vacation-day {
  border-color: #4c86ad;
  background: #eef6fb;
}

.day-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-weight: 700;
}

.day-top small {
  color: var(--muted);
}

.legend {
  flex-wrap: wrap;
}

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

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.dot.work,
.badge.work {
  background: var(--green-soft);
  color: #0d6256;
}

.dot.free,
.badge.free {
  background: #e4edf6;
  color: var(--festma-blue);
}

.dot.holiday,
.badge.holiday {
  background: var(--red-soft);
  color: #941f25;
}

.dot.vacation,
.badge.vacation {
  background: #d8edf8;
  color: var(--festma-blue);
}

.dot.night,
.badge.night {
  background: var(--amber-soft);
  color: #7c4c09;
}

.dot.work {
  background: var(--green);
}

.dot.free {
  background: var(--festma-blue-2);
}

.dot.holiday {
  background: var(--festma-red);
}

.dot.vacation {
  background: #4c86ad;
}

.dot.night {
  background: var(--amber);
}

.badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.badge {
  display: inline-flex;
  max-width: 100%;
  min-height: 20px;
  border-radius: 2px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
}

.table-wrap {
  overflow: auto;
}

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

th,
td {
  padding: 11px 10px;
  border: 2px solid white;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--festma-blue);
  color: white;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
}

tbody tr:nth-child(odd) td {
  background: var(--row);
}

tbody tr:nth-child(even) td {
  background: var(--row-2);
}

td input,
td select,
td textarea {
  min-width: 150px;
  background: white;
}

td textarea {
  min-width: 220px;
}

.hours-cell {
  white-space: nowrap;
  font-weight: 700;
}

.exception-cell {
  min-width: 92px;
}

.boat-cell {
  min-width: 78px;
}

.boat-cell select {
  min-width: 68px;
}

.wachfuhrer-cell {
  min-width: 118px;
}

.exception-cell label,
.wachfuhrer-cell label {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.exception-cell input,
.wachfuhrer-cell input {
  width: 18px;
  min-width: 18px;
  min-height: 18px;
  padding: 0;
}

.check-cell {
  min-width: 210px;
}

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

.check-pill {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  border-radius: 2px;
  padding: 3px 7px;
  font-size: 12px;
  font-weight: 700;
}

.check-pill.ok {
  background: var(--green-soft);
  color: #0d6256;
}

.check-pill.warn {
  background: var(--amber-soft);
  color: #7c4c09;
}

.check-pill.bad {
  background: var(--red-soft);
  color: #941f25;
}

.check-pill.approval {
  font-weight: 800;
}

.check-pill.approval.pending {
  background: var(--amber-soft);
  color: #7c4c09;
}

.check-pill.approval.confirmed {
  background: #e6f4f1;
  color: #0d6256;
}

.check-pill.approval.correction {
  background: var(--red-soft);
  color: #941f25;
}

.locked-control {
  cursor: not-allowed;
  background: #f4f7fa;
  color: var(--muted);
}

tr.has-warning td {
  background: #fff2d9 !important;
}

.delete-button {
  width: 34px;
  min-height: 34px;
  border-radius: var(--radius);
  background: var(--red-soft);
  color: #941f25;
  font-weight: 800;
}

.empty-state {
  padding: 28px 12px;
  color: var(--muted);
  text-align: center;
}

.breakdown-list {
  display: grid;
  gap: 0;
}

.breakdown-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(120px, auto) minmax(130px, auto);
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.breakdown-row strong {
  font-size: 17px;
}

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

.breakdown-row.total {
  margin-top: 6px;
  border-top: 3px solid var(--festma-blue);
  border-bottom: 0;
  font-weight: 800;
}

@media (max-width: 980px) {
  .topbar {
    min-height: 230px;
    padding: 0 18px 22px;
  }

  .site-logo {
    left: 18px;
  }

  .section-tabs {
    grid-template-columns: repeat(3, 1fr);
  }

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

  .tariff-preview dl {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .clock-panel,
  .toolbar-panel,
  .calendar-head,
  .vessel-heading,
  .admin-employee-item {
    flex-direction: column;
    align-items: stretch;
  }

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

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

  .admin-employee-actions,
  .admin-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .clock-actions {
    min-width: 0;
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .topbar {
    min-height: 240px;
  }

  .site-logo {
    width: 132px;
    height: 86px;
  }

  h1 {
    font-size: 30px;
  }

  .top-actions {
    right: 12px;
  }

  [dir="rtl"] .top-actions {
    right: auto;
    left: 12px;
  }

  .section-tabs {
    grid-template-columns: 1fr 1fr;
  }

  .view-panel {
    padding: 18px 10px 0;
  }

  .field-grid,
  .quick-grid,
  .summary-grid,
  .tariff-preview dl,
  .weekday-row,
  .calendar-grid,
  .breakdown-row {
    grid-template-columns: 1fr;
  }

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

  .vessel-map {
    min-height: 320px;
  }
}

@media print {
  .top-actions,
  .section-tabs,
  .clock-actions,
  .toolbar-actions,
  .delete-button {
    display: none !important;
  }

  .topbar {
    min-height: auto;
    background: white;
    padding: 20px 0;
  }

  .site-logo {
    position: static;
  }

  .eyebrow,
  h1,
  .subtitle {
    color: var(--ink);
    padding: 0;
  }

  .view-panel {
    display: block !important;
  }
}

.employee-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(7, 58, 92, 0.88);
}

.employee-card {
  width: min(440px, 100%);
  display: grid;
  gap: 16px;
  border-radius: var(--radius);
  background: white;
  padding: 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.employee-card h2 {
  margin: 0;
  color: var(--ink);
}

.auth-card {
  gap: 14px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid #ccd8e4;
  border-radius: var(--radius);
  overflow: hidden;
}

.auth-tab {
  min-height: 44px;
  border: 0;
  background: #eef3f8;
  color: var(--blue);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.auth-tab.active {
  background: var(--red);
  color: white;
}

.auth-form {
  display: none;
  gap: 14px;
}

.auth-form.active {
  display: grid;
}

.start-time-card {
  width: min(520px, 100%);
}

.manual-shift-card {
  width: min(520px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
}

.confirm-card {
  width: min(460px, 100%);
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.start-time-options {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.start-time-option {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #eef2f6;
  color: var(--festma-blue);
  font-size: 18px;
  font-weight: 800;
}

.start-time-option:hover,
.start-time-option:focus-visible {
  border-color: var(--festma-blue);
  outline: 2px solid rgba(7, 58, 92, 0.18);
  outline-offset: 1px;
}

.start-time-option.is-default {
  background: var(--festma-blue);
  color: white;
}

.employee-help {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.employee-error {
  min-height: 20px;
  margin: 0;
  color: #941f25;
  font-weight: 600;
}

.employee-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  padding: 4px 6px 4px 12px;
  color: var(--festma-blue);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.employee-badge .secondary-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.editing-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid #f0c36b;
  border-radius: var(--radius);
  background: var(--amber-soft);
  color: #7c4c09;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 18px;
}

.admin-pending-group {
  grid-column: 1 / -1;
}

.admin-add-form,
.admin-worktime-box {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.admin-add-form small {
  color: var(--muted);
  font-weight: 400;
  line-height: 1.35;
}

.fineprint.standalone {
  padding: 0;
}

.admin-employee-list {
  display: grid;
  gap: 8px;
  padding: 0 18px 18px;
}

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

.admin-employee-info > strong,
.admin-employee-info > span {
  display: block;
}

.admin-employee-info > span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.admin-employee-actions,
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.admin-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 176px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  padding: 8px 10px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.admin-toggle input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
  accent-color: var(--green);
}

.admin-toggle input:disabled {
  cursor: not-allowed;
}

.admin-toggle:has(input:checked) {
  border-color: #7bbcaf;
  background: var(--green-soft);
}

.admin-toggle:has(input:disabled) {
  opacity: 0.72;
  cursor: not-allowed;
}

.admin-toggle-text {
  display: grid;
  gap: 2px;
  line-height: 1.15;
}

.admin-toggle-text strong {
  display: block;
  font-size: 13px;
}

.admin-toggle-text small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.admin-access-pill {
  display: inline-flex;
  width: fit-content;
  margin-top: 6px;
  border-radius: 2px;
  background: var(--green-soft);
  color: #0d6256;
  padding: 3px 7px;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.admin-access-pill.inactive {
  background: #eef2f6;
  color: var(--muted);
}

.admin-editing-hint {
  margin: 0;
  color: var(--festma-blue);
  font-weight: 700;
}

.pending-shift-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.approval-column {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.approval-column-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: var(--radius);
  background: var(--festma-blue);
  color: white;
  padding: 12px;
}

.approval-column-heading h4 {
  margin: 0;
  font-size: 15px;
}

.approval-column-heading span {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-weight: 800;
}

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

.pending-shift-empty {
  margin: 0;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
  padding: 16px;
  color: var(--muted);
}

.pending-shift-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
  overflow: hidden;
}

.pending-shift-item[open] {
  background: white;
  box-shadow: 0 8px 22px rgba(4, 61, 94, 0.08);
}

.approval-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  cursor: pointer;
  list-style: none;
  padding: 10px 12px;
}

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

.approval-summary::marker {
  content: "";
}

.approval-summary::after {
  content: "▾";
  color: var(--festma-blue);
  font-size: 12px;
  font-weight: 900;
  transition: transform 0.16s ease;
}

.pending-shift-item[open] .approval-summary::after {
  transform: rotate(180deg);
}

.approval-summary-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.approval-summary-title {
  overflow: hidden;
  color: var(--ink);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.approval-summary-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}

.approval-details-body {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 12px;
}

.approval-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.pending-shift-info {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.pending-shift-info > strong {
  color: var(--ink);
}

.pending-shift-info > span,
.pending-shift-info > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.approval-time-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  align-items: end;
}

.approval-time-form label {
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.approval-time-form input {
  min-height: 38px;
  width: 100%;
  min-width: 0;
  font-size: 13px;
}

.approval-time-error {
  grid-column: 1 / -1;
  min-height: 18px;
  margin: 0;
  color: #941f25;
  font-size: 12px;
  font-weight: 700;
}

.approval-time-form button {
  grid-column: 1 / -1;
  min-height: 36px;
}

.pending-shift-item button {
  flex: 0 0 auto;
}

.approval-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
}

.approval-actions button {
  min-height: 36px;
  padding: 0 10px;
  font-size: 13px;
}

.approval-actions button:disabled {
  opacity: 0.55;
  cursor: default;
}


/* Mobile final patch */
@media (max-width: 768px) {
  .admin-panel {
    overflow: hidden;
  }

  .admin-layout {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 14px;
  }

  .pending-shift-list {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .approval-time-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-panel .settings-group {
    min-width: 0;
  }

  .admin-add-form,
  .admin-worktime-box,
  .admin-employee-list {
    padding: 16px;
  }

  .admin-employee-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 12px;
  }

  .admin-employee-actions,
  .admin-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
  }

  .admin-employee-actions button,
  .admin-actions button,
  .pending-shift-item button,
  .admin-toggle {
    width: 100%;
  }

  .admin-toggle {
    min-width: 0;
    justify-content: flex-start;
  }

  .admin-worktime-box select {
    width: 100%;
  }

  body {
    overflow-x: hidden;
  }

  .topbar {
    min-height: 170px;
    padding: 10px 12px 16px;
    align-items: flex-start;
    background-position: center 42%;
  }

  .site-logo {
    position: relative;
    top: 0;
    left: 0;
    width: 116px;
    height: 76px;
    flex: 0 0 auto;
    object-fit: cover;
  }

  [dir="rtl"] .site-logo {
    left: auto;
    right: 0;
  }

  .top-actions {
    position: relative;
    top: 0;
    right: 0;
    left: auto;
    max-width: calc(100% - 128px);
    justify-content: flex-end;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 6px;
  }

  [dir="rtl"] .top-actions {
    right: auto;
    left: 0;
  }

  .employee-badge {
    max-width: 100%;
    min-height: 36px;
    padding: 3px 5px 3px 8px;
    font-size: 12px;
  }

  .employee-badge span {
    max-width: 128px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .employee-badge .secondary-button,
  .top-actions .primary-button,
  .top-actions .icon-button,
  .install-button {
    min-height: 36px;
    padding: 0 10px;
    font-size: 13px;
  }

  .top-actions .icon-button {
    width: 38px;
    padding: 0;
    font-size: 20px;
  }

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

  .tab-button {
    min-height: 48px;
    font-size: 16px;
  }

  .page-title {
    padding: 22px 16px 24px;
  }

  h1 {
    font-size: clamp(32px, 10vw, 42px);
  }

  .subtitle {
    max-width: 92%;
    font-size: 16px;
    line-height: 1.35;
  }

  .view-panel {
    padding: 18px 10px 0;
  }

  .clock-panel {
    flex-direction: column;
    gap: 0;
  }

  .clock-copy {
    padding: 24px;
  }

  .clock-copy strong {
    font-size: clamp(50px, 16vw, 68px);
  }

  .clock-actions {
    min-width: 100%;
    grid-template-columns: 1fr;
  }

  .start-button,
  .stop-button {
    min-height: 62px;
    font-size: 17px;
  }

  .focus-panel,
  .toolbar-panel,
  .calendar-panel,
  .shifts-panel,
  .breakdown-panel,
  .settings-panel {
    padding: 16px;
  }

  .panel-heading,
  .calendar-head,
  .toolbar-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .quick-grid,
  .summary-grid,
  .field-grid,
  .tariff-preview dl,
  .breakdown-row {
    grid-template-columns: 1fr;
  }

  .month-title {
    justify-content: space-between;
  }

  .month-title h2 {
    min-width: 0;
    font-size: 24px;
  }

  .toolbar-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .toolbar-actions button {
    flex: 1 1 140px;
  }

  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 900px;
  }

  .weekday-row,
  .calendar-grid {
    grid-template-columns: repeat(7, minmax(38px, 1fr));
  }

  .day-cell {
    min-height: 82px;
    padding: 7px;
  }

  .employee-gate {
    padding: 12px;
  }

  .employee-card {
    padding: 22px;
  }

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

  .start-time-option {
    min-height: 58px;
    font-size: 20px;
  }

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

@media (max-width: 420px) {
  .topbar {
    min-height: 150px;
  }

  .site-logo {
    width: 104px;
    height: 68px;
  }

  .top-actions {
    max-width: calc(100% - 112px);
  }

  .employee-badge span {
    max-width: 105px;
  }

  .install-button {
    max-width: 180px;
    white-space: normal;
    line-height: 1.1;
  }
}


.install-button[hidden] { display: none !important; }


/* Final mobile header/install patch */
@media (max-width: 768px) {
  .topbar {
    display: grid;
    grid-template-columns: 92px 1fr;
    align-items: start;
    gap: 8px;
    min-height: 150px;
    padding: 8px;
    overflow: hidden;
    background-position: center 42%;
  }

  .site-logo {
    position: static !important;
    width: 92px !important;
    height: 60px !important;
    object-fit: cover;
    z-index: 1;
  }

  .top-actions {
    position: static !important;
    max-width: none !important;
    width: 100%;
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 6px;
    z-index: 2;
  }

  .employee-badge {
    order: 1;
    max-width: 100%;
    min-width: 0;
  }

  .employee-badge span {
    max-width: 95px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .employee-badge .secondary-button,
  .top-actions .primary-button,
  .top-actions .icon-button,
  .install-button {
    min-height: 34px;
    padding: 0 9px;
    font-size: 12px;
    line-height: 1;
  }

  .install-button {
    max-width: 116px;
    white-space: normal;
    text-align: center;
  }

  .top-actions .icon-button {
    width: 36px;
    padding: 0;
    font-size: 20px;
  }
}

@media (max-width: 420px) {
  .topbar {
    grid-template-columns: 78px 1fr;
    min-height: 142px;
  }

  .site-logo {
    width: 78px !important;
    height: 52px !important;
  }

  .employee-badge span {
    max-width: 76px;
  }

  .top-actions .primary-button,
  .top-actions .icon-button,
  .install-button,
  .employee-badge .secondary-button {
    min-height: 32px;
    padding: 0 7px;
    font-size: 11px;
  }

  .install-button {
    max-width: 98px;
  }
}


/* Header service bar correction */
.servicebar {
  max-width: none !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.servicebar-inner {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 1170px;
  min-height: 52px;
  margin: 0 auto;
  padding: 8px 34px;
}

.servicebar .top-actions {
  position: static !important;
  top: auto !important;
  right: auto !important;
  left: auto !important;
  width: auto !important;
  max-width: 100% !important;
  align-items: center !important;
}

.servicebar .employee-badge {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: #f8fafc;
  box-shadow: none;
}

.servicebar .employee-badge[hidden],
.servicebar .editing-badge[hidden],
.servicebar .install-button[hidden] {
  display: none !important;
}

[dir="rtl"] .servicebar .top-actions {
  justify-content: flex-start;
}

@media (min-width: 769px) {
  .servicebar .install-button {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .servicebar-inner {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 8px;
    min-height: 0;
    padding: 8px 12px;
  }

  .servicebar .top-actions {
    width: 100% !important;
    justify-content: flex-end;
    gap: 6px;
  }

  .servicebar .install-button {
    max-width: min(220px, 100%);
    white-space: normal;
    line-height: 1.15;
  }

  .topbar {
    display: block;
  }
}

@media (max-width: 420px) {
  .servicebar .top-actions {
    justify-content: flex-start;
  }

  .servicebar .employee-badge {
    width: 100%;
    justify-content: space-between;
  }

  .servicebar .editing-badge {
    width: 100%;
    justify-content: center;
  }

  .servicebar .employee-badge span {
    max-width: none;
  }
}

@media print {
  .servicebar {
    display: none !important;
  }
}
