/*
 * MCF design system. Same look as Oficina (Geist, thin-bordered panels, small uppercase labels) in MCF's colours:
 * the blue and cool neutrals of /reporte, with purple as the accent.
 * Blue (--primary) is for actions and links. Purple (--purple) is for what is selected or highlighted.
 * Every page except /reporte uses this file, and none of them has its own <style>.
 */

/* ---------- Light (default) ---------- */
:root {
  --radius: 0.625rem;

  --background: #f9fafb;
  --foreground: #1a1a1a;
  --card: #ffffff;
  --card-foreground: #1a1a1a;

  --primary: #2d6695;
  --primary-foreground: #ffffff;
  --purple: #6b46b8;

  --secondary: #eef3f8;
  --secondary-foreground: #27486b;

  --muted: #f3f4f6;
  --muted-foreground: #5f6b7c;

  --accent: #eef3f8;
  --accent-foreground: #27486b;

  --destructive: #9f1239;
  --destructive-foreground: #ffffff;

  --success: #15803d;
  --warning: #b45309;

  --border: #e5e7eb;
  --input: #cbd5e1;
  --ring: #2d6695;

  --sidebar: #ffffff;
  --sidebar-foreground: #374151;
  --sidebar-accent: #f3f5f8;
  --sidebar-accent-foreground: #1a1a1a;
  --sidebar-border: #e5e7eb;

  --sidebar-width: 16rem;
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%235f6b7c'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

/* ---------- Dark ---------- */
.dark {
  --background: oklch(0.15 0.012 250);
  --foreground: oklch(0.93 0.005 250);
  --card: oklch(0.19 0.012 250);
  --card-foreground: oklch(0.93 0.005 250);

  --primary: oklch(0.72 0.11 240);
  --primary-foreground: oklch(0.15 0.012 250);
  --purple: oklch(0.76 0.12 295);

  --secondary: oklch(0.24 0.012 250);
  --secondary-foreground: oklch(0.93 0.005 250);

  --muted: oklch(0.24 0.012 250);
  --muted-foreground: oklch(0.68 0.012 250);

  --accent: oklch(0.28 0.012 250);
  --accent-foreground: oklch(0.93 0.005 250);

  --destructive: oklch(0.63 0.22 20);
  --destructive-foreground: oklch(0.985 0 0);

  --success: oklch(0.72 0.17 150);
  --warning: oklch(0.78 0.14 70);

  --border: oklch(0.28 0.012 250);
  --input: oklch(0.33 0.012 250);
  --ring: oklch(0.72 0.11 240);

  --sidebar: oklch(0.17 0.012 250);
  --sidebar-foreground: oklch(0.85 0.008 250);
  --sidebar-accent: oklch(0.24 0.012 250);
  --sidebar-accent-foreground: oklch(0.93 0.005 250);
  --sidebar-border: oklch(0.24 0.012 250);

  color-scheme: dark;
}

/* Names some page scripts and inline attributes still use. */
:root, .dark {
  --bg-primary: var(--card);
  --bg-secondary: var(--background);
  --bg-tertiary: var(--muted);
  --text-primary: var(--foreground);
  --text-secondary: var(--muted-foreground);
  --text-muted: var(--muted-foreground);
  --danger: var(--destructive);
  --tint-primary: color-mix(in srgb, var(--primary) 12%, transparent);
  --tint-purple: color-mix(in srgb, var(--purple) 12%, transparent);
  --tint-success: color-mix(in srgb, var(--success) 12%, transparent);
  --tint-warning: color-mix(in srgb, var(--warning) 12%, transparent);
  --tint-danger: color-mix(in srgb, var(--destructive) 12%, transparent);
  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--ring) 40%, transparent);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  background: var(--background);
  color: var(--foreground);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" on;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
table, td, th, .tabular { font-variant-numeric: tabular-nums; }
code { font-family: 'Geist Mono', ui-monospace, Consolas, monospace; font-size: 0.85em; background: var(--muted); border-radius: 4px; padding: 1px 4px; overflow-wrap: anywhere; }
.text-center { text-align: center; }
.text-muted { color: var(--muted-foreground); }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
h1 { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
input[type="checkbox"] { width: 1rem; height: 1rem; accent-color: var(--primary); }
.lead { font-size: 1rem; color: var(--muted-foreground); margin-top: 0.25rem; }
.hidden { display: none !important; }

/* ---------- Shell: sidebar, top bar, drawer ---------- */
.mcf-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: none;
  flex-direction: column;
  width: var(--sidebar-width);
  background: var(--sidebar);
  color: var(--sidebar-foreground);
  border-right: 1px solid var(--sidebar-border);
}

