/* =========================================================================
   Escala de Anestesia — visual no padrão dos apps da Apple (macOS / iOS)
   Cores do sistema, materiais translúcidos, tipografia ajustada por tamanho,
   modo escuro automático e movimento curto que responde ao toque.
   ========================================================================= */

:root {
  color-scheme: light dark;
  /* rótulos */
  --label: #1D1D1F;
  --label-2: #6E6E73;
  --label-3: #8E8E93;
  /* superfícies */
  --wallpaper: linear-gradient(160deg, #E9EEF8 0%, #EEEAF5 45%, #F4EEE9 100%);
  --window: #FFFFFF;
  --grouped: #F5F5F7;
  --surface: #FFFFFF;
  --inspector: #FAFAFC;
  --sidebar: rgba(236, 236, 242, 0.74);
  --bar: rgba(255, 255, 255, 0.74);
  --control: #FFFFFF;
  --control-border: rgba(0, 0, 0, 0.13);
  --control-shadow: 0 0.5px 1.5px rgba(0, 0, 0, 0.13);
  --seg-on: #FFFFFF;
  --fill: rgba(120, 120, 128, 0.12);
  --fill-2: rgba(120, 120, 128, 0.07);
  --press: rgba(120, 120, 128, 0.2);
  --sep: rgba(60, 60, 67, 0.16);
  --sep-2: rgba(60, 60, 67, 0.09);
  --shadow-card: 0 0.5px 1px rgba(0, 0, 0, 0.05), 0 2px 6px rgba(0, 0, 0, 0.04);
  --shadow-float: 0 0 0 0.5px rgba(0, 0, 0, 0.12), 0 10px 30px rgba(0, 0, 0, 0.16), 0 2px 6px rgba(0, 0, 0, 0.08);
  /* cores do sistema */
  --accent: #007AFF;
  --accent-hover: #0068D9;
  --accent-tint: rgba(0, 122, 255, 0.12);
  --red: #FF3B30;
  --green: #34C759;
  --orange: #FF9500;
  --indigo: #5856D6;
  --ok: #1E7B34;
  --ok-bg: rgba(52, 199, 89, 0.13);
  --warn-ink: #8A4A00;
  --warn-icon: #C76A00;
  --warn-bg: rgba(255, 149, 0, 0.13);
  --bad-ink: #B42318;
  --bad-icon: #E5372B;
  --bad-bg: rgba(255, 59, 48, 0.1);
  --hour: 56px;
  /* nomes antigos usados no código */
  --ink: var(--label);
  --ink-2: var(--label-2);
  --line: var(--sep);
  --line-soft: var(--sep-2);
  --bg: var(--window);
  --bg-panel: var(--inspector);
  --accent-ink: var(--accent-hover);
  --ease: cubic-bezier(0.32, 0.72, 0, 1);

  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', system-ui, sans-serif;
  font-optical-sizing: auto;
  font-size: 13px;
  line-height: 1.38;
  letter-spacing: -0.003em;
  color: var(--label);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv05', 'cv08', 'ss03';
}

@media (prefers-color-scheme: dark) {
  :root {
    --label: #F5F5F7;
    --label-2: #A1A1A6;
    --label-3: #7C7C80;
    --wallpaper: linear-gradient(160deg, #1B2233 0%, #221D2C 50%, #2A211D 100%);
    --window: #1E1E20;
    --grouped: #161618;
    --surface: #242427;
    --inspector: #212123;
    --sidebar: rgba(38, 38, 42, 0.72);
    --bar: rgba(30, 30, 32, 0.74);
    --control: #3A3A3D;
    --control-border: rgba(255, 255, 255, 0.08);
    --control-shadow: 0 0.5px 1px rgba(0, 0, 0, 0.4), inset 0 0.5px 0 rgba(255, 255, 255, 0.08);
    --seg-on: #636366;
    --fill: rgba(120, 120, 128, 0.24);
    --fill-2: rgba(120, 120, 128, 0.14);
    --press: rgba(120, 120, 128, 0.34);
    --sep: rgba(255, 255, 255, 0.12);
    --sep-2: rgba(255, 255, 255, 0.07);
    --shadow-card: 0 0 0 0.5px rgba(255, 255, 255, 0.06), 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-float: 0 0 0 0.5px rgba(255, 255, 255, 0.12), 0 14px 40px rgba(0, 0, 0, 0.55);
    --accent: #0A84FF;
    --accent-hover: #3395FF;
    --accent-tint: rgba(10, 132, 255, 0.2);
    --red: #FF453A;
    --green: #30D158;
    --orange: #FF9F0A;
    --indigo: #5E5CE6;
    --ok: #4ADE6E;
    --ok-bg: rgba(48, 209, 88, 0.16);
    --warn-ink: #FFB547;
    --warn-icon: #FF9F0A;
    --warn-bg: rgba(255, 159, 10, 0.16);
    --bad-ink: #FF7B72;
    --bad-icon: #FF453A;
    --bad-bg: rgba(255, 69, 58, 0.16);
  }
}

* { box-sizing: border-box; }
html { background: var(--grouped); }
body { margin: 0; background: var(--wallpaper) fixed; min-height: 100vh; }
button, input, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: none; box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--accent) 45%, transparent); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }
* { scrollbar-width: thin; scrollbar-color: rgba(128, 128, 128, 0.45) transparent; }

