/* ============================================================================
   IndicAI Web — identidade de ferramenta de ofertas.
   Sidebar rosa→ameixa (a ousadia), canvas claro, preço/desconto em âmbar,
   verde do WhatsApp só para publicar. Sem fontes externas (CSP self).
   ============================================================================ */
:root {
    --ink:        #2b1a20;
    --ink-soft:   #6f5b62;
    --ink-faint:  #9c8890;

    --rose:       #c4436b;
    --rose-600:   #a83359;
    --rose-700:   #8c2a4b;
    --rose-050:   #fdeef2;
    --plum:       #4f1c37;

    --amber:      #d97a2b;
    --amber-700:  #b45f1a;
    --amber-050:  #fbefe2;

    --wa:         #1fa855;
    --wa-600:     #178c47;

    --canvas:     #faf7f9;
    --card:       #ffffff;
    --line:       #efe1e6;
    --line-soft:  #f5ebef;
    --danger:     #c33350;
    --danger-050: #fdecef;

    --sidebar-w:  248px;
    --radius-s:   10px;
    --radius-m:   14px;
    --radius-l:   20px;
    --radius-xl:  28px;

    --shadow-sm: 0 1px 2px rgba(43,26,32,.05), 0 1px 3px rgba(43,26,32,.05);
    --shadow-md: 0 6px 20px rgba(79,28,55,.09);
    --shadow-lg: 0 18px 48px rgba(79,28,55,.18);
    --ring: 0 0 0 3px rgba(196,67,107,.22);

    --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--sans);
    color: var(--ink);
    background: var(--canvas);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
a { color: var(--rose); text-decoration: none; }
::selection { background: var(--rose-050); }

/* ---- Layout: sidebar fixa colapsável + header global + conteúdo ---------- */
body.sidebar-collapsed { --sidebar-w: 74px; }
.app { min-height: 100vh; }

.sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-w);
    background: linear-gradient(168deg, var(--rose) 0%, var(--rose-700) 55%, var(--plum) 100%);
    color: #fff; z-index: 30; overflow: hidden;
    display: flex; flex-direction: column; gap: 3px; padding: 16px 14px;
    box-shadow: inset -1px 0 0 rgba(0,0,0,.08);
    transition: width .22s ease, transform .22s ease, padding .22s ease;
}

/* Placa branca com a logo do sistema (contraste sobre o rosa) */
.sidebar-brand {
    background: #fff; border-radius: 14px; padding: 12px 14px;
    display: flex; align-items: center; justify-content: center; min-height: 54px; margin-bottom: 14px;
    box-shadow: 0 2px 10px rgba(43,26,32,.12);
}
.sidebar-brand .logo-full { width: 100%; max-width: 152px; height: auto; display: block; }
.sidebar-brand .logo-mark { display: none; font-size: 24px; font-weight: 800; color: var(--rose); }

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
    display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: var(--radius-m);
    color: rgba(255,255,255,.85); font-weight: 600; font-size: 14.5px; cursor: pointer; white-space: nowrap;
    transition: background .16s ease, color .16s ease;
}
.nav-item:hover { background: rgba(255,255,255,.10); color: #fff; }
.nav-item.active { background: #fff; color: var(--rose-600); box-shadow: var(--shadow-md); }
.nav-ico { display: inline-flex; align-items: center; flex: 0 0 22px; }
.nav-ico svg { width: 21px; height: 21px; }
.nav-label { overflow: hidden; text-overflow: ellipsis; }
.nav-spacer { flex: 1 1 auto; }
.nav-divider { height: 1px; background: rgba(255,255,255,.16); margin: 8px 4px; }
.nav-item.muted { color: rgba(255,255,255,.66); font-weight: 500; }
.nav-item.muted:hover { color: #fff; }

/* Estado colapsado: só ícones */
body.sidebar-collapsed .sidebar { padding-left: 10px; padding-right: 10px; }
body.sidebar-collapsed .sidebar-brand { padding: 10px; }
body.sidebar-collapsed .logo-full { display: none; }
body.sidebar-collapsed .logo-mark { display: block; }
body.sidebar-collapsed .nav-label { display: none; }
body.sidebar-collapsed .nav-item { justify-content: center; padding: 11px 0; }

/* Coluna principal + header global */
.main { margin-left: var(--sidebar-w); transition: margin-left .22s ease; min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 20;
    height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 24px;
    background: rgba(255,252,251,.86); backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
}
.sidebar-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 10px; border: none; cursor: pointer;
    background: transparent; color: var(--ink-soft); transition: background .15s ease, color .15s ease;
}
.sidebar-toggle:hover { background: var(--rose-050); color: var(--rose-600); }
.sidebar-toggle svg { width: 20px; height: 20px; }
.topbar-title { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; color: var(--ink); }

.content { flex: 1 1 auto; padding: 30px 32px 60px; }
.screen { width: 100%; max-width: 880px; margin: 0 auto; }
.screen .subtitle { color: var(--ink-soft); margin: 0 0 22px; font-size: 15.5px; }
#content { animation: fadein .22s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Eyebrow opcional acima do título */
.eyebrow {
    display: inline-block;
    font-size: 11.5px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--rose); margin-bottom: 10px;
}

/* ---- Cards --------------------------------------------------------------- */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-l);
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}
.card.hover:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--line-soft); }
.card.row { display: flex; gap: 18px; align-items: flex-start; }
.card .thumb {
    width: 108px; height: 108px; flex: 0 0 108px;
    border-radius: var(--radius-m);
    object-fit: contain;
    background: var(--rose-050);
    border: 1px solid var(--line-soft);
}
.card .grow { flex: 1 1 auto; min-width: 0; }
.card h3 { margin: 0 0 6px; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }

