:root {
    --shop-bg: #f3f6f5;
    --shop-card: #fff;
    --shop-text: #0f172a;
    --shop-muted: #64748b;
    --shop-line: #d9e2de;
    --shop-accent: #0f766e;
    --shop-accent-soft: #e7f3ef;
    --shop-ok: #047857;
    --shop-ok-bg: #ecfdf5;
    --shop-danger: #b91c1c;
    --shop-danger-bg: #fef2f2;
    --shop-side: #0f172a;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    background: var(--shop-bg);
    color: var(--shop-text);
    font-family: Inter, Segoe UI, system-ui, sans-serif;
}

a { color: var(--shop-accent); }

.app {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: var(--shop-side);
    color: #fff;
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
}

.brand strong { display: block; font-size: 20px; }
.brand span { display: block; margin-top: 4px; font-size: 12px; color: #94a3b8; }

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 28px 0 auto;
}

.sidebar nav a {
    color: #cbd5e1;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
}

.sidebar nav a:hover,
.sidebar nav a.on {
    background: #1e293b;
    color: #fff;
}

.sidebar-user {
    border-top: 1px solid #1e293b;
    padding-top: 16px;
    font-size: 13px;
}

.sidebar-user strong { display: block; }
.sidebar-user span { display: block; color: #94a3b8; margin: 4px 0 10px; }
.sidebar-user a {
    color: #99f6e4;
    text-decoration: none;
    font-weight: 700;
}

.main-top {
    background: #fff;
    border-bottom: 1px solid var(--shop-line);
    padding: 22px 32px;
}

.main-top h1 { margin: 0; font-size: 24px; }

.main-body { padding: 28px 32px 40px; }

.card {
    background: var(--shop-card);
    border: 1px solid var(--shop-line);
    border-radius: 16px;
    padding: 22px 24px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.grid-2 {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr);
    gap: 20px;
    align-items: start;
}

.form-linha {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    align-items: end;
}

input[type="hidden"] { display: none !important; }
.form-linha > input[type="hidden"] { display: none; }

.form-linha .campo { flex: 1 1 200px; min-width: 160px; }
.form-linha .campo-curto { flex: 0 1 180px; }

.form-linha input,
.form-linha select { margin-bottom: 0; }

.form-acoes {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.hint {
    margin: 0 0 14px;
    font-size: 13px;
    color: var(--shop-muted);
    line-height: 1.45;
}

.receita-linha {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.receita-linha select {
    flex: 1 1 auto;
    min-width: 0;
    margin-bottom: 0;
}

.receita-linha input {
    flex: 0 0 76px;
    width: 76px;
    margin-bottom: 0;
}

.receita-linha button {
    flex: 0 0 36px;
    width: 36px;
    padding: 0;
}

.bloco-form {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--shop-line);
}

.tabela-wrap { overflow-x: auto; }

.grupo-kit {
    border: 1px solid var(--shop-line);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px;
    background: #f8faf9;
}

.lista-pecas {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
    max-height: 260px;
    overflow: auto;
    padding: 4px 0;
}

.lista-pecas label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-weight: 600;
    font-size: 13px;
    margin: 0;
    line-height: 1.35;
}

.lista-pecas input[type="checkbox"] {
    width: auto;
    margin: 2px 0 0;
    flex: 0 0 auto;
}

@media (max-width: 700px) {
    .lista-pecas { grid-template-columns: 1fr; }
}

.loja-lista { display: grid; gap: 12px; }

a.loja-card {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: inherit;
    margin: 0;
}

a.loja-card:hover { border-color: var(--shop-accent); }

a.loja-card strong { display: block; font-size: 16px; }
a.loja-card span.muted { display: block; margin-top: 2px; font-size: 13px; }
a.loja-card em {
    display: block;
    margin-top: 4px;
    font-style: normal;
    font-size: 13px;
    font-weight: 700;
    color: #334155;
}

.loja-topo {
    display: flex;
    align-items: center;
    gap: 14px;
}

.loja-topo strong { display: block; font-size: 18px; }
.loja-topo span.muted { display: block; margin-top: 2px; }

.loja-status {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex: 0 0 14px;
    background: #94a3b8;
    box-shadow: 0 0 0 4px #e2e8f0;
}

.loja-status.grande {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
}

.loja-status.verde { background: #16a34a; box-shadow: 0 0 0 4px #dcfce7; }
.loja-status.amarelo { background: #d97706; box-shadow: 0 0 0 4px #fef3c7; }
.loja-status.vermelho { background: #dc2626; box-shadow: 0 0 0 4px #fee2e2; }
.loja-status.cinza { background: #94a3b8; box-shadow: 0 0 0 4px #e2e8f0; }

details.bloco-form summary {
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    color: #334155;
}

.badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--shop-accent);
    background: var(--shop-accent-soft);
    border-radius: 999px;
    padding: 6px 10px;
}

.badge-ok {
    color: var(--shop-ok);
    background: var(--shop-ok-bg);
}

.badge-sugestao {
    color: #92400e;
    background: #fef3c7;
}

.lead { margin: 8px 0 0; color: var(--shop-muted); line-height: 1.5; }

label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin: 0 0 6px;
}

textarea,
input, select {
    width: 100%;
    border: 1px solid var(--shop-line);
    border-radius: 10px;
    padding: 11px 12px;
    font-size: 14px;
    margin-bottom: 12px;
    background: #fff;
}
textarea { min-height: 96px; resize: vertical; }

.radios {
    display: flex;
    gap: 18px;
    margin: 4px 0 12px;
}

input:focus {
    outline: 2px solid #99f6e4;
    border-color: var(--shop-accent);
}

button, .btn {
    border: 0;
    border-radius: 10px;
    padding: 11px 16px;
    background: var(--shop-accent);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

a.btn {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

button.btn-ghost,
a.btn-ghost {
    background: #e8eef2;
    color: #0f172a;
}

button.btn-ghost:hover { background: #d7dee6; filter: none; }

.btn-block { width: 100%; }
button:hover, .btn:hover { filter: brightness(1.05); }

.alerta {
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 14px;
    font-size: 14px;
    font-weight: 600;
}

.alerta.erro { background: var(--shop-danger-bg); color: var(--shop-danger); }
.alerta.ok { background: var(--shop-ok-bg); color: var(--shop-ok); }

.ok {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--shop-ok-bg);
    color: var(--shop-ok);
    font-size: 14px;
    font-weight: 600;
}

table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

table.data th, table.data td {
    text-align: left;
    padding: 11px 10px;
    border-bottom: 1px solid var(--shop-line);
    vertical-align: middle;
}

table.data td.acoes { white-space: nowrap; }

table.data th {
    color: var(--shop-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

table.data .muted { color: var(--shop-muted); }
table.data .saldo { font-weight: 800; }
table.data select {
    margin: 0;
    padding: 8px 10px;
}
table.data .sku { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }

table.data tr.grupo td {
    background: var(--shop-accent-soft);
    font-weight: 700;
    border-bottom-color: #c5d8d2;
}

.check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    margin: 0 0 12px;
}

.check input { width: auto; margin: 0; }

.acoes {
    display: flex;
    align-items: center;
    gap: 10px;
}

.acoes form { margin: 0; }

.btn-link {
    background: none;
    border: 0;
    padding: 0;
    color: var(--shop-danger);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

a.ico,
button.ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    color: #475569;
    background: #eef2f6;
    text-decoration: none;
    border: 0;
    cursor: pointer;
    padding: 0;
    filter: none;
}

a.ico:hover,
button.ico:hover { background: #e2e8f0; filter: none; }
button.ico.perigo,
a.ico.perigo { color: var(--shop-danger); background: #f8eaea; }
button.ico.perigo:hover { background: #fde8e8; filter: none; }
.ico-form { display: inline-flex; margin: 0; }

.shop-center {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 40px 16px;
}

.shop-center .card { width: min(420px, 100%); padding: 32px 28px; }
.shop-center h1 { margin: 16px 0 8px; font-size: 28px; }
.shop-center button { width: 100%; }

table.data tr.clicavel { cursor: pointer; }
table.data tr.clicavel:hover td { background: var(--shop-accent-soft); }
table.data tr.clicavel a { color: inherit; text-decoration: none; font-weight: 700; }

.paginacao {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 16px;
}
.paginacao a,
.paginacao strong {
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
}
.paginacao a { background: #e8eef2; color: #0f172a; }
.paginacao a:hover { background: #d7dee6; }
.paginacao strong { background: var(--shop-accent); color: #fff; }

.pedido-topo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.pedido-badges { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.dados { display: grid; gap: 10px; }
.dado span {
    display: block;
    color: var(--shop-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
}
.dado strong { font-weight: 600; font-size: 14px; white-space: pre-wrap; }

.pedido-foto {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 8px;
    background: #e8eef2;
}

.ads-grade {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.8fr);
    gap: 20px;
    align-items: start;
}

.ads-produto { margin-bottom: 16px; }
.ads-produto-topo {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.ads-produto-topo strong { display: block; font-size: 16px; }
.ads-produto-nums {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 13px;
    font-weight: 700;
}

.ads-chat-lista {
    display: grid;
    gap: 10px;
    max-height: 420px;
    overflow: auto;
    margin: 12px 0;
}
.ads-balao {
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.45;
    background: #f8faf9;
}
.ads-balao span {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--shop-muted);
    margin-bottom: 4px;
}
.ads-balao.voce { background: var(--shop-accent-soft); }
.ads-balao.erro { background: var(--shop-danger-bg); color: var(--shop-danger); }

.ads-voltar { margin: 0 0 14px; }
.ads-voltar a { font-weight: 700; text-decoration: none; }
.ads-abrir { font-weight: 700; text-decoration: none; }
.ads-linha { cursor: pointer; }
.ads-linha:hover td { background: var(--shop-accent-soft); }
.ads-foco-nums {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}
.ads-foco-num {
    background: #f8faf9;
    border-radius: 12px;
    padding: 12px;
}
.ads-foco-num span {
    display: block;
    font-size: 12px;
    color: var(--shop-muted);
    margin-bottom: 4px;
}
.ads-foco-num strong { font-size: 20px; }
a.ads-foco-num {
    color: inherit;
    text-decoration: none;
    display: block;
}
a.ads-foco-num:hover,
a.ads-foco-num.on {
    background: var(--shop-accent-soft);
}
.fin-abas {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 0 16px;
}
.fin-abas a {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--shop-line);
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
}
.fin-abas a.on,
.fin-abas a:hover {
    background: var(--shop-accent);
    color: #fff;
    border-color: var(--shop-accent);
}

@media (max-width: 1100px) {
    .ads-grade { grid-template-columns: 1fr; }
    .ads-foco-nums { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .app { grid-template-columns: 1fr; }
    .sidebar { flex-direction: row; flex-wrap: wrap; gap: 16px; padding: 16px; }
    .sidebar nav { flex-direction: row; margin: 0; }
    .sidebar-user { border: 0; padding: 0; margin-left: auto; }
    .grid-2 { grid-template-columns: 1fr; }
    .main-top, .main-body { padding-left: 16px; padding-right: 16px; }
}