h1, h2, h3 { font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', system-ui, sans-serif; }

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

/* ---------- Barra lateral (material translúcido) ---------- */
.sidebar {
  flex: 1 1 228px; max-width: 100%; padding: 14px 10px; display: flex; flex-direction: column; gap: 16px;
  background: var(--sidebar);
  backdrop-filter: blur(40px) saturate(180%); -webkit-backdrop-filter: blur(40px) saturate(180%);
  border-right: 0.5px solid var(--sep);
  position: sticky; top: 0; align-self: flex-start; min-height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 4px; }
.brand-icon { width: 30px; height: 30px; border-radius: 7px; background: linear-gradient(180deg, #2E93FF, #0066E0); display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18), inset 0 0.5px 0 rgba(255, 255, 255, 0.35); }
.brand-name { font-size: 13px; font-weight: 700; letter-spacing: -0.01em; }
.brand-sub { font-size: 11px; color: var(--label-2); }
.nav-group { display: flex; flex-direction: column; gap: 1px; }
.nav-label { padding: 0 10px 3px; font-size: 11px; font-weight: 600; color: var(--label-3); }
.nav-group a {
  display: flex; align-items: center; gap: 8px; min-height: 28px; padding: 0 10px; border-radius: 6px;
  color: var(--label); font-size: 13px; text-decoration: none;
  transition: background-color 120ms ease-out;
}
.nav-group a svg { width: 16px; height: 16px; fill: none; stroke: var(--accent); stroke-width: 1.8; flex: none; }
.nav-group a:hover { background: var(--fill-2); text-decoration: none; }
.nav-group a:active { background: var(--press); }
.nav-group a[aria-current="page"] { background: var(--accent); color: #fff; }
.nav-group a[aria-current="page"] svg { stroke: #fff; }
.nav-group a[aria-current="page"] .badge { background: #fff; color: var(--accent); }
.nav-foot { margin-top: auto; padding: 0 6px; display: flex; flex-direction: column; gap: 6px; font-size: 12px; }
.btn-link { border: 0; background: none; padding: 4px 0; color: var(--accent); font-size: 12px; cursor: pointer; }
.btn-link:hover { text-decoration: underline; }
.nav-foot > .btn-link { color: var(--label-2); text-align: left; }

/* ---------- Área principal ---------- */
.app > .main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; background: var(--grouped); }
.toolbar {
  position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  min-height: 52px; padding: 10px 20px;
  background: var(--bar); backdrop-filter: blur(30px) saturate(180%); -webkit-backdrop-filter: blur(30px) saturate(180%);
  border-bottom: 0.5px solid var(--sep);
}
.spacer { flex: 1; }

/* Botões no padrão do Mac: resposta no toque, sem atraso */
.btn {
  min-height: 28px; padding: 0 12px; border: 0.5px solid var(--control-border); border-radius: 6px;
  background: var(--control); box-shadow: var(--control-shadow); font-size: 13px; font-weight: 450; cursor: default;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
  transition: transform 90ms ease-out, filter 90ms ease-out, background-color 120ms ease-out;
}
.btn:active { transform: scale(0.97); filter: brightness(0.94); }
.btn-primary {
  border: 0; color: #fff; font-weight: 600;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, #fff), var(--accent));
  box-shadow: 0 0.5px 1px rgba(0, 0, 0, 0.18), inset 0 0.5px 0 rgba(255, 255, 255, 0.25);
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary[disabled], .btn[disabled] { opacity: 0.45; filter: none; transform: none; }
.btn-danger { color: var(--red); }
.icon-btn { width: 28px; height: 28px; border: 0; border-radius: 6px; background: transparent; display: inline-flex; align-items: center; justify-content: center; cursor: default; transition: background-color 100ms; }
.icon-btn:hover { background: var(--fill-2); }
.icon-btn:active { background: var(--press); }
.icon-btn svg { width: 14px; height: 14px; fill: none; stroke: var(--label-2); stroke-width: 2.2; }

.segmented { display: inline-flex; padding: 2px; border-radius: 7px; background: var(--fill); }
.segmented button { min-height: 24px; padding: 0 16px; border: 0; border-radius: 5px; background: transparent; font-size: 13px; cursor: default; transition: background-color 150ms var(--ease), box-shadow 150ms; }
.segmented button[aria-pressed="true"] { background: var(--seg-on); box-shadow: 0 0.5px 2px rgba(0, 0, 0, 0.2), 0 0 0 0.5px rgba(0, 0, 0, 0.04); font-weight: 500; }

/* Campos */
select, input[type="text"], input[type="email"], input[type="password"], input[type="time"], input[type="date"], input[type="search"] {
  min-height: 28px; padding: 0 9px; border: 0.5px solid var(--control-border); border-radius: 6px;
  background: var(--control); box-shadow: inset 0 0.5px 1px rgba(0, 0, 0, 0.06); font-size: 13px;
  transition: box-shadow 120ms ease-out, border-color 120ms;
}
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--accent) 35%, transparent); }
select {
  appearance: none; -webkit-appearance: none; padding-right: 26px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='14' viewBox='0 0 10 14' fill='none' stroke='%238E8E93' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 5l3-3 3 3M2 9l3 3 3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
}
input[type="range"] { accent-color: var(--accent); }
input[type="file"] { font-size: 13px; }
input[type="file"]::file-selector-button { margin-right: 10px; min-height: 28px; padding: 0 12px; border: 0.5px solid var(--control-border); border-radius: 6px; background: var(--control); box-shadow: var(--control-shadow); color: var(--label); }

/* Títulos */
.page-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; padding: 22px 28px 12px; }
.page-head h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -0.022em; line-height: 1.12; }
.page-head .sub { font-size: 17px; color: var(--label-2); margin-left: 10px; letter-spacing: -0.01em; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 3px 10px 3px 8px; border-radius: 999px; }
.status svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.status.ok { color: var(--ok); background: var(--ok-bg); }
.status.bad { color: var(--bad-ink); background: var(--bad-bg); }
.status.approved { color: var(--accent); background: var(--accent-tint); }
.page { padding: 6px 28px 48px; display: flex; flex-direction: column; gap: 18px; max-width: 1120px; }
.empty { padding: 48px 28px; color: var(--label-2); font-size: 15px; }

/* ---------- Grade do dia (como o Calendário) ---------- */
.day-body { flex: 1; display: flex; flex-wrap: wrap; align-items: stretch; border-top: 0.5px solid var(--sep); background: var(--window); }
.grid-wrap { flex: 999 1 520px; min-width: 0; overflow-x: auto; }
.grid-inner { min-width: 640px; }
.grid-head { height: 40px; display: flex; padding-left: 64px; border-bottom: 0.5px solid var(--sep); background: var(--window); }
.grid-head div { flex: 1; display: flex; align-items: center; gap: 6px; padding: 0 10px; font-size: 12px; font-weight: 600; }
.grid-head div span:last-child { font-weight: 400; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.grid-body { display: flex; padding: 12px 0 28px; }
.hours { width: 64px; flex: none; position: relative; }
.hours span { position: absolute; right: 10px; transform: translateY(-50%); font-size: 11px; color: var(--label-3); font-variant-numeric: tabular-nums; }
.cols { flex: 1; display: flex; position: relative; background: repeating-linear-gradient(180deg, var(--sep-2) 0 1px, transparent 1px var(--hour)); }
.col { flex: 1; position: relative; border-left: 0.5px solid var(--sep-2); }
.event {
  position: absolute; left: 3px; right: 4px; border: 0; border-radius: 6px; padding: 5px 8px 5px 10px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; overflow: hidden; text-align: left; cursor: default;
  background: color-mix(in srgb, var(--c) 17%, var(--window));
  color: color-mix(in srgb, var(--c) 62%, var(--label));
  box-shadow: inset 3px 0 0 var(--c);
  transition: transform 100ms ease-out, box-shadow 160ms var(--ease), background-color 160ms var(--ease);
}
.event:hover { background: color-mix(in srgb, var(--c) 24%, var(--window)); }
.event:active { transform: scale(0.985); }
.event .t { font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; opacity: 0.85; }
.event .p { font-size: 12.5px; font-weight: 600; line-height: 1.22; letter-spacing: -0.005em; }
.event .a { font-size: 11.5px; opacity: 0.9; }
.event .flag { position: absolute; top: 5px; right: 6px; width: 15px; height: 15px; }
.event[aria-pressed="true"] {
  background: color-mix(in srgb, var(--c) 82%, #000); color: #fff;
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--c) 60%, #000), 0 6px 16px color-mix(in srgb, var(--c) 30%, transparent);
}
.event.uncovered { --c: var(--red); background: repeating-linear-gradient(135deg, var(--bad-bg) 0 8px, transparent 8px 16px), var(--window); color: var(--bad-ink); }
.event.uncovered[aria-pressed="true"] { background: color-mix(in srgb, var(--red) 85%, #000); color: #fff; }
.now-line { position: absolute; left: -6px; right: 0; height: 0; border-top: 1.5px solid var(--red); pointer-events: none; }
.now-line::before { content: ''; position: absolute; left: 0; top: -5px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); }

/* ---------- Inspetor ---------- */
.inspector { flex: 1 1 290px; min-width: 0; border-left: 0.5px solid var(--sep); background: var(--inspector); padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.inspector h2 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -0.018em; line-height: 1.2; }
.meta { font-size: 12px; color: var(--label-2); display: flex; align-items: center; gap: 6px; }
.muted { font-size: 12px; color: var(--label-2); }
.facts { margin: 0; display: grid; grid-template-columns: 96px 1fr; row-gap: 9px; font-size: 13px; padding: 12px 14px; border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-card); }
.facts dt { color: var(--label-2); }
.facts dd { margin: 0; }
.reasons { margin: 0; padding-left: 18px; font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.reasons li::marker { color: var(--accent); }
.note { display: flex; gap: 10px; padding: 11px 12px; border-radius: 10px; font-size: 13px; line-height: 1.4; }
.note svg { width: 17px; height: 17px; flex: none; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; margin-top: 1px; }
.note.warn { background: var(--warn-bg); color: var(--warn-ink); }
.note.warn svg { stroke: var(--warn-icon); }
.note.bad { background: var(--bad-bg); color: var(--bad-ink); }
.note.bad svg { stroke: var(--bad-icon); }
.note.ok { background: var(--ok-bg); color: var(--ok); }
.note.ok svg { stroke: var(--green); }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.field label, .field .label { color: var(--label-2); font-size: 12px; }
.team-list { display: flex; flex-direction: column; border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-card); padding: 4px 12px; }
.team-list div { display: flex; align-items: center; gap: 8px; min-height: 32px; font-size: 13px; }
.team-list div + div { border-top: 0.5px solid var(--sep-2); }
.team-list .name { flex: 1; }
.section-label { font-size: 11px; font-weight: 600; color: var(--label-3); padding: 0 2px 6px; text-transform: none; }

/* ---------- Semana ---------- */
.week { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.day-card {
  border: 0; border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--surface);
  box-shadow: var(--shadow-card); text-align: left; cursor: default; color: inherit;
  transition: transform 140ms var(--ease), box-shadow 200ms var(--ease);
}
.day-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-float); }
.day-card:active { transform: scale(0.985); }
.day-card h3 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -0.01em; text-transform: capitalize; }
.day-card .status { align-self: flex-start; }
.day-card ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.day-card li { display: flex; gap: 8px; align-items: center; }
.day-card .time { width: 40px; color: var(--label-2); font-variant-numeric: tabular-nums; }

