/* Painel da Lumina — CRM */
:root {
  --bg: #f7f2ea; --card: #fffdf9; --ink: #2b2119; --muted: #7d7064; --line: #eadfcf;
  --olive: #3b4732; --olive-2: #2f3a28; --brown: #755137; --caramel: #b07d4a; --gold: #e4c39f;
  --sage: #8a9a6b; --wine: #7a2e3a; --ok: #3f6b3a; --warn: #a8741c; --bad: #a32d2d;
  --r: 14px; --shadow: 0 1px 2px rgba(43,33,25,.04), 0 6px 22px rgba(43,33,25,.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--brown); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; margin: 0; color: var(--ink); }
h1 { font-size: 32px; letter-spacing: .01em; }
h2 { font-size: 22px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }

/* layout */
.app { display: grid; grid-template-columns: var(--sw) 1fr; min-height: 100vh; background: linear-gradient(90deg, var(--olive) var(--sw), transparent var(--sw)); }
html { --sw: 248px; }
.side { background: var(--olive); color: #efe6d6; padding: 22px 16px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; min-width: 0; overflow: visible; }
.side nav, .side .foot { overflow: hidden; }
.side nav a, .side .foot a, .side .foot button { white-space: nowrap; }
.resizer { position: absolute; top: 0; right: -6px; width: 12px; height: 100%; cursor: col-resize; z-index: 5; display: flex; align-items: center; justify-content: center; touch-action: none; }
.resizer i { width: 6px; height: 46px; border-radius: 99px; background: #6b7a5c; border: 2px solid var(--bg); box-shadow: 0 1px 4px rgba(0,0,0,.2); transition: background .15s, height .15s; }
.resizer:hover i, body.resizing .resizer i { background: var(--gold); height: 64px; }
body.resizing { cursor: col-resize; user-select: none; }
.side .brand .mark { display: none; height: 34px; }
.side.mini { padding: 22px 10px; }
.side.mini .t, .side.mini .badge, .side.mini .brand .full { display: none; }
.side.mini .brand .mark { display: block; }
.side.mini .brand { justify-content: center; padding: 4px 0 18px; }
.side.mini nav a { justify-content: center; padding: 11px 0; position: relative; gap: 0; }
.side.mini nav a .badge { display: block; position: absolute; top: 4px; right: 6px; font-size: 9px; padding: 0 5px; }
.side.mini .foot { padding: 10px 0; }
.side.mini .foot a, .side.mini .foot button { justify-content: center; padding: 9px 0; gap: 0; }
.side .brand { display: flex; align-items: center; justify-content: center; padding: 6px 4px 20px; border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: 10px; }
.side .brand:hover { text-decoration: none; }
.side .brand .full { width: 100%; max-width: 190px; height: auto; }
.side nav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; color: #efe6d6; font-weight: 500; }
.side nav a:hover { background: rgba(255,255,255,.07); text-decoration: none; }
.side nav a.on { background: #f3ebdf; color: var(--olive); }
.side nav svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.side .badge { margin-left: auto; background: var(--caramel); color: #fff; border-radius: 99px; font-size: 11px; padding: 1px 8px; }
.side .foot { margin-top: auto; font-size: 12.5px; padding: 10px 0 0; border-top: 1px solid rgba(255,255,255,.1); display: grid; gap: 2px; }
.side .foot a, .side .foot button { color: #d8ccb8; background: none; border: 0; padding: 7px 12px; font: inherit; cursor: pointer; text-align: left; display: flex; align-items: center; gap: 11px; width: 100%; border-radius: 10px; }
.side .foot a:hover, .side .foot button:hover { background: rgba(255,255,255,.07); text-decoration: none; }
.side .foot svg { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.main { padding: 28px 34px 60px; min-width: 0; }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.top .sub { color: var(--muted); margin-top: 2px; }

/* mobile */
.mbar { display: none; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; background: none; }
  .side { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  .resizer { display: none; }
  .side.mini .t, .side.mini .brand .full { display: initial; } .side.mini .brand .mark { display: none; }
  .side.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .mbar { display: flex; align-items: center; justify-content: space-between; background: var(--olive); color: #efe6d6; padding: 12px 16px; position: sticky; top: 0; z-index: 30; }
  .mbar img { height: 28px; }
  .mbar button { background: none; border: 0; color: inherit; font-size: 24px; cursor: pointer; }
  .main { padding: 18px 16px 50px; }
  h1 { font-size: 26px; }
}

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px 20px; min-width: 0; }
.card > h2, .card > .head h2 { margin-bottom: 12px; }
.card .head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card .head h2 { margin: 0; }
.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g21, .g3 { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .g2 { grid-template-columns: 1fr; } .g4 { gap: 10px; } }
.mt { margin-top: 16px; }

.kpi .label { color: var(--muted); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.kpi .value { font-size: 28px; font-weight: 600; margin: 4px 0 2px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi .foot { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.kpi.accent { background: var(--olive); border-color: var(--olive); color: #f3ebdf; }
.kpi.accent .label, .kpi.accent .foot { color: #cfc3ae; }
@media (max-width: 640px) { .kpi .value { font-size: 21px; } .card { padding: 14px; } }
.up { color: var(--ok); font-weight: 600; }
.down { color: var(--bad); font-weight: 600; }
.kpi.accent .up { color: #bfe0a8; } .kpi.accent .down { color: #f2b5ad; }

/* period tabs */
.tabs { display: inline-flex; background: #efe6d8; border-radius: 99px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.tabs a { padding: 6px 14px; border-radius: 99px; color: var(--brown); font-weight: 500; font-size: 13px; }
.tabs a.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.08); text-decoration: none; }

/* tables */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid #f1e9dc; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: #fbf6ee; }
.tbl .r { text-align: right; }
.tbl tfoot td { font-weight: 600; border-top: 2px solid var(--line); }
.scroll { overflow-x: auto; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f1e9dc; align-items: center; }
.list li:last-child { border-bottom: 0; }
.empty { color: var(--muted); padding: 14px 0; text-align: center; }

/* pills */
.pill { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 500; white-space: nowrap; background: #efe6d8; color: var(--brown); }
.pill.awaiting_payment { background: #f5ecd9; color: #8a6418; }
.pill.paid { background: #e3ecd8; color: #3f6b3a; }
.pill.preparing { background: #e6e9f3; color: #3b4f80; }
.pill.shipped { background: #e1eef0; color: #2e6670; }
.pill.delivered { background: #dfe9d9; color: #2d5a28; }
.pill.cancelled, .pill.refunded { background: #f3e1df; color: #8a2e2a; }
.pill.warn { background: #fbecd2; color: #8a5a10; }
.pill.ok { background: #e3ecd8; color: #3f6b3a; }

/* forms & buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 10px; padding: 9px 16px; font: 500 14px "Inter", sans-serif; cursor: pointer; background: var(--brown); color: #fff; text-decoration: none; }
.btn:hover { background: #5a3d28; text-decoration: none; }
.btn.olive { background: var(--olive); } .btn.olive:hover { background: var(--olive-2); }
.btn.ghost { background: transparent; color: var(--brown); border: 1px solid var(--line); }
.btn.ghost:hover { background: #f3ebdf; }
.btn.danger { background: transparent; color: var(--bad); border: 1px solid #ecd2cf; }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.in { width: 100%; border: 1px solid #ddd0bd; background: #fff; border-radius: 9px; padding: 9px 11px; font: 14px "Inter", sans-serif; color: var(--ink); }
.in:focus { outline: 2px solid var(--gold); border-color: var(--caramel); }
textarea.in { resize: vertical; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 500; }
.field .err { color: var(--bad); font-size: 12px; }
.fgrid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.check { display: flex; align-items: center; gap: 8px; }
.search { display: flex; gap: 8px; flex-wrap: wrap; }
.search .in { width: auto; min-width: 220px; flex: 1; }
.cell-in { width: 92px; padding: 6px 8px; text-align: right; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* messages */
.msgs { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.msgs li { padding: 11px 14px; border-radius: 10px; background: #e8efe0; color: #2d5a28; border: 1px solid #d4e2c6; }
.msgs li.warning { background: #fbf0d9; color: #7a5410; border-color: #f0dcb2; }
.msgs li.error { background: #f8e3e1; color: #862222; border-color: #eccac6; }
.msgs li.info { background: #eef0f4; color: #3b4f80; border-color: #d8dde8; }

.chart { position: relative; height: 280px; }
.chart.sm { height: 230px; }
.bar { height: 8px; background: #efe6d8; border-radius: 99px; overflow: hidden; margin-top: 5px; }
.bar i { display: block; height: 100%; background: var(--caramel); border-radius: 99px; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at 30% 20%, #4a5a3f, #2f3a28 70%); padding: 20px; }
.login .box { background: var(--card); border-radius: 18px; padding: 34px 30px; width: min(380px, 100%); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.login .box img { height: 44px; display: block; margin: 0 auto 6px; }
.login .box .tag { text-align: center; font-size: 10px; letter-spacing: .3em; color: var(--caramel); margin-bottom: 22px; }
.login .box .field { margin-bottom: 14px; }
.login .box .btn { width: 100%; justify-content: center; padding: 12px; }

/* dicas */
.tiplist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tiplist li { padding: 10px 14px 10px 38px; border-radius: 10px; position: relative; background: #f6f1e8; line-height: 1.45; }
.tiplist li::before { position: absolute; left: 13px; top: 9px; font-size: 15px; }
.tiplist li.warn { background: #fbf0d9; } .tiplist li.warn::before { content: "⚠️"; }
.tiplist li.info { background: #eef0f4; } .tiplist li.info::before { content: "💡"; }
.tiplist li.ok { background: #eaf1e2; } .tiplist li.ok::before { content: "✅"; }
.tips .head { flex-wrap: wrap; }

/* ações compactas nas linhas */
.rowact { display: inline-flex; align-items: center; gap: 6px; flex-wrap: nowrap; white-space: nowrap; margin: 0; }
.rowact .btn.sm { padding: 5px 10px; gap: 4px; }
.rowact .btn svg, .ibtn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ibtn { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--brown); cursor: pointer; padding: 0; }
.ibtn:hover { background: #f3ebdf; text-decoration: none; }
.ibtn.danger { color: var(--bad); border-color: #ecd2cf; }
.ibtn.danger:hover { background: #f8e3e1; }
.tbl td.num, .tbl td.r.num { white-space: nowrap; }