.mcf-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.5rem;
  flex-shrink: 0;
  padding: 0 0.75rem 0 1.25rem;
  border-bottom: 1px solid var(--sidebar-border);
}

.mcf-brand { display: flex; flex-direction: column; line-height: 1.2; }
.mcf-brand strong { font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; color: var(--sidebar-accent-foreground); }
.mcf-brand span { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: color-mix(in srgb, var(--sidebar-foreground) 60%, transparent); }

.mcf-nav { display: flex; flex-direction: column; gap: 1rem; flex: 1; overflow-y: auto; padding: 0.75rem; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.mcf-nav-group { display: flex; flex-direction: column; gap: 2px; }
.mcf-nav-label { padding: 0 0.75rem 0.25rem; font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; color: color-mix(in srgb, var(--sidebar-foreground) 50%, transparent); }

.mcf-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: calc(var(--radius) - 2px);
  font-size: 14px;
  color: color-mix(in srgb, var(--sidebar-foreground) 75%, transparent);
  transition: background-color 0.15s, color 0.15s;
}
.mcf-nav-item:hover { background: var(--sidebar-accent); color: var(--sidebar-accent-foreground); }
.mcf-nav-item.active { background: var(--tint-purple); color: var(--purple); font-weight: 500; }
.mcf-nav-item svg { width: 1rem; height: 1rem; flex-shrink: 0; }
.mcf-nav-item .mcf-out { width: 0.75rem; height: 0.75rem; margin-left: auto; opacity: 0.5; }
.mcf-nav-item span { min-width: 0; }

.mcf-sidebar-foot { flex-shrink: 0; padding: 0.75rem 1.25rem; border-top: 1px solid var(--sidebar-border); font-size: 12px; color: color-mix(in srgb, var(--sidebar-foreground) 60%, transparent); }
.mcf-sidebar-foot strong { display: block; font-size: 14px; font-weight: 600; color: var(--sidebar-foreground); text-transform: capitalize; }

.mcf-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: 3.5rem;
  padding: 0 0.75rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--background) 80%, transparent);
  backdrop-filter: blur(4px);
}
.mcf-topbar-brand { flex: 1; font-weight: 600; letter-spacing: -0.01em; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background-color 0.15s;
}
.icon-btn:hover { background: var(--accent); color: var(--accent-foreground); }
.icon-btn svg { width: 1.25rem; height: 1.25rem; }
.mcf-sidebar .icon-btn { width: 1.75rem; height: 1.75rem; color: color-mix(in srgb, var(--sidebar-foreground) 70%, transparent); }
.mcf-sidebar .icon-btn:hover { background: var(--sidebar-accent); color: var(--sidebar-accent-foreground); }
.mcf-sidebar .icon-btn svg { width: 1rem; height: 1rem; }

.mcf-logout { display: inline-flex; align-items: center; gap: 0.5rem; height: 2rem; padding: 0 0.75rem; border: 0; border-radius: calc(var(--radius) - 2px); background: transparent; font: inherit; font-weight: 500; color: inherit; cursor: pointer; }
.mcf-logout:hover { background: var(--accent); color: var(--accent-foreground); }
.mcf-logout svg { width: 1rem; height: 1rem; }

.mcf-menu-btn { display: inline-flex; }
.mcf-open-btn { display: none; }

.mcf-scrim { position: fixed; inset: 0; z-index: 40; display: none; background: rgba(0, 0, 0, 0.5); }
.mcf-drawer-open .mcf-scrim { display: block; }
.mcf-drawer-open .mcf-sidebar { display: flex; z-index: 50; width: 18rem; }

@media (min-width: 1024px) {
  body.has-shell { padding-left: var(--sidebar-width); }
  body.has-shell .mcf-sidebar { display: flex; }
  body.has-shell.sidebar-collapsed { padding-left: 0; }
  body.has-shell.sidebar-collapsed .mcf-sidebar { display: none; }
  body.has-shell.sidebar-collapsed .mcf-open-btn { display: inline-flex; }
  .mcf-menu-btn { display: none; }
  .mcf-topbar { padding: 0 1.5rem; }
  .mcf-topbar-brand { visibility: hidden; }
  body.has-shell .back-link { display: none; }
  body.has-shell .submit-bar { left: var(--sidebar-width); }
  body.has-shell.sidebar-collapsed .submit-bar { left: 0; }
}

/* Pages for customers and sign-in: no navigation, only the name on top. */
.mcf-bare-brand { display: flex; flex-direction: column; align-items: center; line-height: 1.2; padding: 1.5rem 0 0.5rem; }
.mcf-bare-brand strong { font-size: 1.125rem; font-weight: 600; letter-spacing: -0.01em; }
.mcf-bare-brand span { font-size: 11px; text-transform: uppercase; letter-spacing: 0.2em; color: var(--muted-foreground); }