/* ---------- Cartões, tabelas, formulários (agrupados como nos Ajustes) ---------- */
.card { border: 0; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-card); overflow: hidden; }
.card-head { padding: 13px 16px; border-bottom: 0.5px solid var(--sep); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; }
.card-head h2 { margin: 0; font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-weight: 600; color: var(--label-2); font-size: 11.5px; padding: 9px 16px; border-bottom: 0.5px solid var(--sep); white-space: nowrap; }
td { padding: 9px 16px; border-bottom: 0.5px solid var(--sep-2); vertical-align: middle; }
tbody tr { transition: background-color 100ms; }
tbody tr:hover { background: var(--fill-2); }
tr:last-child td { border-bottom: 0; }
.form-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 14px 16px; background: var(--fill-2); border-top: 0.5px solid var(--sep); }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  min-height: 24px; padding: 0 10px; border-radius: 999px; border: 0.5px solid var(--control-border); background: var(--control);
  box-shadow: var(--control-shadow); font-size: 12px; cursor: default; transition: background-color 140ms var(--ease), color 140ms, transform 90ms;
}
.chip:active { transform: scale(0.95); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: transparent; color: #fff; box-shadow: none; }
.chip.avoid[aria-pressed="true"] { background: var(--red); }
.chip[disabled] { opacity: 0.6; }
.person { padding: 16px; border-bottom: 0.5px solid var(--sep); display: grid; grid-template-columns: 200px 1fr; gap: 10px 16px; align-items: start; }
.person:last-child { border-bottom: 0; }
.person .who { display: flex; flex-direction: column; gap: 4px; }
.person .who strong { font-size: 14px; letter-spacing: -0.01em; }
.prow { display: grid; grid-template-columns: 150px 1fr; gap: 8px; align-items: center; font-size: 13px; }
.prow > span { color: var(--label-2); font-size: 12px; }
@media (max-width: 700px) { .person, .prow { grid-template-columns: 1fr; } }
.weights { display: flex; flex-direction: column; }
.weight { display: grid; grid-template-columns: 1fr 200px 32px; gap: 14px; align-items: center; padding: 13px 16px; border-bottom: 0.5px solid var(--sep-2); font-size: 13px; }
.weight small { display: block; color: var(--label-2); font-size: 12px; margin-top: 2px; }
.weight output { font-variant-numeric: tabular-nums; text-align: right; font-weight: 600; }
@media (max-width: 600px) { .weight { grid-template-columns: 1fr 40px; } .weight input { grid-column: 1 / -1; } }
.rules { margin: 0; padding: 14px 16px 14px 34px; font-size: 13px; display: flex; flex-direction: column; gap: 7px; }
.rules li::marker { color: var(--accent); }

/* ---------- Mês ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.month-wrap { overflow-x: auto; border-radius: 12px; box-shadow: var(--shadow-card); }
.month { min-width: 860px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--surface); }
.mhead { padding: 8px 10px; font-size: 11px; font-weight: 600; color: var(--label-2); text-align: right; border-bottom: 0.5px solid var(--sep); }
.mcell { min-height: 120px; padding: 6px 8px 8px; display: flex; flex-direction: column; gap: 4px; border-right: 0.5px solid var(--sep-2); border-bottom: 0.5px solid var(--sep-2); background: var(--surface); transition: background-color 120ms; }
.mcell:nth-child(7n) { border-right: 0; }
.mcell.blank { background: var(--fill-2); }
.mcell.weekend { background: color-mix(in srgb, var(--fill-2) 60%, var(--surface)); }
.mcell.alert { background: var(--bad-bg); }
.mday {
  align-self: flex-end; min-width: 26px; height: 26px; padding: 0 6px; border: 0; border-radius: 13px; background: transparent;
  font-size: 14px; font-weight: 600; cursor: default; font-variant-numeric: tabular-nums; transition: background-color 100ms, transform 90ms;
}
.mday:hover { background: var(--fill); }
.mday:active { transform: scale(0.92); }
.mcell.today .mday { background: var(--red); color: #fff; }
.mcell .status { font-size: 11px; padding: 2px 8px 2px 6px; align-self: flex-start; }
.mcell .status svg { width: 11px; height: 11px; }
.night { display: flex; align-items: center; gap: 4px; margin-top: auto; }
.night svg { width: 12px; height: 12px; flex: none; fill: var(--indigo); stroke: none; }
.night select { flex: 1; min-width: 0; min-height: 24px; padding: 0 20px 0 6px; font-size: 11.5px; border-color: transparent; box-shadow: none; background-color: color-mix(in srgb, var(--indigo) 13%, transparent); color: color-mix(in srgb, var(--indigo) 70%, var(--label)); background-position: right 5px center; }
.night select.manual { background-color: var(--indigo); color: #fff; }
.night select.missing { background-color: var(--bad-bg); color: var(--bad-ink); }
.out { font-size: 10.5px; color: var(--label-3); }
.hol { font-size: 11px; font-weight: 600; color: var(--warn-ink); }
.pref-warn { align-self: flex-start; font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--warn-bg); color: var(--warn-ink); }
.alert-list { margin: 4px 0 0; padding-left: 18px; }
.alert-list .btn-link { color: inherit; font-size: inherit; padding: 0; text-decoration: underline; }
td.num, span.num { font-variant-numeric: tabular-nums; }
.bar { display: inline-block; width: 120px; height: 6px; margin-right: 8px; border-radius: 3px; background: var(--fill); vertical-align: middle; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

/* ---------- Pedidos ---------- */
.badge { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.badge[hidden] { display: none; }
.req-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.req { border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-card); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.req-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.req-head strong { font-size: 13px; }
.req-what { font-size: 16px; font-weight: 650; letter-spacing: -0.012em; }
.req-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: auto; padding-top: 4px; }
.req-actions .btn { min-height: 30px; padding: 0 16px; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.pill.aprovado { background: var(--ok-bg); color: var(--ok); }
.pill.recusado { background: var(--fill); color: var(--label-2); }
.pill.pendente { background: var(--warn-bg); color: var(--warn-ink); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--warn-bg); color: var(--warn-ink); }

/* ---------- Conta, acessos ---------- */
.user-box { padding: 10px; border-radius: 10px; background: var(--fill-2); display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.user-box strong { font-size: 12px; }
.user-box .row { display: flex; gap: 12px; }
.temp-pass { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 17px; font-weight: 600; letter-spacing: 0.04em; user-select: all; padding: 1px 6px; border-radius: 5px; background: var(--surface); }
.inline-form { display: flex; gap: 6px; flex-wrap: wrap; }
.inline-form input { min-width: 180px; }

/* ---------- Aviso estilo notificação do Mac ---------- */
.toast {
  position: fixed; top: 14px; right: 14px; z-index: 50; width: min(344px, calc(100vw - 28px));
  display: flex; align-items: center; gap: 11px; padding: 11px 14px 11px 11px; border-radius: 16px;
  background: var(--bar); backdrop-filter: blur(30px) saturate(180%); -webkit-backdrop-filter: blur(30px) saturate(180%);
  box-shadow: var(--shadow-float); color: var(--label); font-size: 13px; line-height: 1.3;
  opacity: 0; transform: translateX(24px) scale(0.98); pointer-events: none;
  transition: opacity 220ms var(--ease), transform 380ms var(--ease);
}
.toast.show { opacity: 1; transform: none; pointer-events: auto; }
.toast img { width: 32px; height: 32px; border-radius: 8px; flex: none; }
.toast b { display: block; font-size: 13px; font-weight: 650; }
.toast:empty { display: none; }

/* ---------- Alerta no estilo do Mac (substitui o confirm do navegador) ---------- */
dialog.alert {
  border: 0; padding: 20px 16px 16px; width: min(280px, calc(100vw - 32px)); border-radius: 14px; text-align: center;
  background: var(--bar); backdrop-filter: blur(40px) saturate(180%); -webkit-backdrop-filter: blur(40px) saturate(180%);
  color: var(--label); box-shadow: var(--shadow-float);
}
dialog.alert[open] { animation: alert-in 260ms var(--ease); }
dialog.alert::backdrop { background: rgba(0, 0, 0, 0.18); animation: fade-in 200ms ease-out; }
dialog.alert img { width: 56px; height: 56px; border-radius: 12px; }
dialog.alert h2 { margin: 10px 0 6px; font-size: 13px; font-weight: 700; }
dialog.alert p { margin: 0 0 16px; font-size: 11.5px; color: var(--label-2); line-height: 1.4; }
dialog.alert .btns { display: flex; flex-direction: column; gap: 8px; }
dialog.alert .btn { min-height: 28px; width: 100%; }
dialog.alert .btn-danger-fill { color: #fff; font-weight: 600; border: 0; background: var(--red); }
@keyframes alert-in { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } }

/* Troca suave entre telas */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 180ms; animation-timing-function: var(--ease); }

@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after { transition-duration: 1ms !important; animation-duration: 1ms !important; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .sidebar, .toolbar, .grid-head, .toast, dialog.alert, .pt-tabs { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .sidebar { background: var(--grouped); }
  .toolbar, .grid-head, .toast, dialog.alert { background: var(--window); }
}

/* =========================== Portal (iOS) =========================== */
.pt-body { background: var(--grouped); }
.pt { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--grouped); padding: 16px 16px 108px; display: flex; flex-direction: column; gap: 18px; font-size: 15px; }
@media (prefers-color-scheme: dark) { .pt-body, .pt { --grouped: #000; --surface: #1C1C1E; } }
.pt-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding-top: 6px; }
.pt-top h1 { margin: 0; font-size: 34px; font-weight: 700; letter-spacing: -0.026em; line-height: 1.08; }
.pt-eyebrow { font-size: 13px; font-weight: 600; color: var(--label-2); letter-spacing: -0.005em; }
.pt-avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(180deg, #8E8E93, #636366); color: #fff; font-size: 15px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex: none; letter-spacing: 0.02em; }
.pt-who { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--label-2); }
.pt-who select { flex: 1; min-height: 36px; border-radius: 10px; font-size: 15px; }
.pt-hero { border-radius: 18px; padding: 16px; color: #fff; display: flex; gap: 14px; align-items: center; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); }
.pt-hero .big { width: 50px; height: 50px; border-radius: 13px; background: rgba(255, 255, 255, 0.2); display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; flex: none; box-shadow: inset 0 0.5px 0 rgba(255, 255, 255, 0.3); }
.pt-hero .t1 { font-size: 17px; font-weight: 600; letter-spacing: -0.015em; }
.pt-hero .t2 { font-size: 14px; opacity: 0.9; }
.pt-hero.off { background: linear-gradient(180deg, #9A9AA0, #7C7C82); }
.pt-hero.night { background: linear-gradient(180deg, #6B69E0, #4E4CC9); }
.pt-section { display: flex; flex-direction: column; gap: 7px; }
.pt-section > .lbl { padding: 0 16px; font-size: 13px; color: var(--label-2); }
.pt-group { border-radius: 12px; background: var(--surface); overflow: hidden; }
.pt-row { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 8px 16px; position: relative; font-size: 15px; }
.pt-row + .pt-row::before { content: ''; position: absolute; top: 0; left: 16px; right: 0; border-top: 0.5px solid var(--sep); }
.pt-row-btn { width: 100%; border: 0; background: var(--surface); text-align: left; font: inherit; color: inherit; cursor: default; transition: background-color 80ms; }
.pt-row-btn:active { background: var(--press); }
.pt-row-btn::after { content: ''; width: 7px; height: 7px; margin-left: auto; border-right: 2px solid var(--label-3); border-top: 2px solid var(--label-3); transform: rotate(45deg); opacity: 0.7; flex: none; }
.pt-row .time { width: 46px; font-weight: 600; font-variant-numeric: tabular-nums; flex: none; }
.pt-row .main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pt-row .sub { font-size: 13px; color: var(--label-2); }
.pt-row .day { width: 64px; font-weight: 500; flex: none; }
.pt-row.weekend .day { color: var(--label-2); }
.pt-nav { display: flex; align-items: center; justify-content: space-between; }
.pt-nav .icon-btn { width: 44px; height: 44px; border-radius: 22px; }
.pt-nav .icon-btn svg { width: 18px; height: 18px; stroke: var(--accent); }
.pt-nav .btn { min-height: 32px; border-radius: 16px; padding: 0 16px; font-size: 14px; color: var(--accent); font-weight: 500; }
.pt-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pt-stat { background: var(--surface); border-radius: 14px; padding: 12px 14px; }
.pt-stat b { display: block; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.pt-stat span { font-size: 12px; color: var(--label-2); }
.pt-form { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.pt-form .field input, .pt-form .field select { min-height: 44px; border-radius: 10px; font-size: 16px; }
.pt-form .btn { min-height: 44px; border-radius: 12px; font-size: 16px; }
.pt-form .btn-primary { min-height: 50px; border-radius: 14px; font-size: 17px; }
.pt-seg { display: flex; padding: 2px; border-radius: 9px; background: var(--fill); }
.pt-seg button { flex: 1; min-height: 32px; border: 0; border-radius: 7px; background: transparent; font-size: 13px; cursor: default; transition: background-color 180ms var(--ease); }
.pt-seg button[aria-pressed="true"] { background: var(--seg-on); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.04); font-weight: 600; }
.pt .chip { min-height: 32px; padding: 0 14px; font-size: 14px; }
.pt-tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; justify-content: center;
  background: var(--bar); backdrop-filter: blur(30px) saturate(180%); -webkit-backdrop-filter: blur(30px) saturate(180%);
  border-top: 0.5px solid var(--sep); padding-bottom: env(safe-area-inset-bottom);
}
.pt-tabs div { width: 100%; max-width: 480px; display: flex; }
.pt-tabs button { flex: 1; min-height: 56px; border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 10.5px; font-weight: 500; color: var(--label-3); cursor: default; position: relative; transition: transform 90ms; }
.pt-tabs button:active { transform: scale(0.94); }
.pt-tabs button svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.pt-tabs button[aria-current="page"] { color: var(--accent); }
.pt-tabs .badge { position: absolute; top: 5px; left: calc(50% + 6px); margin: 0; }
.pt ~ .toast { top: max(10px, env(safe-area-inset-top)); left: 50%; right: auto; transform: translate(-50%, -16px) scale(0.98); }
.pt ~ .toast.show { transform: translate(-50%, 0); }

/* =========================== Login =========================== */
.login-body { background: var(--wallpaper) fixed; }
.login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 24px 16px; }
.login-hero { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.login-hero img { width: 76px; height: 76px; border-radius: 18px; box-shadow: 0 8px 24px rgba(0, 80, 200, 0.28), 0 0 0 0.5px rgba(0, 0, 0, 0.1); }
.login-hero h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.login-hero p { margin: 0; color: var(--label-2); font-size: 13px; }
.login-card {
  width: 100%; max-width: 340px; border-radius: 16px; padding: 22px 20px; display: flex; flex-direction: column; gap: 14px;
  background: var(--bar); backdrop-filter: blur(40px) saturate(180%); -webkit-backdrop-filter: blur(40px) saturate(180%);
  box-shadow: var(--shadow-float);
  animation: alert-in 320ms var(--ease);
}
.login-card[hidden] { display: none; }
.login-card h2 { margin: 0; font-size: 15px; font-weight: 650; text-align: center; }
.login-card input { min-height: 36px; font-size: 14px; border-radius: 8px; }
.login-card .btn-primary { min-height: 34px; font-size: 14px; border-radius: 8px; }
.login-err { margin: 0; min-height: 1em; color: var(--bad-ink); font-size: 12px; text-align: center; }
.login-card.shake { animation: shake 360ms var(--ease); }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }

/* =========================== Impressão =========================== */
@media print {
  :root { color-scheme: light; --window: #fff; --surface: #fff; --label: #000; --label-2: #444; }
  @page { margin: 12mm; }
  html, body { background: #fff !important; }
  .sidebar, .toolbar, .inspector, .nav-foot, .toast, .note.bad .btn-link, .btn, form, .pt-tabs, dialog { display: none !important; }
  .app { display: block; min-height: 0; }
  .app > .main { display: block; background: #fff; }
  .page-head { padding: 0 0 8px; }
  .grid-head { position: static; backdrop-filter: none; }
  .grid-wrap, .month-wrap, .table-wrap { overflow: visible !important; box-shadow: none; }
  .grid-inner, .month { min-width: 0 !important; }
  .event { break-inside: avoid; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .event[aria-pressed="true"] { background: color-mix(in srgb, var(--c) 17%, #fff) !important; color: #000 !important; box-shadow: inset 3px 0 0 var(--c) !important; }
  .mcell { min-height: 84px; break-inside: avoid; }
  .night select { appearance: none; background: none !important; color: #000 !important; border: 0; padding: 0; }
  .card, .month-wrap { break-inside: avoid; box-shadow: none; border: 1px solid #ccc; }
  .page { padding: 0; max-width: none !important; }
  .status, .bar span { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

.brand-img { width: 30px; height: 30px; border-radius: 7px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18); flex: none; }

/* =========================================================================
   Camada macOS 26 (Tahoe): janela, barra lateral de vidro flutuante,
   barra de ferramentas com cápsulas de vidro e título da janela.
   Fica por último para sobrepor as regras acima.
   ========================================================================= */
:root {
  --glass: rgba(250, 250, 252, 0.62);
  --glass-strong: rgba(255, 255, 255, 0.78);
  --glass-edge: rgba(255, 255, 255, 0.7);
  --glass-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.1), 0 4px 14px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  --win-radius: 26px;
  --side-radius: 18px;
  --row-sel: rgba(0, 0, 0, 0.075);
  --window: #FFFFFF;
}
@media (prefers-color-scheme: dark) {
  :root {
    --glass: rgba(52, 52, 56, 0.55);
    --glass-strong: rgba(62, 62, 66, 0.72);
    --glass-edge: rgba(255, 255, 255, 0.14);
    --glass-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.1), 0 6px 18px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    --row-sel: rgba(255, 255, 255, 0.1);
    --window: #1C1C1E;
  }
}

/* A janela */
body:has(> .app) { height: 100vh; overflow: hidden; }
.app {
  position: relative; height: 100vh; min-height: 0; display: flex; flex-wrap: nowrap; overflow: hidden;
  background: var(--window);
}
@media (min-width: 1100px) {
  body:has(> .app) { padding: 14px; }
  .app { height: calc(100vh - 28px); border-radius: var(--win-radius); box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.22), 0 22px 70px rgba(0, 0, 0, 0.28), 0 6px 18px rgba(0, 0, 0, 0.12); }
}

/* Barra lateral de vidro, flutuando dentro da janela */
.sidebar {
  position: relative; top: auto; align-self: stretch; min-height: 0;
  flex: 0 0 236px; margin: 8px 0 8px 8px; padding: 14px 10px 12px;
  border-radius: var(--side-radius); border-right: 0;
  background: var(--glass);
  backdrop-filter: blur(48px) saturate(190%); -webkit-backdrop-filter: blur(48px) saturate(190%);
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.08), 0 2px 10px rgba(0, 0, 0, 0.06), inset 0 1px 0 var(--glass-edge);
  overflow-y: auto; gap: 18px;
}
.app::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 260px; background: var(--wallpaper); opacity: 0.55; pointer-events: none; }
.sidebar { z-index: 1; }
.traffic { display: flex; gap: 8px; padding: 2px 8px 6px; }
.traffic i { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.18); }
.tl-close { background: #FF5F57; } .tl-min { background: #FEBC2E; } .tl-max { background: #28C840; }
.nav-label { padding: 0 10px 4px; font-size: 11px; font-weight: 600; color: var(--label-3); }
.nav-group a { min-height: 32px; padding: 0 10px; gap: 10px; border-radius: 10px; font-size: 13px; color: var(--label); }
.nav-group a svg { width: 17px; height: 17px; stroke-width: 1.7; }
.nav-group a:hover { background: var(--fill-2); text-decoration: none; }
.nav-group a[aria-current="page"] { background: var(--row-sel); color: var(--label); font-weight: 600; }
.nav-group a[aria-current="page"] svg { stroke: var(--accent); }
.nav-group a[aria-current="page"] .badge { background: var(--red); color: #fff; }
.nav-foot { padding: 0 4px; gap: 4px; }
.user-box { background: var(--fill-2); border-radius: 12px; }
.foot-link { display: block; font-size: 12px; padding: 4px 6px; }

/* Conteúdo: rola por baixo da barra de ferramentas */
.app > .main { position: relative; flex: 1 1 auto; min-width: 0; height: 100%; overflow-y: auto; background: var(--window); }
.app > .main[data-view="dia"], .app > .main[data-view="mes"], .app > .main[data-view="semana"] { background: var(--window); }
.app > .main:not([data-view="dia"]) { background: var(--grouped); }
@media (prefers-color-scheme: dark) { .app > .main:not([data-view="dia"]) { background: #18181A; } }

/* Barra de ferramentas: transparente, com efeito de borda ao rolar, itens em cápsulas de vidro */
.toolbar {
  min-height: 60px; padding: 12px 16px 10px 20px; gap: 8px; border-bottom: 0;
  background: linear-gradient(to bottom, var(--window) 0%, color-mix(in srgb, var(--window) 82%, transparent) 70%, transparent 100%);
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
.app > .main:not([data-view="dia"]) .toolbar { background: linear-gradient(to bottom, var(--grouped) 0%, color-mix(in srgb, var(--grouped) 82%, transparent) 70%, transparent 100%); }
.tb-title { display: flex; flex-direction: column; line-height: 1.15; margin-right: 10px; min-width: 0; }
.tb-title strong { font-size: 15px; font-weight: 700; letter-spacing: -0.012em; white-space: nowrap; }
.tb-title span { font-size: 11px; color: var(--label-2); white-space: nowrap; }

.toolbar .btn, .toolbar input[type="date"], .toolbar .segmented, .toolbar > span:has(.icon-btn) {
  min-height: 34px; border-radius: 999px; border: 0;
  background: var(--glass-strong); box-shadow: var(--glass-shadow);
  backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%);
}
.toolbar .btn { padding: 0 15px; font-weight: 500; }
.toolbar .btn:hover { filter: brightness(1.03); }
.toolbar .btn-primary { background: var(--accent); color: #fff; box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.1), 0 4px 12px color-mix(in srgb, var(--accent) 35%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
.toolbar input[type="date"] { padding: 0 14px; font-size: 13px; }
.toolbar > span:has(.icon-btn) { display: inline-flex; align-items: center; padding: 0 3px; }
.toolbar .icon-btn { width: 30px; height: 30px; border-radius: 999px; }
.toolbar .icon-btn svg { stroke: var(--label); width: 15px; height: 15px; }
.toolbar .segmented { padding: 3px; }
.toolbar .segmented button { min-height: 28px; padding: 0 16px; border-radius: 999px; }
.toolbar .segmented button[aria-pressed="true"] { background: var(--row-sel); box-shadow: none; font-weight: 600; }
@media (prefers-color-scheme: dark) { .toolbar .segmented button[aria-pressed="true"] { background: rgba(255, 255, 255, 0.16); } }

/* Títulos grandes só nas telas de calendário (como o app Calendário); nas demais o título fica na barra */
.app > .main:not([data-view="dia"]):not([data-view="semana"]):not([data-view="mes"]) .page-head h1 { display: none; }
.app > .main:not([data-view="dia"]):not([data-view="semana"]):not([data-view="mes"]) .page-head { padding-top: 4px; padding-bottom: 0; min-height: 0; }
.page-head { padding: 8px 28px 12px; }
.page-head h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.024em; }

/* Calendário: grade sem moldura, como no app Calendário */
.day-body { border-top: 0.5px solid var(--sep); background: var(--window); }
.grid-head { background: var(--window); border-bottom: 0.5px solid var(--sep); }
.inspector { margin: 8px 8px 8px 0; border-left: 0; border-radius: var(--side-radius); background: var(--fill-2); align-self: flex-start; position: sticky; top: 68px; }
.facts, .team-list { background: var(--window); }
.month-wrap { box-shadow: none; border-radius: 0; border-top: 0.5px solid var(--sep); margin: 0 -28px; }
.month { background: var(--window); }
.mcell { background: var(--window); }
.mcell.weekend { background: color-mix(in srgb, var(--fill-2) 55%, var(--window)); }
.mhead { background: var(--window); }

/* Formulários e listas no estilo dos Ajustes do Sistema */
.card { border-radius: 14px; background: var(--window); box-shadow: 0 0 0 0.5px var(--sep-2), 0 1px 2px rgba(0, 0, 0, 0.03); }
.card-head { border-bottom: 0.5px solid var(--sep-2); }
.card-head h2 { font-size: 13px; font-weight: 700; }
.form-row { background: transparent; border-top: 0.5px solid var(--sep-2); }
.req, .day-card { background: var(--window); box-shadow: 0 0 0 0.5px var(--sep-2), 0 1px 2px rgba(0, 0, 0, 0.03); border-radius: 14px; }

/* Telas estreitas: janela ocupa tudo e a barra lateral vira faixa superior */
@media (max-width: 900px) {
  body:has(> .app) { height: auto; overflow: auto; padding: 0; }
  .app { height: auto; min-height: 100vh; flex-wrap: wrap; overflow: visible; border-radius: 0; box-shadow: none; }
  .app::before { display: none; }
  .sidebar { flex: 1 1 100%; margin: 8px; max-height: none; }
  .app > .main { height: auto; overflow: visible; flex-basis: 100%; }
  .inspector { position: static; margin: 8px; }
  .traffic { display: none; }
}
@media print {
  body:has(> .app) { height: auto; overflow: visible; padding: 0; }
  .app { height: auto; overflow: visible; box-shadow: none; border-radius: 0; }
  .app::before { display: none; }
  .app > .main { height: auto; overflow: visible; }
}
@media (prefers-reduced-transparency: reduce) {
  .sidebar { background: var(--grouped); }
  .toolbar .btn, .toolbar input[type="date"], .toolbar .segmented, .toolbar > span:has(.icon-btn) { background: var(--control); backdrop-filter: none; }
}

.toolbar .tb-icon { width: 34px; padding: 0; }
.toolbar .tb-icon svg { width: 17px; height: 17px; fill: none; stroke: var(--label); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
@media (min-width: 901px) { .toolbar { flex-wrap: nowrap; } .tb-title { flex: 0 1 auto; overflow: hidden; } .tb-title strong, .tb-title span { overflow: hidden; text-overflow: ellipsis; } }

/* Simplicidade: dicas curtas e rótulos nos ícones quando cabe */
.hint { margin: -4px 28px 12px; font-size: 12px; color: var(--label-2); }
.toolbar .tb-label { display: none; }
@media (min-width: 1480px) {
  .toolbar .tb-icon { width: auto; padding: 0 13px 0 11px; gap: 6px; }
  .toolbar .tb-label { display: inline; }
}
@media (max-width: 1250px) {
  .app > .main[data-view="dia"] .tb-title, .app > .main[data-view="mes"] .tb-title, .app > .main[data-view="semana"] .tb-title { display: none; }
  .tb-title span { display: none; }
}

/* Portal: barra de abas flutuante de vidro, como no iOS 26 */
.pt-tabs { left: 0; right: 0; bottom: 0; background: none; border-top: 0; backdrop-filter: none; -webkit-backdrop-filter: none; padding: 0 16px calc(12px + env(safe-area-inset-bottom)); pointer-events: none; }
.pt-tabs div {
  pointer-events: auto; max-width: 420px; margin: 0 auto; border-radius: 32px; padding: 4px;
  background: var(--glass-strong); backdrop-filter: blur(28px) saturate(190%); -webkit-backdrop-filter: blur(28px) saturate(190%);
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.1), 0 10px 30px rgba(0, 0, 0, 0.16), inset 0 1px 0 var(--glass-edge);
}
.pt-tabs button { min-height: 54px; border-radius: 28px; }
.pt-tabs button[aria-current="page"] { background: var(--row-sel); }

/* =========================================================================
   Coordenador no celular (padrão iPhone, iOS 26): sem barra lateral,
   abas flutuantes embaixo, lista do dia no lugar da grade, detalhes em folha.
   ========================================================================= */
.m-tabs, .m-more, .day-list, .sheet-grab, .sheet-close { display: none; }

@media (max-width: 900px) {
  body:has(> .app) { height: auto; overflow: auto; padding: 0; background: var(--grouped); }
  .app { display: block; height: auto; min-height: 100vh; border-radius: 0; box-shadow: none; overflow: visible; background: var(--grouped); }
  .app::before, .sidebar { display: none; }
  .app > .main { height: auto; overflow: visible; padding-bottom: 110px; background: var(--grouped) !important; }

  /* Barra de cima compacta: só o essencial */
  .toolbar { position: sticky; top: 0; min-height: 0; padding: max(10px, env(safe-area-inset-top)) 14px 8px; gap: 6px; flex-wrap: nowrap;
    background: linear-gradient(to bottom, var(--grouped) 0%, color-mix(in srgb, var(--grouped) 85%, transparent) 75%, transparent 100%) !important; }
  .toolbar .segmented, .toolbar input[type="date"], .toolbar .tb-icon, .tb-title span { display: none !important; }
  .toolbar .btn { min-height: 36px; padding: 0 14px; font-size: 15px; }
  .toolbar .icon-btn { width: 36px; height: 36px; }
  .toolbar .btn-primary { padding: 0 16px; }
  .app > .main:not([data-view="dia"]):not([data-view="semana"]):not([data-view="mes"]) .tb-title { display: flex !important; }
  .app > .main[data-view="dia"] .tb-title, .app > .main[data-view="mes"] .tb-title, .app > .main[data-view="semana"] .tb-title { display: none !important; }
  .tb-title strong { font-size: 17px; }

  /* Título grande do iOS */
  .page-head { padding: 4px 18px 8px; gap: 6px; }
  .page-head h1 { font-size: 30px; line-height: 1.08; letter-spacing: -0.026em; }
  .page-head .sub { display: block; margin: 2px 0 0; font-size: 15px; }
  .hint { margin: 0 18px 10px; font-size: 13px; }
  .page { padding: 4px 16px 24px; gap: 16px; }
  .empty { padding: 32px 18px; }

  /* Dia: lista agrupada no lugar da grade */
  .day-body { display: block; border: 0; background: transparent; }
  .grid-wrap { display: none; }
  .day-list { display: block; padding: 0 16px 8px; }
  .dl-group { display: block; border-radius: 14px; background: var(--window); overflow: hidden; }
  .dl-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px 14px 11px 12px; border: 0; background: transparent; text-align: left; color: inherit; font: inherit; position: relative; transition: background-color 80ms; }
  .dl-row::before { content: ''; align-self: stretch; width: 4px; border-radius: 2px; background: var(--c); flex: none; }
  .dl-row + .dl-row { box-shadow: inset 0 0.5px 0 var(--sep); }
  .dl-row:active { background: var(--press); }
  .dl-row::after { content: ''; width: 7px; height: 7px; border-right: 2px solid var(--label-3); border-top: 2px solid var(--label-3); transform: rotate(45deg); opacity: 0.6; flex: none; margin-left: 4px; }
  .dl-row.uncovered { background: var(--bad-bg); }
  .dl-time { display: flex; flex-direction: column; width: 46px; flex: none; font-variant-numeric: tabular-nums; }
  .dl-time b { font-size: 15px; font-weight: 600; }
  .dl-time span { font-size: 12px; color: var(--label-2); }
  .dl-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  .dl-name { font-size: 16px; font-weight: 500; letter-spacing: -0.01em; }
  .dl-sub { font-size: 13px; color: var(--label-2); }
  .dl-row.uncovered .dl-sub strong { color: var(--bad-ink); }
  .dl-warn svg { width: 18px; height: 18px; fill: none; stroke: var(--warn-icon); stroke-width: 2; }
  .dl-label { padding: 18px 14px 6px; font-size: 13px; color: var(--label-2); }
  .dl-night { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
  .night-moon svg { width: 20px; height: 20px; fill: var(--indigo); }
  .dl-night select { min-height: 34px; font-size: 15px; max-width: 55%; border-radius: 9px; }

  /* Detalhes da cirurgia: folha que sobe de baixo */
  .inspector { display: none; }
  .inspector.open {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 40; margin: 0; max-height: 86vh; overflow-y: auto;
    border-radius: 22px 22px 0 0; padding: 8px 18px calc(24px + env(safe-area-inset-bottom)); background: var(--grouped);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.25); animation: sheet-up 340ms var(--ease);
  }
  .app:has(.inspector.open)::after { content: ''; position: fixed; inset: 0; z-index: 39; background: rgba(0, 0, 0, 0.28); animation: fade-in 220ms ease-out; }
  .inspector .sheet-grab { display: block; width: 38px; height: 5px; border-radius: 3px; background: var(--label-3); opacity: 0.45; margin: 0 auto 4px; }
  .inspector .sheet-close { display: block; position: absolute; top: 12px; right: 14px; border: 0; background: var(--fill); color: var(--accent); font-weight: 600; font-size: 15px; padding: 6px 14px; border-radius: 999px; }
  .inspector h2 { font-size: 22px; padding-right: 64px; }
  .inspector select { min-height: 40px; font-size: 16px; border-radius: 10px; }

  /* Mês: grade compacta como o Calendário do iPhone */
  .month-wrap { margin: 0; border-top: 0; overflow: visible; }
  .month { min-width: 0; border-radius: 14px; overflow: hidden; }
  .mhead { padding: 6px 2px; text-align: center; font-size: 11px; }
  .mcell { min-height: 58px; padding: 4px 2px 6px; align-items: center; gap: 2px; border-right: 0; }
  .mcell .status, .mcell .out, .mcell .hol, .mcell .pref-warn, .night select { display: none; }
  .mday { align-self: center; font-size: 15px; min-width: 30px; height: 30px; border-radius: 15px; }
  .mcell::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: transparent; }
  .mcell:has(.status.ok)::after { background: var(--green); }
  .mcell:has(.status.approved)::after { background: var(--accent); }
  .mcell:has(.status.bad)::after { background: var(--red); }
  .night { margin-top: 0; }
  .night svg { width: 11px; height: 11px; opacity: 0.7; }
  .month-wrap + p.muted { font-size: 12px; }
  .note { font-size: 14px; }

  /* Cartões e tabelas */
  .req-list { grid-template-columns: 1fr; }
  .person { padding: 14px; }
  .form-row { flex-direction: column; align-items: stretch; }
  .form-row .field input, .form-row .field select, .form-row .btn { min-height: 40px; font-size: 16px; }

  /* Abas flutuantes de vidro (iOS 26) */
  .m-tabs { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 0 16px calc(12px + env(safe-area-inset-bottom)); pointer-events: none; }
  .m-tabs > div {
    pointer-events: auto; display: flex; max-width: 440px; margin: 0 auto; padding: 4px; border-radius: 32px;
    background: var(--glass-strong); backdrop-filter: blur(28px) saturate(190%); -webkit-backdrop-filter: blur(28px) saturate(190%);
    box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.1), 0 10px 30px rgba(0, 0, 0, 0.16), inset 0 1px 0 var(--glass-edge);
  }
  .m-tabs a, .m-tabs button {
    flex: 1; min-height: 54px; border: 0; border-radius: 28px; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    font-size: 10.5px; font-weight: 500; color: var(--label-2); text-decoration: none; position: relative; transition: transform 90ms;
  }
  .m-tabs a:active, .m-tabs button:active { transform: scale(0.94); }
  .m-tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; }
  .m-tabs button svg { fill: currentColor; stroke: none; }
  .m-tabs a[aria-current="page"] { color: var(--accent); background: var(--row-sel); }
  .m-tabs .badge { position: absolute; top: 5px; left: calc(50% + 6px); margin: 0; }

  /* Menu "Mais" em folha */
  .m-more { display: block; position: fixed; inset: 0; z-index: 45; pointer-events: none; }
  .m-more::before { content: ''; position: absolute; inset: 0; background: rgba(0, 0, 0, 0.28); opacity: 0; transition: opacity 220ms ease-out; }
  .m-more-panel {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 16px calc(18px + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0;
    background: var(--grouped); transform: translateY(105%); transition: transform 340ms var(--ease); display: flex; flex-direction: column; gap: 14px;
  }
  .m-more.open { pointer-events: auto; }
  .m-more.open::before { opacity: 1; }
  .m-more.open .m-more-panel { transform: none; }
  .m-more .sheet-grab { display: block; width: 38px; height: 5px; border-radius: 3px; background: var(--label-3); opacity: 0.45; margin: 0 auto; }
  .m-more-group { border-radius: 14px; background: var(--window); overflow: hidden; }
  .m-more-group a, .m-more-group button { display: flex; align-items: center; width: 100%; min-height: 48px; padding: 0 16px; border: 0; background: transparent; color: var(--label); font: inherit; font-size: 16px; text-decoration: none; text-align: left; }
  .m-more-group > * + * { box-shadow: inset 0 0.5px 0 var(--sep); }
  .m-more-group a:active, .m-more-group button:active { background: var(--press); }
  .m-more-group a[aria-current="page"] { color: var(--accent); font-weight: 600; }
  .m-more-group .m-danger { color: var(--red); }
  .m-more-close { min-height: 48px; border: 0; border-radius: 14px; background: var(--window); color: var(--accent); font: inherit; font-size: 16px; font-weight: 600; }
  .toast { top: max(10px, env(safe-area-inset-top)); left: 50%; right: auto; transform: translate(-50%, -16px) scale(0.98); }
  .toast.show { transform: translate(-50%, 0); }
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }

@media (max-width: 900px) { .mcell > .muted { display: none; } .mcell.today .mday { background: var(--red); } }

/* =========================================================================
   Leitura rápida (centro cirúrgico) + celular no padrão iOS
   ========================================================================= */
.t-short, .m-summary { display: none; }
/* PC/tablet deitado: cabeçalho da grade mostra quem está em cada sala */
.grid-head { height: auto; min-height: 52px; }
.grid-head > div { flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; padding: 6px 10px; }
.gh-room { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; }
.gh-type { font-weight: 400; color: var(--label-2); font-size: 12px; }
.gh-who { font-size: 13px; font-weight: 600; color: var(--label); padding-left: 14px; }
.gh-who.bad { color: var(--bad-ink); }
.page-head .status { font-size: 13px; padding: 5px 12px 5px 10px; }

@media (max-width: 900px) {
  :root { --grouped: #F2F2F7; }
  body:has(> .app), .app, .app > .main { background: var(--grouped) !important; }
  .app > .main { font-size: 17px; }

  /* Barra de navegação do iOS: botões de vidro circulares e em cápsula */
  .toolbar { padding: max(10px, env(safe-area-inset-top)) 16px 6px; gap: 8px; }
  .toolbar .btn, .toolbar > span:has(.icon-btn) { min-height: 44px; border-radius: 22px; font-size: 17px; font-weight: 500; }
  .toolbar .btn { padding: 0 18px; }
  .toolbar .icon-btn { width: 40px; height: 40px; }
  .toolbar .icon-btn svg { width: 18px; height: 18px; stroke-width: 2.4; }
  .toolbar .btn-primary { font-weight: 600; }

  /* Título grande do iOS */
  .t-long, .page-head .sub, .page-head > .status, .hint { display: none !important; }
  .t-short { display: inline; }
  .page-head { padding: 2px 20px 6px; }
  .page-head h1 { font-size: 34px; letter-spacing: -0.03em; }

  /* Resumo: status grande e salas */
  .m-summary { display: block; padding: 4px 16px 0; }
  .m-status { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 22px; background: var(--window); }
  .m-status > span:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .m-status b { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
  .m-status > span > span { font-size: 15px; color: var(--label-2); }
  .m-status-icon { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; background: var(--green); }
  .m-status-icon svg { width: 26px; height: 26px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
  .m-status.approved .m-status-icon { background: var(--accent); }
  .m-status.bad { background: var(--red); color: #fff; }
  .m-status.bad > span > span { color: rgba(255, 255, 255, 0.88); }
  .m-status.bad .m-status-icon { background: rgba(255, 255, 255, 0.24); }

  .dl-label { padding: 22px 4px 10px; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: var(--label); }
  .room-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .room-tile {
    display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px 14px 16px; border: 0; border-radius: 22px;
    background: var(--window); color: var(--label); text-align: left; font: inherit; min-height: 124px; transition: transform 100ms ease-out;
  }
  .room-tile:active { transform: scale(0.97); }
  .rt-head { display: flex; flex-direction: column; gap: 0; }
  .rt-head span:first-child { font-size: 15px; font-weight: 700; color: var(--c); }
  .rt-head span:last-child { font-size: 13px; color: var(--label-2); }
  .rt-name { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
  .rt-sub { font-size: 14px; color: var(--label-2); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .room-tile.bad { background: var(--red); color: #fff; }
  .room-tile.bad .rt-head span, .room-tile.bad .rt-sub { color: rgba(255, 255, 255, 0.9); }

  /* Lista por horário */
  .day-list { padding: 0 16px 8px; }
  .dl-group { border-radius: 22px; }
  .dl-row { padding: 13px 16px 13px 14px; min-height: 64px; }
  .dl-name { font-size: 17px; }
  .dl-sub { font-size: 15px; }
  .dl-time b { font-size: 17px; }
  .dl-time span { font-size: 13px; }
  .dl-time { width: 52px; }
  .dl-night { border-radius: 22px; padding: 12px 16px; min-height: 56px; }
  .dl-night .dl-name { font-size: 17px; }

  /* Folha de detalhes com tipografia do iOS */
  .inspector.open { font-size: 17px; background: var(--grouped); }
  .inspector h2 { font-size: 26px; }
  .inspector .facts { font-size: 16px; grid-template-columns: 110px 1fr; border-radius: 16px; }
  .inspector .reasons { font-size: 16px; }
  .inspector .note { font-size: 15px; border-radius: 16px; }
  .inspector .team-list div { font-size: 16px; min-height: 44px; }

  /* Outras telas: listas agrupadas maiores */
  .card, .req, .day-card { border-radius: 22px; }
  .card-head h2 { font-size: 17px; }
  td, th, .note, .req-what { font-size: 15px; }
  .req-what { font-size: 18px; }
  .req-actions .btn { min-height: 44px; border-radius: 22px; padding: 0 20px; font-size: 16px; }
  .mday { font-size: 17px; }
}
@media (max-width: 900px) and (prefers-color-scheme: dark) {
  :root { --grouped: #000; --window: #1C1C1E; }
}
@media (max-width: 340px) { .room-tiles { grid-template-columns: 1fr; } }

/* ---------- Mapa do dia: formulário, ações e histórico ---------- */
[hidden] { display: none !important; }
dialog.form-sheet { width: min(420px, calc(100vw - 24px)); text-align: left; padding: 22px 20px 18px; }
.fs-form { display: flex; flex-direction: column; gap: 12px; }
.fs-form h2 { margin: 0; font-size: 17px; font-weight: 700; text-align: left; }
.fs-form > p { margin: -6px 0 2px; font-size: 12.5px; color: var(--label-2); text-align: left; }
.fs-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fs-form input, .fs-form select { width: 100%; min-height: 32px; }
.fs-err { margin: 0; min-height: 1em; color: var(--bad-ink); font-size: 12.5px; }
.fs-form .btns { flex-direction: row-reverse; }
.fs-form .btns .btn { width: auto; flex: 1; min-height: 32px; }
.insp-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.insp-actions .btn { flex: 1 1 auto; }
.history { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; }
.history li { display: flex; gap: 8px; line-height: 1.35; }
.h-time { color: var(--label-2); font-variant-numeric: tabular-nums; flex: none; width: 38px; }
.history b { font-weight: 600; }
.empty .history { margin-top: 8px; }
.empty > div:last-child { margin-top: 18px; }

@media (max-width: 900px) {
  .toolbar .tb-add { display: inline-flex !important; width: 44px; padding: 0; border-radius: 22px; }
  .toolbar .tb-add svg { width: 20px; height: 20px; stroke: var(--accent); stroke-width: 2.4; }
  dialog.form-sheet { margin: auto auto 0; width: 100vw; max-width: 100vw; border-radius: 22px 22px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); animation: sheet-up 340ms var(--ease); }
  .fs-form input, .fs-form select { min-height: 44px; font-size: 17px; border-radius: 10px; }
  .fs-form h2 { font-size: 22px; }
  .fs-form .btns .btn { min-height: 50px; font-size: 17px; border-radius: 14px; }
  .insp-actions .btn { min-height: 44px; font-size: 16px; border-radius: 14px; }
  .dl-history { padding: 18px 4px 0; }
  .history { font-size: 15px; gap: 10px; }
  .h-time { width: 44px; }
}
.pt-map { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px; background: var(--surface); color: var(--label); text-decoration: none; }
.pt-map:hover { text-decoration: none; }
.pt-map:active { background: var(--press); }
.pt-map-icon { width: 40px; height: 40px; border-radius: 10px; flex: none; background: linear-gradient(180deg, #2E93FF, #0066E0) url("/icons/icon-192.png") center / cover; }
.pt-map .main { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.pt-map b { font-size: 16px; }
.pt-map .main > span { font-size: 13px; color: var(--label-2); }
.pt-map::after { content: ''; width: 7px; height: 7px; border-right: 2px solid var(--label-3); border-top: 2px solid var(--label-3); transform: rotate(45deg); flex: none; }
dialog.form-sheet { background: var(--grouped); backdrop-filter: none; -webkit-backdrop-filter: none; }
@media (prefers-color-scheme: dark) { dialog.form-sheet { background: #1C1C1E; } }
.pt-map-icon { background: url("/icons/icon-192.png") center / cover; }
.pt-hero.night svg, .pt-hero .big svg { fill: #fff; width: 26px; height: 26px; }
.pt-hero.off .big svg { fill: none; stroke: #fff; }

/* ---------- Equipe do dia ---------- */
.ros-summary { font-size: 15px; color: var(--label-2); }
.ros-summary b { color: var(--label); font-size: 17px; }
.ros-list { display: flex; flex-direction: column; }
.ros-row { display: grid; grid-template-columns: minmax(180px, 1fr) 2fr; gap: 10px 18px; align-items: center; padding: 14px 16px; }
.ros-row + .ros-row { border-top: 0.5px solid var(--sep-2); }
.ros-row.off .ros-who strong { color: var(--label-2); }
.ros-who { display: flex; flex-direction: column; gap: 2px; }
.ros-who strong { font-size: 15px; }
.ros-who span { font-size: 12px; color: var(--label-2); }
.ros-ctrl { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.ros-seg button { padding: 0 14px; }
.ros-seg button[aria-pressed="true"]:first-child { color: var(--ok); }
.ros-seg button[aria-pressed="true"]:last-child { color: var(--bad-ink); }
.ros-times { display: flex; gap: 10px; }
.ros-times label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--label-2); }
@media (max-width: 900px) {
  .ros-row { grid-template-columns: 1fr; padding: 16px; }
  .ros-who strong { font-size: 17px; }
  .ros-seg button { min-height: 36px; font-size: 15px; flex: 1; }
  .ros-seg { width: 100%; }
  .ros-times input { min-height: 40px; font-size: 17px; }
  .ros-times label { font-size: 15px; }
}

/* ---------- Página da secretaria ---------- */
.sec-body { background: var(--grouped); }
.sec-top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; padding: max(12px, env(safe-area-inset-top)) 20px 12px; background: var(--bar); backdrop-filter: blur(30px) saturate(180%); -webkit-backdrop-filter: blur(30px) saturate(180%); border-bottom: 0.5px solid var(--sep); }
.sec-top img { border-radius: 9px; }
.sec-title { flex: 1; display: flex; flex-direction: column; line-height: 1.2; }
.sec-title strong { font-size: 15px; }
.sec-title span { font-size: 12px; color: var(--label-2); }
.sec { max-width: 1080px; margin: 0 auto; padding: 20px 20px 60px; display: flex; flex-direction: column; gap: 18px; }
.sec-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.sec-date { display: flex; align-items: center; gap: 6px; }
.sec-date h1 { margin: 0 6px; font-size: 26px; font-weight: 700; letter-spacing: -0.024em; }
.sec-date input { margin-left: 8px; }
.sec-tabs button { min-height: 30px; padding: 0 18px; font-size: 14px; }
.sec-section { display: flex; flex-direction: column; gap: 18px; }
.sec-card .card-head h2 { font-size: 15px; }
.sec-upload { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 16px; }
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 190px; padding: 18px; border: 2px dashed color-mix(in srgb, var(--accent) 40%, var(--sep)); border-radius: 16px; background: color-mix(in srgb, var(--accent) 5%, transparent); text-align: center; cursor: pointer; transition: background-color 120ms, border-color 120ms; }
.drop:hover, .drop.over { background: var(--accent-tint); border-color: var(--accent); }
.drop b { font-size: 16px; }
.drop span:not(.drop-icon) { font-size: 13px; color: var(--label-2); }
.drop em { margin-top: 6px; font-style: normal; font-size: 13px; color: var(--accent); }
.drop-icon svg { width: 36px; height: 36px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.paste { display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--label-2); }
.paste b { color: var(--label); }
.paste textarea { flex: 1; min-height: 120px; padding: 10px 12px; border: 0.5px solid var(--control-border); border-radius: 10px; background: var(--control); font: 13px/1.4 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; color: var(--label); resize: vertical; }
.paste textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--accent) 35%, transparent); }
.paste .btn { align-self: flex-start; }
.sec-review { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.sec-notes { margin: 0; padding-left: 20px; font-size: 13px; color: var(--label-2); }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 10px; }
.map-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; }
@media (max-width: 760px) {
  .sec { padding: 14px 14px 50px; }
  .sec-upload { grid-template-columns: 1fr; }
  .sec-date h1 { font-size: 22px; }
  .sec-date input { display: none; }
  .sec-tabs { width: 100%; }
  .sec-tabs button { flex: 1; min-height: 36px; font-size: 15px; }
  .drop { min-height: 140px; }
}

/* Lista da equipe colada/enviada */
.ros-import-btn { align-self: flex-start; }
.ros-preview { list-style: none; margin: 0; padding: 0; border-radius: 12px; overflow: hidden; background: var(--fill, rgba(120,120,128,.08)); }
.ros-preview li { display: flex; align-items: baseline; gap: 8px; padding: 10px 14px; font-size: 15px; }
.ros-preview li + li { border-top: 0.5px solid var(--sep-2); }
.ros-preview li > span:last-child { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--ok); font-weight: 600; }
.ros-preview li.off > span:last-child { color: var(--bad-ink); }
.ros-others { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: var(--label-2); line-height: 1.4; }
.ros-others input { margin-top: 3px; width: 18px; height: 18px; flex: none; }
@media (max-width: 900px) { .ros-preview li { font-size: 17px; padding: 12px 16px; } .ros-others { font-size: 15px; } }
/* =========================================================================
   Celular: faixa da semana + linha do tempo por sala (como o Calendário)
   ========================================================================= */
.m-dayctl, .event .as { display: none; }
@media (max-width: 900px) {
  .m-dayctl { display: flex; flex-direction: column; gap: 12px; padding: 0 16px 14px; }
  .week-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
  .ws-day { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 2px 0; border: 0; background: transparent; color: var(--label); font: inherit; }
  .ws-wd { font-size: 11px; font-weight: 600; color: var(--label-2); }
  .ws-n { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 19px; font-variant-numeric: tabular-nums; transition: background-color 120ms; }
  .ws-day.today .ws-n { color: var(--red); font-weight: 600; }
  .ws-day.sel .ws-n { background: var(--label); color: var(--grouped); font-weight: 700; }
  .ws-day.sel.today .ws-n { background: var(--red); color: #fff; }
  .ws-dot { width: 6px; height: 6px; border-radius: 50%; }
  .ws-dot.ok { background: var(--label-3); }
  .ws-dot.bad { background: var(--red); }
  .m-mode { display: flex; width: 100%; }
  .m-mode button { flex: 1; min-height: 34px; font-size: 14px; }

  /* Linha do tempo: a grade volta, compacta, num cartão */
  .day-body.tl .m-summary, .day-body.tl .dl-surgeries { display: none; }
  .day-body.tl .day-list > .dl-label:first-of-type { padding-top: 18px; }
  .day-body.tl .grid-wrap { display: block; margin: 0 16px; border-radius: 22px; background: var(--window); overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .day-body.tl .grid-inner { min-width: max(100%, calc(44px + var(--n, 4) * 76px)); }
  .day-body.tl .grid-head { position: static; padding-left: 44px; min-height: 0; background: transparent; }
  .day-body.tl .grid-head > div { padding: 10px 4px 8px; align-items: center; }
  .day-body.tl .gh-room { font-size: 12px; gap: 4px; }
  .day-body.tl .gh-type, .day-body.tl .gh-who { display: none; }
  .day-body.tl .grid-body { padding: 10px 0 14px; }
  .day-body.tl .hours { width: 44px; }
  .day-body.tl .hours span { right: 6px; font-size: 11px; }
  .day-body.tl .event { left: 2px; right: 2px; padding: 4px 4px 4px 7px; gap: 1px; border-radius: 7px; }
  .day-body.tl .event .t, .day-body.tl .event .a { display: none; }
  .day-body.tl .event .as { display: block; order: -1; font-size: 13px; font-weight: 700; line-height: 1.15; }
  .day-body.tl .event .p { font-size: 11px; font-weight: 500; line-height: 1.2; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: anywhere; }
  .day-body.tl .event .flag { width: 12px; height: 12px; top: 4px; right: 3px; }
  .day-body.tl .now-line { left: -4px; }
}
/* Avisos clínicos vindos do mapa do hospital (UTI, sangue, via aérea, alergia, anestesia) */
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tag:not(.warn) { background: rgba(120,120,128,.16); color: var(--ink-2, inherit); }
.sec-head-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Escala do mês dos sócios: períodos do dia */
.ros-periods li { align-items: flex-start; }
.ros-periods li > span { display: flex; flex-wrap: wrap; gap: 4px 8px; justify-content: flex-end; }
.ros-name { font-weight: 600; }
.ros-name.new { color: var(--warn-ink); }

/* Computador: o painel da cirurgia só abre quando se escolhe uma cirurgia, e fecha no "OK".
   A grade mantém largura mínima por sala e rola para o lado quando há muitas salas. */
@media (min-width: 901px) {
  .inspector { flex: 0 0 340px; max-width: 340px; }
  .inspector .sheet-close { display: block; position: absolute; top: 14px; right: 14px; border: 0; background: var(--fill); color: var(--accent); font-weight: 600; font-size: 13px; padding: 5px 12px; border-radius: 999px; cursor: pointer; }
  .inspector h2 { padding-right: 56px; }
  .grid-inner { min-width: max(640px, calc(64px + var(--n, 4) * 150px)); }
}
@media (min-width: 901px) {
  .day-body { flex-wrap: nowrap; }
  .grid-wrap { flex: 1 1 0; }
}
/* Tela média (notebook): o painel vira uma gaveta por cima, à direita, e fecha no OK. */
@media (min-width: 901px) and (max-width: 1399px) {
  .inspector { position: fixed; top: 12px; right: 12px; bottom: 12px; z-index: 50; width: 340px; margin: 0; overflow-y: auto; align-self: auto; background: var(--inspector, var(--window)); box-shadow: 0 16px 48px rgba(0,0,0,.35), 0 0 0 0.5px var(--sep); }
}

/* ---------- Tela "Mapa" (formato do mapa do grupo) ---------- */
.d-layout { margin-left: auto; }
.day-body.mapa-mode { flex-wrap: nowrap; }
.mapa-col { flex: 1 1 0; min-width: 0; padding: 12px 16px 24px; display: flex; flex-direction: column; gap: 14px; }
.mapa { display: flex; flex-direction: column; gap: 14px; }
.mp-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.mp-title { font-size: 15px; font-weight: 700; letter-spacing: .02em; }
.mp-coord { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: var(--label-2); }
.mp-coord label { display: flex; align-items: center; gap: 6px; }
.mp-coord b { color: var(--label); }
.mp-coord select { font: inherit; font-weight: 600; color: var(--label); padding: 3px 8px; border-radius: 8px; border: 0.5px solid var(--sep); background: var(--window); }
.mp-sec { border-radius: 14px; overflow: hidden; background: var(--window); box-shadow: 0 0 0 0.5px var(--sep); }
.mp-band { margin: 0; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 9px 14px; font-size: 13px; font-weight: 700; letter-spacing: .03em;
  background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.mp-count { font-size: 12px; font-weight: 500; letter-spacing: 0; color: var(--label-2); }
.mp-count b { color: var(--bad-ink); }
.mp-wrap { overflow-x: auto; }
.mp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mp-table th { text-align: left; font-size: 11px; font-weight: 600; color: var(--label-2); text-transform: uppercase; letter-spacing: .03em; padding: 7px 8px; border-bottom: 0.5px solid var(--sep); white-space: nowrap; }
.mp-table td { padding: 7px 8px; border-bottom: 0.5px solid var(--sep); vertical-align: top; }
.mp-table tbody tr { cursor: pointer; }
.mp-table tbody tr:hover { background: var(--fill, rgba(120,120,128,.12)); }
.mp-table tbody tr.sel { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.mp-table tbody tr.uncovered { background: color-mix(in srgb, var(--bad-ink) 9%, transparent); }
.mp-table tbody tr:last-child td { border-bottom: 0; }
.mp-qd, .mp-num, .mp-c { text-align: center; width: 1%; white-space: nowrap; color: var(--label-2); }
.mp-time { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }
.mp-as { font-weight: 700; color: var(--label-2); }
.mp-room { white-space: nowrap; }
.mp-room .dot { margin-right: 5px; }
.mp-proc { min-width: 200px; }
.mp-proc-t { display: block; }
.mp-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.mp-m-pac { display: none; }
.mp-doc, .mp-alg, .mp-rec { font-size: 12px; }
.mp-anest { font-weight: 700; white-space: nowrap; }
.mp-none { color: var(--bad-ink); font-weight: 700; font-size: 12px; }
.mp-warn { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 8px; background: var(--warn-bg); color: var(--warn-ink); font-size: 11px; font-weight: 800; }
.mp-yes { color: var(--bad-ink); font-size: 11px; }
.mp-empty { margin: 0; padding: 12px 14px; color: var(--label-2); font-size: 13px; }
.mp-escala .mp-esc-row { display: flex; gap: 12px; padding: 8px 14px; border-bottom: 0.5px solid var(--sep); font-size: 13px; }
.mp-escala .mp-esc-row:last-child { border-bottom: 0; }
.mp-escala .mp-esc-row > b { width: 56px; flex: none; }
.mp-escala .mp-esc-row > span { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.mp-name { font-weight: 600; }
.mp-note { margin: 0; font-size: 12px; }
.mp-history:empty { display: none; }

@media (max-width: 900px) {
  .d-layout { display: none; }
  .day-body.mapa-mode { display: block; }
  .mapa-col { padding: 4px 16px 24px; }
  .mp-sec { border-radius: 18px; }
  .mp-table thead { display: none; }
  .mp-table, .mp-table tbody { display: block; }
  .mp-table tbody tr { display: grid; grid-template-columns: auto 1fr auto; gap: 2px 10px; padding: 10px 14px; border-bottom: 0.5px solid var(--sep); border-left: 4px solid var(--c, var(--sep)); }
  .mp-table td { display: none; padding: 0; border: 0; }
  .mp-table td.mp-time { display: block; grid-column: 1; grid-row: 1; font-size: 15px; }
  .mp-table td.mp-room { display: block; grid-column: 1; grid-row: 2; font-size: 12px; color: var(--label-2); }
  .mp-table td.mp-room .dot { display: none; }
  .mp-table td.mp-proc { display: block; grid-column: 2; grid-row: 1 / span 2; min-width: 0; font-size: 14px; }
  .mp-table td.mp-doc { display: block; grid-column: 2; grid-row: 3; color: var(--label-2); }
  .mp-table td.mp-anest { display: block; grid-column: 3; grid-row: 1 / span 2; text-align: right; font-size: 14px; white-space: normal; }
  .mp-m-pac { display: block; font-size: 12px; color: var(--label-2); margin-top: 2px; }
  .mp-table td.mp-act { display: block; grid-column: 1 / -1; grid-row: 4; }
}
@media (min-width: 901px) {
  .mp-tags { display: none; }
  .mp-table th, .mp-table td { padding: 6px 6px; }
  .mp-table th { white-space: normal; }
  .mp-proc { min-width: 170px; }
  .mp-doc { min-width: 90px; }
}
@media (max-width: 900px) { .mp-table tbody tr { grid-template-columns: 52px 1fr auto; } }
.mp-table tbody tr.static { cursor: default; }
.sec-mapa { padding: 12px; }
.btn-sm { padding: 3px 10px; font-size: 12px; min-height: 0; }

/* ---------- Formulário de preferências do anestesista ---------- */
.fm { width: min(680px, 100%); margin: 0 auto; padding: 24px 16px 48px; display: flex; flex-direction: column; gap: 16px; box-sizing: border-box; }
.fm-body { align-items: flex-start; }
.fm .login-hero { text-align: center; }
.fm-form { display: flex; flex-direction: column; gap: 14px; }
.fm-intro { margin: 0; font-size: 14px; line-height: 1.45; color: var(--label-2); }
.fm-card { background: var(--window); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 0 0 0.5px var(--sep); }
.fm-card h2 { margin: 0; font-size: 17px; }
.fm-card h3 { margin: 6px 0 0; font-size: 14px; }
.fm-small { margin: 0; font-size: 13px; }
.fm-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 6px 0; border-top: 0.5px solid var(--sep); }
.fm-row.col { flex-direction: column; align-items: flex-start; }
.fm-label { font-size: 15px; font-weight: 500; }
.fm-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 3px; border-radius: 12px; background: var(--fill, rgba(120,120,128,.14)); }
.fm-opt { position: relative; }
.fm-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.fm-opt span { display: block; padding: 7px 11px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--label-2); }
.fm-opt input:checked + span { background: var(--window); color: var(--label); box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.fm-opt.lv-prefiro input:checked + span { background: #34C759; color: #fff; }
.fm-opt.lv-prefiroNao input:checked + span { background: #FF9F0A; color: #fff; }
.fm-opt.lv-nao input:checked + span { background: #FF3B30; color: #fff; }
.fm-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.fm-seg.small .fm-opt span { padding: 5px 8px; font-size: 12px; }
.fm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fm-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px 4px 10px; border-radius: 999px; background: var(--fill, rgba(120,120,128,.14)); font-size: 13px; font-weight: 600; }
.fm-chip button { border: 0; background: transparent; color: var(--label-2); font-size: 16px; line-height: 1; cursor: pointer; padding: 0 4px; }
.fm-add { display: flex; gap: 8px; }
.fm-add input { flex: 1; min-width: 0; }
.fm-slist { display: flex; flex-direction: column; max-height: 360px; overflow-y: auto; }
.fm-srow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 0; border-top: 0.5px solid var(--sep); font-size: 14px; }
.fm-days { display: flex; flex-wrap: wrap; gap: 6px; }
.fm-day { position: relative; }
.fm-day input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.fm-day span { display: block; padding: 7px 10px; border-radius: 10px; background: var(--fill, rgba(120,120,128,.14)); font-size: 13px; font-weight: 600; }
.fm-day input:checked + span { background: #FF9F0A; color: #fff; }
.fm-day input:focus-visible + span { outline: 2px solid var(--accent); }
.fm-send { width: 100%; min-height: 48px; font-size: 16px; }
/* Portal pessoal aberto no computador: um pouco mais largo */
@media (min-width: 901px) { .pt, .pt-tabs div { max-width: 640px; } }
/* Tela do anestesista no computador: abas no topo, conteúdo mais largo (não parece celular) */
@media (min-width: 901px) {
  .pt, .pt-tabs div { max-width: 820px; }
  .pt { padding: 84px 32px 48px; font-size: 16px; }
  .pt-tabs { top: 0; bottom: auto; border-top: 0; border-bottom: 0.5px solid var(--sep); padding-bottom: 0; }
  .pt-tabs button { flex-direction: row; gap: 8px; min-height: 52px; font-size: 14px; }
  .pt-tabs button svg { width: 20px; height: 20px; }
  .pt ~ .toast { top: 64px; }
}
/* Escala geral do dia dentro da tela do anestesista */
.pt-geral .mapa { gap: 12px; }
.pt-geral .mp-sec { background: var(--window); }
@media (max-width: 900px) { .pt-geral .mp-table tbody tr { padding: 9px 12px; } }
