:root {
  --navy: #001d7e;
  --primary: #001d7e;
  --primary-hover: #00155e;
  --primary-ink: #001d7e;
  --primary-soft: #dcebf4;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f3f8fc;
  --text: #253c56;
  --text-2: #5e6b7c;
  --line: #d9e4ee;
  --line-strong: #bfcedd;
  --success: #15803d;
  --success-ink: #166534;
  --success-soft: #dcfce7;
  --warning: #b45309;
  --warning-ink: #92400e;
  --warning-soft: #fef3c7;
  --danger: #dc2626;
  --danger-ink: #991b1b;
  --danger-soft: #fee2e2;
  --info-ink: #001d7e;
  --info-soft: #dcebf4;
  --neutral-ink: #5e6b7c;
  --neutral-soft: #eef1f6;
  --violet: #5f194a;
  --violet-ink: #5f194a;
  --violet-soft: #f4e6ee;
  --on-navy: #ffffff;
  --on-navy-muted: #b3bfe3;
  --navy-line: #ffffff14;
  --navy-active: #ffffff1f;
  --brand-yellow: #f7d347;
  --brand-yellow-ink: #6b5300;
  --brand-yellow-soft: #fdf5cf;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-badge: 6px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px #001d7e0f;
  --shadow-md: 0 4px 16px #001d7e14;
  --shadow-lg: 0 16px 40px #001d7e2e;
}

.dark {
  --navy: #05113f;
  --primary: #3a5fd9;
  --primary-hover: #4a6fe6;
  --primary-ink: #8fb0ff;
  --primary-soft: #3a5fd938;
  --bg: #0a1024;
  --surface: #121a33;
  --surface-2: #19233f;
  --text: #e6ebf3;
  --text-2: #a3afc2;
  --line: #243049;
  --line-strong: #334260;
  --success: #4ade80;
  --success-ink: #86efac;
  --success-soft: #22c55e29;
  --warning: #fbbf24;
  --warning-ink: #fcd34d;
  --warning-soft: #f59e0b29;
  --danger: #f87171;
  --danger-ink: #fca5a5;
  --danger-soft: #ef444429;
  --info-ink: #a9c2ff;
  --info-soft: #3a5fd938;
  --neutral-ink: #a3afc2;
  --neutral-soft: #a3afc224;
  --violet: #e7a9cf;
  --violet-ink: #efb9da;
  --violet-soft: #7e005142;
  --brand-yellow-ink: #f7d347;
  --brand-yellow-soft: #f7d34729;
  --on-navy-muted: #a7b3d8;
  --shadow-sm: 0 1px 2px #0006;
  --shadow-md: 0 4px 16px #00000073;
  --shadow-lg: 0 16px 40px #0000008c;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Open Sans', ui-sans-serif, system-ui, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100dvh;
}

h1, h2, h3, .page-head-title, .sidebar-brand-name, .topbar-title {
  font-family: 'Montserrat', ui-sans-serif, system-ui, sans-serif;
}

/* ==================== LAYOUT SHELL (SIDEBAR + MAIN) ==================== */
.layout-shell {
  display: flex;
  min-height: 100dvh;
}

.sidebar {
  background: var(--navy);
  color: var(--on-navy);
  width: 256px;
  flex-shrink: 0;
  display: none;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100dvh;
}

@media (min-width: 900px) {
  .sidebar {
    display: flex;
  }
}

.sidebar-brand {
  border-bottom: 1px solid var(--navy-line);
  color: inherit;
  align-items: center;
  gap: 10px;
  padding: 16px 16px 14px;
  text-decoration: none;
  display: flex;
}

.sidebar-brand img {
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: #fff;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  padding: 2px;
}

