:root {
  --navy-dark: #0b223f;
  --navy: #12345d;
  --navy-light: #1e4e8c;
  --blue-tint: #eaf2fb;
  --blue-soft: #d5e5f7;
  --bg: #f3f6fa;
  --surface: #ffffff;
  --border: #d7e1ec;
  --text: #111827;
  --text-muted: #52637a;
  --danger: #b91c1c;
  --danger-bg: #fef2f2;
  --success: #15803d;
  --success-bg: #f0fdf4;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(11, 34, 63, 0.06);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 16px;
}

.hidden {
  display: none !important;
}

/* App Shell (Sidebar Desktop + Topbar Mobile) */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 248px;
  flex-shrink: 0;
  background: #0a1628;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px 14px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 50;
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 4px;
}

.brand-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.brand h1 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
}

.brand-sub {
  margin: 2px 0 0;
  font-size: 0.74rem;
  color: #94a3b8;
}

.autosave-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.76rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 7px 12px;
  border-radius: 999px;
  color: #cbd5e1;
  width: 100%;
  justify-content: center;
}

.autosave-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.65);
}

.year-switcher {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  padding: 3px 6px;
}

.year-switcher select {
  background: transparent;
  color: #ffffff;
  border: none;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 5px 8px;
  cursor: pointer;
}

.year-switcher select option {
  color: var(--text);
  background: #ffffff;
}

.year-switcher .icon-btn {
  color: #94a3b8;
  padding: 5px 9px;
}

.year-switcher .icon-btn:hover {
  color: #ffffff;
}

.nav-tabs {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 22px;
  flex: 1;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 11px;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 9px;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.8;
}

.nav-tab:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-tab:hover .nav-icon {
  opacity: 1;
}

.nav-tab.active {
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.nav-tab.active .nav-icon {
  opacity: 1;
}

.sidebar-footer {
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Main Content Workspace */
.main-content {
  flex: 1;
  min-width: 0;
  width: 100%;
  padding: 24px 28px 56px;
  max-width: 1320px;
  margin: 0 auto;
}

/* Dashboard Header & KPI Strip */
.dash-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.dash-month-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.dash-kpis {
  display: grid;
  grid-template-columns: 1.15fr 1.1fr 0.9fr 1.25fr;
  gap: 14px;
}

.dash-kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--navy-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
}

.dash-kpi-navy {
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 100%);
  border-color: var(--navy-dark);
  border-top-color: #3b82f6;
  color: #ffffff;
}

.dash-kpi-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.dash-kpi-navy .dash-kpi-label {
  color: var(--blue-soft);
}

.dash-kpi-value {
  font-size: clamp(1.12rem, 1.5vw, 1.38rem);
  font-weight: 800;
  line-height: 1.2;
  color: var(--navy-dark);
  white-space: nowrap;
}

.dash-kpi-navy .dash-kpi-value {
  color: #ffffff;
}

.dash-kpi-money {
  color: var(--navy);
}

.dash-kpi-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.dash-kpi-navy .dash-kpi-sub {
  color: var(--blue-soft);
}

.rate-inline-box {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0;
}

.form-header-toggle {
  margin-bottom: 12px;
}

.form-header-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

@media (max-width: 1024px) {
  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: sticky;
    top: 0;
    padding: 12px 16px 0;
  }

  .sidebar-top {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .nav-tabs {
    flex-direction: row;
    margin-top: 10px;
    overflow-x: auto;
    gap: 4px;
  }

  .nav-tab {
    border-radius: 6px 6px 0 0;
    padding: 9px 14px;
    border-bottom: 3px solid transparent;
  }

  .nav-tab.active {
    background: #2563eb;
    box-shadow: none;
    border-bottom-color: transparent;
  }

  .sidebar-footer {
    display: none;
  }

  .main-content {
    padding: 18px 16px 48px;
  }

  .dash-kpis {
    grid-template-columns: repeat(2, 1fr);
  }
}

.view {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  max-width: 100%;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 0;
  max-width: 100%;
  box-shadow: var(--shadow);
  padding: 20px;
}

.card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.card h2,
.card h3 {
  margin: 0;
  color: var(--navy-dark);
}

