/* Sistema de Gestão — Celebrante de Casamentos (demo)
   Painel interno: paleta neutra + um único acento (regra de painéis internos Montazolla) */

:root {
  --graf-950: #14120F;
  --graf-900: #1C1915;
  --graf-800: #2A251F;
  --graf-700: #3D372E;
  --graf-500: #6B6255;
  --graf-300: #A79C8B;
  --graf-100: #E8E1D5;
  --off-white: #FAF8F4;
  --white: #FFFFFF;
  --hairline: #E3DACB;

  --accent: #8A6A3B;
  --accent-dark: #6B5029;
  --accent-tint: #F1E7D6;

  --ok: #3F7A56;
  --ok-tint: #E4F0E7;
  --warn: #B4802B;
  --warn-tint: #FBF0DD;
  --danger: #B4432D;
  --danger-tint: #FAE6E1;

  --wa-green: #25D366;
  --wa-bg: #E9EDEF;
  --wa-bubble-out: #D9FDD3;
  --wa-teal: #075E54;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(20,18,15,0.06);
  --shadow-md: 0 6px 20px rgba(20,18,15,0.08);
  --shadow-lg: 0 16px 40px rgba(20,18,15,0.14);

  --font-display: "Manrope", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "Space Mono", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--off-white);
  color: var(--graf-900);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: var(--font-body); cursor: pointer; }
ul { margin: 0; padding: 0; list-style: none; }

.icon { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.6; fill: none; flex-shrink: 0; }

/* ---------- Layout shell (sidebar) ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 248px;
  background: var(--graf-950);
  color: var(--off-white);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-head { padding: 24px 20px 18px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.sidebar-brand { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; color: var(--off-white); }
.sidebar-brand em { color: var(--accent); font-style: normal; }
.sidebar-sub { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--graf-300); margin-top: 4px; }

.nav { flex: 1; padding: 14px 12px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: #C9C1B2; font-size: 0.88rem; font-weight: 500;
  margin-bottom: 2px; border: none; background: none; width: 100%; text-align: left;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: var(--off-white); }
.nav-item.active { background: var(--accent); color: var(--off-white); }
.nav-item .icon { opacity: 0.85; }

.sidebar-foot { padding: 14px 16px 18px; border-top: 1px solid rgba(255,255,255,0.08); }
.sidebar-reset {
  width: 100%; padding: 9px 10px; border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.14); background: transparent; color: var(--graf-300);
  font-size: 0.74rem; font-family: var(--font-mono); letter-spacing: 0.04em;
}
.sidebar-reset:hover { color: var(--off-white); border-color: rgba(255,255,255,0.3); }

.main { flex: 1; min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 32px; border-bottom: 1px solid var(--hairline); background: var(--white);
  position: sticky; top: 0; z-index: 20;
}
.topbar-title { font-size: 1.3rem; font-weight: 700; }
.topbar-sub { font-size: 0.82rem; color: var(--graf-500); margin-top: 2px; }
.content { padding: 28px 32px 60px; max-width: 1240px; }

/* mobile drawer */
.topbar-mobile { display: none; }
.overlay { display: none; }
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform 0.25s ease; z-index: 100; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .topbar-mobile {
    display: flex; align-items: center; gap: 12px; padding: 14px 18px;
    background: var(--graf-950); color: var(--off-white); position: sticky; top: 0; z-index: 30;
  }
  .topbar-mobile button { background: none; border: none; color: var(--off-white); padding: 4px; }
  .overlay.open { display: block; position: fixed; inset: 0; background: rgba(20,18,15,0.45); z-index: 90; }
  .content { padding: 20px 16px 48px; }
  .topbar { padding: 14px 18px; flex-wrap: wrap; gap: 8px; }
}

/* ---------- Cards / grid utilities ---------- */
.grid { display: grid; gap: 18px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1000px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--white); border: 1px solid var(--hairline); border-radius: var(--radius-lg);
  padding: 20px; box-shadow: var(--shadow-sm);
}
.card-title { font-size: 0.72rem; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.14em; color: var(--graf-500); margin-bottom: 8px; }

.kpi-value { font-size: 2rem; font-weight: 800; font-family: var(--font-display); }
.kpi-delta { font-size: 0.78rem; color: var(--graf-500); margin-top: 4px; }