.sidebar-brand-name {
  color: var(--on-navy);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

.sidebar-brand-sub {
  color: var(--on-navy-muted);
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.2;
}

.sidebar-nav {
  flex-direction: column;
  flex: 1;
  padding: 8px 12px 12px;
  display: flex;
  gap: 2px;
  overflow-y: auto;
}

.sidebar-group {
  color: var(--on-navy-muted);
  letter-spacing: 0.04em;
  padding: 14px 10px 4px;
  font-size: 11px;
  font-weight: 700;
}

.sidebar-link {
  border-radius: var(--radius-sm);
  min-height: 40px;
  color: var(--on-navy-muted);
  white-space: nowrap;
  cursor: pointer;
  text-align: left;
  background: transparent;
  border: none;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
  display: flex;
}

.sidebar-link:hover {
  background: var(--navy-line);
  color: var(--on-navy);
}

.sidebar-link.active {
  background: var(--navy-active);
  color: var(--on-navy);
  box-shadow: inset 3px 0 0 var(--brand-yellow);
}

.sidebar-foot {
  border-top: 1px solid var(--navy-line);
  color: var(--on-navy-muted);
  padding: 12px 16px;
  font-size: 11.5px;
  line-height: 1.4;
}

.main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 900px) {
  .main-area {
    padding-bottom: 24px;
  }
}

/* ==================== TOPBAR ==================== */
.topbar {
  z-index: 30;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  align-items: center;
  gap: 10px;
  height: 58px;
  padding: 0 16px;
  display: flex;
  position: sticky;
  top: 0;
}

@media (min-width: 768px) {
  .topbar {
    padding: 0 24px;
  }
}

.topbar-brand {
  min-width: 0;
  color: var(--text);
  align-items: center;
  gap: 10px;
  display: flex;
}

.topbar-brand img {
  object-fit: contain;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  width: 34px;
  height: 34px;
  padding: 2px;
}

.topbar-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
}

.dark .topbar-title {
  color: var(--text);
}

.topbar-sub {
  font-size: 11.5px;
  color: var(--text-2);
  line-height: 1.2;
}

.topbar-spacer {
  flex: 1;
}

/* ==================== PAGE HEAD & BODY ==================== */
.view-section[hidden] {
  display: none !important;
}

.page-head {
  padding: 22px 24px 0;
}

.page-head-inner {
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px 16px;
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
}

.page-head-main {
  flex: 320px;
  min-width: 0;
}

.page-head-title {
  color: var(--navy);
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
}

.dark .page-head-title {
  color: var(--text);
}

.page-head-desc {
  color: var(--text-2);
  max-width: 72ch;
  margin: 4px 0 0;
  font-size: 13.5px;
}

.page-head-actions {
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  display: flex;
}

.page-body {
  max-width: 1140px;
  width: 100%;
  margin: 0 auto;
  padding: 18px 24px 32px;
}

@media (max-width: 639px) {
  .page-head {
    padding: 16px 16px 0;
  }
  .page-head-title {
    font-size: 19px;
  }
  .page-body {
    padding: 14px 16px 28px;
  }
}

.date-picker-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.date-input-group {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* ==================== COMPONENTES SERVICEDESK CSP ==================== */
.btn {
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid transparent;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
  display: inline-flex;
}

.btn-sm {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12.5px;
}

.btn-icon {
  width: 38px;
  min-width: 38px;
  height: 38px;
  padding: 0;
}

.btn-icon.btn-sm {
  width: 34px;
  min-width: 34px;
  height: 34px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line-strong);
}

.btn-secondary:hover {
  background: var(--surface-2);
}

.btn-ghost {
  color: var(--text-2);
  background: transparent;
}

.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.icon-tile {
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  width: 40px;
  height: 40px;
  color: var(--primary-ink);
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  font-size: 1.15rem;
  display: inline-flex;
}

.icon-tile.teal {
  background: var(--success-soft);
  color: var(--success-ink);
}

.icon-tile.amber {
  background: var(--warning-soft);
  color: var(--warning-ink);
}

.icon-tile.coral {
  background: var(--danger-soft);
  color: var(--danger-ink);
}