.subtitle {
  margin: 4px 0 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Month Navigation */
.month-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.month-heading {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--navy-dark);
  text-transform: capitalize;
}

.month-nav-card {
  padding: 12px 14px;
}

.months-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.month-pill {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #f8fafc;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.month-pill:hover {
  border-color: var(--navy-light);
  background: var(--blue-tint);
}

.month-pill.active {
  background: var(--navy-dark);
  border-color: var(--navy-dark);
  color: #ffffff;
}

.month-pill-name {
  font-weight: 700;
  font-size: 0.9rem;
}

.month-pill-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.month-pill.active .month-pill-meta {
  color: var(--blue-soft);
}

/* Rate Bar */
.rate-bar-card {
  padding: 14px 20px;
}

.rate-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rate-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.rate-label {
  font-weight: 700;
  color: var(--navy-dark);
  font-size: 0.95rem;
}

.rate-input-group {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  overflow: hidden;
  background: #ffffff;
}

.rate-input-group input {
  width: 85px;
  border: none;
  padding: 7px 10px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy-dark);
}

.rate-input-group input:focus {
  outline: none;
}

.unit-suffix {
  padding: 7px 10px;
  background: var(--blue-tint);
  color: var(--navy-dark);
  font-weight: 700;
  font-size: 0.85rem;
  border-left: 1px solid var(--border);
}

.rate-hint {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Form */
.live-preview {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--blue-tint);
  border: 1px solid var(--blue-soft);
  color: var(--navy-dark);
  font-weight: 700;
  font-size: 0.88rem;
}

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

.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-field label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--navy-dark);
}

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

.form-field input,
.form-field select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 0.93rem;
  font-family: inherit;
  background: #ffffff;
  color: var(--text);
}

.form-field input:focus,
.form-field select:focus {
  outline: 2px solid rgba(30, 78, 140, 0.25);
  border-color: var(--navy-light);
}

.form-field input:disabled,
.form-field select:disabled {
  background: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
}

.employer-row,
.pause-input-row,
.new-employer-box,
.employer-add-inline {
  display: flex;
  gap: 6px;
  align-items: center;
}

.new-employer-box {
  margin-top: 6px;
}

.pause-input-row input {
  flex: 1;
  min-width: 70px;
}

.pause-input-row select {
  width: 105px;
}

.form-error {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 7px;
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #fecaca;
  font-size: 0.88rem;
  font-weight: 600;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 7px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}

.btn:active {
  transform: translateY(1px);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.84rem;
}

.btn-primary {
  background: var(--navy-light);
  color: #ffffff;
}

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

.btn-navy {
  background: var(--navy-dark);
  color: #ffffff;
}

.btn-navy:hover {
  background: var(--navy);
}

.btn-outline {
  background: #ffffff;
  border-color: var(--border);
  color: var(--navy-dark);
}

.btn-outline:hover {
  background: var(--blue-tint);
  border-color: var(--navy-light);
}

.btn-danger {
  background: var(--danger);
  color: #ffffff;
}

.btn-danger:hover {
  background: #991b1b;
}

.btn-danger-outline {
  background: #ffffff;
  border-color: #fecaca;
  color: var(--danger);
}

.btn-danger-outline:hover {
  background: var(--danger-bg);
  border-color: var(--danger);
}

.icon-btn {
  background: transparent;
  border: none;
  font-size: 1.15rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 6px;
}

.icon-btn:hover {
  background: rgba(0, 0, 0, 0.06);
}

/* Tables */
.table-header-bar {
  margin-bottom: 14px;
}

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

.table-responsive {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--navy-light);
  border-radius: 8px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
  font-size: 0.9rem;
}

.data-table thead th {
  background: var(--navy);
  color: #ffffff;
  font-weight: 700;
  text-align: left;
  padding: 11px 12px;
  border-right: 1px solid var(--navy-light);
  white-space: nowrap;
}

.data-table thead th:last-child {
  border-right: none;
}

.data-table tbody td {
  padding: 10px 12px;
  border-top: 1px solid #cbd5e1;
  border-right: 1px solid #e2e8f0;
  vertical-align: middle;
}