/* ---------- Page ---------- */
.container { width: 100%; max-width: 40rem; margin: 0 auto; padding: 1rem; }
.container.wide { max-width: 64rem; }
@media (min-width: 1024px) { body.has-shell .container { padding: 2rem; } }

.header { margin-bottom: 1.25rem; }
.header p { font-size: 14px; color: var(--muted-foreground); margin-top: 0.125rem; }
.header-icon { display: none; }
body[data-shell="bare"] .header { text-align: center; }

.footer { text-align: center; padding: 1.5rem 0; color: var(--muted-foreground); font-size: 12px; }

.back-link { display: inline-flex; align-items: center; gap: 0.375rem; margin-bottom: 1rem; font-size: 14px; font-weight: 500; color: var(--muted-foreground); transition: color 0.15s; }
.back-link:hover { color: var(--foreground); }
.back-link svg { width: 1rem; height: 1rem; }

/* ---------- Panels ---------- */
.card, .panel { background: var(--card); color: var(--card-foreground); border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); }
.card { padding: 1rem; margin-bottom: 1rem; }
.card-body { padding: 0; }
.panel { margin-bottom: 1rem; overflow: hidden; }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); }
.panel-body { padding: 1rem; }
.panel-section { padding: 0.75rem 1rem; border-top: 1px solid var(--border); }

.label, .card-title, .section-header, .section-label, .panel-title, .amount-display .label {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-foreground);
}
.card-title { margin-bottom: 0.75rem; }
.section-header, .section-label { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 0.75rem; }
.panel-section .label { margin-bottom: 0.5rem; display: block; }

.divider { height: 1px; background: var(--border); margin: 1.25rem 0; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 1rem; }
.form-group:last-child { margin-bottom: 0; }
.form-label, .form-group > label { display: block; margin-bottom: 0.375rem; font-size: 14px; font-weight: 500; color: var(--foreground); }
.form-hint { margin-top: 0.25rem; font-size: 12px; color: var(--muted-foreground); }