.section-heading { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.section-heading h2 { font-size: 1.15rem; font-weight: 700; }
.section-heading .hint { font-size: 0.82rem; color: var(--graf-500); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px;
  border-radius: var(--radius-sm); font-size: 0.86rem; font-weight: 600; border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: var(--white); }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost { background: var(--white); border-color: var(--hairline); color: var(--graf-900); }
.btn-ghost:hover { border-color: var(--graf-500); }
.btn-sm { padding: 6px 11px; font-size: 0.78rem; }
.btn-danger-ghost { background: var(--white); border-color: var(--danger); color: var(--danger); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px;
  border-radius: 999px; font-size: 0.72rem; font-weight: 700; font-family: var(--font-mono);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.badge-ok { background: var(--ok-tint); color: var(--ok); }
.badge-warn { background: var(--warn-tint); color: var(--warn); }
.badge-danger { background: var(--danger-tint); color: var(--danger); }
.badge-neutral { background: var(--graf-100); color: var(--graf-700); }
.badge-accent { background: var(--accent-tint); color: var(--accent-dark); }

/* ---------- Hero / destaque ---------- */
.hero-destaque {
  background: var(--graf-950); color: var(--off-white); border-radius: var(--radius-lg);
  padding: 28px 30px; display: flex; justify-content: space-between; align-items: center; gap: 24px;
  flex-wrap: wrap; margin-bottom: 22px; position: relative; overflow: hidden;
}
.hero-destaque::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px;
  border-radius: 50%; border: 1px solid rgba(138,106,59,0.35);
}
.hero-eyebrow { font-family: var(--font-mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.18em; color: var(--accent); }
.hero-title { font-size: 1.7rem; font-weight: 800; margin-top: 6px; }
.hero-meta { font-size: 0.86rem; color: var(--graf-300); margin-top: 8px; display: flex; gap: 16px; flex-wrap: wrap; }
.hero-countdown { text-align: center; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); border-radius: var(--radius-md); padding: 14px 24px; z-index: 1; }
.hero-countdown .num { font-size: 2.1rem; font-weight: 800; font-family: var(--font-display); color: var(--accent); line-height: 1; }
.hero-countdown .lbl { font-size: 0.68rem; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--graf-300); margin-top: 4px; }

/* ---------- Kanban ---------- */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 10px; }
.kanban-col { min-width: 232px; flex: 1; background: var(--graf-100); border-radius: var(--radius-md); padding: 12px; }
.kanban-col-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 4px 10px; }
.kanban-col-head span.title { font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--graf-700); }
.kanban-col-head span.count { font-family: var(--font-mono); font-size: 0.72rem; color: var(--graf-500); background: var(--white); border-radius: 999px; padding: 1px 8px; }
.kanban-card {
  background: var(--white); border: 1px solid var(--hairline); border-radius: var(--radius-md);
  padding: 12px 13px; margin-bottom: 10px; cursor: pointer; box-shadow: var(--shadow-sm);
}
.kanban-card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); }
.kanban-card .noivos { font-weight: 700; font-size: 0.86rem; margin-bottom: 4px; }
.kanban-card .meta-row { display: flex; align-items: center; gap: 5px; font-size: 0.74rem; color: var(--graf-500); margin-top: 3px; }
.kanban-card .meta-row .icon { width: 13px; height: 13px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--hairline); border-radius: var(--radius-lg); background: var(--white); }
table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
th { text-align: left; font-family: var(--font-mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--graf-500); padding: 12px 16px; border-bottom: 1px solid var(--hairline); white-space: nowrap; }
td { padding: 13px 16px; border-bottom: 1px solid var(--hairline); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr.clickable:hover { background: var(--off-white); cursor: pointer; }

/* ---------- Modal / drawer ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(20,18,15,0.5); display: flex;
  align-items: stretch; justify-content: flex-end; z-index: 200; opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.drawer {
  width: min(520px, 100%); background: var(--white); height: 100%; overflow-y: auto;
  transform: translateX(24px); transition: transform 0.2s ease; box-shadow: var(--shadow-lg);
}
.modal-overlay.open .drawer { transform: translateX(0); }
.drawer-head { padding: 22px 26px; border-bottom: 1px solid var(--hairline); display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; position: sticky; top: 0; background: var(--white); z-index: 2; }
.drawer-close { background: none; border: none; color: var(--graf-500); padding: 4px; }
.drawer-body { padding: 22px 26px 60px; }
.drawer-section { margin-bottom: 24px; }
.drawer-section h4 { font-size: 0.72rem; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--graf-500); margin-bottom: 10px; }

/* centered modal (form) */
.modal-center { align-items: center; justify-content: center; }
.modal-box { width: min(480px, 92vw); background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); transform: scale(0.97); transition: transform 0.2s ease; max-height: 88vh; overflow-y: auto; }
.modal-overlay.open .modal-box { transform: scale(1); }
.modal-box-head { padding: 20px 24px; border-bottom: 1px solid var(--hairline); display: flex; justify-content: space-between; align-items: center; }
.modal-box-body { padding: 20px 24px 24px; }

