/* ============================================================
   ZenCat — Design System
   Tema claro, editorial e sofisticado.
   Fontes: Faire Octave (headings) / Suisse Int'l (UI),
   com fallback Georgia / Inter.
   ============================================================ */

@font-face {
  font-family: 'Inter';
  src: url('/static/fonts/inter/Inter-Variable.woff2') format('woff2-variations'),
       url('/static/fonts/inter/Inter-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  font-style: normal;
}

:root {
  --bg: #f3f6f1;
  --surface: #fefffe;
  --surface-raised: #eef3ec;
  --surface-soft: #d9ecdb;

  --accent: #1c3d2a;
  --accent-hover: #234e36;
  --text: #16261b;
  --text-muted: #5d6f63;
  --on-accent: #f4f9f2;

  --border: rgba(28, 61, 42, 0.12);
  --border-strong: rgba(28, 61, 42, 0.22);

  --danger: #b4453f;
  --danger-bg: #f7e4e2;
  --success: #1c3d2a;
  --success-bg: #d9ecdb;
  --warning: #8a5a00;
  --warning-bg: #fbeecd;

  --radius: 14px;
  --radius-sm: 9px;

  --font-head: "Inter", system-ui, -apple-system, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;

  --shadow-soft: 0 1px 2px rgba(28, 61, 42, 0.04),
    0 18px 40px -28px rgba(28, 61, 42, 0.28);

  /* Aliases de compatibilidade — tema anterior, ainda usados em inline styles */
  --color-accent-primary: var(--accent);
  --color-text-primary: var(--text);
  --color-text-secondary: var(--text-muted);
  --color-border: var(--border);
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-lg: 1.125rem;
  --font-size-2xl: 1.5rem;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-head);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--accent);
  margin: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

.shell-content {
  flex: 1;
  min-width: 0;
  background:
    radial-gradient(1100px 480px at 80% -10%, rgba(185, 217, 187, 0.5), transparent 60%),
    var(--bg);
}

.admin-content {
  padding: 40px 0 80px;
}

.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 36px;
}

/* ====================== SIDEBAR ====================== */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 26px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-x: hidden;
  overflow-y: auto;
  transition: width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), padding 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 24px;
}

.sidebar-brand-content {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  text-decoration: none;
}

.sidebar-brand-icon {
  width: 46px;
  height: 46px;
  object-fit: contain;
  flex-shrink: 0;
}

.sidebar-app-name {
  /* Altere a fonte aqui se quiser testar outras (ex: 'Roboto', 'Outfit', etc) */
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent);
  white-space: nowrap;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 1px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.16s ease, color 0.16s ease, justify-content 0.3s ease;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-link:hover {
  background: var(--surface-raised);
  color: var(--text);
  text-decoration: none;
}

.sidebar-link i,
.sidebar-link svg {
  width: 25px;
  height: 25px;
  flex-shrink: 0;
}

.sidebar-link.active {
  background: var(--surface-soft);
  color: var(--accent);
  font-weight: 600;
}

.sidebar-link.active i,
.sidebar-link.active svg {
  color: var(--accent);
}

.sidebar-spacer {
  height: 1px;
  background: var(--border);
  margin: 12px 0;
}

/* ====================== TYPOGRAPHY HELPERS ====================== */
.muted {
  color: var(--text-muted);
}

.panel-note {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.muted {
  color: var(--text-muted);
}

.card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.page-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 6px;
}

.page-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* ====================== BUTTONS ====================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--accent);
  cursor: pointer;
  transition: transform 0.06s ease, background 0.16s ease,
    border-color 0.16s ease, opacity 0.16s ease;
  text-decoration: none;
}

.btn:hover {
  background: var(--surface-raised);
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn i {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-secondary {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--accent);
}

.btn-secondary:hover {
  background: var(--surface-raised);
}

.btn-outline {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--accent);
}

.btn-outline:hover {
  background: var(--surface-raised);
}

.btn-danger {
  background: var(--danger-bg);
  border-color: rgba(180, 69, 63, 0.32);
  color: var(--danger);
}

