:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #eef2f5;
  --text: #17202a;
  --muted: #687480;
  --border: #d9e0e6;
  --red: #c81724;
  --red-dark: #9f111b;
  --green: #177245;
  --green-soft: #e8f5ee;
  --amber: #a76508;
  --amber-soft: #fff4dc;
  --blue: #1c5d99;
  --shadow: 0 14px 35px rgba(17, 24, 39, 0.08);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  letter-spacing: 0;
}

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

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 440px) 1fr;
}

.login-panel {
  background: var(--surface);
  padding: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--border);
}

.login-art {
  padding: 52px;
  display: grid;
  align-content: center;
  background:
    linear-gradient(135deg, rgba(200, 23, 36, 0.08), rgba(23, 114, 69, 0.08)),
    #f8fafc;
}

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

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--red);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
}

.login-logo-mark {
  width: 64px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: #111820;
  overflow: hidden;
}

.login-logo-mark img {
  display: block;
  width: 54px;
  height: auto;
}

.brand-text strong {
  display: block;
  font-size: 18px;
}

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

.login-panel h1,
.login-art h2 {
  margin: 0 0 10px;
  font-size: 30px;
  line-height: 1.12;
}

.login-panel p,
.login-art p {
  margin: 0 0 26px;
  color: var(--muted);
  line-height: 1.55;
}

.login-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.login-tile {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  min-height: 118px;
}

.login-tile strong {
  display: block;
  margin-bottom: 8px;
}

.login-tile span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.pwa-install {
  display: grid;
  gap: 12px;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.pwa-install h2 {
  margin: 0;
  font-size: 16px;
}

.pwa-install-actions {
  display: grid;
  gap: 9px;
}

.pwa-install-actions .btn {
  justify-content: flex-start;
  text-align: left;
}

.pwa-install-actions .platform-logo {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.pwa-install-in-app {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
  max-width: 520px;
}

.pwa-install-in-app .pwa-install-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pwa-install-in-app .pwa-install-actions .btn {
  min-height: 92px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 12px;
}

.pwa-install-in-app .pwa-install-actions .platform-logo {
  width: 26px;
  height: 26px;
}

.pwa-install-status {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.pwa-install-help {
  display: grid;
  gap: 9px;
  padding: 13px;
  border: 1px solid #b8c8d8;
  border-radius: 8px;
  background: #edf4fa;
  color: #173d61;
  font-size: 13px;
  line-height: 1.45;
}

.pwa-install-help p {
  margin: 0;
  color: inherit;
}

.pwa-install-help .btn {
  justify-self: start;
  color: inherit;
  border-color: #9cb3c8;
}

.kiosk-login-status {
  display: grid;
  gap: 8px;
  padding: 15px;
  border: 1px solid #b8c8d8;
  border-radius: 8px;
  background: #edf4fa;
  color: #173d61;
}

.kiosk-login-status span {
  color: #42617b;
  font-size: 13px;
  line-height: 1.45;
}

.form {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--text);
  background: #fff;
  outline: none;
}

.field textarea {
  min-height: 82px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(200, 23, 36, 0.12);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px 1fr;
}

.sidebar {
  background: #111820;
  color: #fff;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-header {
  display: block;
}

.sidebar-menu {
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mobile-nav-toggle {
  display: none;
}

.sidebar .brand {
  margin: 0 0 8px;
  gap: 10px;
}

.sidebar-logo {
  display: block;
  width: 58px;
  max-width: 100%;
  height: auto;
}

.sidebar-brand-text strong {
  display: block;
  color: #fff;
  font-size: 16px;
  line-height: 1.15;
}

.sidebar-brand-text span {
  display: block;
  color: #cbd5df;
  font-size: 13px;
  font-weight: 700;
  margin-top: 3px;
}

.sidebar .brand-mark {
  width: 40px;
  height: 40px;
}

.sidebar .brand-text span {
  color: #9aa7b3;
}

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

.nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #cbd5df;
  background: transparent;
  text-align: left;
}

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

.nav-badge {
  min-width: 22px;
  height: 22px;
  margin-left: auto;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--amber);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 10px;
  color: #9aa7b3;
  font-size: 13px;
}

.kiosk-device-label {
  color: #cbd5df;
  line-height: 1.4;
}

.content {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
}

.topbar {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
}

.topbar h1 {
  margin: 0;
  font-size: 20px;
}

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

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #e8eef6;
  color: #12345b;
  font-weight: 800;
}