.data-table tbody td:last-child {
  border-right: none;
}

.data-table tbody tr:nth-child(even) {
  background: var(--blue-tint);
}

.data-table tbody tr:hover {
  background: #dceafb;
}

.cell-strong {
  font-weight: 700;
  color: var(--navy-dark);
}

.cell-money {
  font-weight: 700;
  color: var(--navy);
  white-space: nowrap;
}

.badge-midnight {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--blue-soft);
  color: var(--navy-dark);
  margin-left: 4px;
}

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

.inline-input {
  width: 100%;
  padding: 5px 7px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--text);
  transition: border-color 0.15s, background-color 0.15s;
}

.inline-input:hover {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.75);
}

.inline-input:focus {
  outline: none;
  border-color: var(--navy-light);
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(30, 78, 140, 0.18);
}

.inline-date {
  min-width: 125px;
  font-weight: 700;
  color: var(--navy-dark);
}

.inline-employer {
  min-width: 135px;
}

.inline-time {
  min-width: 88px;
}

.inline-pause-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.inline-pause {
  width: 62px;
  text-align: right;
}

.inline-pause-unit {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.inline-text {
  min-width: 120px;
}

.inline-end-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.empty-table-row td {
  text-align: center;
  padding: 28px 16px;
  color: var(--text-muted);
  font-style: italic;
}

/* Monthly Summary Panel */
.monthly-summary-panel {
  margin-top: 18px;
  border: 2px solid var(--navy-dark);
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border-bottom: 2px solid var(--navy-dark);
}

.summary-stat {
  background: #f8fafc;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.stat-value {
  font-size: 1.2rem;
  color: var(--navy-dark);
}

.stat-sub {
  font-size: 0.84rem;
  color: var(--text-muted);
  font-weight: 600;
}

.summary-grand-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 100%);
  color: #ffffff;
  padding: 20px 24px;
  gap: 20px;
}

.grand-total-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.grand-total-divider {
  width: 1px;
  height: 64px;
  background: rgba(255, 255, 255, 0.25);
}

.gt-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--blue-soft);
}

.gt-value {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.15;
}

.gt-money {
  font-size: 2.2rem;
  color: #ffffff;
}

.gt-sub {
  font-size: 0.85rem;
  color: var(--blue-soft);
}

/* Annual KPIs */
.annual-kpis {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.kpi-box {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kpi-box.kpi-primary {
  background: var(--navy-dark);
  border-color: var(--navy-dark);
  color: #ffffff;
}

.kpi-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.kpi-primary .kpi-label {
  color: var(--blue-soft);
}

.kpi-value {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--navy-dark);
}

.kpi-primary .kpi-value {
  color: #ffffff;
  font-size: 1.7rem;
}

.kpi-sub {
  font-size: 0.84rem;
  color: var(--blue-soft);
}

/* Backup & Settings */
.backup-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.backup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.employers-list {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.employer-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--blue-tint);
  border: 1px solid var(--blue-soft);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--navy-dark);
}

.employer-chip button {
  background: transparent;
  border: none;
  color: var(--danger);
  font-weight: 700;
  cursor: pointer;
  padding: 0 2px;
  font-size: 1rem;
  line-height: 1;
}

/* Modals */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 34, 63, 0.58);
}

.modal-dialog {
  position: relative;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-lg {
  max-width: 960px;
}

.modal-sm {
  max-width: 460px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--navy-dark);
  color: #ffffff;
}

.modal-header h3 {
  margin: 0;
  color: #ffffff;
  font-size: 1.05rem;
}

.modal-header .icon-btn {
  color: #ffffff;
  font-size: 1.4rem;
}

.modal-body {
  padding: 20px;
  overflow: auto;
}

.modal-image-body {
  background: #e2e8f0;
  text-align: center;
}

.modal-image-body img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: #f8fafc;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--navy-dark);
  color: #ffffff;
  padding: 11px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  border-left: 4px solid #4ade80;
}

.toast.toast-error {
  border-left-color: #f87171;
}