/* ---------- Forms ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 0.78rem; font-weight: 600; margin-bottom: 6px; color: var(--graf-700); }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 12px; border-radius: var(--radius-sm); border: 1px solid var(--hairline);
  font-family: var(--font-body); font-size: 0.88rem; background: var(--off-white); color: var(--graf-900);
}
.field textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); background: var(--white); }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }

/* ---------- Checklist ---------- */
.checklist-item { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--hairline); }
.checklist-item:last-child { border-bottom: none; }
.checklist-item input[type=checkbox] { width: 19px; height: 19px; accent-color: var(--accent); flex-shrink: 0; }
.checklist-item span { font-size: 0.9rem; }
.checklist-item.done span { color: var(--graf-500); text-decoration: line-through; }
.checklist-progress { height: 8px; background: var(--graf-100); border-radius: 999px; overflow: hidden; margin-bottom: 4px; }
.checklist-progress-bar { height: 100%; background: var(--accent); border-radius: 999px; transition: width 0.3s ease; }

/* ---------- Roteiro ---------- */
.roteiro-secao { border: 1px solid var(--hairline); border-radius: var(--radius-md); padding: 16px 18px; margin-bottom: 12px; background: var(--white); }
.roteiro-secao h4 { font-size: 0.95rem; font-weight: 700; margin-bottom: 8px; }
.roteiro-secao p, .roteiro-secao textarea { font-size: 0.88rem; line-height: 1.65; color: var(--graf-700); }

/* ---------- Calendar ---------- */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { text-align: center; font-family: var(--font-mono); font-size: 0.64rem; text-transform: uppercase; color: var(--graf-500); padding: 4px 0; }
.cal-day { min-height: 74px; border: 1px solid var(--hairline); border-radius: var(--radius-sm); padding: 6px; background: var(--white); font-size: 0.72rem; color: var(--graf-300); }
.cal-day .n { font-weight: 700; color: var(--graf-700); }
.cal-day.has-event { background: var(--accent-tint); border-color: var(--accent); }
.cal-day.empty { background: transparent; border: none; }
.cal-event { margin-top: 4px; background: var(--accent); color: var(--white); border-radius: 4px; padding: 2px 5px; font-size: 0.64rem; font-weight: 700; line-height: 1.3; }

/* ---------- Toggle ---------- */
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--hairline); gap: 16px; }
.toggle-row:last-child { border-bottom: none; }
.toggle-row .lbl { font-weight: 600; font-size: 0.9rem; }
.toggle-row .desc { font-size: 0.8rem; color: var(--graf-500); margin-top: 2px; }
.switch { width: 42px; height: 24px; border-radius: 999px; background: var(--graf-100); position: relative; border: none; flex-shrink: 0; }
.switch::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: var(--white); top: 3px; left: 3px; transition: transform 0.2s ease; box-shadow: var(--shadow-sm); }
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(18px); }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--graf-950); color: var(--off-white); padding: 12px 20px; border-radius: var(--radius-sm); font-size: 0.86rem; box-shadow: var(--shadow-lg); z-index: 300; opacity: 0; pointer-events: none; transition: all 0.25s ease; display: flex; align-items: center; gap: 10px; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast .icon { color: var(--ok); }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 40px 20px; color: var(--graf-500); }

