/* Vaga — base visual partilhada (claro, moderno, mobile-first) */
:root {
  --brand: #0E7C66;
  --brand-ink: #fff;
  --brand-50: color-mix(in srgb, var(--brand) 7%, white);
  --brand-100: color-mix(in srgb, var(--brand) 14%, white);
  --brand-200: color-mix(in srgb, var(--brand) 28%, white);
  --brand-700: color-mix(in srgb, var(--brand) 82%, black);
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --faint: #94a3b8;
  --line: #e2e8f0;
  --line-2: #f1f5f9;
  --bg: #f6f7fb;
  --card: #fff;
  --ok: #059669; --ok-50: #ecfdf5;
  --warn: #b45309; --warn-50: #fffbeb;
  --bad: #dc2626; --bad-50: #fef2f2;
  --info: #2563eb; --info-50: #eff6ff;
  --r-sm: 10px; --r: 14px; --r-lg: 20px;
  --sh-1: 0 1px 2px rgba(15, 23, 42, .05);
  --sh-2: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -6px rgba(15, 23, 42, .10);
  --sh-3: 0 24px 60px -12px rgba(15, 23, 42, .28);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Plus Jakarta Sans', var(--font);
  font-family: var(--font);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
*, *::before, *::after { box-sizing: border-box; min-width: 0; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); font-size: 15px; line-height: 1.5; min-height: 100vh; overflow-x: clip; }
h1, h2, h3, h4 { font-family: var(--display); letter-spacing: -0.02em; line-height: 1.2; margin: 0; color: var(--ink); }
p { margin: 0; }
a { color: var(--brand-700); }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2.5px solid color-mix(in srgb, var(--brand) 60%, white); outline-offset: 2px; }

/* Botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent; background: var(--brand); color: var(--brand-ink); font-weight: 600; font-size: 14.5px; cursor: pointer; text-decoration: none; transition: background .15s, box-shadow .15s, transform .05s, border-color .15s; white-space: nowrap; }
.btn:hover { background: var(--brand-700); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.ghost { background: #fff; color: var(--ink-2); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--brand-200); color: var(--brand-700); background: var(--brand-50); }
.btn.soft { background: var(--brand-50); color: var(--brand-700); }
.btn.soft:hover { background: var(--brand-100); }
.btn.danger { background: #fff; color: var(--bad); border-color: #fecaca; }
.btn.danger:hover { background: var(--bad-50); }
.btn.plain { background: transparent; color: var(--ink-2); padding: 0 10px; }
.btn.plain:hover { background: var(--line-2); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn.lg { min-height: 52px; padding: 0 22px; font-size: 16px; border-radius: 14px; }
.btn.block { width: 100%; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: #fff; display: inline-grid; place-items: center; cursor: pointer; color: var(--ink-2); flex-shrink: 0; transition: .15s; }
.icon-btn:hover { border-color: var(--brand-200); color: var(--brand-700); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn.sm { width: 34px; height: 34px; border-radius: 10px; }
.icon-btn.bare { border-color: transparent; background: transparent; }
svg.i { width: 18px; height: 18px; flex-shrink: 0; }

/* Formulários */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.req { color: var(--bad); }
.input, .field input:not([type=checkbox]):not([type=radio]):not([type=color]), .field select, .field textarea {
  width: 100%; min-height: 46px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 92px; resize: vertical; line-height: 1.45; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-100); }
