/* OD-LAYOUT-PRIMITIVES v1 — structure only: display, flex/grid, overflow, wrapping, ratio, geometry.
   Put this @layer first; product CSS outside the layer wins ordinary layout rules.
   Native hidden and closed-dialog states take precedence over component display rules. */
@layer od-layout {
  [hidden]:not([hidden="until-found" i]) { display: none !important; }
  dialog:not([open]) { display: none !important; }

  :where(.od-stack,.od-row,.od-row-top,.od-cluster,.od-grid,.od-field,.od-stat,.od-cell,.od-tile) > :where(*) { min-width: 0; }

  .od-stack   { display: flex; flex-direction: column; gap: var(--od-gap, 8px); }
  .od-row     { display: flex; align-items: center; gap: var(--od-gap, 8px); }
  .od-row-top { display: flex; align-items: flex-start; gap: var(--od-gap, 8px); }
  .od-cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--od-gap, 8px); }
  .od-fill    { flex: 1 1 0; min-width: 0; }
  .od-fixed   { flex: none; }
  .od-grid    { display: grid; gap: var(--od-gap, 12px); grid-template-columns: repeat(var(--od-cols, 3), minmax(0, 1fr)); }

  .od-stat, .od-field, .od-cell { display: grid; gap: var(--od-gap, 2px); }
  :where(.od-stat,.od-field,.od-cell) > :where(*) { display: block; }
  .od-tile { display: grid; grid-template-rows: auto 1fr; }
  :where(.od-tile) > :where(*) { display: block; }

  .od-media { display: block; width: 100%; height: auto; aspect-ratio: var(--od-ratio, auto); }
  .od-media-cover { object-fit: cover; }

  .od-icon { display: inline-block; inline-size: var(--od-icon-size, 1em); block-size: var(--od-icon-size, 1em); flex: none; }

  .od-truncate { display: block; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .od-clamp-2, .od-clamp-3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
  .od-clamp-2 { -webkit-line-clamp: 2; }
  .od-clamp-3 { -webkit-line-clamp: 3; }
  .od-lines-2 { min-height: calc(2 * 1.4em); }
  .od-nowrap  { white-space: nowrap; }
  .od-keep    { word-break: keep-all; overflow-wrap: anywhere; }

  .od-screen { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; }
  .od-scroll { overflow-y: auto; overscroll-behavior: contain; min-height: 0; }

  .od-rail { display: flex; gap: var(--od-gap, 8px); overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
             padding-inline: var(--od-rail-pad, 16px); scroll-padding-inline: var(--od-rail-pad, 16px); }
  .od-rail::-webkit-scrollbar { display: none; }
  :where(.od-rail) > :where(*) { flex: none; scroll-snap-align: start; }
  :where(.od-rail) > :where(:last-child) { margin-inline-end: var(--od-rail-pad, 16px); }

  .od-spacer { flex: none; visibility: hidden; pointer-events: none; }
  .od-touch  { min-width: 44px; min-height: 44px; }
}
:root [hidden]:where(:not([hidden="until-found" i])) { display: none; }
/* /OD-LAYOUT-PRIMITIVES v1 */

/* ============================================================
   Futura Pause Web — design tokens
   ============================================================ */
:root {
  --color-bg: #0A0A0A;
  --color-surface: #141820;
  --color-surface-alt: #1a1f2a;
  --color-surface-sunken: #0f1218;
  --color-border: #272e3b;
  --color-border-strong: #3a4354;
  --color-text: #e8edf5;
  --color-text-muted: #9aa6b8;
  --color-text-faint: #6f7b8d;

  --color-primary: #2C7BFF;
  --color-primary-dark: #165DFF;
  --color-accent: #2C92FC;
  --color-primary-soft: #14284f;
  --color-primary-contrast: #ffffff;

  --color-success: #4cc98a;
  --color-success-soft: #12301f;
  --color-warning: #f0a54a;
  --color-warning-soft: #3a2a12;
  --color-danger: #ff6b6b;
  --color-danger-soft: #3d1a1a;
  --color-neutral-strong: #b4bfce;
  --color-neutral-soft: #222936;

  --font-sans: -apple-system, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(20, 27, 36, 0.07);
  --shadow-md: 0 6px 20px rgba(20, 27, 36, 0.12);
  --shadow-lg: 0 16px 40px rgba(20, 27, 36, 0.18);

  --dur-fast: 150ms;
  --dur-base: 220ms;
  --dur-slow: 360ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.7, 0, 0.84, 0);

  --sidebar-w: 248px;
  --topbar-h: 64px;

  color-scheme: dark;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }
button { font-family: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; }

a { color: var(--color-primary); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-primary);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 200;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ============================================================
   Icons
   ============================================================ */
.od-icon { stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
  white-space: nowrap;
}
.btn .od-icon { --od-icon-size: 18px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--color-primary); color: var(--color-primary-contrast); }
.btn-primary:hover:not(:disabled) { background: var(--color-primary-dark); }
.btn-secondary { background: var(--color-surface); color: var(--color-text); border-color: var(--color-border-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--color-surface-alt); }
.btn-ghost { background: transparent; color: var(--color-text); }
.btn-ghost:hover:not(:disabled) { background: var(--color-surface-alt); }
.btn-danger { background: #d63c3c; color: #fff; }
.btn-danger:hover:not(:disabled) { background: #8a2222; }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-icon { width: 36px; height: 36px; padding: 0; min-height: 0; border-radius: var(--radius-sm); }
.btn-icon.btn-danger-ghost { background: transparent; color: var(--color-danger); }
.btn-icon.btn-danger-ghost:hover:not(:disabled) { background: var(--color-danger-soft); }

.btn-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.btn-secondary .btn-spinner, .btn-ghost .btn-spinner {
  border-color: rgba(20,27,36,0.2);
  border-top-color: var(--color-text);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   Login
   ============================================================ */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(900px 500px at 15% -10%, #14284f 0%, transparent 60%),
    radial-gradient(700px 500px at 110% 10%, #1a1f2a 0%, transparent 55%),
    var(--color-bg);
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 40px 32px 32px;
}
.brand { display: flex; align-items: center; gap: 10px; justify-content: center; }
.brand-mark {
  --od-icon-size: 26px;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-md);
}
.brand-name { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.login-subtitle {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 13.5px;
  margin-top: 8px;
}
#login-form { margin-top: 28px; display: flex; flex-direction: column; gap: 18px; }
.login-note {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
  font-size: 12.5px;
  color: var(--color-text-faint);
  line-height: 1.5;
}

/* ============================================================
   Form fields
   ============================================================ */
.field { display: grid; gap: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field label, .field legend {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  padding: 0;
}
.field .optional { font-weight: 400; color: var(--color-text-faint); }
.field input[type="text"],
.field input[type="password"],
.field input[type="search"],
.field input[type="time"],
.field input[type="date"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.field textarea { min-height: 72px; padding: 10px 12px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}
.field input.has-error, .field select.has-error { border-color: var(--color-danger); }
.field input.has-error:focus, .field select.has-error:focus { box-shadow: 0 0 0 3px var(--color-danger-soft); }
.field-error {
  font-size: 12.5px;
  color: var(--color-danger);
  display: flex;
  align-items: center;
  gap: 6px;
}
.field-error .od-icon { --od-icon-size: 14px; flex: none; }
.field-hint { font-size: 12.5px; color: var(--color-text-faint); }
fieldset { border: none; padding: 0; margin: 0; }

.days-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.day-toggle {
  width: 40px; height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.day-toggle:hover { background: var(--color-surface-alt); }
.day-toggle[aria-pressed="true"] {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.switch {
  position: relative;
  display: inline-flex;
  width: 42px; height: 24px;
  border-radius: var(--radius-pill);
  background: var(--color-neutral-soft);
  border: 1px solid var(--color-border-strong);
  cursor: pointer;
  flex: none;
  transition: background var(--dur-fast) var(--ease-out);
}
.switch[aria-checked="true"] { background: var(--color-primary); border-color: var(--color-primary); }
.switch::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-fast) var(--ease-out);
}
.switch[aria-checked="true"]::after { transform: translateX(18px); }

/* ============================================================
   App shell
   ============================================================ */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: none;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  gap: 20px;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 60;
  transition: transform var(--dur-slow) var(--ease-out);
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 0 4px; }
.sidebar-brand .brand-mark { --od-icon-size: 20px; width: 34px; height: 34px; }
.sidebar-brand .brand-name { font-size: 16px; }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 42px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.nav-item .od-icon { --od-icon-size: 19px; }
.nav-item:hover { background: var(--color-surface-alt); color: var(--color-text); }
.nav-item[aria-current="page"] { background: var(--color-primary-soft); color: var(--color-primary-dark); }

.sidebar-footer { border-top: 1px solid var(--color-border); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 0 4px; }
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--color-primary-dark); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex: none;
}
.user-info { display: flex; flex-direction: column; min-width: 0; }
.user-name { font-size: 13.5px; font-weight: 700; }
.user-role { font-size: 12px; color: var(--color-text-faint); }

.nav-toggle {
  display: none;
  position: fixed; top: 14px; left: 14px; z-index: 70;
  align-items: center; gap: 8px;
  height: 40px; padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  font-size: 13.5px; font-weight: 600;
  cursor: pointer;
}
.nav-toggle .od-icon { --od-icon-size: 18px; }

.scrim {
  position: fixed; inset: 0; background: rgba(15, 20, 26, 0.45);
  z-index: 55;
}

.app-main { margin-left: var(--sidebar-w); flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h);
  flex: none;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 0 28px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky; top: 0; z-index: 40;
}
.topbar-title { font-size: 19px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.content { flex: 1; padding: 28px; max-width: 1280px; width: 100%; margin: 0 auto; }
.view-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.view-desc { color: var(--color-text-muted); font-size: 13.5px; margin-top: 4px; max-width: 60ch; }

/* ============================================================
   Cards, stat strip
   ============================================================ */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px;
}
.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { display: grid; gap: 4px; }
.stat-card .od-stat { gap: 2px; }
.stat-number { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.stat-caption { font-size: 13px; color: var(--color-text-muted); font-weight: 600; }
.stat-card[data-tone="success"] .stat-number { color: var(--color-success); }
.stat-card[data-tone="warning"] .stat-number { color: var(--color-warning); }
.stat-card[data-tone="danger"] .stat-number { color: var(--color-danger); }

.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.toolbar .field { min-width: 180px; flex: 1 1 180px; }
.toolbar .search-field { position: relative; flex: 1 1 220px; min-width: 200px; }
.toolbar .search-field .od-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--color-text-faint); --od-icon-size: 16px; }
.toolbar .search-field input { padding-left: 36px; }
.toolbar-spacer { flex: 1 1 auto; min-width: 0; }

/* ============================================================
   Tables
   ============================================================ */
.table-wrap {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
table.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
  text-align: left;
  padding: 12px 16px;
  font-size: 13.5px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
.data-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-faint);
  font-weight: 700;
  background: var(--color-surface-alt);
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--color-surface-alt); }
.cell-primary { font-weight: 700; color: var(--color-text); }
.cell-muted { color: var(--color-text-muted); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

.name-cell { display: flex; align-items: center; gap: 10px; }
.avatar-sm {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: var(--color-surface-sunken); color: var(--color-neutral-strong);
  display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 700;
}

/* ============================================================
   Badges / status
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.badge .od-icon { --od-icon-size: 13px; }
.badge-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.badge-online { background: var(--color-success-soft); color: var(--color-success); }
.badge-online .badge-dot { background: var(--color-success); }
.badge-offline { background: var(--color-neutral-soft); color: var(--color-neutral-strong); }
.badge-offline .badge-dot { background: var(--color-text-faint); }
.badge-break { background: var(--color-warning-soft); color: var(--color-warning); }
.badge-break .badge-dot { background: var(--color-warning); }
.badge-late { background: var(--color-danger-soft); color: var(--color-danger); }
.badge-late .badge-dot { background: var(--color-danger); }
.badge-active { background: var(--color-success-soft); color: var(--color-success); }
.badge-inactive { background: var(--color-neutral-soft); color: var(--color-neutral-strong); }
.badge-revoked { background: var(--color-danger-soft); color: var(--color-danger); }
.badge-type-pausa { background: var(--color-primary-soft); color: var(--color-primary-dark); }
.badge-type-almoco { background: var(--color-warning-soft); color: var(--color-warning); }
.badge-neutral { background: var(--color-surface-alt); color: var(--color-text-muted); border: 1px solid var(--color-border); }

.chip-row { display: flex; gap: 4px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: var(--radius-pill);
  font-size: 11.5px; font-weight: 700;
  background: var(--color-surface-alt); color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}
.chip[data-active="true"] { background: var(--color-primary-soft); color: var(--color-primary-dark); border-color: transparent; }

/* ============================================================
   Empty state
   ============================================================ */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; text-align: center;
  padding: 56px 24px;
  color: var(--color-text-muted);
}
.empty-state .od-icon { --od-icon-size: 34px; color: var(--color-text-faint); }
.empty-state h3 { font-size: 15px; color: var(--color-text); }
.empty-state p { font-size: 13.5px; max-width: 42ch; }