.muted { color: var(--ink-soft); font-size: 13.5px; }
.note { font-size: 12.5px; color: var(--ink-faint); }

/* Preço / desconto — linguagem de oferta */
.pricerow { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 2px 0 4px; }
.price { color: var(--amber-700); font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }
.strike { text-decoration: line-through; color: var(--ink-faint); font-weight: 500; font-size: 14px; }
.off {
    display: inline-flex; align-items: center;
    background: var(--amber-050); color: var(--amber-700);
    border-radius: 999px; padding: 3px 10px; font-size: 12.5px; font-weight: 800; letter-spacing: -0.01em;
}
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    background: var(--rose-050); color: var(--rose-600);
    border-radius: 999px; padding: 4px 11px; font-size: 12.5px; font-weight: 700;
}
.badge.ok { background: #e9f7ef; color: var(--wa-600); }
.badge.off-state { background: #f3edf0; color: var(--ink-faint); }

/* ---- Formulários --------------------------------------------------------- */
label.field { display: block; margin-bottom: 15px; }
label.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
input[type=text], input[type=password], input[type=url], textarea, select {
    width: 100%;
    padding: 11px 13px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-m);
    font-family: inherit;
    font-size: 14.5px;
    background: #fff;
    color: var(--ink);
    transition: border-color .15s ease, box-shadow .15s ease;
}
input::placeholder, textarea::placeholder { color: var(--ink-faint); }
textarea { min-height: 84px; resize: vertical; }
input:focus, textarea:focus, select:focus {
    outline: none; border-color: var(--rose); box-shadow: var(--ring);
}
.form-row { display: flex; gap: 14px; }
.form-row > * { flex: 1 1 0; }

/* Inline checkbox dentro de label.field (CAIXA ALTA etc.) */
label.field.inline { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--ink); }
label.field.inline input { width: auto; }
input[type=checkbox], input[type=radio] { accent-color: var(--rose); width: 17px; height: 17px; }