.form-input, .form-select, .form-textarea, .form-control, .denomination-input, .password-input, .input {
  width: 100%;
  min-height: 2.5rem;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--input);
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: var(--foreground);
  font: inherit;
  font-size: 16px; /* below 16px, phones zoom in on focus */
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
@media (min-width: 768px) {
  .form-input, .form-select, .form-textarea, .form-control, .denomination-input, .password-input, .input { min-height: 2.25rem; font-size: 14px; }
}
.form-textarea, textarea.form-input, textarea.form-control { min-height: 5rem; padding: 0.5rem 0.75rem; resize: vertical; }
.form-input:focus, .form-select:focus, .form-textarea:focus, .form-control:focus, .denomination-input:focus, .password-input:focus, .input:focus { border-color: var(--ring); box-shadow: var(--focus-ring); }
.form-input::placeholder, .form-textarea::placeholder, .form-control::placeholder, .denomination-input::placeholder, .password-input::placeholder, .input::placeholder { color: var(--muted-foreground); }
.form-input.error, .password-input.error { border-color: var(--destructive); box-shadow: 0 0 0 3px var(--tint-danger); }
.form-select, select.form-control { appearance: none; -webkit-appearance: none; padding-right: 2.25rem; background-image: var(--chevron); background-repeat: no-repeat; background-position: right 0.625rem center; background-size: 1rem; }
.form-select option, select.form-control option { background: var(--card); color: var(--foreground); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.amount-row { display: grid; grid-template-columns: 1fr 100px; gap: 0.75rem; }
.input-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
.input-row .form-group { margin-bottom: 0; }
.input-row .form-label { font-size: 12px; text-align: center; }
.input-row .form-input { text-align: center; padding: 0.25rem 0.5rem; }
.rating-group { display: flex; align-items: center; gap: 0.5rem; }
.rating-group .form-input { width: 5rem; text-align: center; }
.rating-hint { font-size: 12px; color: var(--muted-foreground); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid transparent;
  border-radius: calc(var(--radius) - 2px);
  font: inherit;
  font-weight: 500;
  white-space: normal;
  cursor: pointer;
  outline: none;
  transition: background-color 0.15s, opacity 0.15s, box-shadow 0.15s;
}
.btn:focus-visible { box-shadow: var(--focus-ring); }
.btn:disabled { opacity: 0.5; pointer-events: none; }
.btn svg { width: 1rem; height: 1rem; flex-shrink: 0; }

.btn-primary, .btn-purple, .btn-cyan, .btn-indigo, .btn-orange, .btn-success { width: 100%; background: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover, .btn-purple:hover, .btn-cyan:hover, .btn-indigo:hover, .btn-orange:hover, .btn-success:hover { background: color-mix(in srgb, var(--primary) 90%, transparent); }
.btn-danger { width: 100%; background: var(--destructive); color: var(--destructive-foreground); }
.btn-danger:hover { background: color-mix(in srgb, var(--destructive) 90%, transparent); }
.btn-outline, .btn-secondary { background: var(--background); border-color: var(--border); color: var(--foreground); }
.btn-outline:hover, .btn-secondary:hover { background: var(--accent); color: var(--accent-foreground); }
.btn-outline { width: 100%; margin-top: 0.625rem; }
.btn-ghost { background: transparent; color: inherit; }
.btn-ghost:hover { background: var(--accent); color: var(--accent-foreground); }
.btn-sm { min-height: 2rem; padding: 0.25rem 0.75rem; }
.btn-lg { min-height: 2.75rem; padding: 0.5rem 1.5rem; }
.btn-inline { width: auto; }

.toggle-link { display: inline-flex; align-items: center; gap: 0.375rem; border: 0; background: none; padding: 0; font: inherit; font-weight: 500; color: var(--primary); cursor: pointer; }
.toggle-link svg { width: 1rem; height: 1rem; transition: transform 0.2s; }
.toggle-link.open svg { transform: rotate(180deg); }
#fiscal-fields { display: none; margin-top: 1rem; }
#fiscal-fields.visible { display: block; }

/* ---------- Badges and notices ---------- */
.badge, .location-badge, .mandatory-badge, .section-header .mandatory-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  width: fit-content;
  flex-shrink: 0;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.badge { background: var(--muted); color: var(--muted-foreground); }
.badge.good { background: var(--tint-success); color: var(--success); }
.badge.warn { background: var(--tint-warning); color: var(--warning); }
.badge.bad, .mandatory-badge, .section-header .mandatory-indicator { background: var(--tint-danger); color: var(--destructive); }
.location-badge { background: var(--tint-purple); color: var(--purple); }
.location-badge { margin-top: 0.5rem; padding: 0.25rem 0.625rem; }
.location-badge svg { width: 0.875rem; height: 0.875rem; }
.task-item.completed .mandatory-badge { background: var(--tint-success); color: var(--success); }

.alert, .notice, .info-box, .warning-box { border: 1px solid var(--border); border-radius: var(--radius); padding: 0.75rem 1rem; margin-bottom: 1rem; font-size: 14px; }
.alert-warning, .notice, .warning-box { background: var(--tint-warning); border-color: color-mix(in srgb, var(--warning) 30%, transparent); color: var(--warning); }
.alert-danger { background: var(--tint-danger); border-color: color-mix(in srgb, var(--destructive) 30%, transparent); color: var(--destructive); }
.alert-success { background: var(--tint-success); border-color: color-mix(in srgb, var(--success) 30%, transparent); color: var(--success); }
.alert-info, .info-box { background: var(--tint-primary); border-color: color-mix(in srgb, var(--primary) 25%, transparent); color: var(--foreground); }
.info-box-title { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; font-weight: 500; }
.info-box-title svg { width: 1.125rem; height: 1.125rem; flex-shrink: 0; }
.info-box p { font-size: 13px; color: var(--muted-foreground); margin-bottom: 0.5rem; }
.info-box p:last-child { margin-bottom: 0; }
.warning-box { display: flex; gap: 0.5rem; margin: 0.75rem 0 0; font-size: 13px; }
.warning-box svg { width: 1.125rem; height: 1.125rem; flex-shrink: 0; margin-top: 1px; }
.warn-color { color: var(--destructive); }
.error-message { display: none; margin-top: 0.5rem; font-size: 13px; color: var(--destructive); }
.error-message.visible { display: block; }

/* ---------- Money entry ---------- */
.denomination-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 1.25rem; }
.denomination-item { display: flex; flex-direction: column; gap: 0.375rem; }
.denomination-label { font-size: 13px; font-weight: 500; color: var(--muted-foreground); }
.denomination-label .icon { display: none; }
.denomination-input { text-align: center; }

.amount-display { text-align: center; padding: 1rem; margin-bottom: 1rem; background: var(--muted); border-radius: var(--radius); }
.amount-display .label { margin-bottom: 0.125rem; }
.amount-display .value { font-size: 1.75rem; font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; color: var(--foreground); }

.breakdown { padding: 0.75rem 1rem; margin-bottom: 1rem; background: var(--muted); border-radius: var(--radius); }
.breakdown-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.375rem; font-size: 14px; color: var(--muted-foreground); }
.breakdown-row.total { margin: 0.625rem 0 0; padding-top: 0.625rem; border-top: 1px solid var(--border); }

