/* Tabs */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 1.5rem; }
.tab-link {
  padding: 0.5rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-light);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
}
.tab-link:hover { color: var(--text); }
.tab-link.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Section headings */
.section-heading {
  font-size: 1.1rem;
  margin: 1.5rem 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Permission groups */
.permission-group {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.permission-group summary {
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.65rem 1rem;
  cursor: pointer;
  background: #f8fafc;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.permission-group summary:hover { background: #f1f5f9; }

.group-count {
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--text-light);
}

.permission-list { padding: 0.25rem 0; }

/* Permission row */
.permission-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 1rem;
  border-bottom: 1px solid #f1f5f9;
}
.permission-row:last-child { border-bottom: none; }
.permission-row:hover { background: #fafbfc; }

.permission-row label {
  flex: 1;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.permission-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.permission-row .scope-wrapper {
  width: 130px;
  flex-shrink: 0;
}

.permission-row .scope-wrapper select {
  width: 100%;
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.permission-row-readonly { cursor: default; }
.permission-row-readonly label { cursor: default; }

.scope-badge {
  font-size: 0.8rem;
  color: var(--text-light);
  font-style: italic;
}

/* Customization dots */
.customized-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-left: 0.25rem;
  vertical-align: middle;
}
.customized-dot.scope_changed { background: var(--warning); }
.customized-dot.added { background: var(--success); }
.customized-dot.removed { background: var(--danger); }

.customized-count {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--warning);
}

/* Role assignment card */
.role-assignment {
  margin-bottom: 1.5rem;
}

.role-assignment h3 {
  margin-bottom: 0.5rem;
}

.role-assign-form {
  margin-top: 0.5rem;
}

.role-assign-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.role-assign-row select {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  min-width: 200px;
}
/* Photo Review */

.section-title {
  font-size: 1.1rem;
  margin: 2rem 0 1rem;
  color: var(--text);
}

.threshold-slider {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.threshold-slider label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.threshold-slider strong {
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  margin-left: 0.25rem;
}

.threshold-slider input[type="range"] {
  width: 100%;
  max-width: 480px;
  vertical-align: middle;
}

.threshold-histogram-wrap {
  width: 100%;
  max-width: 480px;
  /* Half-thumb inset on each side so bar value N lines up with slider value N.
     The native range thumb is ~14-16px wide in macOS browsers; 8px is a good
     visual match without being noticeable when the data is centered. */
  padding: 0 8px;
  box-sizing: border-box;
  margin-top: 0.25rem;
}

.threshold-histogram {
  width: 100%;
  height: 32px;
  display: block;
}

.threshold-help {
  font-size: 0.8rem;
  color: var(--text-light);
  margin: 0.4rem 0 0;
}

/* Inline review rows */
.review-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.review-row {
  display: grid;
  grid-template-columns: 170px 80px 170px 1fr auto;
  gap: 1.25rem;
  align-items: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.review-photo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.review-photo img {
  width: 160px;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius);
  background: #f1f5f9;
}

.review-photo .photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 160px;
  height: 200px;
  background: #f1f5f9;
  color: var(--text-light);
  font-size: 0.8rem;
  text-align: center;
  padding: 0.35rem;
  border-radius: var(--radius);
}

.review-photo-caption {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-light);
}

.review-score {
  font-size: 1.9rem;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.review-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.85rem;
  min-width: 0;
}

.review-meta-time {
  color: var(--text-light);
  font-size: 0.8rem;
}

.review-zoom-btn {
  align-self: flex-start;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  cursor: pointer;
  margin-top: 0.15rem;
}

.review-zoom-btn:hover {
  background: #f1f5f9;
  border-color: var(--primary);
}

.review-controls {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: flex-end;
  min-width: 280px;
}

.review-verdict {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.review-verdict-option {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  background: #fff;
  user-select: none;
  transition: all 0.12s;
}

.review-verdict-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.review-verdict-option:hover {
  background: #f8fafc;
}

.review-accept:has(input:checked) {
  border-color: var(--success);
  background: #16a34a;
  color: #fff;
}

.review-reject:has(input:checked) {
  border-color: var(--danger);
  background: #dc2626;
  color: #fff;
}

.review-verdict-clear {
  background: transparent;
  border: none;
  color: var(--text-light);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.1rem 0.4rem;
  line-height: 1;
}

.review-verdict-clear:hover { color: var(--text); }

.review-needs-update-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-light);
  cursor: pointer;
}