/* ============================================================
   Teams grid
   ============================================================ */
.teams-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.team-card { display: flex; flex-direction: column; gap: 10px; }
.team-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.team-card-title { font-size: 15.5px; font-weight: 700; }
.team-card-meta { font-size: 13px; color: var(--color-text-muted); }
.team-card-stats { display: flex; gap: 18px; margin-top: 4px; }
.team-card-stats .od-stat { gap: 0; }
.team-card-stats .stat-number { font-size: 18px; }
.team-card-stats .stat-caption { font-size: 11.5px; }
.team-card-actions { display: flex; gap: 8px; margin-top: 6px; }

/* ============================================================
   Schedules / timeline
   ============================================================ */
.schedule-toolbar { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 20px; }
.schedule-toolbar .field { min-width: 240px; }

.timeline-card { padding: 24px 20px; }
.timeline-ruler { display: flex; padding-left: 108px; margin-bottom: 6px; }
.timeline-ruler span {
  flex: 1; font-size: 11px; color: var(--color-text-faint); font-weight: 600;
}
.timeline-rows { display: flex; flex-direction: column; gap: 10px; }
.timeline-row { display: flex; align-items: center; gap: 12px; }
.timeline-label { width: 96px; flex: none; font-size: 13px; font-weight: 700; color: var(--color-text-muted); }
.timeline-label[data-off="true"] { color: var(--color-text-faint); font-weight: 600; }
.timeline-track {
  position: relative;
  flex: 1; height: 30px;
  background: var(--color-surface-sunken);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.timeline-seg { position: absolute; top: 3px; bottom: 3px; border-radius: 4px; }
.timeline-seg-duty { background: #27407a; }
.timeline-seg-pausa { background: var(--color-primary); }
.timeline-seg-almoco { background: var(--color-warning); }
.timeline-legend { display: flex; gap: 18px; margin-top: 18px; flex-wrap: wrap; }
.timeline-legend-item { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--color-text-muted); }
.timeline-legend-swatch { width: 14px; height: 14px; border-radius: 4px; flex: none; }

.exceptions-head { display: flex; align-items: center; justify-content: space-between; margin: 28px 0 12px; }
.exceptions-head h3 { font-size: 15px; }

/* ============================================================
   Reports
   ============================================================ */
.report-filters { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 20px; }
.report-filters .field { min-width: 190px; }
.chart-card { margin-bottom: 20px; }
.chart-card h3 { font-size: 14.5px; margin-bottom: 16px; }
.chart-svg { width: 100%; height: 220px; display: block; }
.chart-bar { fill: var(--color-primary); }
.chart-bar:hover { fill: var(--color-primary-dark); }
.chart-axis-label { font-size: 10.5px; fill: var(--color-text-faint); font-family: var(--font-sans); }
.chart-value-label { font-size: 10.5px; fill: var(--color-text-muted); font-family: var(--font-sans); font-weight: 700; }

.callout {
  display: flex; gap: 12px;
  background: var(--color-primary-soft);
  border: 1px solid #2a4a8f;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--color-primary-dark);
}
.callout .od-icon { --od-icon-size: 18px; flex: none; margin-top: 1px; }
.callout strong { font-weight: 700; }

/* ============================================================
   Dialogs
   ============================================================ */
dialog.dialog {
  border: none;
  border-radius: var(--radius-lg);
  padding: 0;
  box-shadow: var(--shadow-lg);
  width: min(560px, calc(100vw - 32px));
  max-height: min(680px, calc(100vh - 48px));
  background: var(--color-surface);
}
dialog.dialog::backdrop { background: rgba(15, 20, 26, 0.5); }
dialog.dialog-sm { width: min(420px, calc(100vw - 32px)); }
.dialog-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 20px 24px; border-bottom: 1px solid var(--color-border);
}
.dialog-header h2 { font-size: 17px; }
.dialog-header p { font-size: 13px; color: var(--color-text-muted); margin-top: 4px; }
.dialog-body { padding: 22px 24px; overflow-y: auto; max-height: 60vh; display: flex; flex-direction: column; gap: 18px; }
.dialog-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 24px; border-top: 1px solid var(--color-border);
}
.dialog-footer.footer-split { justify-content: space-between; }

