/* ============ Base ============ */
/* Identidade neutra do sistema MW Digital. As paletas de cliente (ex.: LIPOMONSTER)
   vivem no cadastro de cada marca e aparecem só nas telas e relatórios daquela marca. */
:root {
    --primary: #2563EB;
    --dark: #0F172A;
    --dark-2: #1E293B;
    --tint: #E8EEFC;
    --muted: #6B7280;
    --positive: #1FA85C;
    --negative: #E11D48;
    --border: #E7E7EA;
    --bg: #F7F7F9;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: Calibri, Arial, "Segoe UI", sans-serif;
    font-size: 16px;
    color: #1C1C21;
    background: var(--bg);
}

/* ============ Topbar ============ */
.topbar {
    background: var(--dark);
    color: #fff;
}
.topbar-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.brand {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 20px;
    letter-spacing: 0.5px;
}
.brand span { color: var(--primary); }
.brand em {
    font-style: normal;
    font-weight: 400;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.65);
    margin-left: 8px;
}
.topbar-nav { display: flex; align-items: center; gap: 16px; }
.user-name { font-size: 14px; color: rgba(255, 255, 255, 0.8); }

/* ============ Layout ============ */
.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 32px 24px;
}
.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
}
.page-head h1 { font-size: 26px; }
.page-actions { display: flex; gap: 10px; }
.muted { color: var(--muted); font-size: 14px; margin-top: 4px; }

/* ============ Botões ============ */
.btn {
    display: inline-block;
    padding: 9px 18px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: #1C1C21;
    font: inherit;
    font-size: 15px;
    cursor: pointer;
    text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 600;
}
.btn-ghost {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 6px 14px;
    font-size: 14px;
}
.btn-block { width: 100%; }

/* ============ Empty state ============ */
.empty-state {
    background: #fff;
    border: 1px dashed var(--border);
    border-radius: 12px;
    padding: 64px 32px;
    text-align: center;
}
.empty-state h2 { font-size: 20px; margin-bottom: 10px; }
.empty-state p { color: var(--muted); line-height: 1.5; }

/* ============ Login ============ */
body.bare {
    background: radial-gradient(1200px 600px at 85% -10%, var(--dark-2), var(--dark) 60%);
    min-height: 100vh;
}
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.login-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 14px;
    padding: 40px 36px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
}
.login-logo {
    font-size: 30px;
    font-weight: 700;
    text-align: center;
    color: var(--dark);
}
.login-logo span { color: var(--primary); }
.login-subtitle {
    text-align: center;
    color: var(--muted);
    font-size: 14px;
    margin: 6px 0 28px;
}
.login-card label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin: 16px 0 6px;
}
.login-card input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
}
.login-card input:focus {
    outline: 2px solid var(--primary);
    outline-offset: -1px;
    border-color: var(--primary);
}
.login-card .btn-block { margin-top: 24px; padding: 12px; }

/* ============ Alertas ============ */
.alert {
    padding: 11px 14px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 8px;
}
.alert-error {
    background: #FDE8EC;
    color: var(--negative);
    border: 1px solid #F7C3CE;
}

/* ============ Cards e grids ============ */
.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
}
.card h2 { font-size: 18px; margin-bottom: 8px; }
.card h3 { font-size: 16px; }
.card-disabled { opacity: 0.65; }
.mt { margin-top: 24px; }
.muted-inline { color: var(--muted); font-weight: 400; font-size: 13px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.grid-2-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 900px) {
    .grid-2, .grid-4 { grid-template-columns: 1fr; }
}