.review-notes {
  width: 100%;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-family: inherit;
}

.review-notes:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.review-form-footer {
  position: sticky;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
  padding: 0.75rem 1rem;
  margin-top: 0.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.review-form-help {
  font-size: 0.85rem;
  color: var(--text-light);
}

/* Side-by-side photo comparison */
.photo-comparison {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.photo-panel {
  flex: 1;
  background: #fff;
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid var(--border);
}

.photo-panel h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-light);
  margin-bottom: 0.75rem;
}

.photo-frame {
  background: #f1f5f9;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 3 / 4;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-placeholder {
  color: var(--text-light);
  font-size: 0.9rem;
}

.photo-meta {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.photo-location {
  color: var(--primary);
  cursor: pointer;
}

/* Score display */
.score-display {
  margin-bottom: 1.5rem;
}

.score-row {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.score-label {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-light);
  margin-bottom: 0.25rem;
}

.score-value {
  font-size: 1.75rem;
  font-weight: 700;
}

.score-pass { color: var(--success); }
.score-uncertain { color: var(--warning); }
.score-fail { color: var(--danger); }

/* Auto result badges */
.badge-pass { background: #dcfce7; color: #166534; }
.badge-fail { background: #fee2e2; color: #991b1b; }
.badge-uncertain { background: #fef3c7; color: #92400e; }

/* Review result badges */
.badge-confirmed { background: #dcfce7; color: #166534; }
.badge-rejected { background: #fee2e2; color: #991b1b; }

/* Verdict form */
.verdict-card {
  margin-bottom: 2rem;
}

.verdict-card h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
}

.verdict-buttons {
  display: flex;
  gap: 1rem;
}

.verdict-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.25rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: center;
}

.verdict-option:hover {
  background: #f8fafc;
}

.verdict-option input[type="radio"] {
  margin-bottom: 0.5rem;
}

.verdict-option input[type="radio"]:checked ~ .verdict-label {
  font-weight: 700;
}

.verdict-confirm:has(input:checked) {
  border-color: var(--success);
  background: #f0fdf4;
}

.verdict-reject:has(input:checked) {
  border-color: var(--danger);
  background: #fef2f2;
}

.verdict-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.verdict-desc {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 0.25rem;
}

/* Checkbox */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
}

/* Textarea */
.form-textarea {
  width: 100%;
  max-width: 600px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
}

.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
/*


 */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --bg: #f8fafc;
  --sidebar-bg: #1e293b;
  --sidebar-text: #cbd5e1;
  --sidebar-active: #3b82f6;
  --text: #1e293b;
  --text-light: #64748b;
  --border: #e2e8f0;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --radius: 6px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 220px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  padding: 1.5rem 0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 0 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 1rem;
  text-align: center;
}

.sidebar-header h2 {
  color: #fff;
  font-size: 1.25rem;
  margin-bottom: 0;
}

.sidebar-header .subtitle {
  font-size: 0.8rem;
  color: var(--sidebar-text);
}

.sidebar ul { list-style: none; }

.sidebar li a {
  display: block;
  padding: 0.6rem 1.25rem 0.6rem 3.25rem;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.15s;
}

.sidebar li a:hover { background: rgba(255,255,255,0.08); }
.sidebar li a.active {
  background: var(--sidebar-active);
  color: #fff;
  font-weight: 500;
}

/* Top-level link (Dashboard) sits flush with section-header text. */
.sidebar > ul > li > a { padding-left: 1.25rem; }

.sidebar-section { margin-top: 1rem; }
.sidebar-standalone { margin-top: 1rem; }
.sidebar-section-header {
  width: 100%;
  text-align: left;
  background: rgba(234, 179, 8, 0.15);
  border: 0;
  padding: 0.55rem 1.25rem;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fde68a;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: inherit;
  transition: background 0.15s;
}
.sidebar-section-header:hover {
  background: rgba(234, 179, 8, 0.25);
}
.sidebar-section-header::before {
  content: "▾";
  display: inline-block;
  font-size: 0.75em;
  color: #fde68a;
  opacity: 0.7;
  transition: transform 0.15s;
  width: 0.8em;
}
.sidebar-section.collapsed .sidebar-section-header::before {
  transform: rotate(-90deg);
}
.sidebar-section.collapsed > ul {
  display: none;
}
.sidebar li a.sidebar-sublink {
  padding-left: 4.25rem;
  font-size: 0.85rem;
}
/* Non-clickable grouping label inside a sidebar section (e.g. "Samsara"
   and "Fleetio" under Fleet). Sits below the section header but above
   the items it groups. */
.sidebar li.sidebar-subhead {
  padding: 0.6rem 1.25rem 0.2rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  list-style: none;
  cursor: default;
  user-select: none;
}
.sidebar-badge {
  display: inline-block;
  background: #d97706;
  color: #fff;
  font-size: 0.7rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  margin-left: 0.4rem;
  font-weight: 600;
}
.sidebar-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  background: #ef4444;
  border-radius: 999px;
  margin-left: 0.45rem;
  vertical-align: middle;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25);
}