/* ---------- Login gate (portal do casal) ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--graf-950); padding: 24px; }
.login-box { width: min(400px, 100%); background: var(--white); border-radius: var(--radius-lg); padding: 34px 30px; box-shadow: var(--shadow-lg); }
.login-eyebrow { font-family: var(--font-mono); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.16em; color: var(--accent); text-align: center; }
.login-title { text-align: center; font-size: 1.3rem; font-weight: 800; margin-top: 8px; margin-bottom: 22px; }
.login-error { font-size: 0.8rem; color: var(--danger); margin-top: 8px; display: none; }
.login-error.show { display: block; }
.login-hint { font-size: 0.74rem; color: var(--graf-500); text-align: center; margin-top: 16px; line-height: 1.5; }

/* ---------- Tabs (portal do casal) ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--hairline); margin-bottom: 24px; overflow-x: auto; }
.tab-btn { padding: 12px 16px; font-size: 0.86rem; font-weight: 600; color: var(--graf-500); background: none; border: none; border-bottom: 2px solid transparent; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.tab-btn.active { color: var(--accent-dark); border-bottom-color: var(--accent); }

/* ---------- Hub (index) ---------- */
.hub-wrap { min-height: 100vh; background: var(--graf-950); display: flex; align-items: center; justify-content: center; padding: 24px; }
.hub-inner { width: min(880px, 100%); text-align: center; }
.hub-eyebrow { font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.2em; color: var(--accent); }
.hub-title { color: var(--off-white); font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 800; margin: 10px 0 8px; }
.hub-sub { color: var(--graf-300); font-size: 0.96rem; max-width: 520px; margin: 0 auto 40px; line-height: 1.6; }
.hub-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 640px) { .hub-cards { grid-template-columns: 1fr; } }
.hub-card {
  background: var(--white); border-radius: var(--radius-lg); padding: 30px 24px; text-align: left;
  border: 1px solid var(--hairline); transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.hub-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.hub-card .icon-wrap { width: 46px; height: 46px; border-radius: var(--radius-md); background: var(--accent-tint); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.hub-card .icon-wrap .icon { color: var(--accent-dark); width: 22px; height: 22px; }
.hub-card h3 { font-size: 1.05rem; font-weight: 800; margin-bottom: 6px; }
.hub-card p { font-size: 0.85rem; color: var(--graf-500); line-height: 1.5; margin-bottom: 16px; }
.hub-card .go { font-size: 0.82rem; font-weight: 700; color: var(--accent-dark); display: flex; align-items: center; gap: 6px; }
.hub-foot { margin-top: 36px; font-size: 0.76rem; color: var(--graf-500); font-family: var(--font-mono); }

/* ---------- Phone mockup (funcionaria-digital) ---------- */
.phone-frame {
  width: 300px; background: #0B0B0B; border-radius: 34px; padding: 10px; box-shadow: var(--shadow-lg); margin: 0 auto;
}
.phone-screen { background: var(--wa-bg); border-radius: 24px; overflow: hidden; height: 560px; display: flex; flex-direction: column; }
.phone-header { background: var(--wa-teal); color: var(--white); padding: 14px 16px; display: flex; align-items: center; gap: 10px; }
.phone-header .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.8rem; }
.phone-header .info .name { font-weight: 700; font-size: 0.88rem; }
.phone-header .info .status { font-size: 0.68rem; opacity: 0.85; }
.phone-body { flex: 1; padding: 14px 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 78%; padding: 8px 11px; border-radius: 8px; font-size: 0.82rem; line-height: 1.4; box-shadow: var(--shadow-sm); opacity: 0; transform: translateY(6px); transition: all 0.25s ease; }
.bubble.show { opacity: 1; transform: translateY(0); }
.bubble.in { background: var(--white); align-self: flex-start; border-top-left-radius: 0; }
.bubble.out { background: var(--wa-bubble-out); align-self: flex-end; border-top-right-radius: 0; }
.typing-dots { align-self: flex-start; background: var(--white); border-radius: 8px; border-top-left-radius: 0; padding: 9px 13px; display: none; gap: 4px; }
.typing-dots.show { display: flex; }
.typing-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--graf-300); animation: blink 1s infinite ease-in-out; }
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.3; } 40% { opacity: 1; } }
.phone-play { display: flex; justify-content: center; margin-top: 18px; }

.scene-tabs { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 24px; }
.scene-tab { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--hairline); background: var(--white); font-size: 0.8rem; font-weight: 600; color: var(--graf-700); display: flex; align-items: center; gap: 7px; }
.scene-tab.active { background: var(--graf-950); color: var(--off-white); border-color: var(--graf-950); }

/* ---------- Misc ---------- */
.muted { color: var(--graf-500); }
.mono { font-family: var(--font-mono); }
.divider { height: 1px; background: var(--hairline); margin: 20px 0; }
.avatar-circle { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-tint); color: var(--accent-dark); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.85rem; flex-shrink: 0; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.stack-sm > * + * { margin-top: 6px; }
.stack-md > * + * { margin-top: 12px; }