.btn-danger:hover {
  background: #f1d4d1;
}

.btn-sm {
  padding: 7px 12px;
  font-size: 13px;
  border-radius: 8px;
}

.btn-icon-action {
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
  text-decoration: none;
}

.btn-icon-action:hover {
  color: var(--accent);
  border-color: var(--border-strong);
  background: var(--surface-raised);
  text-decoration: none;
}

.btn-icon-action i {
  width: 15px;
  height: 15px;
}

.btn-icon-action.danger {
  color: var(--danger);
}

.btn-icon-action.danger:hover {
  background: var(--danger-bg);
  border-color: rgba(180, 69, 63, 0.4);
}

/* ====================== FIELDS / FORMS ====================== */
.field {
  width: 100%;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.field::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.field:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(28, 61, 42, 0.12);
}

select.field {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%235d6f63' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 36px;
}

.field-form {
  min-height: 140px;
  resize: vertical;
  line-height: 1.55;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-row.full {
  grid-column: 1 / -1;
}

/* Pilha vertical de seções de formulário (cada seção full-width). */
.form-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-stack.compact {
  gap: 14px;
}

/* Grid responsivo com proporções por --cols; empilha no mobile.
   Media queries não sobrescrevem style inline, mas como o inline define
   apenas a variável --cols (e não grid-template-columns), a regra abaixo vence. */
.row-cols {
  display: grid;
  gap: 18px;
  grid-template-columns: var(--cols, 1fr);
  align-items: start;
}

/* Layout de duas colunas largas (tabela + form). Empilha mais cedo (920px). */
.split-layout {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: var(--cols, 1fr);
  align-items: start;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.form-section {
  display: grid;
  grid-template-columns: minmax(180px, 0.34fr) minmax(0, 1fr);
  gap: 28px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
}

.form-section:first-of-type {
  border-top: none;
  padding-top: 4px;
}

.form-section__header h2 {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 500;
  color: var(--accent);
  margin: 0 0 7px;
}

.form-section__header .panel-note {
  margin: 0;
}

.config-fields-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.config-field-main {
  grid-column: span 2;
}

.field-counter {
  margin: 0;
  text-align: right;
  color: var(--text-muted);
  font-size: 12px;
}

/* ====================== PANEL ====================== */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-soft);
}

/* ====================== TABLE CARD ====================== */
.table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  margin-bottom: 1.5rem;
}

.table-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.table-card-title {
  font-family: var(--font-head);
  font-size: 19px;
  font-weight: 500;
  color: var(--accent);
}

.table-card-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.table-card-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.table-admin {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table-admin thead th {
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 13px 24px;
  background: var(--surface-raised);
  border-bottom: 1px solid var(--border);
}

.table-admin tbody td {
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.table-admin tbody tr:last-child td {
  border-bottom: none;
}

.table-admin tbody tr {
  transition: background 0.14s ease;
}

.table-admin tbody tr:hover {
  background: var(--surface-raised);
}

.table-admin .col-actions {
  text-align: right;
  white-space: nowrap;
}

.table-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.table-actions .btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 8px;
  font-size: 0;
}

.table-actions .btn i {
  width: 15px;
  height: 15px;
}

.success-text {
  color: var(--success);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.row-actions {
  display: inline-flex;
  gap: 6px;
  justify-content: flex-end;
}

/* ====================== BADGES ====================== */
.badge-ativo,
.badge-inativo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  line-height: 1;
}

.badge-ativo {
  background: var(--success-bg);
  color: var(--success);
  box-shadow: inset 0 0 0 1px rgba(28, 61, 42, 0.18);
}

.badge-inativo {
  background: var(--danger-bg);
  color: var(--danger);
  box-shadow: inset 0 0 0 1px rgba(180, 69, 63, 0.22);
}

.badge-ativo::before,
.badge-inativo::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ====================== FLASH ====================== */
#flash-zone {
  position: fixed;
  top: 2rem;
  right: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.flash {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border);
  animation: flash-in 0.4s ease;
  margin-bottom: 0;
  pointer-events: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.form-actions-floating {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  z-index: 100;
}

.form-actions-floating button {
  box-shadow: 0 8px 24px rgba(44, 37, 32, 0.2);
  border-radius: 999px;
  padding: 14px 28px;
  font-size: 15px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.form-actions-floating button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(44, 37, 32, 0.25);
}

.flash i {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.flash-success {
  background: var(--success-bg);
  border-color: rgba(28, 61, 42, 0.2);
  color: var(--success);
}

.flash-error {
  background: var(--danger-bg);
  border-color: rgba(180, 69, 63, 0.3);
  color: var(--danger);
}

.flash-warning {
  background: var(--warning-bg);
  border-color: rgba(138, 90, 0, 0.25);
  color: var(--warning);
}

@keyframes flash-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ====================== STEPPER ====================== */
.stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border-strong);
}