.token-reveal-box {
  display: flex; align-items: center; gap: 10px;
  background: var(--color-surface-sunken);
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: "SFMono-Regular", Consolas, Menlo, monospace;
  font-size: 13.5px;
  word-break: break-all;
}
.token-reveal-box code { flex: 1; }

.confirm-icon {
  --od-icon-size: 20px;
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-danger-soft); color: var(--color-danger);
  flex: none;
}
.confirm-icon.tone-neutral { background: var(--color-primary-soft); color: var(--color-primary-dark); }

/* ============================================================
   Toasts
   ============================================================ */
.toast-region {
  position: fixed; right: 20px; bottom: 20px; z-index: 300;
  display: flex; flex-direction: column; gap: 10px;
  max-width: 340px;
}
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--color-text);
  color: #fff;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-size: 13.5px;
  animation: toast-in var(--dur-base) var(--ease-out);
}
.toast .od-icon { --od-icon-size: 18px; flex: none; margin-top: 1px; }
.toast-success .od-icon { color: #7fd4a6; }
.toast-danger .od-icon { color: #f0a3a3; }
.toast.toast-leaving { animation: toast-out var(--dur-fast) var(--ease-in) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

/* ============================================================
   View transitions
   ============================================================ */
.view { animation: view-in var(--dur-base) var(--ease-out); }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .field-row { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.is-open { transform: translateX(0); }
  .app-main { margin-left: 0; }
  .nav-toggle { display: inline-flex; }
  .topbar { padding-left: 72px; }
  .content { padding: 20px; padding-top: 72px; }
}

@media (max-width: 720px) {
  .data-table thead { display: none; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
  .data-table tr {
    border-bottom: 1px solid var(--color-border);
    padding: 12px 16px;
  }
  .data-table tbody tr:hover { background: transparent; }
  .data-table td {
    border-bottom: none;
    padding: 4px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    text-align: right;
  }
  .data-table td[data-label]::before {
    content: attr(data-label);
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-faint);
    text-align: left;
  }
  .data-table td.name-cell-td { justify-content: flex-start; }
  .data-table td.name-cell-td::before { display: none; }
  .row-actions { justify-content: flex-end; }
  .timeline-ruler { padding-left: 0; display: none; }
  .timeline-label { width: 72px; font-size: 12px; }
}

@media (max-width: 560px) {
  .stat-strip { grid-template-columns: 1fr 1fr; }
  .login-card { padding: 32px 20px 24px; }
  .toolbar .field, .toolbar .search-field { flex: 1 1 100%; }
  .dialog-body { max-height: 56vh; }
  .view-header { flex-direction: column; }
  .view-header .btn { align-self: stretch; }
}

@media (max-width: 400px) {
  .stat-strip { grid-template-columns: 1fr; }
}

/* Com um diálogo aberto, o menu e a barra superior ficam ocultos */
body:has(dialog[open]) :is(.sidebar, .topbar, .nav-toggle) { visibility: hidden; }
