/* NossoSim Admin — identidade visual inspirada nos sites de casal do casar.com
   (Cinzel nos títulos, Dancing Script na marca, Lato no texto, Quicksand nos rótulos) */
:root {
  /* Identidade visual NossoSim — "Nossa Lista" */
  --bg: #fbf7f0;            /* creme */
  --surface: #ffffff;
  --text: #5e4c47;
  --text-strong: #3a2c29;
  --muted: #9b8781;
  --border: #ecdcd3;
  --focus: #eba095;
  --primary: #b83432;       /* vermelho */
  --primary-dark: #962a28;
  --gold: #c38c42;          /* dourado */
  --gold-dark: #a7732f;
  --rose: #eba095;          /* rosa */
  --star: #eb8d84;          /* coral da estrela */
  --blush: #f0cfc4;
  --danger: #b83432;
  --success: #4f8a6a;
  --soft: #b834321a;
  --shadow: 0 6px 24px rgba(120, 50, 40, .08);
  --radius: 8px;
  --font-title: "Fraunces", Georgia, serif;
  --font-script: "Fraunces", Georgia, serif;
  --font-body: "Jost", sans-serif;
  --font-label: "Jost", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--font-title); color: var(--text-strong); font-weight: 500; letter-spacing: 0; margin: 0; }
.hidden { display: none !important; }

/* ---------- marca ---------- */
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand img { height: 40px; width: auto; display: block; }
.brand-sub { font-family: var(--font-label); font-size: 12px; letter-spacing: .4em; text-transform: uppercase; color: var(--text-strong); }
.star { display: inline-block; width: 1em; height: 1em; color: var(--star); vertical-align: middle; }
.tagline { font-family: var(--font-label); font-size: 13px; letter-spacing: .32em; text-transform: uppercase; line-height: 2.1; }
.rule { width: 70px; height: 2px; background: var(--primary); margin: 18px auto; border: 0; }

/* ---------- formulários ---------- */
.form-group { margin-bottom: 18px; }
.form-group label, .label {
  display: block;
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text-strong);
  font: inherit;
  transition: border-color .25s, box-shadow .25s;
}
textarea.form-control { height: auto; min-height: 110px; padding: 12px 14px; resize: vertical; }
.form-control:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px var(--soft); }
.form-control[readonly] { background: #f7f0ea; color: var(--muted); }
.form-hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.form-row { display: grid; gap: 0 16px; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); }
.input-prefix { display: flex; align-items: stretch; }
.input-prefix span {
  display: flex; align-items: center; padding: 0 12px; background: #f7f0ea;
  border: 1px solid var(--border); border-right: 0; border-radius: var(--radius) 0 0 var(--radius);
  color: var(--muted); font-size: 14px; white-space: nowrap;
}
.input-prefix .form-control { border-radius: 0 var(--radius) var(--radius) 0; }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 22px;
  border: 1px solid transparent; border-radius: 2px;
  font-family: var(--font-body); font-size: 14px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  cursor: pointer; text-decoration: none;
  transition: all .2s ease-in-out;
}
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover:not(:disabled) { background: var(--gold-dark); }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover:not(:disabled) { background: var(--soft); }
.btn-link { background: none; color: var(--primary); padding: 0 8px; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 12px; }

.icon-btn {
  width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; background: transparent; color: var(--primary); cursor: pointer;
  transition: background .2s; position: relative;
}
.icon-btn:hover { background: var(--soft); }
.icon-btn.danger { color: var(--danger); }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn .badge {
  position: absolute; top: 0; right: -2px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--rose); color: #fff; font-size: 10.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- alertas / toast ---------- */
.alert { padding: 12px 14px; border-radius: var(--radius); font-size: 14px; margin-bottom: 16px; }
.alert-error { background: #fbeceb; color: var(--danger); border: 1px solid var(--blush); }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: var(--text-strong); color: #fff; padding: 12px 22px; border-radius: 30px;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: all .3s; z-index: 300;
  max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--danger); }
.toast { background: var(--text-strong); }

/* =========================================================
   LOGIN
   ========================================================= */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