.step .step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  background: var(--surface-raised);
  color: var(--text-muted);
}

.step.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.step.active .step-num {
  background: rgba(244, 249, 242, 0.22);
  color: var(--on-accent);
}

/* ====================== HTMX INDICATOR ====================== */
.htmx-indicator {
  opacity: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-muted);
  font-size: 13px;
  transition: opacity 0.2s ease;
}

.htmx-request .htmx-indicator,
.htmx-indicator.htmx-request {
  opacity: 1;
}

.htmx-indicator i {
  width: 15px;
  height: 15px;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ====================== COTAÇÃO — LAYOUT 2 COLUNAS ====================== */
.cotacao-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 22px;
  align-items: start;
}

.cotacao-aside {
  position: sticky;
  top: 40px;
}

/* Card de acomodação disponível */
.room-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-soft);
}

.room-card+.room-card {
  margin-top: 14px;
}

.room-name {
  font-family: var(--font-head);
  font-size: 2rem;
  color: var(--accent);
}

.room-meta {
  font-size: 16px;
  color: var(--text-muted);
  margin-top: 2px;
}

.room-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Contador +/- */
.counter {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.counter button {
  width: 32px;
  height: 34px;
  border: none;
  background: var(--surface);
  color: var(--accent);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.16s ease;
}

.counter button:hover {
  background: var(--surface-raised);
}

.counter button i {
  width: 15px;
  height: 15px;
}

.counter .counter-value {
  min-width: 40px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  padding: 7px 0;
}

.counter-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-right: 2px;
}

/* Painel de selecionados */
.selected-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.selected-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.selected-head h3 {
  font-size: 16px;
}

.selected-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--surface-soft);
  border-radius: 999px;
  padding: 3px 9px;
}

.selected-body {
  padding: 16px 18px;
}

.selected-card {
  border: 1px solid #b2dbb8;
  background: var(--surface-soft);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
}

.selected-card+.selected-card {
  margin-top: 12px;
}

.selected-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.selected-card-name {
  font-weight: 600;
  color: var(--accent);
  font-size: 14px;
}

.selected-card-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}

.empty-selection {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 30px 18px;
  text-align: center;
  color: var(--text-muted);
}

.empty-selection i {
  width: 26px;
  height: 26px;
  margin-bottom: 8px;
  color: var(--text-muted);
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.selected-foot {
  padding: 16px 18px;
  border-top: 1px solid var(--border);
}

.selected-foot .btn {
  width: 100%;
}

/* Cards de pacote */
.package-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-soft);
}

.package-card+.package-card {
  margin-top: 14px;
}

.package-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.package-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.package-icon i {
  width: 20px;
  height: 20px;
}

.package-name {
  font-family: var(--font-head);
  font-size: 17px;
  color: var(--accent);
}

.package-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.tag-warning {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid rgba(180, 69, 63, 0.28);
  border-radius: 999px;
  padding: 4px 10px;
}

.tag-warning i {
  width: 13px;
  height: 13px;
}

/* Grid de estatísticas (revisão) */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.public-link-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin: 18px 0 22px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
}