.icon-tile.navy {
  background: var(--navy);
  color: #fff;
}

.icon-tile.soft {
  background: var(--primary-soft);
  color: var(--primary-ink);
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
}

@media (max-width: 639px) {
  .card {
    padding: 14px 16px;
  }
}

.card-title {
  color: var(--navy);
  margin: 0 0 12px;
  font-size: 15.5px;
  font-weight: 700;
}

.dark .card-title {
  color: var(--text);
}

.pill {
  border-radius: var(--radius-badge);
  white-space: nowrap;
  border: 1px solid transparent;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  display: inline-flex;
}

.pill-dot {
  background: currentColor;
  border-radius: 999px;
  width: 6px;
  height: 6px;
}

.pill-strong {
  font-weight: 700;
}

.pill-electric {
  background: var(--info-soft);
  color: var(--info-ink);
}

.pill-teal {
  background: var(--success-soft);
  color: var(--success-ink);
}

.pill-amber {
  background: var(--warning-soft);
  color: var(--warning-ink);
}

.pill-coral {
  background: var(--danger-soft);
  color: var(--danger-ink);
}

.pill-muted {
  background: var(--neutral-soft);
  color: var(--neutral-ink);
}

/* ==================== SELETOR DOS 3 TURNOS ==================== */
.shifts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

@media (max-width: 680px) {
  .shifts-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  .shift-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 10px 6px;
    gap: 6px;
  }
  .shift-card .icon-tile {
    width: 34px;
    height: 34px;
    font-size: 1rem;
  }
  .shift-card-title {
    font-size: 12px;
    line-height: 1.2;
  }
  .shift-card-sub {
    display: none;
  }
}

.shift-card {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.shift-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}

.shift-card.active {
  border-color: var(--primary);
  background: var(--surface-2);
  box-shadow: 0 0 0 2px var(--primary-soft), var(--shadow-md);
}

.shift-card-body {
  flex: 1;
  min-width: 0;
}

.shift-card-title {
  color: var(--navy);
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 700;
}

.dark .shift-card-title {
  color: var(--text);
}

.shift-card-sub {
  color: var(--text-2);
  font-size: 12px;
}

/* ==================== PROGRESS BANNER & FILTERS ==================== */
.progress-banner {
  margin-bottom: 16px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.progress-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.progress-track {
  height: 8px;
  background: var(--neutral-soft);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--success));
  border-radius: 999px;
  transition: width 0.25s ease;
}

.kanban-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-btn {
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  min-height: 36px;
  color: var(--text-2);
  cursor: pointer;
  padding: 0 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.filter-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.filter-btn.active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-ink);
}

/* ==================== CARDS DE SALAS E EQUIPAMENTOS ==================== */
.rooms-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}

@media (max-width: 639px) {
  .rooms-list {
    grid-template-columns: 1fr;
  }
}

.room-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.room-card.room-complete-ok {
  border-color: var(--success);
  box-shadow: 0 0 0 1px var(--success-soft), var(--shadow-sm);
}

.room-card.room-has-problem {
  border-color: var(--danger);
  box-shadow: 0 0 0 1px var(--danger-soft), var(--shadow-sm);
}

.room-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}

.room-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.room-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
}

.dark .room-title {
  color: var(--text);
}

.btn-all-ok {
  background: var(--success-soft);
  border: 1px solid var(--success);
  color: var(--success-ink);
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: filter 0.12s, transform 0.1s;
}

.btn-all-ok:hover {
  filter: brightness(0.96);
}

.btn-all-ok:active {
  transform: scale(0.96);
}

.eq-list {
  display: flex;
  flex-direction: column;
}

.eq-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  gap: 10px;
}

.eq-row:last-child {
  border-bottom: none;
}

.eq-info {
  flex: 1;
  min-width: 0;
}

.eq-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 7px;
}