.field .hint { font-size: 12.5px; color: var(--muted); }
.field.invalid input, .field.invalid textarea { border-color: var(--bad); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 600px) { .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); } }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand); flex-shrink: 0; }
.alert { padding: 12px 14px; border-radius: 12px; font-size: 14px; border: 1px solid; display: flex; gap: 10px; align-items: flex-start; }
.alert.error { background: var(--bad-50); color: #991b1b; border-color: #fecaca; }
.alert.info { background: var(--brand-50); color: var(--ink-2); border-color: var(--brand-200); }
.alert.warn { background: var(--warn-50); color: #92400e; border-color: #fde68a; }

/* Interruptor */
.switch { position: relative; width: 42px; height: 24px; flex-shrink: 0; display: inline-block; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: #cbd5e1; border-radius: 99px; transition: .2s; }
.switch span::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::before { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2.5px solid var(--brand-200); outline-offset: 2px; }

/* Peças comuns */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.chip svg.i { width: 14px; height: 14px; }
.chip.ok { background: var(--ok-50); color: #047857; }
.chip.warn { background: var(--warn-50); color: #b45309; }
.chip.bad { background: var(--bad-50); color: #b91c1c; }
.chip.info { background: var(--info-50); color: #1d4ed8; }
.chip.brand { background: var(--brand-50); color: var(--brand-700); }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 14px; flex-shrink: 0; overflow: hidden; background: var(--c, var(--brand)); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 56px; height: 56px; font-size: 18px; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatars { display: flex; }
.avatars .avatar { border: 2px solid #fff; margin-left: -8px; }
.avatars .avatar:first-child { margin-left: 0; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--brand)); flex-shrink: 0; display: inline-block; }
.seg { display: inline-flex; background: #eef1f6; border-radius: 12px; padding: 4px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 7px 13px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: var(--sh-1); }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); font-size: 14px; }
.empty svg.i { width: 34px; height: 34px; color: var(--faint); margin: 0 auto 10px; }
.spinner { width: 26px; height: 26px; border: 3px solid var(--brand-100); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.skel { background: linear-gradient(90deg, #eef1f6 25%, #f6f8fb 50%, #eef1f6 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 10px; }
@keyframes sk { to { background-position: -200% 0; } }
.fade-in { animation: fadeIn .28s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Aviso flutuante */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(16px); background: #0f172a; color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 500; opacity: 0; transition: .25s; z-index: 2000; pointer-events: none; box-shadow: var(--sh-3); max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.err { background: var(--bad); }

/* Gaveta lateral (no telemóvel, folha que sobe) */
.scrim { position: fixed; inset: 0; background: rgba(15, 23, 42, .38); z-index: 900; animation: fadeOnly .2s; }
@keyframes fadeOnly { from { opacity: 0; } }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: #fff; z-index: 901; display: flex; flex-direction: column; box-shadow: var(--sh-3); animation: slideIn .25s cubic-bezier(.2, .8, .2, 1); }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } }
.drawer-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 18px; flex: 1; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 18px 28px; display: flex; flex-direction: column; gap: 18px; }
.drawer-foot { padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; gap: 10px; flex-wrap: wrap; background: #fff; }
@media (max-width: 640px) {
  .drawer { top: auto; left: 0; width: 100%; max-height: 92vh; border-radius: 22px 22px 0 0; animation: sheetUp .28s cubic-bezier(.2, .8, .2, 1); }
  .drawer::before { content: ''; width: 40px; height: 5px; border-radius: 99px; background: #cbd5e1; margin: 8px auto 0; }
  @keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } }
}
.section-title { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.kv { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

/* Selector de datas e horas */
.date-strip { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.date-chip { flex: 0 0 64px; scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-radius: 14px; border: 1px solid var(--line); background: #fff; cursor: pointer; transition: .15s; }
.date-chip .wd { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.date-chip .dn { font-size: 20px; font-weight: 700; font-family: var(--display); line-height: 1.1; }
.date-chip .mo { font-size: 11.5px; color: var(--muted); }
.date-chip .av { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); margin-top: 3px; }
.date-chip:hover:not(:disabled) { border-color: var(--brand-200); }
.date-chip.on { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 6px 16px -6px var(--brand); }
.date-chip.on .wd, .date-chip.on .mo { color: rgba(255, 255, 255, .85); }
.date-chip.on .av { background: #fff; }
.date-chip:disabled { opacity: .4; cursor: default; background: #fafbfc; }
.date-chip:disabled .av { visibility: hidden; }
.picker-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.picker-head strong { font-size: 15px; }
.picker-head strong::first-letter { text-transform: uppercase; }
.slot-group { margin-top: 16px; }
.slot-group h4 { font-family: var(--font); font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.slot { min-height: 46px; border-radius: 12px; border: 1px solid var(--brand-200); background: #fff; color: var(--brand-700); font-weight: 700; font-size: 15px; cursor: pointer; transition: .12s; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; padding: 4px; }
.slot small { font-size: 11px; font-weight: 600; color: var(--muted); }
.slot:hover { background: var(--brand-50); border-color: var(--brand); }
.slot.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.slot.on small { color: rgba(255, 255, 255, .85); }
.search input { padding-left: 42px !important; }
.tz-note { margin-top: 16px; display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.tz-note select { border: 0; background: transparent; color: var(--ink-2); font-weight: 600; font-size: 12.5px; cursor: pointer; max-width: 240px; padding: 4px; }