.public-link-card__icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--surface);
  color: var(--accent);
  border: 1px solid var(--border);
}

.public-link-card__icon i {
  width: 18px;
  height: 18px;
}

.public-link-card__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--text-muted);
}

.public-link-card__url {
  margin-top: 3px;
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--text-muted);
}

.stat-value {
  font-family: var(--font-head);
  font-size: 26px;
  color: var(--accent);
  margin-top: 4px;
}

/* Lista de acomodações (revisão) */
.review-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 0;
  border-bottom: 1px solid var(--border);
}

.review-line:last-of-type {
  border-bottom: none;
}

.review-line-name {
  font-weight: 600;
}

.review-line-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.review-line-total {
  font-family: var(--font-head);
  font-size: 18px;
  color: var(--accent);
  white-space: nowrap;
}

.grand-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding-top: 20px;
  border-top: 2px solid var(--border-strong);
}

.grand-total .label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--text-muted);
}

.grand-total .value {
  font-family: var(--font-head);
  font-size: 34px;
  color: var(--accent);
}

.quote-review-modal {
  display: grid;
  gap: 20px;
  padding: 24px;
}

.quote-review-modal__header h3 {
  font-family: var(--font-head);
  font-size: 24px;
  font-weight: 500;
  color: var(--accent);
  margin: 0 0 4px;
}

.quote-review-modal__header .page-eyebrow {
  margin-bottom: 8px;
}

.review-list {
  display: grid;
}

.quote-review-modal__actions {
  justify-content: space-between;
  margin-top: 0;
}

/* Checkbox row */
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}

.check-row input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Upload grid (admin) */
.upload-grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

@media (max-width: 560px) {
  .upload-grid {
    grid-template-columns: 1fr;
  }
}

.upload-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-raised);
}

.upload-card__body {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.upload-preview {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: var(--surface-raised);
}

.upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ============ SIDEBAR: colapsar (desktop) + topbar/overlay (mobile) ============ */
/* Botão de colapsar (agora no topo, ao lado do logo) */
.sidebar-collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
  flex-shrink: 0;
}

.sidebar-collapse-btn:hover {
  background: var(--surface-raised);
  color: var(--text);
}

.sidebar-collapse-btn i,
.sidebar-collapse-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

/* Barra superior com hambúrguer (só mobile) */
.sidebar-topbar {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
}

.sidebar-topbar .sidebar-app-name {
  font-size: 17px;
}

.sidebar-burger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.sidebar-burger i {
  width: 20px;
  height: 20px;
}

/* Backdrop do drawer (só mobile, quando aberto) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(22, 38, 27, 0.45);
  z-index: 40;
}

/* ---- Estado colapsado (desktop): rail só com ícones ---- */
html.sidebar-collapsed .sidebar {
  width: 64px;
  padding-left: 12px;
  padding-right: 12px;
}

html.sidebar-collapsed .sidebar-label,
html.sidebar-collapsed .sidebar-app-name {
  display: none;
}

html.sidebar-collapsed .sidebar-link {
  justify-content: center;
  gap: 0;
}

html.sidebar-collapsed .sidebar-brand {
  flex-direction: column;
  align-items: center;
  padding: 4px 0 24px;
  gap: 16px;
}

html.sidebar-collapsed .sidebar-collapse-btn i,
html.sidebar-collapsed .sidebar-collapse-btn svg {
  transform: rotate(180deg);
}