.eq-note {
  font-size: 12px;
  color: var(--danger-ink);
  background: var(--danger-soft);
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  margin-top: 4px;
  font-weight: 600;
}

.eq-buttons {
  display: flex;
  gap: 6px;
}

.btn-check {
  height: 38px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  touch-action: manipulation;
  transition: all 0.12s ease;
}

@media (max-width: 639px) {
  .eq-row {
    padding: 11px 14px;
  }
  .btn-check {
    height: 40px;
    padding: 0 13px;
    font-size: 13px;
  }
  .btn-all-ok {
    padding: 8px 13px;
    font-size: 12.5px;
    touch-action: manipulation;
  }
  .field {
    font-size: 16px;
    min-height: 42px;
  }
}

.btn-check:hover {
  background: var(--surface-2);
  color: var(--text);
}

.btn-check.ok.selected {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.btn-check.problema.selected {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

/* ==================== FORM FIELDS & NOTICES ==================== */
.field {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background-color: var(--surface);
  color: var(--text);
  width: 100%;
  min-height: 38px;
  padding: 7px 11px;
  font-family: inherit;
  font-size: 13.5px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  outline: none;
}

.field-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field-label {
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
}

.field-hint {
  color: var(--text-2);
  font-size: 12.5px;
}

.form-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 820px) {
  .form-grid-4 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 520px) {
  .form-grid-4 {
    grid-template-columns: 1fr;
  }
}

/* ==================== KPI CARDS & TABLES (RELATÓRIO) ==================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

@media (max-width: 720px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  display: flex;
}

.kpi-label {
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
}

.kpi-value {
  color: var(--navy);
  font-family: 'Montserrat', sans-serif;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.15;
  margin-top: 2px;
}

.dark .kpi-value {
  color: var(--text);
}

.kpi-sub {
  color: var(--text-2);
  font-size: 12px;
  margin-top: 2px;
}

.report-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 780px) {
  .report-split {
    grid-template-columns: 1fr;
  }
}

.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.table-wrap table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}

.table-wrap thead th {
  text-align: left;
  color: var(--text-2);
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  padding: 9px 12px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
}

.table-wrap tbody td {
  border-bottom: 1px solid var(--line);
  color: var(--text);
  padding: 10px 12px;
}

.table-wrap tbody tr:last-child td {
  border-bottom: none;
}

.detailed-log {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.log-item {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.log-item.problema {
  border-left: 4px solid var(--danger);
}

.log-item.ok {
  border-left: 4px solid var(--success);
}

.log-meta {
  color: var(--text-2);
  font-size: 12px;
  margin-top: 2px;
}

.log-note {
  color: var(--danger-ink);
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
}

/* ==================== CADASTROS ==================== */
.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.inline-form .field:not(.icon-select) {
  flex: 1 1 180px;
}

@media (max-width: 520px) {
  .inline-form .btn {
    width: 100%;
    min-height: 42px;
  }
}

.icon-select {
  width: 64px;
  flex-shrink: 0;
  text-align: center;
  font-size: 1.1rem;
}

.config-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.config-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
}