/* ============ Formulários ============ */
.card label, .inline-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin: 14px 0 5px;
}
.card input[type="text"], .card input[type="number"], .card input[type="email"],
.card select, .card textarea,
.inline-form input[type="text"], .inline-form input[type="number"], .inline-form textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    background: #fff;
}
.card textarea { resize: vertical; }
.card input:focus, .card select:focus, .card textarea:focus,
.inline-form input:focus, .inline-form textarea:focus {
    outline: 2px solid var(--primary);
    outline-offset: -1px;
}
.check { display: flex; align-items: center; gap: 8px; font-weight: 400 !important; }
.check input { width: auto !important; }
.form-footer { margin-top: 20px; display: flex; gap: 10px; }
.btn-sm { padding: 5px 10px; font-size: 13px; border-radius: 6px; }
.btn-danger { color: var(--negative); border-color: #F3C1CC; }
.row-actions { display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.logo-thumb { max-height: 40px; vertical-align: middle; margin-left: 8px; }

.color-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 8px;
}
.color-item label { margin: 8px 0 4px; font-size: 12px; }
.color-item input[type="color"] {
    width: 100%;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2px;
    background: #fff;
    cursor: pointer;
}

/* ============ Preview da capa ============ */
.cover-preview {
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    padding: 7% 8%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    color: #fff;
    overflow: hidden;
}
.cover-brand { font-size: 15px; font-weight: 700; letter-spacing: 2px; }
.cover-title { font-size: 24px; font-weight: 700; line-height: 1.15; }
.cover-sub { font-size: 11px; opacity: 0.85; }
.cover-note { font-size: 9px; opacity: 0.6; }
.cover-footer { font-size: 10px; opacity: 0.75; margin-top: auto; }

/* ============ Tabelas ============ */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th {
    text-align: left;
    padding: 9px 10px;
    background: var(--dark);
    color: #fff;
    font-weight: 600;
    white-space: nowrap;
}
.data-table th:first-child { border-radius: 8px 0 0 0; }
.data-table th:last-child { border-radius: 0 8px 0 0; }
.data-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); }
.data-table tbody tr:nth-child(even) { background: #FAFAFC; }
.row-inactive { opacity: 0.55; }
.pos { color: var(--positive); font-weight: 600; }
.neg { color: var(--negative); font-weight: 600; }
.tag {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 20px;
    background: var(--tint);
    color: var(--dark);
    vertical-align: middle;
}
.margin-live {
    margin-top: 14px;
    padding: 10px 14px;
    background: var(--tint);
    border-radius: 8px;
    font-size: 14px;
}

/* ============ Cards de marca (dashboard) ============ */
.brand-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}
.brand-card {
    display: block;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s ease;
}
.brand-card:hover { box-shadow: 0 6px 24px rgba(15, 23, 42, 0.12); }
.brand-card-inactive { opacity: 0.6; }
.brand-card-swatch { height: 64px; }
.brand-card-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.brand-card-body .muted { font-size: 13px; }

/* ============ Alerta OK ============ */
.alert-ok {
    background: #E7F6EE;
    color: var(--positive);
    border: 1px solid #BFE8D2;
}

/* ============ Wizard de relatório ============ */
.steps { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.step {
    padding: 7px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: #fff;
    font-size: 13px;
    text-decoration: none;
    color: inherit;
}
.step-active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.step-disabled { opacity: 0.45; cursor: not-allowed; }

.kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}
.kpi {
    background: var(--tint);
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.kpi-label { font-size: 12px; color: var(--muted); }
.kpi-value { font-size: 24px; font-weight: 700; }
.kpi-delta { font-size: 12px; font-weight: 600; }

.diag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.diag {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 14px;
}
.diag p { margin-top: 4px; color: #3d3d44; }
.diag-sev { display: block; font-size: 10px; font-weight: 700; letter-spacing: 1px; margin-bottom: 4px; }
.diag-critico { border-color: var(--negative); border-width: 2px; }
.diag-critico .diag-sev { color: var(--negative); }
.diag-atencao .diag-sev { color: #B98900; }
.diag-oportunidade .diag-sev { color: var(--positive); }

.row-pending { background: #FFF7E0 !important; }
.check-inline { display: inline-flex; margin: 0 8px; font-size: 13px; }
.inline-flex { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-flex select { width: auto; }
.notes { padding-left: 18px; font-size: 14px; }
.notes li { margin: 4px 0; }
.compare-line { font-size: 16px; }
code { background: #F1F2F5; padding: 2px 6px; border-radius: 4px; font-size: 13px; }
