/* Toda Charmosa — tokens e componentes compartilhados */
:root {
  --wine: #8a1240;
  --rose: #b3164f;
  --rose-2: #c9245f;
  --rose-soft: #fbe9ef;
  --rose-50: #fdf5f8;
  --gold: #c9973f;
  --gold-2: #e2bd6e;
  --gold-soft: #fbf3e4;
  --ink: #2b1720;
  --muted: #7d6870;
  --line: #efdfe5;
  --bg: #fffafb;
  --card: #ffffff;
  --ok: #1f9d6b;
  --ok-soft: #e3f6ee;
  --warn: #c77a12;
  --warn-soft: #fdf1dc;
  --bad: #d23a3a;
  --bad-soft: #fde6e6;
  --info: #2f6fd1;
  --info-soft: #e5eefc;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px -12px rgba(138, 18, 64, .22);
  --shadow-sm: 0 2px 10px -4px rgba(138, 18, 64, .18);
  --f-title: 'Playfair Display', Georgia, serif;
  --f-script: 'Great Vibes', cursive;
  --f-body: 'Poppins', system-ui, -apple-system, Segoe UI, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--f-body); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--f-title); margin: 0 0 .4em; line-height: 1.2; color: var(--ink); }
.script { font-family: var(--f-script); font-weight: 400; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.flex { display: flex; gap: .6rem; align-items: center; }
.flex.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; }
.mt { margin-top: 1rem; } .mb { margin-bottom: 1rem; }

/* botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; border: 1px solid transparent; border-radius: 999px; padding: .62rem 1.2rem; font-weight: 500; font-size: .92rem; transition: .18s; background: var(--rose); color: #fff; white-space: nowrap; }
.btn:hover { background: var(--wine); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn.gold { background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #3b2208; }
.btn.gold:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; color: var(--rose); border-color: var(--rose); }
.btn.ghost:hover { background: var(--rose-soft); }
.btn.light { background: var(--rose-soft); color: var(--wine); }
.btn.light:hover { background: #f6d5e0; }
.btn.white { background: #fff; color: var(--wine); }
.btn.wa { background: #25d366; color: #fff; }
.btn.wa:hover { background: #1da851; }
.btn.danger { background: var(--bad); }
.btn.danger:hover { background: #a92626; }
.btn.ok { background: var(--ok); }
.btn.sm { padding: .38rem .8rem; font-size: .82rem; }
.btn.xs { padding: .22rem .55rem; font-size: .75rem; }
.btn.block { width: 100%; }
.btn.lg { padding: .85rem 1.6rem; font-size: 1rem; }
.icon-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 50%; border: 0; background: transparent; color: var(--ink); position: relative; transition: .15s; }
.icon-btn:hover { background: var(--rose-soft); color: var(--rose); }
.dot-badge { position: absolute; top: 1px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--rose); color: #fff; font-size: .68rem; font-weight: 600; display: grid; place-items: center; border: 2px solid #fff; }

/* formulários */
.field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .85rem; }
.field label { font-size: .8rem; font-weight: 500; color: var(--muted); }
.input, .field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .62rem .8rem; font: inherit; font-size: .92rem; background: #fff; color: var(--ink); transition: .15s; }
.field textarea { min-height: 90px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--rose); box-shadow: 0 0 0 3px rgba(179, 22, 79, .12); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 1rem; }
.span-2 { grid-column: span 2; }
.check { display: flex; align-items: center; gap: .5rem; font-size: .9rem; cursor: pointer; margin-bottom: .6rem; }
.check input { accent-color: var(--rose); width: 17px; height: 17px; }
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #ddcfd4; border-radius: 24px; transition: .2s; cursor: pointer; }
.switch span::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--rose); }
.switch input:checked + span::before { transform: translateX(18px); }

/* badges */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .18rem .6rem; border-radius: 999px; font-size: .72rem; font-weight: 600; background: var(--rose-soft); color: var(--wine); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.gold { background: var(--gold-soft); color: #8b6215; }
.badge.gray { background: #f0eaec; color: #6b5a60; }

/* cartões */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; box-shadow: var(--shadow-sm); }

/* modal */
.modal-bg { position: fixed; inset: 0; background: rgba(43, 23, 32, .55); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 1000; padding: 16px; animation: fade .2s; }
.modal { background: #fff; border-radius: 18px; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .45); animation: pop .22s ease-out; }
.modal.lg { width: min(860px, 100%); }
.modal.xl { width: min(1080px, 100%); }
.modal.sm { width: min(420px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 1.1rem 1.3rem; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 2; }
.modal-head h3 { margin: 0; font-size: 1.25rem; }
.modal-body { padding: 1.3rem; }
.modal-foot { display: flex; justify-content: flex-end; gap: .6rem; padding: 1rem 1.3rem; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: #fff; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(14px) scale(.98); opacity: 0; } }

/* toasts */
.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: .6rem; max-width: min(380px, calc(100vw - 32px)); }
.toast { background: #fff; border-left: 4px solid var(--rose); border-radius: 12px; padding: .8rem 1rem; box-shadow: var(--shadow); display: flex; gap: .7rem; align-items: flex-start; animation: slidein .25s ease-out; font-size: .9rem; }
.toast.ok { border-color: var(--ok); } .toast.ok i { color: var(--ok); }
.toast.bad { border-color: var(--bad); } .toast.bad i { color: var(--bad); }
.toast.warn { border-color: var(--warn); } .toast.warn i { color: var(--warn); }
.toast i { margin-top: 3px; color: var(--rose); }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } }

/* tabelas */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; padding: .7rem .8rem; border-bottom: 1px solid var(--line); background: var(--rose-50); white-space: nowrap; }
.tbl td { padding: .7rem .8rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: #fffbfc; }
.empty { text-align: center; padding: 2.2rem 1rem; color: var(--muted); }
.empty i { font-size: 2rem; color: var(--gold); margin-bottom: .5rem; display: block; }

@media (max-width: 720px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .toasts { left: 16px; right: 16px; bottom: 16px; }
}
@media print {
  .no-print { display: none !important; }
}
/* Operational feedback and accessibility */
.save-overlay { position:fixed; inset:0; z-index:10000; display:grid; place-items:center; background:rgba(255,255,255,.88); color:#691337; font:600 1.1rem system-ui; cursor:wait; }
:focus-visible { outline:3px solid #9b184c; outline-offset:3px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration:.01ms !important; transition-duration:.01ms !important; scroll-behavior:auto !important; } }