@media (max-width: 920px) {
  .cotacao-layout {
    grid-template-columns: 1fr;
  }

  .cotacao-aside {
    position: static;
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .split-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {

  /* Topbar acima do conteúdo; sidebar sai do fluxo (drawer fixed) */
  .app-shell {
    flex-direction: column;
  }

  /* Topbar com hambúrguer fica visível; sidebar vira drawer off-canvas */
  .sidebar-topbar {
    display: flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 250px;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: var(--shadow-soft);
  }

  /* No mobile o drawer sempre mostra os labels (ignora estado colapsado) */
  html.sidebar-collapsed .sidebar {
    width: 250px;
    padding-left: 16px;
    padding-right: 16px;
  }

  html.sidebar-collapsed .sidebar-label,
  html.sidebar-collapsed .sidebar-app-name {
    display: inline;
  }

  html.sidebar-collapsed .sidebar-link,
  html.sidebar-collapsed .sidebar-brand {
    justify-content: flex-start;
    gap: 11px;
  }

  /* Drawer mobile usa a nova estrutura unificada (icone + texto) */

  /* Botão de colapsar não faz sentido no drawer mobile */
  .sidebar-collapse-btn {
    display: none;
  }

  html.sidebar-mobile-open .sidebar {
    transform: translateX(0);
  }

  html.sidebar-mobile-open .sidebar-overlay {
    display: block;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-section {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .config-fields-grid {
    grid-template-columns: 1fr;
  }

  .config-field-main {
    grid-column: auto;
  }

  /* Empilha colunas dos forms no mobile (o inline só define --cols) */
  .row-cols {
    grid-template-columns: 1fr;
  }

  .public-link-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .public-link-card .btn {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .review-line {
    align-items: flex-start;
  }

  .container {
    padding: 0 20px;
  }
}

/* ====================== CONFIG TABS ====================== */
.config-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
  padding: 0 1.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.config-tabs::-webkit-scrollbar {
  display: none;
}

.config-tab-btn {
  flex-shrink: 0;
  padding: 14px 18px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.16s ease, border-color 0.16s ease;
  white-space: nowrap;
}

.config-tab-btn:hover {
  color: var(--text);
}

.config-tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.config-tab-panel {
  padding: 0 1.5rem 1.5rem;
}

/* ====================== MODAL "SOBRE" (grid 2×2 estética Ease) ====================== */
/* Carregado em #modal-zone; usa o modal global (overlay + ESC + clique fora). */
.modal-ease {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  padding: 16px;
  background: var(--surface);
  margin: 2em;
}

.modal-ease__col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-ease__cell {
  border-radius: 16px;
  padding: 40px;
  display: flex;
  flex-direction: column;
}

/* Q1 — verde claro */
.modal-ease__intro {
  background: #d1f0d1;
  flex: 1;
}

.modal-ease__logo {
  min-width: 100px;
  max-width: 200px;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.modal-ease__intro-bottom {
  margin-top: auto;
}

.modal-ease__subtitle {
  font-size: 14px;
  font-weight: 600;
  color: #1a3a1a;
  margin-bottom: 12px;
}

.modal-ease__desc {
  font-size: 14px;
  line-height: 1.55;
  color: rgba(26, 58, 26, 0.78);
  margin: 0;
}

/* Q2 — azul/cinza, logo */
.modal-ease__brand {
  background: #c5d8e0;
  align-items: center;
  justify-content: center;
  padding: 30px;
}

.modal-ease__stack {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  justify-content: center;
}

.badge-stack {
  font-size: 13px;
  font-weight: 500;
  color: #1a3a1a;
  background: rgba(255, 255, 255, 0.45);
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

/* Q3 — verde médio, desenvolvedor */
.modal-ease__dev {
  background: #b5d8b5;
  justify-content: center;
  flex: 1;
}

.modal-ease__dev-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  font-weight: 600;
  color: rgba(26, 58, 26, 0.6);
  margin: 0 0 16px;
}

.modal-ease__dev-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.modal-ease__dev-list li,
.modal-ease__dev-list a {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #1a3a1a;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.modal-ease__dev-list a:hover {
  text-decoration: underline;
}

.modal-ease__dev-list i {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Q4 — botão escuro largo */
.modal-ease__cta {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 88px;
  background: #1a3a1a;
  color: #eaf3ea;
  text-decoration: none;
  transition: background 0.16s ease;
}

.modal-ease__cta:hover {
  background: #16301a;
  text-decoration: none;
}

.modal-ease__cta span {
  font-family: var(--font-head);
  font-size: 20px;
}

.modal-ease__cta i {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

/* X de fechar flutuando sobre o grid (remove a barra branca do header global). */
.modal-container:has(.modal-ease) .modal-header {
  position: absolute;
  top: 0;
  right: 0;
  padding: 12px;
  border-bottom: none;
  background: transparent;
  z-index: 5;
}

@media (max-width: 640px) {
  .modal-ease {
    grid-template-columns: 1fr;
  }

  .modal-ease__cell {
    padding: 24px;
  }
}

/* ====================== COLOR PICKER ====================== */
input[type="color"].field.color-swatch-circular {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background-color: transparent;
  flex-shrink: 0;
}

input[type="color"].field.color-swatch-circular::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"].field.color-swatch-circular::-webkit-color-swatch {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
}

input[type="color"].field.color-swatch-circular::-moz-color-swatch {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
}

.color-input-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color 0.15s ease;
}

.color-input-wrapper:focus-within {
  border-color: var(--accent);
}

.color-hex-display {
  font-family: monospace;
  font-size: 0.9em;
  color: var(--text-muted);
  flex: 1;
  text-transform: uppercase;
}

/* ============================================================
   Página de Login (Split Screen)
   ============================================================ */
.login-container {
  display: flex;
  min-height: 100vh;
  background-color: var(--bg, #f4f5f5);
}
.login-image {
  display: none;
}
.login-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  background: radial-gradient(1100px 480px at 80% -10%, rgba(185, 217, 187, 0.5), transparent 60%), var(--bg, #f4f5f5);
}
.login-form-wrapper {
  width: 100%;
  max-width: 380px;
}
@media (min-width: 900px) {
  .login-image {
    display: block;
    flex: 1.2;
    background-image: url('/static/img/login_bg.jpg');
    background-size: cover;
    background-position: center;
    position: relative;
  }
  .login-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(28, 61, 42, 0.4), rgba(0,0,0,0.1));
  }
  .login-content {
    flex: 1;
  }
}
.brand-title {
  font-family: var(--font-heading, 'Georgia', serif);
  font-size: 2rem;
  color: var(--accent, #1c3d2a);
  margin-bottom: 0.5rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.brand-subtitle {
  color: var(--text-muted, #5d6f63);
  font-size: 1rem;
  margin-bottom: 2.5rem;
  line-height: 1.5;
}
.input-field {
  width: 100%;
  padding: .75rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--border-strong, #ccc);
  font-size: 1rem;
  background: var(--surface, #fff);
  color: var(--text, #111);
  box-sizing: border-box;
  transition: border-color 0.2s;
}
.input-field:focus {
  outline: none;
  border-color: var(--accent, #1c3d2a);
}
.form-label {
  display: block;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text, #111);
}

/* ============================================================
   Telas de Autenticação (Recuperar Senha)
   ============================================================ */
.auth-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: radial-gradient(1100px 480px at 80% -10%, rgba(185, 217, 187, 0.5), transparent 60%), var(--bg, #f4f5f5);
  padding: 2rem;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 2.5rem;
  background: var(--surface, #ffffff);
  border-radius: var(--radius, 12px);
  box-shadow: 0 12px 40px rgba(28, 61, 42, 0.08);
  border: 1px solid var(--border, #eaeaea);
  position: relative;
  z-index: 10;
}
.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}
.auth-header img {
  height: 54px;
  margin-bottom: 1.2rem;
}
.auth-header h2 {
  font-family: var(--font-heading, 'Georgia', serif);
  font-size: 1.6rem;
  color: var(--accent, #1c3d2a);
  margin-bottom: 0.5rem;
  font-weight: 500;
}
.auth-header p {
  color: var(--text-muted, #5d6f63);
  font-size: 0.95rem;
  line-height: 1.5;
}
.auth-actions {
  margin-top: 1.5rem;
  text-align: center;
}
.auth-actions a {
  font-size: 0.9rem;
  color: var(--text-muted, #5d6f63);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s;
}
.auth-actions a:hover {
  color: var(--accent, #1c3d2a);
}