/* Responsive */
@media (max-width: 960px) {
  .months-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .annual-kpis {
    grid-template-columns: repeat(2, 1fr);
  }
  .backup-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .months-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .summary-grid {
    grid-template-columns: 1fr;
  }
  .summary-grand-total {
    flex-direction: column;
    align-items: flex-start;
  }
  .grand-total-divider {
    width: 100%;
    height: 1px;
  }
  .annual-kpis {
    grid-template-columns: 1fr;
  }
  .month-nav-header {
    flex-wrap: wrap;
  }
}

.pdf-import-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 14px;
  background: var(--blue-tint);
  border: 1px solid var(--blue-soft);
  border-radius: 8px;
}

.pdf-import-summary {
  margin: 0;
  font-weight: 700;
  color: var(--navy-dark);
}

.pdf-import-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pdf-import-controls label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--navy-dark);
}

.pdf-import-controls select {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 0.88rem;
}

/* Mobile-first card layout & touch optimization */
@media (max-width: 768px) {
  .container {
    padding: 0 10px;
  }

  .card {
    padding: 14px;
  }

  .topbar-inner {
    padding-top: 10px;
    padding-bottom: 8px;
    gap: 8px;
  }

  .brand-sub {
    display: none;
  }

  .autosave-pill {
    font-size: 0.75rem;
    padding: 4px 10px;
  }

  .nav-tab {
    padding: 9px 12px;
    font-size: 0.86rem;
  }

  .btn {
    min-height: 42px;
  }

  .dash-header {
    flex-direction: column;
    align-items: stretch;
  }

  .dash-month-bar {
    justify-content: space-between;
  }

  .dash-quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .dash-quick-actions #btn-toggle-shift-form {
    grid-column: 1 / -1;
  }

  .dash-kpis {
    grid-template-columns: 1fr;
  }

  .table-actions-bar {
    width: 100%;
    flex-direction: column;
  }

  .table-actions-bar .btn {
    width: 100%;
  }

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

  .rate-info {
    width: 100%;
  }

  /* Éviter le zoom automatique sur iOS/Android */
  .form-field input,
  .form-field select,
  .inline-input,
  .rate-input-group input {
    font-size: 16px;
  }

  /* Transformation du tableau mensuel et aperçu PDF en cartes mobiles */
  #monthly-table,
  #pdf-preview-table {
    min-width: 0;
  }

  .table-responsive:has(#monthly-table),
  .table-responsive:has(#pdf-preview-table) {
    border: none;
    overflow-x: visible;
  }

  #monthly-table thead,
  #pdf-preview-table thead {
    display: none;
  }

  #monthly-table tbody,
  #pdf-preview-table tbody {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  #monthly-table tbody tr:not(.empty-table-row),
  #pdf-preview-table tbody tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 10px;
    padding: 12px;
    border: 1px solid var(--navy-light);
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(11, 34, 63, 0.06);
  }

  #monthly-table tbody tr:nth-child(even):not(.empty-table-row),
  #pdf-preview-table tbody tr:nth-child(even) {
    background: #f8fbff;
  }

  #monthly-table tbody td,
  #pdf-preview-table tbody td {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 4px 0;
    border: none;
  }

  #monthly-table tbody td::before,
  #pdf-preview-table tbody td::before {
    content: attr(data-label);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.03em;
  }

  #monthly-table tbody td.col-actions::before {
    display: none;
  }

  /* Champs pleine largeur dans la carte mobile */
  #monthly-table tbody td[data-label="Employeur"],
  #monthly-table tbody td[data-label="Poste"],
  #monthly-table tbody td[data-label="Remarques"],
  #monthly-table tbody td.col-actions,
  #pdf-preview-table tbody td[data-label="Employeur / Site"],
  #pdf-preview-table tbody td[data-label="Poste"] {
    grid-column: 1 / -1;
  }

  #monthly-table tbody td.col-actions .row-actions,
  #monthly-table tbody td.col-actions .btn-delete {
    width: 100%;
  }

  .inline-input {
    border-color: var(--border);
    background: #ffffff;
    padding: 8px 10px;
    min-width: 0;
  }

  .inline-date,
  .inline-employer,
  .inline-time,
  .inline-text {
    min-width: 0;
    width: 100%;
  }

  .inline-pause {
    width: 100%;
    text-align: left;
  }

  .table-search-input {
    width: 100%;
  }

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