/* Ticket / Factura (/ticket): mode switch and factura service lines */
[hidden] { display: none !important; }
.mode-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 0.25rem; padding: 0.25rem; margin-bottom: 1.25rem; background: var(--muted); border-radius: var(--radius); }
.mode-toggle button { border: 1px solid transparent; background: transparent; border-radius: calc(var(--radius) - 2px); padding: 0.5rem 0.75rem; font: inherit; font-size: 14px; font-weight: 500; color: var(--muted-foreground); cursor: pointer; }
.mode-toggle button:hover { color: var(--foreground); }
.mode-toggle button.active { background: var(--card); border-color: var(--border); color: var(--purple); }
.mode-toggle button:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.section-title { margin: 0.25rem 0 0.75rem; font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted-foreground); }
.linea { padding: 0.75rem; margin-bottom: 0.625rem; background: var(--muted); border: 1px solid var(--border); border-radius: var(--radius); }
.linea-top, .linea-bottom { display: grid; gap: 0.5rem; align-items: center; }
.linea-top { grid-template-columns: 1.4fr 1fr; margin-bottom: 0.5rem; }
.linea-bottom { grid-template-columns: 4rem 1fr auto 2.25rem; }
.linea .form-input { background: var(--card); }
.linea-importe { min-width: 4.5rem; text-align: right; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.linea-remove { width: 2.25rem; height: 2.25rem; border: 0; border-radius: calc(var(--radius) - 2px); background: transparent; color: var(--muted-foreground); font-size: 20px; line-height: 1; cursor: pointer; }
.linea-remove:hover { background: var(--tint-danger); color: var(--destructive); }
.linea-remove:disabled { visibility: hidden; }
.btn-add { width: 100%; margin-bottom: 1rem; background: var(--card); border: 1px dashed var(--border); color: var(--primary); }
.btn-add:hover { background: var(--tint-primary); border-color: var(--primary); }
.breakdown-row.total .breakdown-label { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; }
.breakdown-row.total .breakdown-value { font-size: 1.5rem; font-weight: 600; color: var(--foreground); }
.breakdown-value { font-variant-numeric: tabular-nums; font-weight: 500; color: var(--foreground); }

/* ---------- Choices ---------- */
.toggle-group { display: flex; gap: 0.5rem; }
.toggle-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--input);
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: var(--foreground);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}
.toggle-option:hover { background: var(--accent); }
.toggle-option.selected, .toggle-option.active { border-color: var(--purple); background: var(--tint-purple); color: var(--purple); }
.toggle-option input { display: none; }

.emoji-rating { display: flex; justify-content: space-between; gap: 0.5rem; }
.emoji-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.75rem 0.25rem;
  border: 1px solid var(--input);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}
.emoji-option:hover { background: var(--accent); }
.emoji-option.selected { border-color: var(--purple); background: var(--tint-purple); }
.emoji-option input { display: none; }
.emoji-option .emoji { font-size: 1.75rem; line-height: 1.1; }
.emoji-option .emoji-label { font-size: 11px; text-align: center; color: var(--muted-foreground); }
.question-number { display: inline-flex; align-items: center; justify-content: center; width: 1.5rem; height: 1.5rem; margin-right: 0.5rem; border-radius: 50%; background: var(--tint-purple); color: var(--purple); font-size: 12px; font-weight: 600; }
.star-rating { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 0.5rem; }
.star-rating input { display: none; }
.star-rating label { font-size: 2rem; color: var(--border); cursor: pointer; transition: color 0.15s; }
.star-rating label:hover, .star-rating label:hover ~ label, .star-rating input:checked ~ label { color: var(--purple); }

