/* Personalize — painel de gestão */
body.admin { background: #f4f2f7; }
.sidebar { position: fixed; z-index: 80; top: 0; bottom: 0; left: 0; width: 248px; background: var(--plum-900); color: #d9cce4; display: flex; flex-direction: column; transition: transform .25s; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 20px 20px 16px; }
.side-brand img:first-child { height: 38px; width: auto; }
.side-brand span img { height: 22px; width: auto; }
.side-brand small { display: block; color: #ffb59d; font-weight: 800; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; margin-top: 2px; }
.side-nav { flex: 1; overflow-y: auto; padding: 4px 12px 16px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: #d9cce4; font-weight: 600; font-size: .92rem; margin-bottom: 2px; }
.side-nav a span:not(.count) { flex: 1; }
.side-nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.side-nav a.active { background: linear-gradient(90deg, rgba(255,106,61,.22), rgba(255,106,61,.06)); color: #fff; box-shadow: inset 3px 0 0 var(--coral); }
.side-nav a.active [data-lucide], .side-nav a.active .lucide { color: #ffb59d; }
.side-nav .ext { width: 14px; height: 14px; opacity: .5; }
.side-nav .count { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px; background: var(--coral); color: #fff; font-size: .72rem; font-weight: 800; display: grid; place-items: center; }
.nav-label { padding: 16px 12px 6px; font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #8f7a9f; }
.side-foot { padding: 14px 24px; font-size: .74rem; color: #7d6a8c; border-top: 1px solid rgba(255,255,255,.06); }
.scrim { position: fixed; inset: 0; z-index: 75; background: rgba(23, 5, 36, .5); opacity: 0; pointer-events: none; transition: opacity .25s; }
.main { margin-left: 248px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 60; display: flex; align-items: center; gap: 12px; height: 68px; padding: 0 24px; background: rgba(244, 242, 247, .9); backdrop-filter: blur(10px); border-bottom: 1px solid #e7e2ee; }
.page-title { font-size: 1.15rem; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-btn { display: none; }
.gsearch { position: relative; flex: 1; max-width: 460px; margin-left: auto; display: flex; align-items: center; gap: 8px; background: #fff; border: 1.5px solid #e2dcea; border-radius: 99px; padding: 0 12px 0 14px; height: 42px; }
.gsearch:focus-within { border-color: var(--brand-500); }
.gsearch [data-lucide], .gsearch .lucide { color: var(--muted); }
.gsearch input { flex: 1; border: 0; background: none; font: inherit; font-size: .92rem; min-width: 0; }
.gsearch input:focus { outline: none; }
.gsearch kbd { font: 700 .7rem var(--font); color: var(--muted); border: 1px solid var(--line-2); border-radius: 6px; padding: 1px 6px; }
.gsearch-results { position: absolute; left: 0; right: 0; top: calc(100% + 8px); background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 6px; display: none; max-height: 70vh; overflow: auto; }
.gsearch-results.open { display: block; }
.gsearch-results a { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 10px; color: var(--ink); }
.gsearch-results a:hover, .gsearch-results a.sel { background: var(--sand); }
.gsearch-results small { display: block; color: var(--muted); }
.gsearch-results .type { font-size: .66rem; font-weight: 800; text-transform: uppercase; color: var(--brand-500); margin-left: auto; }
.only-mobile-flex { display: none !important; }
.notif-wrap, .user-menu { position: relative; }
.notif-drop { width: 360px; padding: 0; }
.nd-head { display: flex; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: .9rem; }
.nd-item { display: flex !important; gap: 10px; align-items: flex-start; padding: 12px 14px !important; border-radius: 0 !important; border-bottom: 1px solid var(--line); }
.nd-item strong { display: block; font-size: .88rem; color: var(--ink); }
.nd-item small { color: var(--muted); font-weight: 500; }
.nd-item.unread { background: var(--brand-50); }
.nd-item .ico-box { width: 36px; height: 36px; border-radius: 10px; }
.user-menu > button { display: flex; align-items: center; gap: 10px; background: none; border: 0; cursor: pointer; padding: 4px; border-radius: 12px; font: inherit; }
.user-menu > button:hover { background: #ebe6f1; }
.user-menu .who { text-align: left; line-height: 1.2; }
.user-menu .who small { display: block; color: var(--muted); font-size: .75rem; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--coral)); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .82rem; flex-shrink: 0; }
.page { padding: 24px; flex: 1; width: 100%; max-width: 1400px; }
.bottom-nav { display: none; }
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-102%); }
  .sidebar.open { transform: none; }
  .sidebar.open ~ .scrim, .scrim.open { opacity: 1; pointer-events: auto; }
  .main { margin-left: 0; }
  .menu-btn { display: inline-grid; }
  .gsearch { display: none; }
  .only-mobile-flex { display: inline-grid !important; margin-left: auto; }
  .user-menu .who { display: none; }
  .topbar { padding: 0 12px; height: 60px; gap: 6px; }
  .page { padding: 16px 14px calc(90px + var(--safe-b)); }
  .bottom-nav { position: fixed; z-index: 70; left: 0; right: 0; bottom: 0; display: flex; background: #fff; border-top: 1px solid var(--line); padding: 6px 4px calc(6px + var(--safe-b)); box-shadow: 0 -8px 24px -16px rgba(43, 11, 63, .3); }
  .bottom-nav a { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; font-size: .7rem; font-weight: 700; color: var(--muted); border-radius: 12px; }
  .bottom-nav a.active { color: var(--plum); }
  .bottom-nav a.active [data-lucide], .bottom-nav a.active .lucide { color: var(--coral); }
  .bottom-nav [data-lucide], .bottom-nav .lucide { width: 22px; height: 22px; }
  .bottom-nav b { position: absolute; top: 0; left: 52%; min-width: 18px; height: 18px; border-radius: 99px; background: var(--coral); color: #fff; font-size: .66rem; display: grid; place-items: center; padding: 0 4px; border: 2px solid #fff; }
  .notif-drop { position: fixed; left: 8px; right: 8px; top: 64px; width: auto; }
  .toasts { bottom: calc(84px + var(--safe-b)); }
}

/* cabeçalho de página */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { margin: 0; }
.page-head p { margin: 2px 0 0; color: var(--muted); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .input, .toolbar .select { min-height: 40px; padding-top: 7px; padding-bottom: 7px; font-size: .92rem; width: auto; }
.toolbar .search-input { flex: 1; min-width: 200px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin-bottom: 16px; border-bottom: 1px solid #e2dcea; }
.tabs a { padding: 10px 14px; font-weight: 700; font-size: .9rem; color: var(--muted); border-bottom: 2.5px solid transparent; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tabs a.active { color: var(--plum); border-bottom-color: var(--coral); }
.tabs a .n { font-size: .72rem; background: #ece7f2; color: var(--ink-2); border-radius: 99px; padding: 1px 7px; }
.pills { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.pills .chip { flex-shrink: 0; }
.chip .n { background: rgba(0,0,0,.08); border-radius: 99px; padding: 0 6px; font-size: .72rem; }
.chip.active .n { background: rgba(255,255,255,.2); }

/* dashboard */
.hello { margin-bottom: 18px; }
.hello h2 { font-size: 1.6rem; margin-bottom: 2px; }
.period { display: inline-flex; background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 3px; gap: 2px; }
.period a { padding: 6px 14px; border-radius: 99px; font-weight: 700; font-size: .84rem; color: var(--muted); white-space: nowrap; }
.period a.active { background: var(--plum); color: #fff; }
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 16px; position: relative; overflow: hidden; }
.kpi .k-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); margin-bottom: 10px; }
.kpi .k-ico [data-lucide], .kpi .k-ico .lucide { width: 18px; height: 18px; }
.kpi small { display: block; color: var(--muted); font-weight: 700; font-size: .78rem; }
.kpi strong { display: block; font-size: 1.45rem; color: var(--plum); letter-spacing: -.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi .delta { font-size: .76rem; font-weight: 800; }
.kpi .delta.up { color: var(--mint); }
.kpi .delta.down { color: var(--red); }
.kpi.hero { grid-column: span 2; background: linear-gradient(135deg, var(--plum), var(--brand)); color: #e9dbf5; border: 0; }
.kpi.hero strong { color: #fff; font-size: 2rem; }
.kpi.hero small { color: #d8c3ea; }
.kpi.hero .k-ico { background: rgba(255,255,255,.14); color: #ffb59d; }
.kpi.hero .delta.up { color: #7ef0c6; }
.kpi.hero .delta.down { color: #ffb4b4; }
@media (max-width: 1280px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 760px) { .kpis { grid-template-columns: 1fr 1fr; gap: 10px; } .kpi.hero { grid-column: span 2; } .kpi { padding: 14px; } .kpi strong { font-size: 1.25rem; } }
.alerts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.alert-tile { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; background: #fff; border: 1px solid var(--line); color: var(--ink); }
.alert-tile:hover { border-color: var(--brand-100); box-shadow: var(--shadow-sm); color: var(--ink); }
.alert-tile strong { font-size: 1.3rem; line-height: 1; }
.alert-tile span { font-size: .84rem; color: var(--muted); font-weight: 600; }
.alert-tile.red { border-left: 4px solid var(--red); }
.alert-tile.yellow { border-left: 4px solid var(--sun); }
.alert-tile.blue { border-left: 4px solid var(--sky); }
.alert-tile.purple { border-left: 4px solid var(--brand-500); }
@media (max-width: 960px) { .alerts { grid-template-columns: 1fr 1fr; } }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 18px; margin-bottom: 18px; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr; } }
.chart-box { position: relative; height: 280px; }
.funnel { display: grid; gap: 10px; }
.funnel-row { display: grid; grid-template-columns: 120px 1fr 64px; gap: 10px; align-items: center; font-size: .86rem; }
.funnel-row .bar { height: 26px; border-radius: 0 6px 6px 0; background: #f1ecf6; overflow: hidden; }
.funnel-row .bar i { display: block; height: 100%; background: #7b2fb0; border-radius: 0 6px 6px 0; min-width: 3px; }
.funnel-row strong { text-align: right; font-variant-numeric: tabular-nums; }
.rank { counter-reset: r; }
.rank .list-item::before { counter-increment: r; content: counter(r); width: 26px; height: 26px; border-radius: 8px; background: var(--sand); display: grid; place-items: center; font-weight: 800; font-size: .8rem; color: var(--plum); flex-shrink: 0; }
.mini-bar { height: 6px; border-radius: 99px; background: #f1ecf6; overflow: hidden; margin-top: 6px; }
.mini-bar i { display: block; height: 100%; background: #7b2fb0; }

/* pedidos */
.order-cards { display: none; }
.o-card { display: block; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--ink); }
.o-card:hover { background: #fdfaf6; color: var(--ink); }
.o-card .row { gap: 6px; }
@media (max-width: 860px) { .order-table { display: none; } .order-cards { display: block; } }
.late { color: var(--red); font-weight: 800; }
.show-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .show-grid { grid-template-columns: 1fr; } }
.status-flow { display: flex; gap: 6px; flex-wrap: wrap; }
.status-flow button { border: 1.5px solid var(--line-2); background: #fff; border-radius: 99px; padding: 7px 12px; font: inherit; font-weight: 700; font-size: .8rem; cursor: pointer; color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center; }
.status-flow button:hover { border-color: var(--plum); color: var(--plum); }
.status-flow button.current { background: var(--plum); color: #fff; border-color: var(--plum); }
.status-flow button.done { background: var(--mint-100); border-color: transparent; color: #087a58; }
.status-flow button [data-lucide], .status-flow button .lucide { width: 15px; height: 15px; }
.item-row { display: grid; grid-template-columns: 84px 1fr auto; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.item-row:last-child { border-bottom: 0; }
.item-thumb { width: 84px; height: 84px; border-radius: 14px; overflow: hidden; background: var(--sand); }
.item-thumb img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 640px) { .item-row { grid-template-columns: 64px 1fr; } .item-thumb { width: 64px; height: 64px; } .item-row > :last-child { grid-column: 1 / -1; text-align: right; } }
.files-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.file-card { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.file-card .fc-img { aspect-ratio: 1; background: repeating-conic-gradient(#f3eff6 0% 25%, #fff 0% 50%) 50% / 16px 16px; display: grid; place-items: center; color: var(--muted); }
.file-card .fc-img img { width: 100%; height: 100%; object-fit: contain; }
.file-card .fc-img [data-lucide], .file-card .fc-img .lucide { width: 34px; height: 34px; }
.file-card .fc-body { padding: 8px 10px; font-size: .78rem; }
.file-card .fc-body strong { display: block; word-break: break-all; font-size: .8rem; }
.file-card .fc-actions { display: flex; border-top: 1px solid var(--line); }
.file-card .fc-actions a, .file-card .fc-actions button { flex: 1; display: grid; place-items: center; padding: 8px; color: var(--ink-2); background: none; border: 0; cursor: pointer; }
.file-card .fc-actions a:hover, .file-card .fc-actions button:hover { background: var(--sand); }
.kv { margin: 0; }
.kv div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: .9rem; }
.kv div:last-child { border-bottom: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 700; text-align: right; word-break: break-word; }
.wa-list { display: grid; gap: 6px; }
.wa-list a { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 12px; background: #eafaf0; color: #128c4a; font-weight: 700; font-size: .86rem; }
.wa-list a:hover { background: #d4f5e1; }

/* produtos */
.p-thumb { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; background: var(--sand); flex-shrink: 0; }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .form-grid { grid-template-columns: 1fr; } }
.sticky-side { position: sticky; top: 84px; }
@media (max-width: 1100px) { .sticky-side { position: static; } }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.img-item { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--sand); cursor: grab; }
.img-item img { width: 100%; height: 100%; object-fit: cover; }
.img-item .rm { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(255,255,255,.95); color: var(--red); cursor: pointer; display: grid; place-items: center; }
.img-item .first { position: absolute; left: 6px; bottom: 6px; font-size: .66rem; font-weight: 800; background: var(--plum); color: #fff; padding: 2px 7px; border-radius: 99px; }
.img-item.dragging { opacity: .4; }
.img-add { aspect-ratio: 1; border-radius: 14px; border: 2px dashed var(--line-2); display: grid; place-items: center; text-align: center; color: var(--muted); cursor: pointer; font-size: .8rem; font-weight: 700; padding: 8px; }
.img-add:hover { border-color: var(--brand-500); color: var(--brand); }
.img-add input { display: none; }
.rep-table { width: 100%; border-collapse: collapse; }
.rep-table td, .rep-table th { padding: 6px 4px; vertical-align: middle; }
.rep-table th { font-size: .72rem; text-transform: uppercase; color: var(--muted); text-align: left; letter-spacing: .05em; }
.rep-table .input, .rep-table .select { min-height: 40px; padding: 7px 10px; font-size: .9rem; }
.rep-table .input-prefix .input { padding-left: 38px; }
.rep-table input[type=color] { width: 40px; height: 40px; border: 1px solid var(--line-2); border-radius: 10px; padding: 2px; background: #fff; cursor: pointer; }
@media (max-width: 760px) {
  .rep-table thead { display: none; }
  .rep-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; }
  .rep-table td { padding: 0; }
  .rep-table td.full { grid-column: span 2; }
}
.margin-box { padding: 14px; border-radius: 14px; background: var(--mint-100); color: #087a58; font-weight: 700; }
.margin-box strong { font-size: 1.3rem; display: block; color: #06644a; }
.margin-box.bad { background: var(--red-100); color: var(--red); }
.margin-box.bad strong { color: var(--red); }
.area-editor { position: relative; max-width: 360px; margin: 0 auto; border-radius: 16px; overflow: hidden; background: var(--sand); touch-action: none; user-select: none; }
.area-editor img { width: 100%; display: block; pointer-events: none; }
.area-box { position: absolute; border: 2px dashed var(--coral); background: rgba(255, 106, 61, .12); cursor: move; }
.area-box .h { position: absolute; right: -8px; bottom: -8px; width: 18px; height: 18px; border-radius: 50%; background: var(--coral); border: 3px solid #fff; cursor: nwse-resize; }
.color-list { display: flex; flex-wrap: wrap; gap: 6px; }
.color-list span { width: 28px; height: 28px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); cursor: pointer; position: relative; }
.color-list span:hover::after { content: '×'; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 800; text-shadow: 0 0 3px #000; }
fieldset.section { border: 0; padding: 0; margin: 0; }
.section-title { display: flex; align-items: center; gap: 8px; font-size: 1rem; margin: 0; }
.section-title [data-lucide], .section-title .lucide { color: var(--coral); }

/* clientes */
.c-head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.c-head .avatar { width: 64px; height: 64px; font-size: 1.3rem; }
.c-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.c-stats div { padding: 12px; border-radius: 14px; background: var(--bg); }
.c-stats small { display: block; color: var(--muted); font-weight: 700; font-size: .74rem; }
.c-stats strong { font-size: 1.1rem; color: var(--plum); }
@media (max-width: 640px) { .c-stats { grid-template-columns: 1fr 1fr; } }
.timeline-v { list-style: none; margin: 0; padding: 0; }
.timeline-v li { position: relative; padding: 0 0 16px 28px; }
.timeline-v li::before { content: ''; position: absolute; left: 7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--brand-500); }
.timeline-v li::after { content: ''; position: absolute; left: 12px; top: 20px; bottom: 0; width: 2px; background: var(--line); }
.timeline-v li:last-child::after { display: none; }
.timeline-v small { display: block; color: var(--muted); }
.tag-pill { display: inline-block; padding: 2px 9px; border-radius: 99px; background: var(--brand-50); color: var(--brand); font-size: .74rem; font-weight: 700; margin: 2px; }

/* configurações */
.settings-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; align-items: start; }
.settings-nav { padding: 8px; position: sticky; top: 84px; }
.settings-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; color: var(--ink-2); font-weight: 700; font-size: .9rem; }
.settings-nav a.active { background: var(--plum); color: #fff; }
.settings-nav a.active .lucide { color: #ffb59d; }
.settings-nav a .ok { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--mint); }
.settings-nav a .warn { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--sun); }
@media (max-width: 860px) { .settings-grid { grid-template-columns: 1fr; } .settings-nav { position: static; display: flex; overflow-x: auto; gap: 4px; } .settings-nav a { white-space: nowrap; } }
.copy-box { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--bg); border: 1px dashed var(--line-2); font-family: ui-monospace, monospace; font-size: .82rem; word-break: break-all; }
.copy-box button { flex-shrink: 0; }
.howto { font-size: .88rem; color: var(--ink-2); background: var(--sky-100); border-radius: 14px; padding: 14px 16px; }
.howto ol { margin: 6px 0 0; padding-left: 18px; }
.howto li { margin-bottom: 4px; }
.notif-prefs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 20px; }
@media (max-width: 640px) { .notif-prefs { grid-template-columns: 1fr; } }
.notif-prefs label { padding: 10px 0; border-bottom: 1px solid var(--line); margin: 0; }
.notif-prefs small { display: block; color: var(--muted); font-weight: 500; }

/* login */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(circle at 80% 10%, rgba(255,106,61,.35), transparent 40%), linear-gradient(135deg, var(--plum-950), var(--brand)); }
.login-card { width: min(420px, 100%); padding: 32px; border-radius: 26px; }
.login-card .logo-top { display: flex; justify-content: center; margin-bottom: 18px; }

@media print {
  .sidebar, .topbar, .bottom-nav, .no-print { display: none !important; }
  .main { margin: 0; }
}

/* ===== Fase 2 ===== */
/* Kanban */
/* Quadro de produção: todas as colunas na mesma tela (sem rolar para o lado). Em telas menores, as colunas quebram em linhas. */
.page:has(.kanban) { max-width: none; }
.kanban { --kb-cols: 9; display: grid; grid-template-columns: repeat(var(--kb-cols), minmax(0, 1fr)); gap: 8px; align-items: start; padding-bottom: 14px; }
.kb-col { min-width: 0; background: #ebe6f1; border-radius: 14px; display: flex; flex-direction: column; max-height: calc(100vh - 190px); container-type: inline-size; }
.kb-head { display: flex; align-items: center; gap: 5px; padding: 9px 8px 8px; font-weight: 800; font-size: .76rem; line-height: 1.15; color: var(--plum); border-top: 4px solid var(--brand-500); border-radius: 14px 14px 0 0; }
.kb-head .lucide, .kb-head [data-lucide] { width: 15px; height: 15px; flex-shrink: 0; }
.kb-head span { flex: 1; min-width: 0; overflow-wrap: break-word; }
.kb-head b { background: #fff; border-radius: 99px; padding: 1px 7px; font-size: .72rem; flex-shrink: 0; }
.kb-yellow .kb-head { border-top-color: var(--sun); } .kb-orange .kb-head { border-top-color: var(--coral); } .kb-green .kb-head { border-top-color: var(--mint); }
.kb-teal .kb-head { border-top-color: #14b8a6; } .kb-blue .kb-head { border-top-color: var(--sky); } .kb-purple .kb-head { border-top-color: var(--brand-500); } .kb-red .kb-head { border-top-color: var(--red); }
.kb-list { flex: 1; overflow-y: auto; padding: 0 6px 8px; display: flex; flex-direction: column; gap: 6px; min-height: 60px; scrollbar-width: thin; overflow-x: hidden; }
.kb-card { background: #fff; border-radius: 10px; padding: 8px; box-shadow: var(--shadow-sm); border: 1px solid #e4dcea; cursor: grab; font-size: .8rem; }
.kb-card:hover { border-color: var(--brand-100); box-shadow: var(--shadow); }
.kb-card.late { border-left: 4px solid var(--red); }
.kb-link { color: inherit; display: block; }
.kb-link:hover { color: inherit; }
.kb-top { display: flex; justify-content: space-between; align-items: center; gap: 4px; flex-wrap: wrap; }
.kb-top strong { font-size: .84rem; }
.kb-client { font-weight: 700; font-size: .8rem; margin: 2px 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-items { display: flex; gap: 6px; font-size: .74rem; color: var(--muted); line-height: 1.3; min-width: 0; }
.kb-items img { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; background: var(--sand); flex-shrink: 0; }
.kb-items span { min-width: 0; }
.kb-items i { display: block; font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-tags { margin: 6px 0 2px; gap: 3px; flex-wrap: wrap; }
.kb-tags .badge { font-size: .64rem; padding: 1px 6px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }
.kb-date { font-size: .7rem; font-weight: 700; color: var(--muted); display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.kb-date.late { color: var(--red); }
.kb-date .lucide { width: 12px; height: 12px; }
.kb-card footer { padding-top: 6px; border-top: 1px dashed var(--line); margin-top: 4px; display: flex; justify-content: space-between; align-items: center; gap: 4px; flex-wrap: wrap; font-size: .7rem; color: var(--muted); }
.kb-avatar { width: 20px; height: 20px; border-radius: 50%; background: var(--plum); color: #fff; font-size: .56rem; font-weight: 800; display: grid; place-items: center; flex-shrink: 0; }
.kb-move { border: 1px solid var(--line-2); border-radius: 8px; font: inherit; font-size: .72rem; padding: 3px 4px; background: #fff; color: var(--ink-2); width: 100%; margin-top: 6px; }
@media (hover: hover) and (pointer: fine) { .kb-move { display: none; } } /* no computador é só arrastar */
.kb-empty { font-size: .72rem; color: var(--muted); text-align: center; padding: 10px 0 4px; }
.kb-list:has(.kb-card) .kb-empty { display: none; }
@container (max-width: 135px) { .kb-head > .lucide, .kb-head > [data-lucide] { display: none; } .kb-items img { display: none; } .kb-card footer .kb-money { display: none; } }
@container (max-width: 112px) { .kb-head { font-size: .68rem; gap: 3px; padding: 8px 6px 7px; } .kb-head b { padding: 0 5px; font-size: .66rem; } }
.kb-ghost { opacity: .35; background: var(--brand-50); }
.kb-chosen { box-shadow: var(--shadow-lg); transform: rotate(1.5deg); }
/* Menos espaço: as colunas quebram em linhas (só rola para baixo) */
@media (max-width: 1279px) { .kanban { --kb-cols: 5; } .kb-col { max-height: none; } .kb-list { max-height: 46vh; } }
@media (max-width: 900px) { .kanban { --kb-cols: 3; } }
@media (max-width: 640px) { .kanban { --kb-cols: 2; gap: 6px; } .kb-list { max-height: 60vh; } }
@media (max-width: 420px) { .kanban { --kb-cols: 1; } .kb-list { min-height: 0; max-height: none; } }
/* Celular: resumo das etapas no topo (toque para ir até a coluna) */
.kb-jump { display: none; }
@media (max-width: 640px) {
  .kb-jump { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
  .kb-jump a { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 99px; background: #fff; border: 1px solid var(--line); font-size: .78rem; font-weight: 700; color: var(--ink-2); }
  .kb-jump a b { background: var(--brand-50); color: var(--brand); border-radius: 99px; padding: 0 6px; font-size: .72rem; }
  .kb-jump a.empty { opacity: .55; }
  .kb-col { scroll-margin-top: 80px; }
}
/* Artes */
.art-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.art-card { display: grid; grid-template-columns: 96px 1fr; gap: 14px; padding: 14px; }
.art-card.alt { border-color: #f8c2c7; background: #fffafa; }
.art-thumb { width: 96px; height: 96px; border-radius: 14px; overflow: hidden; background: var(--sand); display: grid; place-items: center; color: var(--muted); }
.art-thumb img { width: 100%; height: 100%; object-fit: cover; }
.art-body { min-width: 0; }
.art-comment { margin-top: 6px; padding: 8px 10px; border-radius: 10px; background: var(--red-100); color: #8f1d2a; font-size: .84rem; }
.proof-row { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.proof-files { display: flex; gap: 6px; flex-wrap: wrap; max-width: 220px; }
.proof-files a { width: 70px; height: 70px; border-radius: 10px; overflow: hidden; display: grid; place-items: center; background: repeating-conic-gradient(#f3eff6 0% 25%, #fff 0% 50%) 50% / 12px 12px; border: 1px solid var(--line); }
.proof-files img { width: 100%; height: 100%; object-fit: contain; }
.proof-form { margin-top: 14px; padding: 14px; border-radius: 14px; background: var(--bg); border: 1px dashed var(--line-2); }
.label-box { padding: 12px 14px; border-radius: 14px; background: var(--brand-50); border: 1px solid var(--brand-100); }
.label-box > strong { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; color: var(--plum); }
.legend { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); font-weight: 600; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 8px; }
.text-coral { color: var(--coral-600); }

/* ------------------------------------------------------------ Fase 4: assistente IA */
.ai-chat { display: flex; flex-direction: column; height: calc(100vh - 230px); height: calc(100dvh - 230px); min-height: 420px; overflow: hidden; }
.ai-log { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.ai-msg { display: flex; gap: 10px; align-items: flex-start; max-width: 860px; }
.ai-msg.me { justify-content: flex-end; align-self: flex-end; }
.ai-msg .bubble { padding: 12px 16px; border-radius: 18px; line-height: 1.55; overflow-wrap: anywhere; }
.ai-msg.me .bubble { background: var(--plum); color: #fff; border-bottom-right-radius: 6px; white-space: pre-wrap; }
.ai-msg.bot .bubble { background: var(--brand-50); border: 1px solid var(--brand-100); border-bottom-left-radius: 6px; }
.ai-msg.bot .bubble p { margin: 0 0 8px; } .ai-msg.bot .bubble p:last-child { margin-bottom: 0; }
.ai-msg.bot .bubble ul { margin: 4px 0 8px; padding-left: 20px; } .ai-msg.bot .bubble li { margin: 3px 0; }
.ai-msg.bot .bubble h4 { margin: 10px 0 4px; color: var(--plum); font-size: .95rem; }
.ai-msg.error .bubble { background: #fff1ee; border-color: #ffd2c6; color: #a63a1c; }
.ai-avatar { flex-shrink: 0; width: 34px; height: 34px; border-radius: 12px; background: linear-gradient(135deg, var(--brand), var(--coral)); color: #fff; display: grid; place-items: center; }
.ai-avatar svg { width: 18px; height: 18px; }
.ai-src { font-size: .75rem; color: var(--muted); margin-top: 8px !important; }
.ai-hello { margin: auto; text-align: center; max-width: 620px; }
.ai-hello .ai-avatar { margin: 0 auto 10px; width: 48px; height: 48px; border-radius: 16px; }
.ai-examples { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }
.ai-examples .chip { cursor: pointer; text-align: left; white-space: normal; }
.ai-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: #fff; }
.ai-form textarea { flex: 1; resize: none; border: 1px solid var(--line); border-radius: 14px; padding: 11px 14px; font: inherit; max-height: 160px; }
.ai-form textarea:focus { outline: 2px solid var(--brand-100); border-color: var(--brand); }
.ai-form .btn { align-self: flex-end; }
.ai-foot { padding: 0 14px 10px; margin: 0; }
.ai-msg.thinking .bubble { color: var(--muted); }
.dots { display: inline-flex; gap: 3px; margin-right: 6px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); animation: aiDot 1s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes aiDot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (max-width: 760px) { .ai-chat { height: calc(100vh - 330px); height: calc(100dvh - 330px); min-height: 360px; } .ai-log { padding: 14px; } .ai-msg .bubble { padding: 10px 13px; } }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px 12px; }
.perm-grid label { display: flex; gap: 8px; align-items: center; font-size: .88rem; }
.perm-grid label.override { font-weight: 700; color: var(--plum); }

/* Orçamento: fotos de prévia (mockup) */
.qm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 8px 0 12px; }
.qm-item { display: flex; flex-direction: column; gap: 6px; }
.qm-item img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); background: var(--sand); display: block; }
.qm-item.new img { outline: 2px dashed var(--coral); outline-offset: -2px; }
.qm-item .input { min-height: 36px; font-size: .84rem; }
.qm-add { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.qm-add .input { flex: 1; min-width: 200px; }
.qm-mini { display: flex; gap: 4px; flex-wrap: wrap; margin: 6px 0 2px; }
.qm-mini img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }

/* Importação de produtos */
.import-drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 16px; border: 2px dashed var(--brand-100); border-radius: 18px; background: var(--brand-50); text-align: center; cursor: pointer; }
.import-drop [data-lucide], .import-drop .lucide { width: 34px; height: 34px; color: var(--brand); }
.import-drop input[type=file] { max-width: 100%; }