/* V2 Dashboard Chart, Search & Modal Form */
.dash-chart-card {
  padding: 16px 20px;
}

.chart-header {
  margin-bottom: 10px;
}

.chart-header-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.chart-detail-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--navy-dark);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
}

.chart-legend-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--blue-tint);
  border: 1px solid var(--blue-soft);
  color: var(--navy-dark);
  font-size: 0.82rem;
  font-weight: 700;
}

.dash-chart-container {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 4px;
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 136px;
  min-width: 640px;
  padding-top: 4px;
}

.chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  background: transparent;
  border: none;
  padding: 2px 1px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: background-color 0.12s ease;
}

.chart-col:hover,
.chart-col.is-selected {
  background: var(--blue-tint);
}

.chart-val {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--navy-dark);
  line-height: 1;
  min-height: 10px;
  white-space: nowrap;
}

.chart-bar-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.chart-bar {
  width: 100%;
  max-width: 18px;
  border-radius: 4px 4px 2px 2px;
  background: #e2e8f0;
  transition: height 0.2s ease, background-color 0.15s ease;
}

.chart-col.is-active .chart-bar {
  background: linear-gradient(180deg, var(--navy-light) 0%, var(--navy-dark) 100%);
}

.chart-col.is-active:hover .chart-bar,
.chart-col.is-selected .chart-bar {
  background: #2563eb;
}

.chart-day {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
}

.chart-col.is-active .chart-day {
  color: var(--navy-dark);
  font-weight: 700;
}

.table-search-input {
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-family: inherit;
  font-size: 0.88rem;
  min-width: 220px;
  background: #ffffff;
  color: var(--text);
}

.table-search-input:focus {
  outline: 2px solid rgba(30, 78, 140, 0.2);
  border-color: var(--navy-light);
}

.modal-md {
  max-width: 680px;
}

.modal-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-header-right .live-preview {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
  font-size: 0.82rem;
  padding: 4px 11px;
}

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

.modal-form-actions {
  justify-content: flex-end;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* Vue Pronote — Emploi du temps hebdomadaire */
.pronote-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
}

.pronote-week-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.pronote-week-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.pronote-title {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--navy-dark);
}

.pronote-week-stats {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--navy-light);
}

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

.pronote-card {
  padding: 0;
  overflow: hidden;
}

.pronote-grid {
  display: flex;
  width: 100%;
  overflow-x: auto;
  background: #ffffff;
}

.pronote-time-col {
  width: 58px;
  flex-shrink: 0;
  background: #f8fafc;
  border-right: 1px solid var(--border);
}

.pronote-time-spacer {
  height: 52px;
  border-bottom: 2px solid var(--navy-dark);
  background: var(--navy-dark);
}

.pronote-hour-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: right;
  padding: 2px 6px 0 0;
  border-bottom: 1px dashed #e2e8f0;
}

.pronote-days-wrap {
  display: grid;
  grid-template-columns: repeat(7, minmax(125px, 1fr));
  flex: 1;
  min-width: 875px;
}

.pronote-day-col {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.pronote-day-col:last-child {
  border-right: none;
}

.pronote-day-header {
  height: 52px;
  background: var(--navy);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-bottom: 2px solid var(--navy-dark);
}

.pronote-day-col.is-today .pronote-day-header {
  background: #1d4ed8;
}

.pronote-day-name {
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.pronote-day-date {
  font-size: 0.76rem;
  color: var(--blue-soft);
}

.pronote-day-body {
  position: relative;
  background: #ffffff;
}

.pronote-grid-line {
  position: absolute;
  left: 0;
  right: 0;
  border-bottom: 1px solid #f1f5f9;
  pointer-events: none;
}

.pronote-empty-day {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.78rem;
  color: #cbd5e1;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  pointer-events: none;
}

.pronote-block {
  position: absolute;
  left: 4px;
  right: 4px;
  border-radius: 6px;
  border: 1px solid transparent;
  border-left-width: 4px;
  padding: 5px 7px;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: inherit;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
  transition: transform 0.1s, box-shadow 0.15s;
}

.pronote-block:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.16);
  z-index: 5;
}