/* ---- Botões -------------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; gap: 7px;
    background: var(--rose); color: #fff;
    border: none; border-radius: 999px;
    padding: 10px 20px; font-size: 14.5px; font-weight: 700; letter-spacing: -0.01em;
    cursor: pointer; font-family: inherit;
    box-shadow: 0 2px 8px rgba(196,67,107,.25);
    transition: background .15s ease, transform .12s ease, box-shadow .15s ease, filter .15s ease;
}
.btn:hover { background: var(--rose-600); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(196,67,107,.3); }
.btn:active { transform: translateY(0); }
.btn.wa { background: var(--wa); box-shadow: 0 2px 8px rgba(31,168,85,.28); }
.btn.wa:hover { background: var(--wa-600); box-shadow: 0 6px 16px rgba(31,168,85,.32); }
.btn.secondary { background: var(--rose-050); color: var(--rose-600); box-shadow: none; }
.btn.secondary:hover { background: #fadfe8; }
.btn.ghost { background: transparent; color: var(--rose-600); border: 1.5px solid var(--line); box-shadow: none; }
.btn.ghost:hover { background: var(--rose-050); border-color: var(--rose-050); }
.btn.danger { background: transparent; color: var(--danger); border: 1.5px solid var(--danger-050); box-shadow: none; }
.btn.danger:hover { background: var(--danger-050); }
.btn.small { padding: 7px 14px; font-size: 13px; }
.btn svg { width: 16px; height: 16px; }

.actions { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.toolbar { display: flex; gap: 9px; align-items: center; margin: 4px 0 18px; flex-wrap: wrap; }

/* Chips (dias da semana) */
.chips { display: flex; gap: 7px; flex-wrap: wrap; margin: 2px 0 4px; }
.chip {
    border: 1.5px solid var(--line); border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 600;
    cursor: pointer; user-select: none; color: var(--ink-soft); transition: all .14s ease;
}
.chip input { display: none; }
.chip:hover { border-color: var(--rose); color: var(--rose-600); }
.chip.on { background: var(--rose); color: #fff; border-color: var(--rose); }

/* ---- Status / vazio / legenda -------------------------------------------- */
.status {
    padding: 12px 16px; border-radius: var(--radius-m);
    background: var(--amber-050); color: var(--amber-700);
    font-weight: 600; font-size: 14px; margin-bottom: 18px;
    border: 1px solid #f4dcc2;
}
.empty {
    color: var(--ink-soft); padding: 40px 24px; text-align: center;
    border: 1.5px dashed var(--line); border-radius: var(--radius-l); background: #fff;
}
.empty .big { font-size: 34px; margin-bottom: 8px; }
.empty .t { font-weight: 700; color: var(--ink); font-size: 16px; margin-bottom: 4px; }

pre.caption {
    white-space: pre-wrap; word-break: break-word;
    background: var(--rose-050); color: var(--ink);
    padding: 13px 15px; border-radius: var(--radius-m);
    font-family: inherit; font-size: 13.5px; line-height: 1.55; margin: 10px 0 0;
    border: 1px solid var(--line-soft);
}

.copysrc { display: none; }

/* Destaque para a fila "repostar agora" */
.card.due { border: 1.5px solid var(--rose); box-shadow: var(--shadow-md); }
.card.due > h3 { color: var(--rose-600); }

/* ---- Login --------------------------------------------------------------- */
.login-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
    background: linear-gradient(150deg, var(--rose) 0%, var(--rose-700) 52%, var(--plum) 100%);
    position: relative; overflow: hidden;
}
.login-wrap::before {
    content: "#"; position: absolute; right: -4vw; bottom: -12vh;
    font-size: 52vh; font-weight: 800; color: rgba(255,255,255,.06); line-height: 1; pointer-events: none;
}
.login-card {
    width: 360px; max-width: 100%; background: #fff; border-radius: var(--radius-xl);
    padding: 34px 30px; box-shadow: var(--shadow-lg); position: relative;
}
.login-card .logo { display: block; width: 196px; max-width: 82%; height: auto; margin: 0 auto 8px; }
.login-card .sub { text-align: center; color: var(--ink-soft); margin-bottom: 24px; font-size: 14px; }
.login-card .btn { width: 100%; justify-content: center; }

/* ---- Responsivo: sidebar vira drawer off-canvas -------------------------- */
@media (max-width: 760px) {
    .sidebar { transform: translateX(-100%); width: 250px; box-shadow: var(--shadow-lg); }
    body.sidebar-open .sidebar { transform: translateX(0); }
    body.sidebar-open::after { content: ""; position: fixed; inset: 0; background: rgba(20,8,14,.42); z-index: 25; }
    /* Em mobile o menu abre por cima; nunca fica "só ícones". */
    body.sidebar-collapsed { --sidebar-w: 250px; }
    body.sidebar-collapsed .nav-label { display: inline; }
    body.sidebar-collapsed .logo-full { display: block; }
    body.sidebar-collapsed .logo-mark { display: none; }
    body.sidebar-collapsed .nav-item { justify-content: flex-start; padding: 11px 12px; }
    .main { margin-left: 0; }
    .content { padding: 22px 16px 48px; }
    .form-row { flex-direction: column; gap: 0; }
    .card.row { flex-direction: column; }
    .card .thumb { width: 100%; height: 180px; flex-basis: auto; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}
