/* Variáveis e estilos base SM Capas. Importado por todas as páginas via <link>. */
:root {
    --bg: #f4f1e8;
    --page: #fffaf0;
    --paper: #ffffff;
    --surface: #fff7df;
    --surface2: #f6e9bf;
    --text: #121212;
    --muted: #6b6254;
    --border: #ead8a8;
    --black: #080808;
    --yellow: #f6b80e;
    --yellow2: #ffd45a;
    --green: #16a34a;
    --red: #dc2626;
    --orange: #f59e0b;
    --blue: #2563eb;

    --dark-grad: linear-gradient(135deg, rgba(8,8,8,.98) 0%, rgba(22,22,22,.94) 48%, rgba(246,184,14,.96) 100%);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --mono: 'JetBrains Mono', monospace;
    --radius: 12px;
    --radius-sm: 8px;
}

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

body {
    background: radial-gradient(circle at top left, rgba(246, 184, 14, .25), transparent 30%),
                radial-gradient(circle at bottom right, rgba(8, 8, 8, .14), transparent 34%),
                linear-gradient(135deg, #fff9e8 0%, #f7edd3 48%, #f0e2b8 100%);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Logo redonda */
.logo-mark {
    width: 44px; height: 44px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--yellow); border: 2px solid rgba(255,255,255,.48);
    overflow: hidden; flex: 0 0 auto;
    box-shadow: 0 4px 10px rgba(0,0,0,.24);
}
.logo-mark img { width: 100%; height: 100%; object-fit: cover; }
.logo-mark.large { width: 72px; height: 72px; border: 3px solid rgba(255,255,255,.48); }

/* Topbar simples (usada em telas internas) */
.topbar {
    background: var(--paper);
    border-bottom: 1px solid var(--border);
    padding: 14px 20px;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.topbar .brand-sub { font-size: 11px; color: var(--muted); font-weight: 500; }
.topbar a { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; }
.topbar a:hover { color: var(--text); }

/* Container padrão */
.container { max-width: 960px; margin: 24px auto; padding: 0 16px; }

/* Cards */
.card {
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,.03);
}
.card-title {
    font-size: 13px; font-weight: 700; color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.06em;
    margin-bottom: 14px; display: flex; align-items: center; gap: 8px;
}
.card-title::before {
    content: ""; width: 6px; height: 6px; background: var(--yellow);
    border-radius: 50%;
}

/* Inputs e botões */
input, select, textarea {
    font-family: inherit; font-size: 14px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text);
    width: 100%;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--yellow);
    box-shadow: 0 0 0 3px rgba(246,184,14,.18);
}

button, .btn {
    font-family: inherit; font-size: 14px; font-weight: 600;
    padding: 10px 18px;
    border: none; border-radius: var(--radius-sm);
    cursor: pointer;
    background: var(--text); color: #fff;
    transition: transform .1s, opacity .15s;
}
button:hover, .btn:hover { opacity: .9; }
button:active, .btn:active { transform: translateY(1px); }
button:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary { background: var(--yellow); color: #000; }
.btn-secondary { background: var(--paper); color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: var(--red); color: #fff; }
.btn-ok { background: var(--green); color: #fff; }
.btn-block { width: 100%; padding: 14px; font-size: 15px; }

/* Status / mensagens */
.status { padding: 12px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; margin: 12px 0; display: none; }
.status.show { display: block; }
.status.processing { background: #fff7df; color: #8a6d00; border: 1px solid var(--yellow); }
.status.success { background: #e8f3ee; color: #166534; border: 1px solid #86efac; }
.status.error { background: #fef2f2; color: #b91c1c; border: 1px solid #fca5a5; }

/* Tabelas */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
th { background: var(--surface); font-weight: 700; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }

/* Chips */
.chip {
    display: inline-block;
    background: var(--surface2);
    color: var(--text);
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-right: 4px;
}
.chip.green { background: #d1fae5; color: #065f46; }
.chip.red { background: #fee2e2; color: #991b1b; }
.chip.blue { background: #dbeafe; color: #1e40af; }
.chip.yellow { background: var(--yellow2); color: #5b3f00; }

/* Toast (helpers.js usa) */
#toast { font-family: inherit; }

/* Mobile */
@media (max-width: 640px) {
    .container { padding: 0 12px; margin: 16px auto; }
    .card { padding: 16px; }
    .topbar { padding: 12px 14px; }
    .topbar .brand-sub { display: none; }
}

/* Esconder utilitário */
.hidden { display: none !important; }

/* Print */
@media print {
    .no-print, .topbar, button, .btn { display: none !important; }
    .card { break-inside: avoid; box-shadow: none; }
    body { background: #fff !important; }
}