.page {
  padding: 28px;
  overflow: auto;
}

.kiosk-session-notice {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 16px;
  padding: 10px 12px;
  border: 1px solid #b8c8d8;
  border-radius: 6px;
  background: #edf4fa;
  color: #173d61;
  font-size: 13px;
}

.kiosk-session-notice span {
  color: #42617b;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.two {
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  align-items: start;
}

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

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

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.panel-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.panel-header h2,
.metric strong {
  margin: 0;
  font-size: 16px;
}

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

.panel-body {
  padding: 20px;
}

.metric {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.metric strong {
  display: block;
  font-size: 24px;
}

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

.time-overview {
  display: grid;
  gap: 16px;
}

.time-summary-section + .time-summary-section {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.time-summary-heading {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
}

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

.time-summary-grid div {
  min-width: 0;
}

.time-summary-grid span,
.pause-rules strong {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.time-summary-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 17px;
}

.time-summary-grid p {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 1.45;
}

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

.balance-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.balance-summary strong,
.balance-value {
  display: block;
  margin-top: 5px;
  font-size: 20px;
}

.balance-positive {
  color: var(--green);
}

.balance-negative {
  color: var(--red);
}

.check-field {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
}

.check-field input {
  width: 16px;
  height: 16px;
}

.form-note {
  margin: -3px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.time-warning {
  color: var(--amber);
}

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

.open-time-corrections {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  line-height: 1.45;
}

.open-time-corrections strong {
  font-size: 14px;
}

.open-time-corrections span {
  font-size: 13px;
}

.open-time-corrections .actions {
  margin-top: 2px;
}

.btn.open-correction-button {
  background: #fff;
  border: 1px solid #fff;
  color: var(--red-dark);
}

.btn.open-correction-button:hover {
  background: #fce8eb;
}

.pause-rules {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.pause-rules ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.btn {
  min-height: 39px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  padding: 0 14px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

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

.btn.primary:hover {
  background: var(--red-dark);
}

.btn.primary.login-submit {
  background: #12345b;
}

.btn.primary.login-submit:hover {
  background: #0d2747;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.btn.success {
  background: var(--green);
  color: #fff;
}

.btn.warning {
  background: var(--amber);
  color: #fff;
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
}

.sidebar .btn.ghost {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.42);
}

.btn.small {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.status.running,
.status.approved,
.status.sent {
  background: var(--green-soft);
  color: var(--green);
}

.status.paused,
.status.pending,
.status.pending_lead,
.status.pending_management {
  background: var(--amber-soft);
  color: var(--amber);
}

.status.closed,
.status.rejected,
.status.cancelled {
  background: var(--surface-2);
  color: var(--muted);
}

.status.consultation,
.status.consultation_lead,
.status.consultation_management {
  background: #e8eef6;
  color: #12345b;
}

.status.failed {
  background: var(--red-soft);
  color: var(--red);
}

.status.corrected {
  margin-top: 6px;
  background: #e8eef6;
  color: #12345b;
}

.smtp-delivery-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.smtp-delivery-status span {
  color: var(--muted);
  font-size: 13px;
}

.smtp-delivery-active {
  background: var(--green-soft);
  border-color: #c7e4d2;
}

.smtp-delivery-inactive {
  background: var(--amber-soft);
  border-color: #eed7aa;
}

.kiosk-enrollment {
  display: grid;
  gap: 10px;
  padding: 15px;
  border: 1px solid #b8c8d8;
  border-radius: 6px;
  background: #edf4fa;
}

.kiosk-enrollment > div:first-child {
  display: grid;
  gap: 3px;
}

.kiosk-enrollment > div:first-child span {
  color: #42617b;
  font-size: 13px;
  line-height: 1.45;
}

.kiosk-enrollment textarea {
  min-height: 72px;
  resize: vertical;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
}

.dashboard-vacation-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 18px;
  border: 1px solid #c7e4d2;
  border-radius: 6px;
  background: var(--green-soft);
}

.dashboard-vacation-notice > div:first-child {
  display: grid;
  gap: 3px;
}

.dashboard-vacation-notice > div:first-child span,
.dashboard-vacation-notice-list span {
  color: #3c6951;
  font-size: 13px;
}

.dashboard-vacation-notice-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.dashboard-vacation-notice-list > div {
  display: grid;
  gap: 2px;
  min-width: 165px;
  padding-left: 14px;
  border-left: 1px solid #b9d9c5;
}

@media (max-width: 720px) {
  .dashboard-vacation-notice {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-vacation-notice-list {
    justify-content: flex-start;
  }
}

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

.project-list-meta {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.show-more-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 14px;
}

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

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

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

td {
  font-size: 14px;
}

.time-booking-days {
  display: grid;
  gap: 10px;
}

.time-booking-day {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

.time-booking-day summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 12px 16px;
  cursor: pointer;
  color: var(--text);
  background: #f6f8fa;
}

.time-booking-day summary span {
  color: var(--muted);
  font-size: 13px;
}

.time-booking-day[open] summary {
  border-bottom: 1px solid var(--border);
}

.time-booking-day .table-wrap {
  padding: 0 12px;
}

.time-booking-day table {
  min-width: 860px;
}

.time-correction-note {
  display: grid;
  gap: 2px;
  margin-top: 8px;
  padding: 8px 10px;
  border-left: 3px solid var(--blue);
  background: #edf3f9;
  color: #12345b;
  font-size: 12px;
  line-height: 1.35;
}

.time-correction-note strong {
  font-size: 12px;
}

.review-inbox-sections {
  display: grid;
  gap: 24px;
}

.review-inbox-sections > div + div {
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.review-inbox-sections h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.employee-management-layout {
  grid-template-columns: minmax(0, 1fr);
}

.employee-quick-nav {
  order: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.employee-quick-nav .btn {
  min-height: 38px;
}

.employee-quick-nav .btn svg {
  width: 17px;
  height: 17px;
}

.employee-table-panel {
  order: 1;
}

#sick-day-panel {
  order: 2;
}

#employee-edit-panel {
  order: 3;
}

.employee-create-panel {
  order: 4;
}

.employee-system-panel {
  order: 5;
}

#calendar-data-panel {
  order: 6;
}

.employee-table {
  min-width: 1260px;
}

.employee-action-column {
  width: 126px;
}

.employee-row-actions {
  display: flex;
  gap: 6px;
  min-width: 126px;
  white-space: nowrap;
}

.icon-button {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: #12345b;
}

.icon-button:hover:not(:disabled) {
  border-color: #9fb1c5;
  background: #eef3f8;
}

.icon-button.medical {
  color: var(--red);
}

.icon-button svg {
  width: 17px;
  height: 17px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

.stack {
  display: grid;
  gap: 14px;
}

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

.vacation-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.vacation-summary div {
  padding: 12px 0;
  border-bottom: 2px solid var(--border);
}

.vacation-summary span,
.vacation-period-grid > div > strong {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.vacation-summary strong {
  display: block;
  margin-top: 5px;
  font-size: 18px;
}

.vacation-period-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.period-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
}

.period-line span:last-child {
  color: var(--muted);
  white-space: nowrap;
}

.absence-calendar {
  display: grid;
  gap: 10px;
  overflow-x: auto;
}

.absence-calendar-toolbar {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 12px;
  min-width: 700px;
}

.absence-calendar-toolbar strong {
  text-align: center;
  font-size: 17px;
}

.absence-calendar-weekdays,
.absence-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(100px, 1fr));
  min-width: 700px;
}

.absence-calendar-weekdays span {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.absence-calendar-day {
  min-height: 128px;
  padding: 8px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.absence-calendar-day:nth-child(7n + 1) {
  border-left: 1px solid var(--border);
}

.absence-calendar-day.outside-month {
  background: #f7f8f9;
}

.absence-calendar-day.holiday,
.absence-calendar-day.school-break {
  background: #f1f3f5;
}

.absence-calendar-day.weekend {
  background: #e3e8ed;
}

.absence-calendar-day.today {
  box-shadow: inset 0 3px 0 #1c5d99;
}

.absence-calendar-date {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 800;
}

.calendar-today-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #1c5d99;
}

.calendar-meta {
  min-height: 31px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  overflow: hidden;
}

.calendar-events {
  display: grid;
  gap: 4px;
}

.calendar-event {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 3px 5px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.calendar-event span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-event svg {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
}

.calendar-event.company-closure {
  background: #e8eef6;
  color: #12345b;
}

.calendar-event.vacation {
  background: var(--green-soft);
  color: var(--green);
}

.calendar-event.vacation.pending_lead,
.calendar-event.vacation.pending_management {
  background: var(--amber-soft);
  color: var(--amber);
}

.calendar-event.sick {
  background: #fdecee;
  color: var(--red-dark);
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  min-width: 700px;
  padding-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

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

.legend-swatch {
  width: 12px;
  height: 12px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: #fff;
}

.legend-swatch.weekend { background: #e3e8ed; }
.legend-swatch.special { background: #f1f3f5; }
.legend-swatch.closure { background: #e8eef6; }
.legend-swatch.vacation { background: var(--green-soft); }
.legend-swatch.sick { background: #fdecee; }

.vacation-actions {
  min-width: 250px;
}

.message {
  min-height: 22px;
  color: var(--red);
  font-size: 13px;
}

.message.success {
  color: var(--green);
}

.toggle-field {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  cursor: pointer;
}

.toggle-field input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.toggle-control {
  width: 44px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border-radius: 999px;
  background: #9ba7b2;
  transition: background 160ms ease;
}

.toggle-control span {
  width: 18px;
  height: 18px;
  display: block;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.28);
  transition: transform 160ms ease;
}

.toggle-field input:checked + .toggle-control {
  background: var(--green);
}

.toggle-field input:checked + .toggle-control span {
  transform: translateX(20px);
}

.toggle-field input:focus-visible + .toggle-control {
  outline: 3px solid rgba(28, 93, 153, 0.32);
  outline-offset: 2px;
}

.toggle-field strong,
.toggle-field small {
  display: block;
}

.toggle-field small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.setup-secret {
  display: grid;
  gap: 8px;
}

.two-factor-setup {
  display: grid;
  grid-template-columns: 190px 1fr;
  align-items: center;
  gap: 16px;
}

.qr-box {
  display: grid;
  place-items: center;
  width: 190px;
  height: 190px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.qr-code {
  display: block;
  width: 100%;
  height: 100%;
}

.setup-secret code,
.recovery-code-grid code {
  display: block;
  width: 100%;
  overflow-wrap: anywhere;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px 12px;
  color: var(--text);
  font-family: Consolas, "Liberation Mono", monospace;
  font-size: 14px;
}

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

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

@media (max-width: 980px) {
  .login-screen,
  .app-shell,
  .grid.two,
  .grid.three,
  .grid.four {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 40;
    padding: 0;
    gap: 0;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.24);
  }

  .sidebar-header {
    min-height: 64px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .sidebar .brand {
    min-width: 0;
    margin: 0;
  }

  .sidebar-logo {
    width: 46px;
  }

  .sidebar-brand-text strong {
    font-size: 15px;
  }

  .sidebar-brand-text span {
    font-size: 11px;
  }

  .mobile-nav-toggle {
    width: 42px;
    height: 42px;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
  }

  .mobile-nav-toggle:hover,
  .mobile-nav-toggle:focus-visible {
    background: rgba(255, 255, 255, 0.14);
    outline: none;
  }

  .mobile-nav-toggle .lucide {
    width: 22px;
    height: 22px;
  }

  .sidebar-menu {
    display: block;
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-6px);
    transition: max-height 220ms ease, opacity 160ms ease, transform 220ms ease, visibility 0s linear 220ms;
  }

  .sidebar.mobile-menu-open .sidebar-menu {
    max-height: 72vh;
    padding: 0 14px 14px;
    overflow-y: auto;
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    transition: max-height 260ms ease, opacity 180ms ease, transform 260ms ease;
  }

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

  .sidebar-footer {
    display: none;
  }

  .topbar {
    height: auto;
    padding: 16px;
    align-items: flex-start;
    flex-direction: column;
  }

  .page {
    padding: 16px;
  }

  .two-factor-setup {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 620px) {
  .login-panel,
  .login-art {
    padding: 28px 20px;
  }

  .login-grid,
  .inline-fields,
  .time-summary-grid,
  .balance-summary,
  .vacation-summary,
  .vacation-period-grid {
    grid-template-columns: 1fr;
  }

  .pwa-install-in-app .pwa-install-actions {
    grid-template-columns: 1fr;
  }

  .pwa-install-in-app .pwa-install-actions .btn {
    min-height: 46px;
    flex-direction: row;
    align-items: center;
  }

  .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }
}