/* painel da marca: vermelho com estrela e slogan, como no brand board */
.login-hero {
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center;
  padding: 48px; background: var(--primary); color: #fff; text-align: center;
}
.login-hero .star { width: 34px; height: 34px; color: var(--rose); }
.login-hero .tagline { font-size: 15px; margin-top: 26px; }
.login-hero .rule { background: rgba(255,255,255,.8); margin-top: 26px; }
.login-hero .deco { position: absolute; color: var(--rose); opacity: .35; }
.login-hero .deco.a { width: 120px; height: 120px; top: 8%; left: 8%; }
.login-hero .deco.b { width: 70px; height: 70px; bottom: 12%; right: 12%; color: var(--gold); opacity: .5; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.login-card { width: 100%; max-width: 400px; }
.login-card .logo { display: block; width: 230px; max-width: 70%; margin: 0 auto; }
.login-card .brand-sub { text-align: center; margin: 20px 0 0; font-size: 15px; }
.login-card .rule { margin: 18px auto 30px; }

@media (max-width: 860px) {
  .login-page { grid-template-columns: 1fr; }
  .login-hero { order: 2; padding: 40px 24px; }
  .login-hero .tagline { font-size: 12.5px; }
  .login-hero .deco { display: none; }
}

/* =========================================================
   APP (layout autenticado)
   ========================================================= */
.topbar {
  position: sticky; top: 0; z-index: 50; height: 64px;
  display: flex; align-items: center; gap: 16px; padding: 0 24px;
  background: rgba(255,255,255,.96); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}
.topbar .brand img { height: 42px; }
.topbar .spacer { flex: 1; }
.tenant-switch { display: flex; align-items: center; gap: 8px; }
.tenant-switch label { font-family: var(--font-label); font-weight: 700; font-size: 13px; white-space: nowrap; }
.tenant-switch .form-control { height: 38px; min-width: 200px; }
.tenant-pill {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw;
  font-family: var(--font-label); font-weight: 700; font-size: 13px;
  padding: 7px 14px; border-radius: 20px; background: var(--soft); color: var(--text-strong);
}
.user-box { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.user-box .avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--gold); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.user-box small { display: block; font-size: 11px; color: var(--muted); letter-spacing: .08em; }
.menu-toggle { display: none; }

.layout { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 64px); }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); padding: 24px 14px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 4px;
  border-radius: var(--radius); color: var(--text); text-decoration: none;
  font-family: var(--font-label); font-weight: 700; font-size: 15px; transition: all .2s;
}
.sidebar nav a svg { width: 20px; height: 20px; flex: none; }
.sidebar nav a:hover { background: var(--soft); }
.sidebar nav a.active { background: var(--primary); color: #fff; }
.sidebar .sidebar-foot { margin-top: 24px; padding: 16px; border-top: 1px solid var(--border); font-size: 13px; }

.content { padding: 32px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { font-size: 26px; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
.card-body { padding: 24px; }
.card + .card { margin-top: 24px; }
.card h2 { font-size: 17px; margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
.card h2::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty svg { width: 48px; height: 48px; color: var(--gold); margin-bottom: 10px; }

/* ---------- filtros / estatísticas ---------- */
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .form-control { height: 40px; max-width: 280px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.stats > .card + .card { margin-top: 0; }
.stat { padding: 18px 20px; }
.stat .label { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.stat .value { font-family: var(--font-title); font-size: 22px; color: var(--text-strong); margin-top: 4px; }

/* ---------- tabela ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--border);
  font-family: var(--font-label); font-weight: 700; font-size: 12.5px;
  text-transform: uppercase; letter-spacing: .06em; color: var(--muted); white-space: nowrap;
}
.table td { padding: 12px 16px; border-bottom: 1px solid #f3e9e2; vertical-align: middle; color: var(--text-strong); }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fdf9f4; }
.table .num { text-align: right; white-space: nowrap; }
.table .center { text-align: center; }
.table .acoes { text-align: right; white-space: nowrap; }
.thumb { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; background: #f3ebe4; display: block; }
.prod-cell { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.prod-cell strong { font-weight: 700; }
.progress { height: 6px; border-radius: 3px; background: #f3ebe4; overflow: hidden; margin-top: 6px; width: 90px; }
.progress > div { height: 100%; background: var(--gold); }

.tag {
  display: inline-block; padding: 4px 10px; border-radius: 20px;
  font-family: var(--font-label); font-weight: 700; font-size: 11.5px; letter-spacing: .05em; white-space: nowrap;
}
.tag-ok { background: #e3f3ec; color: var(--success); }
.tag-off { background: #f1f2f4; color: #8a8f96; }
.tag-wait { background: #fbf0dc; color: var(--gold-dark); }
.tag-bad { background: #fbe3df; color: var(--primary); }
.muted { color: var(--muted); }
.alert-warn { background: #fbf3e4; color: #7a5a1f; border: 1px solid #f0dcb2; }
.alert code, .detail-row code { font-size: 12.5px; background: rgba(0,0,0,.05); padding: 1px 5px; border-radius: 4px; word-break: break-all; }
.giver-pay { margin: 0 0 8px; font-size: 12.5px; }
.detail-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.detail-valor { font-family: var(--font-title); font-size: 24px; color: var(--text-strong); }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 28px; }
.detail-grid h4 { margin: 0 0 8px; font-family: var(--font-label); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.detail-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid #f3e9e2; font-size: 14px; }
.detail-row span { color: var(--muted); }
.detail-row strong { font-weight: 500; color: var(--text-strong); text-align: right; min-width: 0; overflow-wrap: anywhere; }
.detail-msg { margin: 12px 0 0; padding: 10px 14px; background: var(--bg); border-left: 3px solid var(--rose); border-radius: 0 8px 8px 0; font-style: italic; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; white-space: nowrap; }
.check input { width: 17px; height: 17px; accent-color: var(--primary); }
/* Recebidos: mural de presentes e mensagens */
.recebidos { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; align-items: start; }
.recebidos .card + .card { margin-top: 0; }
.recebido { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.recebido-head { display: flex; align-items: center; gap: 12px; }
.recebido-head .avatar {
  flex: none; width: 44px; height: 44px; border-radius: 50%; background: #fbe3df; color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-family: var(--font-title); font-size: 17px;
}
.recebido-quem { flex: 1; min-width: 0; }
.recebido-quem h3 { font-size: 16px; overflow-wrap: anywhere; }
.recebido-quem .muted { font-size: 12.5px; }
.recebido-valor-box { text-align: right; }
.recebido-valor-box small { display: block; font-size: 11.5px; }
.recebido-valor { font-family: var(--font-title); font-size: 17px; color: var(--text-strong); white-space: nowrap; }
.recebido-msg {
  margin: 0; padding: 14px 16px; background: var(--bg); border-left: 3px solid var(--rose); border-radius: 0 10px 10px 0;
  font-family: var(--font-title); font-style: italic; font-size: 16px; line-height: 1.55; color: var(--text-strong);
  white-space: pre-line; overflow-wrap: anywhere;
}
.recebido-msg.vazio { font-family: var(--font-body); font-size: 13.5px; color: var(--muted); border-left-color: var(--border); }
.recebido-produto { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.recebido-produto .thumb { width: 46px; height: 46px; }
.recebido-produto strong { color: var(--text-strong); margin-right: 6px; }
.recebido-produto .muted { font-size: 12.5px; margin-top: 2px; }
.recebido-contato { display: flex; flex-wrap: wrap; gap: 4px 16px; padding-top: 12px; border-top: 1px solid #f3e9e2; font-size: 13px; }
.recebido-contato a { text-decoration: none; overflow-wrap: anywhere; }
/* Financeiro — números em sans (Jost); colunas com algarismos tabulares */
.fin .stat .value, .fin-hero-valor { font-family: var(--font-body); font-weight: 600; letter-spacing: -.01em; }
.fin-hero { padding: 26px 28px; margin-bottom: 24px; }
.fin-hero .label { margin: 0; font-family: var(--font-label); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.fin-hero-valor { font-size: 52px; line-height: 1.1; color: var(--text-strong); margin: 6px 0 4px; }
.fin-hero p:last-child { margin: 0; }
.fin-stats { margin-bottom: 24px; }
.stat-sub { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
.fin-periodo { height: 44px; width: auto; min-width: 180px; }
.fin-casal {
  border: 0; padding: 0; background: none; cursor: pointer; text-align: left;
  font: inherit; font-weight: 700; color: var(--primary); text-decoration: underline; text-underline-offset: 3px;
}
.fin-casal:hover { color: var(--primary-dark); }
.fin-tabela td:first-child { min-width: 200px; }
.fin-cell small { display: block; margin-top: 2px; }
.fin-tabela tfoot td[data-label="Lista atingida"]:empty { padding: 0; }
.fin-meios { margin-bottom: 24px; }
.fin-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.fin-bars li { display: grid; grid-template-columns: 170px 1fr 190px; align-items: center; gap: 14px; font-size: 14px; }
.fin-bar-rotulo { color: var(--text-strong); }
.fin-bar-track { height: 10px; border-radius: 5px; background: #f6dedb; overflow: hidden; }
.fin-bar { display: block; height: 100%; min-width: 4px; border-radius: 5px; background: var(--primary); }
.fin-bar-valor { white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.fin-casais-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-bottom: 8px; }
.fin-casais-head h2 { flex: 1; margin: 0; }
.fin-casais-head .form-control { width: auto; height: 38px; }
.fin-tabela .num, .fin-tabela td small { font-variant-numeric: tabular-nums; }
.fin-tabela tfoot td { border-top: 2px solid var(--border); background: #fdf9f4; color: var(--text-strong); }
.fin-meter { width: 110px; height: 8px; border-radius: 4px; background: #f6dedb; overflow: hidden; margin-bottom: 4px; }
.fin-meter span { display: block; height: 100%; border-radius: 4px; background: var(--primary); }
/* Filtro de categorias (chips) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text-strong);
  font: inherit; font-size: 13.5px; cursor: pointer; transition: background .15s, border-color .15s, color .15s;
}
.chip span { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chip:hover { border-color: var(--focus); }
.chip:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.chip.ativo { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip.ativo span { color: rgba(255,255,255,.85); }
.chip-vazio { border-style: dashed; }
.tag-cat { background: #f6ead7; color: var(--gold-dark); margin-top: 4px; font-size: 11px; }
/* Seções liga/desliga do Site (cerimônia / recepção) */
.secao-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.secao-head h2 { margin: 0; flex: 1; }
.secao-campos.desligada > * { display: none; }
.secao-campos.desligada::before {
  content: "Esta seção está oculta no site dos convidados. Ligue \"Exibir no site\" para mostrar e editar.";
  display: block; padding: 14px 16px; border: 1px dashed var(--border); border-radius: var(--radius);
  color: var(--muted); font-size: 14px;
}
.sub-titulo { font-size: 15px; margin: 26px 0 14px; color: var(--text-strong); }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text-strong); white-space: nowrap; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-trilho { position: relative; width: 42px; height: 24px; border-radius: 12px; background: #d9cdc6; transition: background .2s; flex: none; }
.switch-trilho::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.switch input:checked + .switch-trilho { background: var(--primary); }
.switch input:checked + .switch-trilho::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-trilho { outline: 2px solid var(--primary); outline-offset: 2px; }
/* Login: esqueci minha senha / redefinição */
.login-link { text-align: center; margin: 16px 0 0; }
.link-btn { border: 0; background: none; padding: 4px; color: var(--primary); font: inherit; font-size: 14px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.login-sub { font-size: 19px; text-align: center; margin-bottom: 8px; }
.alert-ok { background: #e8f4ee; color: #2f6b4f; border: 1px solid #c7e3d4; }
a.avatar { text-decoration: none; }
/* Minha conta */
.conta-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 24px; align-items: start; }
.conta-grid .card + .card { margin-top: 0; }
.sidebar nav a.menu-conta { margin-top: 18px; }
.sidebar nav a.menu-conta::before { content: ""; position: absolute; left: 16px; right: 16px; top: -10px; height: 1px; background: var(--border); }
.sidebar nav a { position: relative; }
/* Compartilhar site */
.share-link { display: flex; gap: 8px; }
.share-link .form-control { flex: 1; min-width: 0; }
.share-opcoes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.share-opcoes .btn { flex: 1; min-width: 120px; }
/* Comissão no cadastro de presentes */
.comissao-box { margin: 20px 0 0; padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius); }
.comissao-box legend { padding: 0 6px; font-family: var(--font-label); font-weight: 700; font-size: 14px; color: var(--text-strong); }
.comissao-opcoes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.comissao-opcao { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; font-size: 14px; line-height: 1.4; }
.comissao-opcao small { color: var(--muted); }
.comissao-opcao input { margin-top: 3px; accent-color: var(--primary); }
.comissao-opcao:has(input:checked) { border-color: var(--primary); background: #fdf3f1; }
.simulacao { width: 100%; margin: 14px 0 6px; border-collapse: collapse; font-size: 14px; }
.simulacao td { padding: 6px 0; border-bottom: 1px solid #f3e9e2; color: var(--text); }
.simulacao td:last-child { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-strong); }
.simulacao .sim-total td { border-bottom: 0; font-weight: 700; color: var(--text-strong); }
.valores-titulo { margin: 22px 0 4px; font-family: var(--font-label); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tag-admin { background: #f6ead7; color: var(--gold-dark); }
.tag-casal { background: #fbe3df; color: var(--primary); }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200; background: rgba(58, 44, 41, .5);
  display: flex; align-items: center; justify-content: center; padding: 16px;
  opacity: 0; transition: opacity .2s;
}
.modal-backdrop.show { opacity: 1; }
.modal {
  background: #fff; border-radius: 12px; width: 100%; max-width: 560px; max-height: calc(100vh - 32px);
  display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.2);
  transform: translateY(12px); transition: transform .2s;
}
.modal.lg { max-width: 760px; }
.modal-backdrop.show .modal { transform: none; }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 18px; }
.modal-body { padding: 24px; overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--border); flex-wrap: wrap; }

.giver { display: flex; gap: 16px; padding: 18px 0; border-bottom: 1px solid #f3e9e2; }
.giver:first-child { padding-top: 0; }
.giver:last-child { border-bottom: 0; padding-bottom: 0; }
.giver .avatar {
  flex: none; width: 46px; height: 46px; border-radius: 50%; background: var(--soft);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-title); color: var(--text-strong); font-size: 18px;
}
.giver-body { flex: 1; min-width: 0; }
.giver h4 { margin: 0; font-size: 16px; color: var(--text-strong); }
.giver .meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13.5px; margin: 4px 0 8px; }
.giver .meta a { text-decoration: none; }
.giver blockquote {
  margin: 0; padding: 10px 14px; background: var(--bg); border-left: 3px solid var(--rose);
  border-radius: 0 8px 8px 0; font-style: italic; color: var(--text-strong);
}
.giver .qtd { margin-left: auto; text-align: right; white-space: nowrap; font-size: 13px; }
.giver .qtd strong { display: block; font-family: var(--font-title); font-size: 16px; color: var(--text-strong); }

/* ---------- site ---------- */
.site-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.site-aside { position: sticky; top: 88px; }
/* Campo de foto: o wrapper é um container, então o layout se adapta à largura da COLUNA
   (ex.: duas fotos lado a lado), não só à largura da tela */
.photo-wrap { container-type: inline-size; }
.photo-field { display: flex; gap: 16px; align-items: flex-start; }
.photo-preview {
  flex: none; width: 110px; height: 110px; border-radius: 10px; border: 1px dashed var(--border);
  background: #f7f0ea center/cover no-repeat; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 12px; text-align: center;
}
.photo-preview.round { border-radius: 50%; }
.photo-preview.wide { width: 160px; }
.photo-field .inputs { flex: 1; min-width: 0; }
.photo-preview { position: relative; overflow: hidden; cursor: pointer; transition: border-color .2s, box-shadow .2s; }
.photo-preview:hover, .photo-preview:focus-visible { border-color: var(--focus); outline: none; box-shadow: 0 0 0 3px var(--soft); }
.photo-preview.dragging { border: 2px dashed var(--primary); background-color: #fbeceb; }
.photo-placeholder { padding: 8px; pointer-events: none; }
.photo-progress { position: absolute; left: 8px; right: 8px; bottom: 8px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.85); overflow: hidden; }
.photo-progress > div { height: 100%; width: 5%; background: var(--primary); transition: width .2s; }
.photo-preview.has-image { border-style: solid; border-color: var(--border); }
.photo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.photo-actions .btn { white-space: nowrap; }
.photo-field .form-hint { line-height: 1.45; }
@container (max-width: 400px) {
  .photo-field { flex-direction: column; align-items: stretch; gap: 12px; }
  .photo-preview { align-self: flex-start; }
  .photo-preview.wide { width: 100%; height: 150px; }
  .photo-actions .btn[data-escolher] { flex: 1; }
}
.photo-or { display: flex; align-items: center; gap: 10px; margin: 10px 0 8px; font-size: 12.5px; color: var(--muted); }
.photo-or::before, .photo-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.map-frame { width: 100%; height: 240px; border: 0; border-radius: 10px; background: #f3ebe4; display: block; }
.link-box { word-break: break-all; padding: 12px 14px; border-radius: var(--radius); background: var(--soft); font-size: 14px; margin-bottom: 14px; }
.cep-status { font-size: 12.5px; margin-top: 4px; min-height: 18px; }

/* ---------- responsivo ---------- */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-grid { grid-template-columns: 1fr; }
  .site-aside { position: static; }
}
@media (max-width: 860px) {
  .topbar { padding: 0 12px; gap: 10px; }
  .menu-toggle { display: inline-flex; }
  .user-box .info, .tenant-switch label { display: none; }
  .tenant-switch .form-control { min-width: 0; max-width: 160px; }
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: 64px; left: 0; bottom: 0; width: 260px; z-index: 40;
    transform: translateX(-100%); transition: transform .25s; box-shadow: var(--shadow);
  }
  body.menu-open .sidebar { transform: none; }
  body.menu-open::after { content: ""; position: fixed; inset: 64px 0 0; background: rgba(58,44,41,.35); z-index: 30; }
  .content { padding: 20px 16px; }
  .page-head h1 { font-size: 21px; }
  .form-row { grid-template-columns: 1fr; }
  .table-responsive thead { display: none; }
  .table-responsive tr { display: block; padding: 12px 4px; border-bottom: 1px solid var(--border); }
  .table-responsive td { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 0; padding: 6px 12px; text-align: right; }
  .table-responsive td::before { content: attr(data-label); font-family: var(--font-label); font-weight: 700; font-size: 12px; color: var(--muted); text-transform: uppercase; text-align: left; }
  .table-responsive td.no-label::before { display: none; }
  .table-responsive .prod-cell { min-width: 0; text-align: left; }
  .table-responsive .acoes { justify-content: flex-end; }
  .detail-grid { grid-template-columns: 1fr; }
  .conta-grid { grid-template-columns: 1fr; }
  .share-link { flex-direction: column; }
  .comissao-opcoes { grid-template-columns: 1fr; }
  .recebidos { grid-template-columns: 1fr; }
  .fin-hero-valor { font-size: 40px; }
  .fin-bars li { grid-template-columns: 1fr auto; }
  .fin-bar-track { grid-column: 1 / -1; grid-row: 2; }
  .fin-tabela tfoot tr { display: block; padding: 12px 4px; }
  .fin-tabela tfoot td { display: flex; justify-content: space-between; border: 0; padding: 6px 12px; }
  .fin-tabela tfoot td:empty { display: none; }
  .fin-cell { text-align: right; }
  .fin-cell .fin-meter { margin-left: auto; }
  .fin-meter { margin-left: auto; }
  .giver { flex-wrap: wrap; }
  .giver-body { flex-basis: calc(100% - 62px); }
  .giver .meta { flex-direction: column; }
  .giver .qtd { margin-left: 62px; text-align: left; display: flex; gap: 10px; align-items: baseline; }
}
@media (max-width: 520px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px; }
  .stat .value { font-size: 18px; }
  .topbar .brand img { height: 34px; }
  .photo-field { flex-direction: column; }
  .photo-preview.wide { width: 100%; }
}
