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

:root {
    /* OX Design System v1.0 — paleta oficial da marca */
    --primary:      #D71920;   /* OX Red */
    --primary-dark: #A90F17;   /* OX Red Dark */
    --primary-subtle: #fff5f5;
    --graphite:     #18181B;   /* OX Graphite — fundo escuro */
    --surface-dark: #27272A;   /* OX Surface — cards escuros */
    --danger:       #dc2626;
    --success:      #16a34a;
    --warning:      #d97706;
    --text:         #18181B;
    --text-muted:   #52625B;
    --border:       #d9dde3;
    --bg:           #f0f2f5;
    --bg-card:      #ffffff;
    --radius:       10px;
    --radius-sm:    6px;
    --shadow:       0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
    --shadow-md:    0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.05);
    --font:         -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                     'Helvetica Neue', Arial, sans-serif;
}

body {
    font-family: var(--font);
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
}

/* ── Layout ── */
#app { min-height: 100vh; }

.topbar {
    background: var(--primary-dark);
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 15px;
    color: #fff;
}

.topbar-brand img { height: 26px; object-fit: contain; }
.topbar-brand i { color: #fff; font-size: 18px; }

.topbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: rgba(255,255,255,.85);
}

.topbar-user .btn-ghost {
    color: #fff;
    border-color: rgba(255,255,255,.3);
}
.topbar-user .btn-ghost:hover:not(:disabled) {
    background: rgba(255,255,255,.12);
}

.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px;
}

/* ── Cards ── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
}

.card-body { padding: 20px; }

/* ── Formulários ── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-weight: 500; margin-bottom: 6px; font-size: 13px; }
.form-input, .form-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 14px;
    color: var(--text);
    background: #fff;
    transition: border-color .15s;
}
.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(215,25,32,.12);
}

/* ── Botões ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s, opacity .15s;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary   { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-ghost     { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover:not(:disabled) { background: #f3f4f6; }
.btn-sm        { padding: 5px 12px; font-size: 13px; }
.btn-danger    { background: var(--danger); color: #fff; }

/* ── Tabela ── */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.table th {
    text-align: left;
    padding: 10px 14px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}
table.table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
table.table tbody tr:last-child td { border-bottom: none; }
table.table tbody tr:hover { background: #fafafa; }

/* ── Badges ── */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .02em;
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-neutral { background: #f3f4f6; color: #374151; }
.badge-primary { background: var(--primary-subtle); color: var(--primary-dark); }

/* ── Login Portal Contador ── */
.pxl-login-root {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--graphite);
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(215,25,32,.20) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(80,80,80,.12) 0%, transparent 50%);
}
.pxl-login-card {
    background: var(--surface-dark);
    border: 1px solid #333;
    border-radius: 16px;
    box-shadow: 0 8px 48px rgba(0,0,0,.6);
    padding: 44px 40px 36px;
    width: 100%;
    max-width: 400px;
}
.pxl-login-logo {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 6px;
}
.pxl-login-logo img {
    height: 44px;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(215,25,32,.4));
}
.pxl-login-divider {
    width: 1px;
    height: 32px;
    background: #444;
    flex-shrink: 0;
}
.pxl-login-produto {
    font-size: 17px;
    font-weight: 700;
    color: #f0f0f0;
    line-height: 1.2;
}
.pxl-login-desc {
    font-size: 12px;
    color: #888;
    margin: 0 0 28px 0;
    padding-left: 2px;
}
.pxl-login-erro {
    background: rgba(215,25,32,.15);
    border: 1px solid rgba(215,25,32,.35);
    color: #f87171;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 16px;
}
.pxl-form-group {
    margin-bottom: 14px;
}
.pxl-form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 6px;
}
.pxl-form-group input {
    width: 100%;
    background: #2c2c2c;
    border: 1px solid #3a3a3a;
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    color: #f0f0f0;
    font-size: 14px;
    font-family: var(--font);
    transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
}
.pxl-form-group input::placeholder { color: #555; }
.pxl-form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(215,25,32,.2);
}
.pxl-btn-entrar {
    width: 100%;
    margin-top: 8px;
    padding: 12px;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background .15s, transform .1s;
}
.pxl-btn-entrar:hover:not(:disabled) { background: var(--primary-dark); }
.pxl-btn-entrar:active:not(:disabled) { transform: scale(.98); }
.pxl-btn-entrar:disabled { opacity: .5; cursor: not-allowed; }
.pxl-login-footer {
    text-align: center;
    font-size: 11px;
    color: #555;
    margin-top: 24px;
    margin-bottom: 0;
}

/* ── Filtros ── */
.filtros {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
    padding: 16px 20px;
}

/* ── Paginação ── */
.paginacao {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--border);
}

/* ── Stats ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: transform .15s, box-shadow .15s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    background: var(--primary-subtle);
    color: var(--primary-dark);
}
.stat-icon.stat-icon-success { background: #f0fdf4; color: #166534; }
.stat-icon.stat-icon-warning { background: #fffbeb; color: #92400e; }
.stat-icon.stat-icon-danger  { background: #fef2f2; color: #991b1b; }
.stat-info { min-width: 0; }
.stat-value { font-size: 1.5rem; font-weight: 700; line-height: 1.2; color: var(--text); }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── Spinners ── */
.spinner {
    display: inline-block;
    width: 28px;
    height: 28px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-wrap {
    display: flex;
    justify-content: center;
    padding: 48px;
}

/* ── Empty ── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 48px;
    color: var(--text-muted);
    gap: 12px;
}
.empty-state i { font-size: 2rem; color: var(--primary-dark); opacity: .5; }

/* ── Toast ── */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
    animation: slideIn .2s ease;
}
.toast-success { background: var(--success); }
.toast-erro    { background: var(--danger); }
@keyframes slideIn { from { opacity:0; transform:translateY(8px); } }