/* Sidebar logo */
.sidebar-logo {
  display: flex;
  justify-content: center;
  padding: 0 1.25rem 1rem;
}
.sidebar-logo img {
  max-width: 96px;
  max-height: 96px;
  object-fit: contain;
  border-radius: var(--radius);
}

/* Form sections (used by system_settings) */
.form-section {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}
.form-section-heading {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
}
.form-section-hint {
  font-size: 0.85rem;
  color: var(--text-light);
  margin: 0 0 1rem;
}
.form-hint {
  display: block;
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 0.25rem;
}
.form-label-static {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.logo-comparison {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.5rem;
}
.logo-pair {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.logo-pair[hidden] { display: none; }
.logo-pair .form-label-static { margin-bottom: 0.35rem; }
.logo-preview {
  display: inline-block;
  padding: 0.5rem;
  background: var(--sidebar-bg);
  border-radius: var(--radius);
}
.logo-preview img {
  max-width: 120px;
  max-height: 120px;
  display: block;
}
/* Content */
.content {
  flex: 1;
  padding: 2rem;
  max-width: 1100px;
}

.content h1 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

/* Flash messages */
.flash {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}
.flash.notice { background: #dcfce7; color: #166534; border: 1px solid #86efac; word-break: break-all; }
.flash.alert { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

th, td {
  padding: 0.65rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

th {
  background: #f1f5f9;
  font-weight: 600;
  color: var(--text-light);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8fafc; }

/* Buttons & links */
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background 0.15s;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.8rem; }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { background: #f1f5f9; }

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

/* The `hidden` attribute must win over any display rule (e.g. .btn's
   inline-block), otherwise a hidden button still shows. */
[hidden] { display: none !important; }

/* File input driven by a <label for> styled as a button: keep the native
   input focusable for keyboard users, just not visible. */
.form-group input.file-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.form-group label.btn-file {
  display: inline-block;
  margin-bottom: 0;
}
.form-group input.file-input-hidden:focus-visible + div label.btn-file {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* A text input with a live status note to its right (employee form: email
   in use → link to that employee). Wraps under the field when narrow. */
.field-with-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.form-group .field-with-status input {
  width: auto;
  flex: 0 1 400px;
  min-width: 0;
}
.field-status {
  display: inline;
  margin-top: 0;
}
.field-status.is-warning { color: var(--danger); }
.field-status.is-warning a { color: inherit; font-weight: 500; }

/* Grouped, mutually exclusive choices (employee form: Back Office account). */
.form-fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem 1rem;
  margin: 0 0 1rem;
  max-width: 520px;
}
.form-fieldset legend {
  font-weight: 500;
  font-size: 0.85rem;
  padding: 0 0.3rem;
}
.radio-option {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  font-size: 0.9rem;
  cursor: pointer;
}
.radio-option input[type="radio"] {
  width: auto;
  margin: 0.2rem 0 0;
  flex: none;
}
.radio-option .form-hint { margin-top: 0.1rem; }
#account_password_fields { margin-top: 0.75rem; }
.form-group label.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 400;
  cursor: pointer;
}
.btn:disabled:hover,
.btn[disabled]:hover {
  background: inherit;
}

.actions { display: flex; gap: 0.5rem; align-items: center; }
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.page-header h1 { margin-bottom: 0; }
.page-header .timecard-next { white-space: nowrap; }

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-weight: 500;
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
  color: var(--text);
}

.form-group input,
.form-group select {
  width: 100%;
  max-width: 400px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
}

/* Checkboxes must not inherit the 100%-width text-input sizing above —
   a stretched checkbox leaves a huge gap before its label text. */
.form-group input[type="checkbox"] {
  width: auto;
  padding: 0;
}

/* Sortable column headers: keep "Label ↑" on one line. */
table th a {
  white-space: nowrap;
}

/* Filter-bar Apply/Clear sit side by side; the submit input must not
   take the 100%-width text-input sizing. */
.filter-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-buttons input[type="submit"] {
  width: auto;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: normal;
  margin-top: 0.35rem;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-errors {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  color: #991b1b;
  font-size: 0.85rem;
}
.form-errors ul { margin-left: 1.2rem; }

.form-actions {
  margin-top: 1.5rem;
  display: flex;
  gap: 0.75rem;
}

/* Dashboard cards */
.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.card {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid var(--border);
}

.card h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.card .value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
}

.card .detail {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 0.25rem;
}

/* Status badges */
.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
}
.badge-active { background: #dcfce7; color: #166534; }
.badge-inactive { background: #f1f5f9; color: #64748b; }
.badge-terminated { background: #fee2e2; color: #991b1b; }
.badge-lost { background: #fef3c7; color: #92400e; }
.badge-warn { background: #fef3c7; color: #92400e; }
.badge-voided { background: #fee2e2; color: #991b1b; }
.badge-pw { background: #ede9fe; color: #5b21b6; }
.badge-sheet-received { background: #f1f5f9; color: #64748b; }
.badge-sheet-deciphered { background: #dbeafe; color: #1e40af; }
.badge-sheet-failed { background: #fee2e2; color: #991b1b; }
.badge-sheet-confirmed { background: #dcfce7; color: #166534; }

.text-warn { color: #92400e; }

/* Code display */
.code-display {
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--primary);
}

/* Auth pages */
.auth-body {
  background: var(--sidebar-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.auth-container {
  width: 100%;
  max-width: 420px;
  padding: 1rem;
}

.auth-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.15);
}

.auth-header {
  text-align: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.auth-header h1 {
  font-size: 1.5rem;
  color: var(--text);
  margin-bottom: 0.15rem;
}

.auth-subtitle {
  font-size: 0.85rem;
  color: var(--text-light);
}

.auth-card h2 {
  font-size: 1.15rem;
  margin-bottom: 1rem;
}

.auth-card .form-group input {
  max-width: 100%;
}

.auth-card .form-actions {
  margin-top: 1.25rem;
}

.auth-card .btn-primary {
  width: 100%;
  padding: 0.65rem 1rem;
  font-size: 0.95rem;
}

.auth-note {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 1rem;
}

.auth-links {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.85rem;
}

.auth-links p { margin-bottom: 0.4rem; }
.auth-links a { color: var(--primary); text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }

/* Sidebar user info */
.sidebar-user {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: auto;
  font-size: 0.8rem;
}

.sidebar-user .user-name {
  color: #fff;
  font-weight: 500;
  display: block;
  margin-bottom: 0.25rem;
}

.sidebar-user a {
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.8rem;
}

.sidebar-user a:hover { color: #fff; }

.locale-switcher {
  margin: 0 1.25rem 1rem;
}
.locale-switcher select {
  width: 100%;
  background: rgba(255,255,255,0.06);
  color: var(--sidebar-text);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius);
  padding: 0.3rem 0.5rem;
  font-size: 0.8rem;
  cursor: pointer;
  appearance: auto;
}
.locale-switcher select:hover { background: rgba(255,255,255,0.1); color: #fff; }
.locale-switcher select:focus {
  outline: none;
  border-color: var(--sidebar-active);
}
/* Native <option> rendering follows OS conventions; explicit styling is
   intentionally omitted so system dark-mode defaults apply. */

/* Utility */
.text-muted { color: var(--text-light); }

/* Form rows (side-by-side fields) */
.form-row {
  display: flex;
  gap: 1rem;
}
.form-row .form-group { flex: 1; }

/* Textarea */
.form-group textarea {
  width: 100%;
  max-width: 600px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
}
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Filters bar */
.filters {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.filters .form-group {
  margin-bottom: 0;
}
.filters .form-group label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-light);
}
.filters .form-group select,
.filters .form-group input {
  max-width: 200px;
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
}

/* Additional badge styles */
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-accepted { background: #dcfce7; color: #166534; }
.badge-discarded { background: #f1f5f9; color: #64748b; }
.badge-pushed { background: #e0e7ff; color: #3730a3; }
.badge-delivered { background: #dbeafe; color: #1e40af; }
.badge-read { background: #dcfce7; color: #166534; }

/* Punch type badges */
.badge-punch-clock_in { background: #dcfce7; color: #166534; }
.badge-punch-clock_out { background: #fee2e2; color: #991b1b; }
.badge-punch-break_start { background: #fef3c7; color: #92400e; }
.badge-punch-break_end { background: #e0e7ff; color: #3730a3; }
.badge-punch-meal_start { background: #ffedd5; color: #9a3412; }
.badge-punch-meal_end   { background: #fed7aa; color: #7c2d12; }
.badge-punch-context_change { background: #f1f5f9; color: #64748b; }

/* Attestation answers list */
.attestation-answers dt { font-weight: 500; margin-top: 0.5rem; }
.attestation-answers dd { margin-left: 0; margin-bottom: 0.5rem; }

/* Filter form */
.filter-form { width: 100%; }
.filter-row {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
}
.filter-field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-light);
  margin-bottom: 0.3rem;
}
.filter-field .input {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  min-width: 160px;
}
.filter-field .input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
/* Native <input type="date"> shows its placeholder text in browser-default
   light grey, which reads as "disabled". Force the inner edit fields to use
   the same text color as the rest of the form so the field looks active. */
.filter-field input[type="date"] { color: var(--text); }
.filter-field input[type="date"]::-webkit-datetime-edit { color: var(--text); }
.filter-field input[type="date"]::-webkit-datetime-edit-text,
.filter-field input[type="date"]::-webkit-datetime-edit-month-field,
.filter-field input[type="date"]::-webkit-datetime-edit-day-field,
.filter-field input[type="date"]::-webkit-datetime-edit-year-field { color: var(--text); }

.filter-date-range .date-range-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.filter-date-range .date-range-controls .input { min-width: 130px; }
.filter-date-range .date-range-separator {
  color: var(--text-light);
  font-size: 0.9rem;
}
.filter-date-range .date-range-arrow {
  font-size: 1rem;
  line-height: 1;
  padding: 0.4rem 0.5rem;
  min-width: auto;
}
.filter-date-range .date-range-arrow.disabled {
  opacity: 0.4;
  pointer-events: none;
  cursor: default;
}
.filter-actions {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  padding-bottom: 1px;
}
/* Employee picker sitting inside the standard filter bar (Timecards):
   size its search box like the bar's other inputs. */
.filter-field .employee-picker { min-width: 220px; max-width: 22rem; }
.filter-field .employee-picker-input {
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
  border-radius: var(--radius);
}
/* Match button vertical padding to the inputs' so Apply/Clear sit at the
   same visual height as the selects beside them. Default .btn padding is
   0.5rem 1rem; .input is 0.4rem 0.6rem. */
.filter-actions .btn {
  padding: 0.4rem 0.9rem;
}

/* Count line under a filter bar, e.g. "42 employees". Sits between the
   filter bar and the table. */
.results-count {
  margin: 0.5rem 0 0.75rem;
  font-size: 0.85rem;
  color: var(--text-light);
}

/* Detail card */
.detail-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid var(--border);
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}
.detail-section { margin-bottom: 1.5rem; }
.detail-section h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-light);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.detail-section dl { display: grid; grid-template-columns: 120px 1fr; gap: 0.4rem 1rem; }
.detail-section dt { font-size: 0.85rem; color: var(--text-light); font-weight: 500; }
.detail-section dd { font-size: 0.85rem; }
.monospace { font-family: "SF Mono", "Fira Code", monospace; font-size: 0.8rem; }

/* Punch photo */
.punch-photo { margin-top: 0.5rem; }
.photo-preview {
  max-width: 300px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

/* Side-by-side reference + punch comparison */
.photo-pair {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}
.photo-pair-item { margin: 0; }
.photo-pair-item figcaption {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 0.35rem;
  font-weight: 500;
}
.photo-missing {
  width: 300px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-light);
  font-size: 0.85rem;
}
.photo-match-controls {
  margin-top: 1rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  flex-wrap: wrap;
}
.photo-match-result {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  background: var(--surface, #fafafa);
}
.photo-match-score {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  display: inline-block;
  color: #fff;
}
.photo-match-score--green  { background: #16a34a; }
.photo-match-score--yellow { background: #eab308; color: #1f2937; }
.photo-match-score--orange { background: #ea580c; }
.photo-match-score--red    { background: #dc2626; }
.photo-match-meta {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-light);
}

/* Empty states */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-light);
  font-size: 0.95rem;
}

/* Map */
.map-container {
  height: 350px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 1rem;
}
.map-hint {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: -0.75rem;
  margin-bottom: 1rem;
}

/* Punch correction / timeline */
.corrections-timeline {
  list-style: none;
  padding: 0;
  margin: 0;
}
.corrections-timeline li {
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--border);
  margin-bottom: 0.5rem;
  background: #f8fafc;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.9rem;
}
.corrections-timeline li.void    { border-left-color: #991b1b; }
.corrections-timeline li.unvoid  { border-left-color: #166534; }
.corrections-timeline li.adjust  { border-left-color: #92400e; }
.corrections-timeline .meta {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 0.25rem;
}
.corrections-timeline .reason {
  font-style: italic;
  color: var(--text);
  margin-top: 0.25rem;
}
.corrections-timeline .change {
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 0.85rem;
}
.corrections-timeline .change del { color: #991b1b; text-decoration: line-through; }
.corrections-timeline .change ins { color: #166534; text-decoration: none; background: #dcfce7; padding: 0 0.2rem; }

.supervisor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-start;
}
.supervisor-actions details {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
}
.supervisor-actions details[open] { background: white; }
.supervisor-actions summary {
  cursor: pointer;
  font-weight: 500;
  user-select: none;
}
.supervisor-actions form { margin-top: 0.75rem; display: grid; gap: 0.5rem; }
.supervisor-actions label { font-size: 0.85rem; color: var(--text-light); }
.supervisor-actions input[type="text"],
.supervisor-actions input[type="datetime-local"],
.supervisor-actions select,
.supervisor-actions textarea {
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font: inherit;
}
.supervisor-actions textarea { min-height: 3rem; }

.voided-banner {
  background: #fee2e2;
  color: #991b1b;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-weight: 500;
}

/* Timecard page */
.filter-bar {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}
.filter-bar .filter-form {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
}
.filter-bar label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-weight: 500;
}
.filter-bar select,
.filter-bar input[type="date"] {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  min-width: 180px;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text);
  font-weight: normal;
}
.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.8rem; }

.timecard-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.timecard-header h2 { margin: 0; }
.timecard-week { color: var(--text-light); font-size: 0.95rem; }

table.timecard {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  font-variant-numeric: tabular-nums;
}
.timecard th,
.timecard td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border);
  text-align: right;
  font-size: 0.9rem;
}
.timecard th { font-weight: 500; color: var(--text-light); background: #f8fafc; }
.timecard .timecard-row-label { text-align: left; font-weight: 500; color: var(--text); min-width: 160px; }
.timecard .timecard-cell.weekend,
.timecard th.weekend { background: #f8fafc; color: #94a3b8; }
.timecard .timecard-week-divider { border-left: 2px solid #64748b; }
.timecard--biweekly th,
.timecard--biweekly td { padding: 0.4rem 0.4rem; font-size: 0.85rem; }
.timecard-summary-total th,
.timecard-summary-total td { background: #f1f5f9; font-weight: 600; }
.timecard .timecard-total-col { font-weight: 600; border-left: 1px solid var(--border); background: #f8fafc; }
.timecard .timecard-totals-row td { border-top: 2px solid var(--text-light); font-weight: 600; background: #f1f5f9; }
.timecard-day-header { display: flex; flex-direction: column; align-items: center; }
.timecard-day-dow { font-size: 0.75rem; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.04em; }
.timecard-day-date { font-weight: 500; color: var(--text); }

table.timecard-summary {
  border-collapse: collapse;
  margin: 0.5rem 0 1rem;
  font-variant-numeric: tabular-nums;
}
.timecard-summary th,
.timecard-summary td {
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border);
  text-align: right;
  font-size: 0.9rem;
}
.timecard-summary th { background: #f8fafc; font-weight: 500; text-align: center; }
.timecard-summary tbody th { text-align: left; }

.timecard-corrections { margin-top: 1.5rem; border-top: 1px dashed var(--border); padding-top: 1rem; }
.timecard-corrections h3 { margin-top: 0; font-size: 1rem; }

.timecard-blocks { margin-top: 1.5rem; border-top: 1px dashed var(--border); padding-top: 1rem; }
.timecard-blocks summary { cursor: pointer; font-weight: 500; color: var(--text-light); }
.timecard-blocks-table { width: 100%; margin-top: 0.75rem; border-collapse: collapse; font-size: 0.85rem; }
.timecard-blocks-table th,
.timecard-blocks-table td { padding: 0.35rem 0.6rem; border-bottom: 1px solid var(--border); text-align: left; }
.timecard-blocks-table a { margin-right: 0.35rem; color: var(--primary); text-decoration: none; }
.timecard-blocks-type-col { width: 1px; white-space: nowrap; text-align: right; padding-left: 0.25rem; padding-right: 0.5rem; }
.timecard-blocks-meal td { color: var(--text-light); }

/* ── Print version of timecard ──────────────────────────────────────── */
.timecard-actions { margin-left: auto; }
.print-page { background: #fff; }
.print-content { padding: 1rem 1.5rem; }
.print-back-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
  border-bottom: 1px dashed var(--border);
}
.print-back-bar .print-hint { font-size: 0.8rem; }
.print-sheet { max-width: 60rem; }
.print-header { text-align: center; margin-bottom: 1.25rem; }
.print-header h1 { font-size: 1.1rem; margin: 0; color: var(--text-light); font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; }
.print-header h2 { font-size: 1.5rem; margin: 0.25rem 0 0; }
.print-employee-block {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}
.print-footer {
  margin-top: 2rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border);
  font-size: 0.8rem;
  color: var(--text-light);
  text-align: right;
}

@media print {
  .no-print { display: none !important; }
  body, .print-page { background: #fff !important; }
  .print-content { padding: 0; }
  .print-sheet { max-width: none; }
  table.timecard,
  table.timecard-summary { page-break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}

/* Inline employee picker (typeahead) */
.employee-picker {
  position: relative;
  max-width: 32rem;
}
.employee-picker-current {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  margin-bottom: 0.4rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.95rem;
}
.employee-picker-current[hidden] { display: none; }
.employee-picker-clear-btn {
  margin-left: auto;
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  width: 1.5rem;
  height: 1.5rem;
  line-height: 1;
  font-size: 1.1rem;
  cursor: pointer;
  color: #64748b;
  padding: 0;
}
.employee-picker-clear-btn:hover {
  background: #fff;
  color: #0f172a;
}
.employee-picker-input {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.95rem;
  background: #fff;
}
.employee-picker-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.employee-picker-results {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 50;
  margin-top: 2px;
  max-height: 18rem;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
}
.employee-picker-result {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 0.7rem;
  font-size: 0.92rem;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
}
.employee-picker-result:last-child { border-bottom: 0; }
.employee-picker-result:hover,
.employee-picker-result.is-active {
  background: #eff6ff;
}
.employee-picker-result strong {
  font-weight: 600;
}
.employee-picker-empty {
  padding: 0.7rem;
  color: #64748b;
  font-style: italic;
  font-size: 0.9rem;
}