/* ---------- Checklists ---------- */
.task-list { display: flex; flex-direction: column; gap: 0.5rem; }
.task-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); cursor: pointer; transition: background-color 0.15s, border-color 0.15s; }
.task-item:hover { background: var(--accent); }
.task-item.completed { background: var(--tint-success); border-color: color-mix(in srgb, var(--success) 40%, transparent); }
.task-item.mandatory { border-left: 3px solid var(--destructive); }
.task-item.mandatory.completed { border-left-color: var(--success); }
.task-checkbox { display: flex; align-items: center; justify-content: center; width: 1.375rem; height: 1.375rem; flex-shrink: 0; border: 1px solid var(--input); border-radius: 6px; transition: background-color 0.15s, border-color 0.15s; }
.task-item.completed .task-checkbox { background: var(--success); border-color: var(--success); }
.task-checkbox svg { width: 0.875rem; height: 0.875rem; color: #fff; opacity: 0; transition: opacity 0.15s; }
.task-item.completed .task-checkbox svg { opacity: 1; }
.task-content { flex: 1; min-width: 0; }
.task-title { font-weight: 500; }
.task-item.completed .task-title { color: var(--success); }
.task-desc { margin-top: 0.125rem; font-size: 12px; color: var(--muted-foreground); }

.progress-container { margin-bottom: 1rem; }
.progress-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.progress-label { font-size: 13px; color: var(--muted-foreground); }
.progress-count { font-size: 13px; font-weight: 600; color: var(--purple); }
.progress-bar { height: 0.5rem; overflow: hidden; background: var(--muted); border-radius: 999px; }
.progress-fill { height: 100%; background: var(--success); border-radius: 999px; transition: width 0.3s ease; }

.submit-bar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 15; display: none; padding: 0.75rem 1rem; background: var(--card); border-top: 1px solid var(--border); }
.submit-bar.visible { display: block; }
.submit-bar-content { max-width: 36rem; margin: 0 auto; }
.submit-bar .btn { width: 100%; }
.submit-status { margin-bottom: 0.5rem; text-align: center; font-size: 13px; color: var(--muted-foreground); }
.submit-status.warning { color: var(--destructive); }
body:has(.submit-bar) .container { padding-bottom: 8rem; }

/* ---------- Inventory ---------- */
.inventory-section { margin-bottom: 1.5rem; }
.inventory-section:last-child { margin-bottom: 0; }
.inventory-header { display: flex; align-items: center; gap: 0.625rem; margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border); }
.inventory-icon { display: flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; flex-shrink: 0; border-radius: calc(var(--radius) - 2px); background: var(--tint-purple); color: var(--purple); }
.inventory-icon svg { width: 1.125rem; height: 1.125rem; }
.inventory-title { font-size: 14px; font-weight: 600; }
.inventory-desc { font-size: 12px; color: var(--muted-foreground); }
.example-gallery { display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem; }
.example-item { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); }
.example-item img { display: block; width: 100%; height: auto; }
.example-caption { padding: 0.75rem; background: var(--muted); font-size: 13px; color: var(--muted-foreground); }
.example-caption strong { color: var(--foreground); }
.collapsible-header { display: flex; align-items: center; justify-content: space-between; padding: 0.25rem 0; cursor: pointer; }
.collapsible-header .chevron { transition: transform 0.2s; }
.collapsible-header.expanded .chevron { transform: rotate(180deg); }
.collapsible-content { display: none; padding-top: 0.75rem; }
.collapsible-content.show { display: block; }

/* ---------- Finished and busy states ---------- */
#completion-message { display: none; text-align: center; padding: 2rem 1rem; }
#completion-message .card-title, .completion-title { margin-bottom: 0.5rem; font-size: 1.125rem; font-weight: 600; text-transform: none; letter-spacing: normal; color: var(--foreground); }
.completion-text { margin-bottom: 1.5rem; color: var(--muted-foreground); }
.completion-icon { display: flex; align-items: center; justify-content: center; width: 3.5rem; height: 3.5rem; margin: 0 auto 1rem; border-radius: 50%; background: var(--tint-success); color: var(--success); }
.completion-icon svg { width: 1.75rem; height: 1.75rem; }

.loading-overlay { position: fixed; inset: 0; z-index: 1000; display: none; background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(4px); }
.loading-overlay.active { display: flex; align-items: center; justify-content: center; }
.loading-card { padding: 2rem 3rem; text-align: center; background: var(--card); border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); }
.loading-spinner { width: 2.25rem; height: 2.25rem; margin: 0 auto 1rem; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: mcf-spin 0.8s linear infinite; }
.loading-text { font-size: 14px; color: var(--muted-foreground); }
.empty { padding: 3rem 1rem; text-align: center; color: var(--muted-foreground); }

@keyframes mcf-spin { to { transform: rotate(360deg); } }
@keyframes mcf-fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes mcf-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.fade-in { animation: mcf-fade-in 0.2s ease; }
.shake { animation: mcf-shake 0.3s ease; }