.btn-del-small {
  background: var(--danger-soft);
  border: 1px solid transparent;
  color: var(--danger-ink);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

/* ==================== BOTTOM NAV MOBILE (NAVY CSP) ==================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--navy);
  color: var(--on-navy);
  border-top: 1px solid var(--navy-line);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
  z-index: 40;
}

@media (min-width: 900px) {
  .bottom-nav {
    display: none;
  }
}

.nav-item {
  background: transparent;
  border: none;
  color: var(--on-navy-muted);
  padding: 6px 4px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
}

.nav-item.active {
  color: var(--on-navy);
  background: var(--navy-active);
  box-shadow: inset 0 2px 0 var(--brand-yellow);
}

.nav-icon {
  font-size: 1.1rem;
}

.nav-label {
  font-size: 11px;
  font-weight: 700;
}

/* ==================== MODAL & NOTICE ==================== */
.modal-backdrop {
  z-index: 60;
  background: #14243b8c;
  justify-content: center;
  align-items: center;
  padding: 16px;
  display: flex;
  position: fixed;
  inset: 0;
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 500px;
  overflow: hidden;
}

@media (max-width: 639px) {
  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }
  .modal-panel {
    max-width: 100%;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .modal-foot .btn {
    flex: 1;
    min-height: 44px;
  }
  .tag-chip {
    padding: 7px 12px;
    font-size: 12.5px;
  }
}

.modal-head {
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 20px 0;
  display: flex;
}

.modal-title {
  color: var(--navy);
  font-size: 16px;
  font-weight: 700;
}

.dark .modal-title {
  color: var(--text);
}

.modal-body {
  padding: 14px 20px 18px;
}

.modal-foot {
  justify-content: flex-end;
  gap: 8px;
  padding: 0 20px 18px;
  display: flex;
}

.notice {
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  padding: 12px 14px;
  font-size: 13.5px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.45;
}

.notice[hidden] {
  display: none !important;
}

.notice svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.notice-body {
  flex: 1;
  min-width: 0;
}

.notice-danger {
  background: var(--danger-soft);
  color: var(--danger-ink);
  border-color: #dc262640;
}

.notice-success {
  background: var(--success-soft);
  color: var(--success-ink);
  border-color: #15803d40;
}

.notice-info {
  background: var(--info-soft);
  color: var(--info-ink);
  border-color: #001d7e40;
}

.notice-title {
  font-weight: 700;
  margin-bottom: 2px;
}

.pill-violet {
  background: var(--violet-soft);
  color: var(--violet-ink);
}

.card-raised {
  box-shadow: var(--shadow-md);
}

.w-full {
  width: 100%;
}

.field-req {
  color: var(--danger);
  margin-left: 2px;
}

.field-icon-box {
  position: relative;
}

.field-left-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  display: inline-flex;
  color: var(--text-2);
}

.field.with-icon {
  padding-left: 38px;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 640px) {
  .form-grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.muted {
  color: var(--text-2);
}

/* ==================== AUTENTICAÇÃO (PADRÃO PORTAL CSP / AUTHSHELL) ==================== */
.auth-page {
  min-height: 100dvh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.auth-page[hidden],
.layout-shell[hidden],
[hidden] {
  display: none !important;
}

.auth-band {
  background: var(--navy);
  color: var(--on-navy);
  min-height: 72px;
  padding: 16px 24px 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.auth-band-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-band-brand img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 2px;
}

.auth-band-name {
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  color: #fff;
}

.auth-band-sub {
  font-size: 12px;
  color: var(--on-navy-muted);
  line-height: 1.2;
  margin-top: 2px;
}

.auth-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px 32px;
  margin-top: -28px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 28px 28px 24px;
}

.auth-card-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.auth-card-logo img {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.auth-card-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--navy);
  margin: 0;
}

.dark .auth-card-title {
  color: var(--text);
}

.auth-card-sub {
  font-size: 13.5px;
  color: var(--text-2);
  margin-top: 2px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-points {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 22px;
  margin-top: 22px;
  max-width: 760px;
}

.auth-point {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
}

.auth-point .icon-tile {
  width: 32px;
  height: 32px;
}

.auth-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  margin-top: 16px;
  font-size: 13.5px;
  color: var(--text-2);
}

.link-btn {
  background: none;
  border: none;
  color: var(--primary-ink);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
}

.link-btn:hover {
  text-decoration: underline;
}

.auth-mobile-credit {
  margin-top: 20px;
  text-align: center;
}

.dev-credit {
  font-size: 11px;
}

.dev-credit.on-dark {
  color: var(--on-navy-muted);
}

.dev-credit.on-dark a {
  color: var(--on-navy);
  font-weight: 600;
  text-decoration: none;
}

.dev-credit.on-surface {
  color: var(--text-2);
}