.pronote-block-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.pronote-block-time {
  font-size: 0.72rem;
  font-weight: 700;
}

.pronote-block-net {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.75);
}

.pronote-block-emp {
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pronote-block-poste {
  font-size: 0.72rem;
  opacity: 0.88;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pronote-midnight {
  font-weight: 700;
}

/* Couleurs Pronote par employeur */
.pronote-color-0 {
  background: #e0ecff;
  border-color: #bfdbfe;
  border-left-color: #1d4ed8;
  color: #1e3a8a;
}

.pronote-color-1 {
  background: #dcfce7;
  border-color: #bbf7d0;
  border-left-color: #15803d;
  color: #14532d;
}

.pronote-color-2 {
  background: #fef3c7;
  border-color: #fde68a;
  border-left-color: #d97706;
  color: #78350f;
}

.pronote-color-3 {
  background: #f3e8ff;
  border-color: #e9d5ff;
  border-left-color: #7e22ce;
  color: #581c87;
}

.pronote-color-4 {
  background: #ffe4e6;
  border-color: #fecdd3;
  border-left-color: #be123c;
  color: #881337;
}

/* Pronote Mobile : liste verticale par jour */
@media (max-width: 768px) {
  .pronote-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .pronote-week-nav {
    justify-content: space-between;
  }

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

  .pronote-time-col,
  .pronote-grid-line {
    display: none;
  }

  .pronote-days-wrap {
    grid-template-columns: 1fr;
    min-width: 0;
    width: 100%;
  }

  .pronote-day-col {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .pronote-day-header {
    height: auto;
    padding: 8px 12px;
    flex-direction: row;
    justify-content: space-between;
  }

  .pronote-day-body {
    height: auto !important;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .pronote-empty-day {
    position: static;
    transform: none;
    text-align: center;
    padding: 6px 0;
  }

  .pronote-block {
    position: static;
    height: auto !important;
    padding: 10px 12px;
  }
}

/* Argent personnel */
.personal-money-card {
  padding: 14px 18px;
}

.personal-money-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.personal-money-info,
.personal-money-total {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pm-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.pm-value {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--navy-dark);
}

.pm-total-value {
  font-size: 1.32rem;
  font-weight: 800;
  color: #15803d;
}

.personal-money-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.personal-money-controls .rate-input-group input {
  width: 105px;
}

/* Graphique d'évolution annuelle */
.evo-toggle {
  display: inline-flex;
  background: var(--blue-tint);
  border: 1px solid var(--blue-soft);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
}

.evo-btn {
  background: transparent;
  border: none;
  color: var(--navy-dark);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.evo-btn.active {
  background: var(--navy-dark);
  color: #ffffff;
}

.dash-evolution-container {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}

.evo-svg {
  width: 100%;
  min-width: 560px;
  height: auto;
  display: block;
}

.evo-point {
  cursor: pointer;
}

.evo-dot {
  fill: #cbd5e1;
  stroke: #ffffff;
  stroke-width: 2;
  transition: r 0.15s, fill 0.15s;
}

.evo-point.is-active .evo-dot {
  fill: #1d4ed8;
}

.evo-point.is-current .evo-dot,
.evo-point.is-selected .evo-dot {
  fill: #2563eb;
  stroke: #dbeafe;
  stroke-width: 3;
}

.evo-val-label {
  font-size: 11px;
  font-weight: 700;
  fill: var(--navy-dark);
}

.evo-x-label {
  font-size: 11px;
  font-weight: 600;
  fill: var(--text-muted);
}

.evo-point.is-current .evo-x-label,
.evo-point.is-selected .evo-x-label {
  fill: var(--navy-dark);
  font-weight: 800;
}

.backup-transfer-box {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.backup-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: monospace;
  font-size: 0.85rem;
  resize: vertical;
  background: #f8fafc;
}

.backup-textarea:focus {
  outline: 2px solid rgba(30, 78, 140, 0.2);
  border-color: var(--navy-light);
  background: #ffffff;
}