/* ---------- Sign-in ---------- */
.signin { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 1.5rem; }
.signin-inner { width: 100%; max-width: 24rem; }
.signin-brand { margin-bottom: 2rem; text-align: center; }
.signin-brand strong { display: block; font-size: 1.5rem; font-weight: 600; letter-spacing: -0.01em; }
.signin-brand span { font-size: 12px; text-transform: uppercase; letter-spacing: 0.2em; color: var(--muted-foreground); }
.signin-title { margin-bottom: 1rem; font-size: 14px; font-weight: 500; }
.user-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.user-chip { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; min-height: 2.75rem; padding: 0.5rem 0.75rem; border: 1px solid var(--input); border-radius: calc(var(--radius) - 2px); background: transparent; color: var(--foreground); font: inherit; font-weight: 500; cursor: pointer; transition: background-color 0.15s; }
.user-chip:hover { background: var(--accent); }
.user-chip.wide { grid-column: 1 / -1; }
.user-chip .admin-badge { font-size: 11px; font-weight: 400; color: var(--muted-foreground); }
.back-btn { display: inline-flex; align-items: center; gap: 0.375rem; margin-bottom: 1rem; border: 0; background: none; font: inherit; font-weight: 500; color: var(--muted-foreground); cursor: pointer; }
.back-btn:hover { color: var(--foreground); }
.back-btn svg { width: 1rem; height: 1rem; }
.field-stack > * + * { margin-top: 0.75rem; }
.sub-flow { display: none; }
.sub-flow.active { display: block; }
.pin-card { max-width: 22rem; margin: 2.5rem auto; }
.pin-card .input { margin-bottom: 0.75rem; letter-spacing: 0.3em; text-align: center; }

/* ---------- Inicio ---------- */
.tiles { display: grid; gap: 1rem; margin-bottom: 1rem; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
.tile { display: block; padding: 1rem; background: var(--card); border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); transition: background-color 0.15s; }
a.tile:hover { background: var(--accent); }
.tile-title { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted-foreground); }
.tile-value { margin-top: 0.25rem; font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; }
.tile-value.good { color: var(--success); }
.tile-value.warn { color: var(--warning); }
.tile-value.bad { color: var(--destructive); }
.tile-sub { margin-top: 0.125rem; font-size: 12px; color: var(--muted-foreground); }

.home-grid { display: grid; gap: 1rem; align-items: start; }
.home-grid .panel { margin-bottom: 0; }
@media (min-width: 900px) { .home-grid { grid-template-columns: repeat(2, 1fr); } }
.link-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 1rem; transition: background-color 0.15s; }
.link-row + .link-row { border-top: 1px solid var(--border); }
.link-row:hover { background: var(--accent); }
.link-row > svg:first-child { width: 1.125rem; height: 1.125rem; flex-shrink: 0; color: var(--purple); }
.link-row-text { flex: 1; min-width: 0; }
.link-row-title { font-weight: 500; }
.link-row-desc { font-size: 12px; color: var(--muted-foreground); }
.link-row-end { width: 1rem; height: 1rem; flex-shrink: 0; color: var(--muted-foreground); opacity: 0.6; }

/* ---------- Kiosk status, error catalog, kiosk settings ---------- */
.status-banner { padding: 1rem; }
.status-banner h2 { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; }
.status-banner .name, .status-banner .seen { font-size: 12px; opacity: 0.85; }
.status-banner .name { font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; }
.state-ok .status-banner { background: var(--tint-success); color: var(--success); }
.state-problem .status-banner { background: var(--tint-warning); color: var(--warning); }
.state-down .status-banner { background: var(--tint-danger); color: var(--destructive); }
.state-off .status-banner, .state-unknown .status-banner { background: var(--muted); color: var(--muted-foreground); }

.problem { margin-bottom: 0.5rem; }
.problem:last-child { margin-bottom: 0; }
.problem a, .inline-link { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.1875rem 0; }
.row > span:first-child { color: var(--muted-foreground); }
.row.strong > span:first-child { color: var(--foreground); font-weight: 500; }

.money-form { display: flex; gap: 0.5rem; }
.money-form .input { flex: 1; min-width: 0; letter-spacing: 0.3em; text-align: center; }
.message { margin-top: 0.375rem; min-height: 1.125rem; font-size: 13px; color: var(--destructive); }

.entry { margin-bottom: 0.625rem; padding: 0.875rem 1rem; background: var(--card); border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); scroll-margin-top: 4.5rem; }
.entry:target { border-color: var(--ring); box-shadow: var(--focus-ring); }
.entry-title { display: flex; align-items: baseline; gap: 0.625rem; font-weight: 600; }
.entry .meaning { margin: 0.375rem 0 0.5rem; color: var(--muted-foreground); }
.entry h3 { margin-top: 0.5rem; font-size: 12px; font-weight: 500; color: var(--muted-foreground); }
.entry ul { padding-left: 1.125rem; }
.entry details { margin-top: 0.5rem; font-size: 13px; color: var(--muted-foreground); }
.entry summary { cursor: pointer; }
.area-title { margin: 1.25rem 0 0.5rem; font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted-foreground); }