.dev-credit.on-surface a {
  color: var(--primary-ink);
  font-weight: 600;
  text-decoration: none;
}

.dev-credit a:hover {
  text-decoration: underline;
}

@media (max-width: 639px) {
  .auth-card {
    padding: 22px 18px 20px;
  }
  .auth-points-mobile {
    display: none;
  }
}

.auth-photo {
  position: relative;
  display: none;
  overflow: hidden;
  background: var(--navy);
}

.auth-photo picture,
.auth-photo picture img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 38%;
}

.auth-photo-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 36, 59, 0.28) 0%, rgba(20, 36, 59, 0.42) 50%, rgba(20, 36, 59, 0.90) 100%);
}

.auth-photo-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 32px 40px 28px;
  color: #fff;
}

.auth-photo-title {
  color: #fff;
  font-size: 30px;
  font-weight: 600;
  line-height: 1.15;
  max-width: 440px;
  margin: 0 0 8px;
}

.auth-photo-sub {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.82);
  max-width: 440px;
  margin: 0 0 22px;
}

.auth-photo .auth-points {
  margin: 0;
  justify-content: flex-start;
  max-width: none;
  flex-direction: column;
  gap: 10px;
}

.auth-photo .auth-point {
  color: rgba(255, 255, 255, 0.92);
  font-size: 14px;
}

.auth-photo .auth-point .icon-tile {
  background: var(--brand-yellow);
  color: var(--navy);
}

@media (min-width: 1024px) {
  .auth-page {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  }
  .auth-photo {
    display: block;
    min-height: 100dvh;
  }
  .auth-band {
    display: none;
  }
  .auth-main {
    justify-content: center;
    margin-top: 0;
    padding: 40px 32px;
  }
  .auth-points-mobile,
  .auth-mobile-credit {
    display: none;
  }
}

/* ==================== USER CHIP NA TOPBAR & FOOTER ==================== */
.user-chip {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
  padding: 4px;
  border-radius: var(--radius-sm);
  min-width: 0;
}

.user-chip-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-chip-info {
  display: none;
  min-width: 0;
}

@media (min-width: 640px) {
  .user-chip-info {
    display: block;
  }
}

.user-chip-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}

.user-chip-sub {
  font-size: 11px;
  color: var(--text-2);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}

@media (max-width: 639px) {
  .hide-sm {
    display: none;
  }
}

@media (max-width: 480px) {
  .hide-xs {
    display: none;
  }
  .topbar-brand-text .topbar-sub {
    display: none;
  }
}

.portal-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 10px 24px;
  font-size: 11px;
}

.portal-footer-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}

/* ==================== PÁGINA DE USUÁRIOS (DESKTOP TABLE + MOBILE CARDS) ==================== */
.users-table-desktop {
  display: none;
}

.users-cards-mobile {
  display: flex;
}

@media (min-width: 768px) {
  .users-table-desktop {
    display: block;
  }
  .users-cards-mobile {
    display: none;
  }
}

.ticket-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.ticket-card-title {
  font-weight: 600;
  font-size: 14px;
  margin: 0 0 6px;
}

.ticket-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}

.ticket-card-sub {
  font-size: 12.5px;
  color: var(--text-2);
  margin-bottom: 10px;
  word-break: break-all;
}

.bottom-nav.has-4-items {
  grid-template-columns: repeat(4, 1fr);
}

.quick-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.tag-chip {
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  color: var(--text);
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.tag-chip:hover,
.tag-chip:active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-ink);
}

.toast {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 80;
}

.print-only-header {
  display: none;
}

@media print {
  body {
    background: #fff;
    color: #000;
  }
  .no-print {
    display: none !important;
  }
  .print-only-header {
    display: block;
    margin-bottom: 16px;
    border-bottom: 2px solid #001d7e;
    padding-bottom: 8px;
  }
  .main-area, .page-body {
    padding: 0 !important;
    max-width: 100% !important;
  }
}
