/* ==========================================================================
   Gestão Kola — Entrelinhas
   ========================================================================== */
:root {
  --paper: #F3EFE8;
  --paper-2: #F8F5F0;
  --card: #FFFDF9;
  --sand: #E8E0D5;
  --parch: #DED3C3;
  --taupe: #938577;
  --ink: #292724;
  --ink-soft: #5a544e;
  --wine: #633D3C;
  --wine-2: #7a4b49;
  --wine-soft: #f1e6e3;
  --green: #4E6B4A;
  --line: #E3DACE;
  --line-2: #d6ccbf;
  --danger: #9A3B3B;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --radius: 14px;
  --ease: cubic-bezier(.22, .8, .26, 1);
  --shadow: 0 1px 2px rgba(41, 39, 36, .04), 0 12px 30px -18px rgba(41, 39, 36, .25);
  --side: 256px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 14px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; margin: 0; letter-spacing: -.005em; }
p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
::selection { background: var(--wine); color: #fff; }
:focus-visible { outline: 2px solid rgba(99, 61, 60, .45); outline-offset: 2px; }
.ico { width: 18px; height: 18px; flex: 0 0 auto; }
.eyebrow { font-size: 10.5px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--wine); margin-bottom: 8px; }
.muted { color: var(--taupe); }
.small { font-size: 12px; }
.serif { font-family: var(--serif); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Botões ------------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid transparent;
  font-size: 13px; font-weight: 500; letter-spacing: .01em; white-space: nowrap;
  background: var(--card); color: var(--ink); border-color: var(--line-2);
  transition: background .25s, color .25s, border-color .25s, transform .2s var(--ease), box-shadow .25s;
}
.btn:hover { border-color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn .ico { width: 16px; height: 16px; }
.btn--wine { background: var(--wine); border-color: var(--wine); color: #fff; box-shadow: 0 8px 18px -10px rgba(99, 61, 60, .8); }
.btn--wine:hover { background: var(--ink); border-color: var(--ink); }
.btn--ink { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn--ink:hover { background: var(--wine); border-color: var(--wine); }
.btn--soft { background: transparent; }
.btn--ghost { background: transparent; border-color: transparent; }
.btn--ghost:hover { background: var(--sand); border-color: transparent; }
.btn--danger { color: var(--danger); border-color: #e6cfcf; background: transparent; }
.btn--danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn--sm { height: 34px; padding: 0 14px; font-size: 12.5px; }
.btn--xs { height: 28px; padding: 0 11px; font-size: 12px; }
.btn--block { width: 100%; height: 50px; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; justify-content: space-between; padding: 0 22px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icon-btn { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 50%; border: 0; background: transparent; color: var(--ink-soft); transition: background .2s, color .2s; }
.icon-btn:hover { background: var(--sand); color: var(--ink); }
.icon-btn--danger:hover { background: #f3e1e1; color: var(--danger); }
.link { color: var(--wine); border-bottom: 1px solid rgba(99, 61, 60, .3); transition: border-color .2s; }
.link:hover { border-color: var(--wine); }

/* Estrutura --------------------------------------------------------------- */
.app { display: flex; min-height: 100vh; }
.side {
  position: fixed; inset: 0 auto 0 0; z-index: 40; width: var(--side);
  display: flex; flex-direction: column; background: var(--ink); color: #e9e2d8;
  padding: 26px 16px 18px;
}
.side__brand { display: grid; justify-items: center; line-height: 1; padding: 6px 0 26px; border-bottom: 1px solid rgba(255, 255, 255, .08); margin-bottom: 18px; }
.side__brand span { font: 500 19px/1 var(--serif); letter-spacing: .16em; color: #fff; }
.side__brand i { color: #c98f8b; font-style: normal; font-size: 11px; margin: 5px 0 3px; }
.side__brand small { font: italic 13px var(--serif); color: #b9ada0; }
.side__nav { flex: 1; overflow-y: auto; display: grid; align-content: start; gap: 2px; scrollbar-width: thin; }
.side__group { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: #8a8076; margin: 18px 12px 8px; }
.side__nav a, .side__foot a {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: #d5ccc1; font-size: 13.5px; transition: background .2s, color .2s;
}
.side__nav a:hover, .side__foot a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side__nav a.is-active { background: rgba(255, 255, 255, .09); color: #fff; }
.side__nav a.is-active::before { content: ""; position: absolute; left: -16px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: #c98f8b; }
.side__count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #c98f8b; color: var(--ink); font-size: 11px; display: grid; place-items: center; }
.side__foot { border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 12px; display: grid; gap: 2px; }
.side__foot a { font-size: 12.5px; color: #a99d91; }
.side-scrim { display: none; }

.main { flex: 1; margin-left: var(--side); min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.top {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 18px;
  padding: 16px clamp(18px, 3vw, 40px); background: rgba(243, 239, 232, .88); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(41, 39, 36, .06);
}
.top__menu { display: none; border: 0; background: none; padding: 6px; }
.top__title { flex: 1; min-width: 0; }
.top__title h1 { font-size: 30px; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top__crumb { font-size: 11.5px; color: var(--taupe); margin-bottom: 2px; }
.top__crumb a:hover { color: var(--wine); }
.top__actions { display: flex; align-items: center; gap: 12px; }
.user { position: relative; }
.user__btn { display: flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); }
.user__meta { display: grid; text-align: left; line-height: 1.15; }
.user__meta strong { font-weight: 500; font-size: 13px; }
.user__meta small { font-size: 11px; color: var(--taupe); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: var(--wine); color: #fff; font: 500 13px var(--sans); letter-spacing: .04em; flex: 0 0 auto; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--lg { width: 64px; height: 64px; font-size: 20px; }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px; padding: 6px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
  opacity: 0; transform: translateY(-6px); pointer-events: none; transition: opacity .2s, transform .2s var(--ease);
}
[data-dropdown].is-open .dropdown { opacity: 1; transform: none; pointer-events: auto; }
.dropdown a, .dropdown button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 12px; border: 0; border-radius: 8px; background: none; font-size: 13px; text-align: left; }
.dropdown a:hover, .dropdown button:hover { background: var(--paper); }
.content { flex: 1; padding: clamp(18px, 3vw, 36px) clamp(18px, 3vw, 40px) 50px; }
.foot { display: flex; justify-content: space-between; padding: 18px clamp(18px, 3vw, 40px); font: italic 13px var(--serif); color: var(--taupe); border-top: 1px solid var(--line); }

/* Avisos ----------------------------------------------------------------- */
.toasts { position: fixed; right: 22px; top: 82px; z-index: 60; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.toast {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px 14px 18px; border-radius: 12px;
  background: var(--ink); color: #f3efe8; box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .45); font-size: 13.5px;
  animation: toast-in .5s var(--ease);
}
.toast span { flex: 1; }
.toast button { border: 0; background: none; color: inherit; opacity: .6; font-size: 18px; line-height: 1; }
.toast--ok { border-left: 3px solid #9cc49a; }
.toast--error { border-left: 3px solid #e59a93; }
.toast--info { border-left: 3px solid #d9c3a3; }
.toast.is-leaving { opacity: 0; transform: translateX(20px); transition: .4s var(--ease); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } }
.alert { padding: 12px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 16px; background: var(--sand); }
.alert--error { background: #f5e3e1; color: #7c2f2d; }
.alert--ok { background: #e6efe3; color: #34502f; }
.alert--info { background: #efe7da; }
.callout { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: 12px; background: var(--wine-soft); border: 1px solid #e8d3cf; margin-bottom: 20px; }
.callout p { color: var(--ink-soft); }
.callout strong { color: var(--ink); }
.callout--sand { background: var(--paper-2); border-color: var(--line); }

/* Cabeçalho de página ---------------------------------------------------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h2 { font-size: 34px; line-height: 1.05; }
.page-head h2 em { color: var(--wine); }
.page-head p { color: var(--ink-soft); max-width: 640px; margin-top: 6px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Cartões ---------------------------------------------------------------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.card__head h3 { font-size: 22px; }
.card__head .muted { font-size: 12.5px; }
.card__body { padding: 22px; }
.card__body--flush { padding: 0; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); align-items: start; }

.kpi { padding: 20px 22px; position: relative; overflow: hidden; }
.kpi__label { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--taupe); font-weight: 500; }
.kpi__value { font: 400 38px/1.05 var(--serif); margin: 8px 0 4px; }
.kpi__value small { font-size: 18px; color: var(--taupe); }
.kpi__foot { font-size: 12px; color: var(--ink-soft); }
.kpi::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: radial-gradient(circle, rgba(99, 61, 60, .08), transparent 70%); }
.kpi--wine { background: var(--wine); color: #fff; border-color: var(--wine); }
.kpi--wine .kpi__label, .kpi--wine .kpi__foot { color: #e8d6d3; }

/* Hero do painel --------------------------------------------------------- */
.hello {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 30px; align-items: center;
  padding: 30px 34px; border-radius: 20px; overflow: hidden; color: #f6f1ea; margin-bottom: 22px;
  background: radial-gradient(120% 140% at 0% 0%, #7a4b49 0%, var(--wine) 45%, #3e2524 100%);
}
.hello::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, transparent 0 33px, rgba(255, 255, 255, .04) 33px 34px); pointer-events: none; }
.hello__date { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: #e2c9c5; }
.hello h2 { font-size: clamp(32px, 3.4vw, 46px); line-height: 1.02; margin: 10px 0 10px; color: #fff; }
.hello h2 em { color: #f0cfc9; }
.hello p { color: #eadbd8; max-width: 540px; }
.hello__book { position: relative; display: flex; align-items: center; gap: 20px; padding: 16px 22px 16px 16px; border-radius: 14px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); max-width: 380px; }
.hello__book small { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: #e2c9c5; }
.hello__book strong { display: block; font: italic 400 23px/1.1 var(--serif); color: #fff; margin: 4px 0 2px; }
.hello__book span { font: 15px var(--serif); color: #eadbd8; }
.hello__week { display: flex; gap: 6px; margin-top: 10px; }
.kpi__value, .num, .totals, .product__price, .item-total, .serif, .title, .hello__book, .tl-when { font-variant-numeric: lining-nums; }
.hello__week i { width: 26px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .25); }
.hello__week i.on { background: #f0cfc9; }

/* Tabelas ---------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--taupe); font-weight: 500; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--paper-2); }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: #fbf7f1; }
.table .strong { font-weight: 500; color: var(--ink); }
.table .title { font: 400 18px/1.2 var(--serif); }
.table .actions { text-align: right; white-space: nowrap; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-link { cursor: pointer; }
.cell-user { display: flex; align-items: center; gap: 12px; }
.cell-user .avatar { width: 36px; height: 36px; }
.cell-thumb { width: 48px; height: 48px; border-radius: 10px; background: var(--paper) center/cover no-repeat; border: 1px solid var(--line); flex: 0 0 auto; }

.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 11.5px; font-weight: 500; color: var(--b, var(--taupe)); background: color-mix(in srgb, var(--b, var(--taupe)) 12%, transparent); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--plain::before { display: none; }
.chip { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); font-size: 11.5px; color: var(--ink-soft); }

/* Filtros ---------------------------------------------------------------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.filters input, .filters select { height: 36px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper-2); padding: 0 14px; font: inherit; font-size: 13px; color: var(--ink); outline: none; }
.filters input:focus, .filters select:focus { border-color: var(--wine); background: #fff; }
.search { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.search .ico { position: absolute; left: 12px; top: 9px; width: 16px; color: var(--taupe); }
.search input { width: 100%; padding-left: 36px; }
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--sand); width: max-content; max-width: 100%; overflow-x: auto; }
.tabs a { padding: 7px 14px; border-radius: 999px; font-size: 12.5px; color: var(--ink-soft); white-space: nowrap; transition: background .2s, color .2s; }
.tabs a:hover { color: var(--ink); }
.tabs a.is-active { background: var(--card); color: var(--ink); box-shadow: 0 2px 6px -2px rgba(41, 39, 36, .2); }
.tabs a b { font-weight: 500; color: var(--taupe); margin-left: 4px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; font-size: 12.5px; color: var(--taupe); border-top: 1px solid var(--line); }
.pager a { color: var(--wine); }

/* Formulários ------------------------------------------------------------ */
.form-card { margin-bottom: 20px; }
.form-section { padding: 22px; border-bottom: 1px solid var(--line); }
.form-section:last-child { border-bottom: 0; }
.form-section > h3 { font-size: 21px; margin-bottom: 4px; }
.form-section > .muted { font-size: 12.5px; margin-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px 18px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; } .span-9 { grid-column: span 9; } .span-12 { grid-column: span 12; }
.field label { font-size: 12px; font-weight: 500; color: var(--ink-soft); }
.req { color: var(--wine); font-weight: 500; }
.field input:not([type=checkbox]):not([type=radio]):not([type=color]), .field select, .field textarea, .input {
  width: 100%; min-height: 42px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; padding: 10px 12px;
  font: inherit; font-size: 14px; color: var(--ink); outline: none; transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; line-height: 1.6; }
.field textarea.serif-input { font: 17px/1.6 var(--serif); }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { border-color: var(--wine); box-shadow: 0 0 0 3px rgba(99, 61, 60, .1); }
.field input[disabled], .field input[readonly] { background: var(--paper-2); color: var(--ink-soft); }
.hint { font-size: 11.5px; color: var(--taupe); line-height: 1.45; }
.input-group { display: flex; }
.input-prefix { display: grid; place-items: center; padding: 0 12px; border: 1px solid var(--line-2); border-right: 0; border-radius: 10px 0 0 10px; background: var(--paper-2); color: var(--taupe); font-size: 13px; }
.input-group input { border-radius: 0 10px 10px 0 !important; }
.field input[type=color] { width: 54px; height: 42px; padding: 3px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; }
.color-row { display: flex; gap: 10px; align-items: center; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; padding: 18px 22px; background: var(--paper-2); border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); flex-wrap: wrap; }
.form-actions .spacer { flex: 1; }
.sticky-actions { position: sticky; bottom: 0; z-index: 5; }

.toggle { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; min-height: 42px; }
.toggle input[type=checkbox] { position: absolute; opacity: 0; pointer-events: none; }
.toggle__track { position: relative; width: 42px; height: 24px; border-radius: 12px; background: var(--parch); transition: background .25s; flex: 0 0 auto; }
.toggle__track i { position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .3s var(--ease); }
.toggle input:checked + .toggle__track { background: var(--wine); }
.toggle input:checked + .toggle__track i { transform: translateX(18px); }
.toggle input:focus-visible + .toggle__track { outline: 2px solid rgba(99, 61, 60, .45); outline-offset: 2px; }
.toggle__label { font-size: 13.5px; color: var(--ink); }
.field--toggle { justify-content: flex-end; }

.img-field { display: flex; gap: 14px; align-items: center; padding: 10px; border: 1px dashed var(--line-2); border-radius: 12px; background: var(--paper-2); }
.img-field__preview { width: 86px; height: 86px; border-radius: 10px; overflow: hidden; background: var(--sand); display: grid; place-items: center; flex: 0 0 auto; font-size: 11px; color: var(--taupe); text-align: center; }
.img-field__preview img { width: 100%; height: 100%; object-fit: cover; }
.img-field__actions { display: grid; gap: 8px; justify-items: start; }
.img-remove { font-size: 12px; color: var(--taupe); display: flex; gap: 6px; align-items: center; }

.quick-dates { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.quick-dates button { height: 28px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; font-size: 12px; color: var(--ink-soft); transition: .2s; }
.quick-dates button:hover { border-color: var(--wine); color: var(--wine); }
.publish-box { padding: 18px; border-radius: 12px; background: var(--paper-2); border: 1px solid var(--line); }
.publish-box__state { display: flex; align-items: center; gap: 10px; font: 18px var(--serif); margin-bottom: 14px; }

/* Vazio / erro ----------------------------------------------------------- */
.empty { text-align: center; padding: 50px 24px; }
.empty--page { padding: 90px 24px; }
.empty__mark { display: inline-flex; align-items: center; gap: 10px; color: var(--wine); margin-bottom: 16px; }
.empty__mark span { width: 34px; height: 1px; background: currentColor; }
.empty h3 { font-size: 26px; margin-bottom: 6px; }
.empty p { color: var(--ink-soft); max-width: 420px; margin: 0 auto 18px; }

/* Listas ----------------------------------------------------------------- */
.list { display: grid; }
.list__item { display: flex; align-items: center; gap: 14px; padding: 14px 22px; border-bottom: 1px solid var(--line); transition: background .15s; }
.list__item:last-child { border-bottom: 0; }
a.list__item:hover { background: #fbf7f1; }
.list__main { flex: 1; min-width: 0; }
.list__title { font: 18px/1.2 var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list__meta { font-size: 12px; color: var(--taupe); margin-top: 2px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--taupe); flex: 0 0 auto; }

/* Linha do tempo --------------------------------------------------------- */
.timeline { position: relative; padding: 6px 22px 10px 22px; }
.timeline::before { content: ""; position: absolute; left: 33px; top: 20px; bottom: 20px; width: 1px; background: var(--line-2); }
.tl-item { position: relative; display: flex; gap: 16px; padding: 12px 0; }
.tl-dot { position: relative; z-index: 1; width: 23px; height: 23px; border-radius: 50%; background: var(--card); border: 1px solid var(--line-2); display: grid; place-items: center; flex: 0 0 auto; margin-top: 2px; }
.tl-dot::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--taupe); }
.tl-item.is-now .tl-dot { border-color: var(--wine); }
.tl-item.is-now .tl-dot::after { background: var(--wine); box-shadow: 0 0 0 4px rgba(99, 61, 60, .15); }
.tl-item.is-future .tl-dot::after { background: #B78E51; }
.tl-when { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--taupe); }
.tl-title { font: 18px/1.25 var(--serif); margin: 2px 0; }
.tl-title a:hover { color: var(--wine); }

/* Capas de livro --------------------------------------------------------- */
.cover {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden;
  width: 74px; aspect-ratio: 2 / 3; padding: 10px 8px 8px; text-align: center; background: var(--c); color: var(--t);
  box-shadow: 6px 8px 16px -8px rgba(41, 39, 36, .5), inset 3px 0 0 rgba(0, 0, 0, .14); flex: 0 0 auto;
}
.cover::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0, 0, 0, .16) 0 3%, rgba(255, 255, 255, .16) 5%, transparent 12%); pointer-events: none; z-index: 1; }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover img ~ em, .cover img ~ small { display: none; }
.cover em { font: italic 13px/1.05 var(--serif); }
.cover small { font-size: 6.5px; letter-spacing: .12em; text-transform: uppercase; opacity: .85; }
.cover.sm { width: 46px; padding: 6px 5px; }
.cover.sm em { font-size: 9px; }
.cover.sm small { display: none; }
.cover.lg { width: 150px; padding: 18px 12px 14px; }
.cover.lg em { font-size: 21px; }
.cover.lg small { font-size: 8px; }
.cover.xl { width: 190px; padding: 22px 14px 16px; }
.cover.xl em { font-size: 26px; }
.cover.xl small { font-size: 9px; }

.shelf-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 26px 20px; padding: 26px 22px 30px; }
.shelf-item { display: grid; justify-items: center; gap: 12px; text-align: center; position: relative; }
.shelf-item .cover { width: 120px; transition: transform .5s var(--ease), box-shadow .5s; }
.shelf-item .cover em { font-size: 17px; }
.shelf-item .cover small { font-size: 7.5px; }
.shelf-item:hover .cover { transform: translateY(-8px) rotate(-1.5deg); box-shadow: 14px 20px 26px -12px rgba(41, 39, 36, .55); }
.shelf-item__title { font: 17px/1.15 var(--serif); }
.shelf-item__meta { font-size: 11.5px; color: var(--taupe); }
.shelf-item .badge { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); z-index: 2; height: 22px; box-shadow: 0 4px 12px rgba(41, 39, 36, .12); }
.shelf-item.is-off .cover { opacity: .45; filter: grayscale(.6); }
.shelf-item__date { font-size: 11px; color: var(--wine); }

.book-preview { display: grid; background: var(--paper-2); }
.book-preview__shelf { display: grid; place-items: end center; padding: 34px 22px 0; background: linear-gradient(180deg, transparent 0 calc(100% - 12px), #cdbfad calc(100% - 12px) calc(100% - 7px), #a8967f calc(100% - 7px)); }
.book-preview__shelf .cover { margin-bottom: 12px; box-shadow: 0 18px 24px -12px rgba(41, 39, 36, .5); }
.book-preview__lines { display: grid; gap: 2px; padding: 20px 24px 24px; }
.book-preview__lines small { font-size: 9px; letter-spacing: .2em; text-transform: uppercase; font-weight: 500; color: var(--wine); }
.book-preview__lines b { font: italic 400 24px/1.1 var(--serif); margin-top: 4px; }
.book-preview__lines span { font: 15px/1.3 var(--serif); color: var(--ink-soft); }
.book-preview__lines p { margin-top: 8px; font-size: 13px; line-height: 1.6; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.book-preview__lines em { margin-top: 8px; font: italic 15px var(--serif); color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

.showcase { display: grid; grid-template-columns: repeat(4, 1fr) minmax(120px, .7fr); gap: 20px; align-items: end; padding: 30px 22px 0; background: linear-gradient(180deg, transparent 0 calc(100% - 14px), #cdbfad calc(100% - 14px) calc(100% - 8px), #a8967f calc(100% - 8px)); }
.showcase .shelf-item { padding-bottom: 22px; }
.showcase__all { display: grid; justify-items: center; align-content: end; gap: 10px; padding-bottom: 22px; text-align: center; color: var(--ink-soft); }
.showcase__spines { display: flex; align-items: flex-end; gap: 2px; height: 180px; }
.showcase__spines i { display: block; width: 22px; background: var(--c, var(--wine)); box-shadow: inset -3px 0 0 rgba(0, 0, 0, .15); }
.showcase__all b { font: italic 17px/1.1 var(--serif); color: var(--ink); }
.showcase__all small { font-size: 11px; color: var(--taupe); }
@media (max-width: 1100px) { .showcase { grid-template-columns: repeat(2, 1fr); background: none; } .showcase__all { display: none; } }

/* Estado das leituras ---------------------------------------------------- */
.reading-card { display: grid; grid-template-columns: auto 1fr; gap: 20px; padding: 20px 22px; border-bottom: 1px solid var(--line); align-items: center; }
.reading-card:last-child { border-bottom: 0; }
.reading-card h4 { font-size: 24px; line-height: 1.1; }
.reading-card h4 em { color: var(--wine); }
.reading-card__meta { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 8px 0 12px; font-size: 12.5px; color: var(--taupe); align-items: center; }
.reading-card__actions { display: flex; gap: 8px; flex-wrap: wrap; }

.week-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 6px 0 2px; }
.week-steps div { padding: 12px 14px; border-radius: 10px; background: var(--paper-2); border: 1px solid var(--line); }
.week-steps div.on { background: var(--wine-soft); border-color: #e3c9c4; }
.week-steps small { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--taupe); }
.week-steps strong { display: block; font: 17px/1.2 var(--serif); font-weight: 400; margin-top: 2px; }

/* Permissões ------------------------------------------------------------- */
.perm-group { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.perm-group + .perm-group { margin-top: 14px; }
.perm-group__head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--paper-2); border-bottom: 1px solid var(--line); }
.perm-group__head h4 { font-size: 19px; }
.perm-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.perm-row:last-child { border-bottom: 0; }
.perm-row code { font-size: 11px; color: var(--taupe); background: var(--paper); padding: 2px 6px; border-radius: 6px; }

/* Configurações ---------------------------------------------------------- */
.cfg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.cfg-card { display: grid; gap: 6px; padding: 22px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .3s var(--ease), border-color .3s; }
.cfg-card:hover { transform: translateY(-3px); border-color: var(--wine); }
.cfg-card .ico { width: 26px; height: 26px; color: var(--wine); margin-bottom: 8px; }
.cfg-card h3 { font-size: 22px; }
.cfg-card p { font-size: 12.5px; color: var(--ink-soft); }

/* Produtos --------------------------------------------------------------- */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; padding: 20px; }
.product { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; transition: transform .3s var(--ease), box-shadow .3s; }
.product:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.product__img { aspect-ratio: 4 / 3; background: #fff center/contain no-repeat; border-bottom: 1px solid var(--line); position: relative; }
.product__img .badge { position: absolute; left: 10px; top: 10px; background: #fff; }
.product__body { padding: 14px 16px 16px; display: grid; gap: 4px; flex: 1; }
.product__code { font-size: 11px; letter-spacing: .1em; color: var(--taupe); }
.product__name { font: 19px/1.15 var(--serif); }
.product__price { margin-top: auto; padding-top: 10px; font: 22px var(--serif); color: var(--wine); }
.product__price small { font: 11px var(--sans); color: var(--taupe); }

/* Orçamento: editor ------------------------------------------------------ */
.items { width: 100%; border-collapse: separate; border-spacing: 0; }
.items th { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--taupe); font-weight: 500; text-align: left; padding: 0 8px 10px; }
.items td { padding: 8px; vertical-align: top; border-top: 1px solid var(--line); }
.items tr.item-row { transition: background .2s; }
.items tr.item-row:hover { background: #fcf9f4; }
.items .input { min-height: 38px; padding: 8px 10px; font-size: 13.5px; }
.items textarea.input { min-height: 64px; resize: vertical; }
.items .num input { text-align: right; }
.item-thumb { width: 52px; height: 52px; border-radius: 10px; border: 1px solid var(--line); background: #fff center/contain no-repeat; }
.item-total { font: 19px var(--serif); text-align: right; padding-top: 14px !important; white-space: nowrap; }
.item-handle { cursor: grab; color: var(--taupe); padding-top: 16px !important; }
.picker { position: relative; }
.picker__list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; max-height: 320px; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); display: none; }
.picker.is-open .picker__list { display: block; }
.picker__opt { display: flex; gap: 12px; align-items: center; padding: 10px 12px; cursor: pointer; border-bottom: 1px solid var(--line); }
.picker__opt:last-child { border-bottom: 0; }
.picker__opt:hover, .picker__opt.is-active { background: var(--paper); }
.picker__opt .item-thumb { width: 40px; height: 40px; }
.picker__opt strong { font: 16px var(--serif); font-weight: 400; display: block; }
.picker__opt small { color: var(--taupe); font-size: 11.5px; }
.totals { display: grid; gap: 8px; margin-left: auto; width: min(360px, 100%); }
.totals div { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13.5px; color: var(--ink-soft); }
.totals input { width: 130px; text-align: right; }
.totals .grand { padding-top: 12px; border-top: 1px solid var(--line); color: var(--ink); }
.totals .grand strong { font: 30px var(--serif); color: var(--wine); }

/* Orçamento: documento --------------------------------------------------- */
.doc-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.doc-side { position: sticky; top: 90px; display: grid; gap: 16px; }
.doc-side .btn { width: 100%; justify-content: flex-start; }
.share { display: flex; gap: 8px; }
.share input { flex: 1; min-width: 0; height: 36px; border: 1px solid var(--line); border-radius: 999px; padding: 0 12px; font-size: 12px; background: var(--paper-2); color: var(--ink-soft); }
.history { display: grid; }
.history div { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.history div:last-child { border-bottom: 0; }
.history strong { font-weight: 500; }
.history small { display: block; color: var(--taupe); }

/* Modal ------------------------------------------------------------------ */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(41, 39, 36, .45); backdrop-filter: blur(3px); animation: fade-in .25s; }
.modal[hidden] { display: none; }
.modal__box { width: min(480px, 100%); background: var(--card); border-radius: 18px; padding: 28px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .4); animation: pop-in .35s var(--ease); }
.modal__box--lg { width: min(720px, 100%); }
.modal__box h3 { font-size: 28px; margin-bottom: 8px; }
.modal__text { color: var(--ink-soft); margin-bottom: 22px; }
.modal__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }

/* Barras / gráficos ------------------------------------------------------ */
.bars { display: grid; gap: 14px; }
.bar__head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.bar__head strong { font-weight: 500; }
.bar__track { height: 8px; border-radius: 4px; background: var(--sand); overflow: hidden; }
.bar__fill { height: 100%; border-radius: 4px; background: var(--wine); transform-origin: left; animation: grow 1s var(--ease); }
@keyframes grow { from { transform: scaleX(0); } }
.spark { display: flex; align-items: flex-end; gap: 6px; height: 110px; padding-top: 10px; }
.spark div { flex: 1; display: grid; justify-items: center; gap: 6px; height: 100%; align-content: end; }
.spark i { width: 100%; max-width: 34px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, var(--wine-2), var(--wine)); animation: grow-y .9s var(--ease); transform-origin: bottom; min-height: 3px; }
.spark small { font-size: 10.5px; color: var(--taupe); }
@keyframes grow-y { from { transform: scaleY(0); } }

/* Mensagens -------------------------------------------------------------- */
.msg { padding: 20px 22px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.msg:last-child { border-bottom: 0; }
.msg__text { font: italic 19px/1.5 var(--serif); color: var(--ink); border-left: 2px solid var(--wine); padding-left: 16px; }
.msg__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 12px; color: var(--taupe); }
.msg__actions { display: flex; gap: 6px; flex-wrap: wrap; }
.msg.is-new { background: #fdf8f3; }

/* Acesso ----------------------------------------------------------------- */
.auth { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; background: var(--paper); }
.auth__art { position: relative; overflow: hidden; background: #a99b8b; }
.auth__art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; filter: saturate(.8) sepia(.08); animation: slow-zoom 30s ease-in-out infinite alternate; }
.auth__art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(41, 39, 36, .05) 40%, rgba(41, 39, 36, .7)); }
.auth__quote { position: absolute; left: 44px; bottom: 44px; right: 44px; z-index: 1; color: #fff; }
.auth__quote p { font: italic 400 clamp(34px, 3.4vw, 50px)/1.05 var(--serif); }
.auth__quote em { color: #f0cfc9; }
.auth__quote span { display: block; margin-top: 16px; font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: #eadbd8; }
@keyframes slow-zoom { from { transform: scale(1.02); } to { transform: scale(1.12); } }
.auth__panel { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 40px 24px 24px; }
.auth__box { width: min(400px, 100%); margin: auto 0; animation: pop-in .6s var(--ease); }
.auth__brand { display: grid; justify-items: start; line-height: 1; margin-bottom: 46px; }
.auth__brand span { font: 500 22px/1 var(--serif); letter-spacing: .16em; }
.auth__brand i { color: var(--wine); font-style: normal; font-size: 12px; margin: 5px 0 3px 4px; }
.auth__brand small { font: italic 14px var(--serif); color: var(--taupe); }
.auth__title { font-size: clamp(38px, 4vw, 50px); line-height: 1; margin: 6px 0 14px; }
.auth__title em { color: var(--wine); }
.auth__lead { color: var(--ink-soft); margin-bottom: 28px; }
.auth__form { display: grid; gap: 14px; margin-bottom: 18px; }
.auth__link { display: inline-block; font: italic 16px var(--serif); color: var(--ink-soft); border-bottom: 1px solid var(--line-2); }
.auth__link:hover { color: var(--wine); border-color: var(--wine); }
.auth__foot { font: italic 13px var(--serif); color: var(--taupe); margin-top: 30px; }
.auth__foot a:hover { color: var(--wine); }
.float { position: relative; display: block; }
.float input { width: 100%; height: 56px; padding: 22px 46px 6px 16px; border: 1px solid var(--line-2); border-radius: 12px; background: #fff; font: 15px var(--sans); color: var(--ink); outline: none; transition: border-color .2s, box-shadow .2s; }
.float input:focus { border-color: var(--wine); box-shadow: 0 0 0 3px rgba(99, 61, 60, .1); }
.float span { position: absolute; left: 17px; top: 18px; font-size: 14px; color: var(--taupe); pointer-events: none; transition: transform .2s var(--ease), font-size .2s, top .2s; }
.float input:focus + span, .float input:not(:placeholder-shown) + span { top: 9px; font-size: 11px; letter-spacing: .04em; }
.float__eye { position: absolute; right: 8px; top: 11px; width: 34px; height: 34px; border: 0; background: none; color: var(--taupe); display: grid; place-items: center; border-radius: 50%; }
.float__eye:hover { background: var(--paper); color: var(--ink); }
.strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: -4px; }
.strength i { height: 3px; border-radius: 2px; background: var(--line); transition: background .3s; }
.strength[data-level="1"] i:nth-child(-n+1) { background: #c9776f; }
.strength[data-level="2"] i:nth-child(-n+2) { background: #c9a36f; }
.strength[data-level="3"] i:nth-child(-n+3) { background: #8fa86f; }
.strength[data-level="4"] i { background: var(--green); }
.rules { list-style: none; margin: 0; padding: 0; display: flex; gap: 16px; font-size: 12px; color: var(--taupe); }
.rules li::before { content: "○ "; }
.rules li.ok { color: var(--green); }
.rules li.ok::before { content: "● "; }

/* Responsivo ------------------------------------------------------------- */
@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main, .doc-wrap { grid-template-columns: 1fr; }
  .doc-side { position: static; }
}
@media (max-width: 960px) {
  .side { transform: translateX(-100%); transition: transform .4s var(--ease); }
  .side.is-open { transform: none; box-shadow: 20px 0 60px rgba(0, 0, 0, .3); }
  .side-scrim { position: fixed; inset: 0; z-index: 35; background: rgba(41, 39, 36, .4); }
  .side.is-open + .side-scrim { display: block; }
  .main { margin-left: 0; }
  .top__menu { display: grid; }
  .top__title h1 { font-size: 24px; }
  .top__quick span, .user__meta { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .hello { grid-template-columns: 1fr; padding: 26px; }
  .auth { grid-template-columns: 1fr; }
  .auth__art { display: none; }
  .week-steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid > .field { grid-column: 1 / -1 !important; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .kpi__value { font-size: 30px; }
  .table .hide-sm { display: none; }
  .items thead { display: none; }
  .items tr.item-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line); }
  .items tr.item-row td { border: 0; padding: 4px; }
  .items tr.item-row td.desc { grid-column: 1 / -1; }
  .item-handle, .items td.thumb { display: none; }
  .foot { flex-direction: column; gap: 4px; }
}
@media print {
  .side, .top, .foot, .doc-side, .toasts, .no-print { display: none !important; }
  .main { margin: 0; }
  .content { padding: 0; }
  body { background: #fff; }
  .doc-wrap { display: block; }
}