.scroll-x { overflow-x: auto; }
.settings-table { width: 100%; border-collapse: collapse; }
.settings-table th { padding: 0.25rem 0.375rem 0.25rem 0; text-align: left; font-size: 12px; font-weight: 500; color: var(--muted-foreground); white-space: nowrap; }
.settings-table td { padding: 0.1875rem 0.375rem 0.1875rem 0; vertical-align: middle; }
.settings-table .machine-name { font-weight: 500; white-space: nowrap; }
.settings-table .input { width: auto; }
.input.time { width: 7rem; }
.input.money, .input.num { width: 5rem; text-align: right; }
.input.mid { width: 10rem; }
#hours .input.time, .settings-table td:has(> .input.time) { min-width: 7rem; }
body:has(.savebar) .container { padding-bottom: 6rem; }
@media (min-width: 900px) {
  .panel.kiosk { display: grid; grid-template-columns: repeat(2, 1fr); }
  .panel.kiosk .status-banner { grid-column: 1 / -1; }
  .panel.kiosk .panel-section:nth-child(odd) { border-left: 1px solid var(--border); }
}
.field { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.25rem 0; }
.help { margin-bottom: 0.625rem; font-size: 13px; color: var(--muted-foreground); }
.savebar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 15; padding: 0.75rem 1rem; background: var(--card); border-top: 1px solid var(--border); }
.savebar .btn { display: flex; width: 100%; max-width: 60rem; margin: 0 auto; }
@media (min-width: 1024px) {
  body.has-shell .savebar { left: var(--sidebar-width); }
  body.has-shell.sidebar-collapsed .savebar { left: 0; }
}
.page-message { display: none; margin-bottom: 1rem; scroll-margin-top: 4.5rem; }
.page-message.good, .page-message.bad, .page-message.warn { display: block; padding: 0.625rem 0.75rem; border-radius: calc(var(--radius) - 2px); font-size: 14px; }
.page-message.good { background: var(--tint-success); color: var(--success); }
.page-message.bad { background: var(--tint-danger); color: var(--destructive); }
.page-message.warn { background: var(--tint-warning); color: var(--warning); }

/* ---------- Public landing page ---------- */
.site-nav { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1.5rem; height: 3.5rem; padding: 0 1.25rem; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--background) 80%, transparent); backdrop-filter: blur(4px); }
.site-nav .mcf-brand { margin-right: auto; }
.site-nav .mcf-brand strong { color: var(--foreground); }
.site-nav .mcf-brand span { color: var(--muted-foreground); }
.site-links { display: none; gap: 1.25rem; font-weight: 500; color: var(--muted-foreground); }
.site-links a:hover { color: var(--foreground); }
@media (min-width: 768px) { .site-links { display: flex; } }
.site-section { max-width: 64rem; margin: 0 auto; padding: 4rem 1.25rem; }
.site-hero { padding-top: 6rem; padding-bottom: 6rem; }
.site-hero h1 { max-width: 44rem; font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.site-hero p { max-width: 38rem; margin: 1.25rem 0 2rem; font-size: 1.125rem; color: var(--muted-foreground); }
.site-section h2 { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 0.5rem; }
.site-eyebrow { margin-bottom: 0.5rem; font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; color: var(--purple); }
.site-lede { max-width: 40rem; font-size: 1rem; color: var(--muted-foreground); }
.site-band { background: var(--card); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.site-grid { display: grid; gap: 1rem; margin-top: 2rem; }
@media (min-width: 640px) { .site-grid.four { grid-template-columns: repeat(2, 1fr); } .site-grid.three { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .site-grid.four { grid-template-columns: repeat(4, 1fr); } }
.site-card { padding: 1.25rem; background: var(--card); border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); }
.site-card svg { width: 1.25rem; height: 1.25rem; margin-bottom: 0.75rem; color: var(--purple); }
.site-card h3 { margin-bottom: 0.25rem; font-size: 14px; font-weight: 600; }
.site-card p { font-size: 14px; color: var(--muted-foreground); }
.site-work { overflow: hidden; background: var(--card); border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); }
.site-work img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.site-work div { padding: 1rem; }
.site-work .label { display: block; margin-bottom: 0.25rem; }
.site-contact { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.25rem; }
.site-foot { padding: 1.5rem 1.25rem; border-top: 1px solid var(--border); text-align: center; font-size: 12px; color: var(--muted-foreground); }
html { scroll-behavior: smooth; }
.site-section[id] { scroll-margin-top: 3.5rem; }
