/* ─── Variáveis ─────────────────────────────────────────────────── */
:root {
    --primary:       #0284c7;
    --primary-dark:  #0369a1;
    --primary-light: #e0f2fe;
    --sidebar:       #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-width: 240px;
    --bg:            #f1f5f9;
    --card-shadow:   0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
}

/* ─── Home ──────────────────────────────────────────────────────── */
.home-logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding-top: 30vh;   /* ← distância do topo: aumente para descer */
}

.home-logo {
    max-width: 800px;    /* ← tamanho máximo da logo */
    width: 100%;
}

/* ─── Base ──────────────────────────────────────────────────────── */
body {
    background-color: var(--bg);
    font-family: 'Segoe UI', sans-serif;
    font-size: 0.925rem;
}

/* ─── Sidebar ───────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: width 0.25s;
}

.sidebar-brand {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #1e293b;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo {
    max-width: 160px;
    height: auto;
    display: block;
    border-radius: 6px;
}

.sidebar .nav-link {
    color: #94a3b8;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    margin: 2px 8px;
    font-size: 0.88rem;
    transition: all 0.18s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: var(--sidebar-hover);
    color: #f1f5f9;
}

.sidebar .nav-link i {
    width: 18px;
    text-align: center;
    font-size: 1rem;
}

.sidebar-section-title {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: #475569;
    padding: 0.65rem 1.25rem 0.25rem;
    margin-top: 0.5rem;
}

.sidebar-footer {
    margin-top: auto;
    padding: 0.85rem 1rem;
    border-top: 1px solid #1e293b;
}

.sidebar-footer .user-name {
    font-size: 0.85rem;
    color: #f1f5f9;
    font-weight: 500;
}

.sidebar-footer .user-nivel {
    font-size: 0.72rem;
    color: #64748b;
    text-transform: capitalize;
}

.sidebar-footer .btn-logout {
    color: #64748b;
    font-size: 1.1rem;
    transition: color 0.18s;
}

.sidebar-footer .btn-logout:hover {
    color: #f87171;
}

/* ─── Conteúdo principal ────────────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 1.75rem 2rem;
    min-height: 100vh;
}

/* ─── Página header ─────────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.page-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.page-title-sub {
    font-size: 0.82rem;
    color: #64748b;
    margin-top: 0.1rem;
}

/* ─── Stat cards (dashboard) ────────────────────────────────────── */
.stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.stat-card .stat-value {
    font-size: 1.7rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 0.15rem;
}

.stat-icon-blue   { background: #dbeafe; color: #1d4ed8; }
.stat-icon-yellow { background: #fef9c3; color: #a16207; }
.stat-icon-green  { background: #dcfce7; color: #16a34a; }
.stat-icon-red    { background: #fee2e2; color: #dc2626; }
.stat-icon-gray   { background: #f1f5f9; color: #475569; }
.stat-icon-cyan   { background: #cffafe; color: #0e7490; }
.stat-icon-indigo { background: #e0e7ff; color: #4338ca; }

/* ─── Cards genéricos ───────────────────────────────────────────── */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
}

.card-header-custom {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 10px 10px 0 0 !important;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
}

/* ─── Tabelas ───────────────────────────────────────────────────── */
.table-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.table thead th {
    background: #f8fafc;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.75rem 1rem;
}

.table tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    font-size: 0.875rem;
}

.table tbody tr:last-child td { border-bottom: none; }

.table tbody tr:hover td { background: #f8fafc; }

/* ─── Badges de status ──────────────────────────────────────────── */
.badge-status {
    padding: 0.3em 0.75em;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* ─── Formulários ───────────────────────────────────────────────── */
.form-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    padding: 1.75rem;
}

.form-section-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.5rem;
    margin-bottom: 1.25rem;
}

.form-label {
    font-weight: 500;
    font-size: 0.85rem;
    color: #374151;
    margin-bottom: 0.3rem;
}

.form-control, .form-select {
    border-color: #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    padding: 0.45rem 0.75rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

/* Radio group para tipo relatório */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.radio-group .form-check {
    margin: 0;
    padding: 0;
}

.radio-group .form-check-input { display: none; }

.radio-group .form-check-label {
    cursor: pointer;
    padding: 0.35rem 0.9rem;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    font-size: 0.82rem;
    color: #374151;
    background: #fff;
    transition: all 0.15s;
    user-select: none;
}

.radio-group .form-check-input:checked + .form-check-label {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 500;
}

.radio-group .form-check-label:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.radio-group .form-check-input:checked + .form-check-label:hover {
    color: #fff;
}

/* ─── Detalhe do relatório ──────────────────────────────────────── */
.detail-row {
    display: flex;
    padding: 0.6rem 0;
    border-bottom: 1px solid #f1f5f9;
    align-items: flex-start;
    gap: 1rem;
}

.detail-row:last-child { border-bottom: none; }

.detail-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #94a3b8;
    width: 160px;
    flex-shrink: 0;
    padding-top: 0.1rem;
}

.detail-value {
    color: #0f172a;
    font-size: 0.9rem;
    flex: 1;
}

.detail-value.empty {
    color: #94a3b8;
    font-style: italic;
    font-size: 0.82rem;
}

.copy-btn {
    border: none;
    background: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0 0.25rem;
    font-size: 0.85rem;
    transition: color 0.15s;
    flex-shrink: 0;
}

.copy-btn:hover { color: var(--primary); }

/* ─── Flash messages ────────────────────────────────────────────── */
.flash-overlay {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 9999;
    max-width: 380px;
    pointer-events: none;
}

.flash-message {
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.3s, transform 0.3s;
    border-radius: 8px;
    font-size: 0.875rem;
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
    pointer-events: none;
}

.flash-show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.flash-hide {
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
}

/* ─── Contatos — cores de linha ─────────────────────────────────── */
tr.row-finalizado td { background-color: rgba(25, 135, 84, 0.12); }
tr.row-atencao    td { background-color: rgba(255, 193, 7,  0.18); }

/* ─── Login page ────────────────────────────────────────────────── */
.login-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #0284c7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 14px;
    padding: 2.5rem 2rem;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

.login-logo {
    height: 130px;
    width: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.login-subtitle {
    font-size: 0.82rem;
    color: #64748b;
}

/* ─── Botões ────────────────────────────────────────────────────── */
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover, .btn-primary:focus {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-sm { font-size: 0.8rem; }

/* ─── Utilitários ───────────────────────────────────────────────── */
.text-primary { color: var(--primary) !important; }

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #94a3b8;
}

.empty-state i { font-size: 2.5rem; margin-bottom: 0.75rem; display: block; }
.empty-state p { font-size: 0.9rem; margin: 0; }

/* ─── Dashboard — filtros ───────────────────────────────────────── */
.dash-filter-bar {
    background: #fff;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    padding: 1rem 1.25rem;
}

.dash-filter-active {
    font-size: 0.78rem;
    color: #64748b;
}

/* ─── Dashboard — tabela de operadores ──────────────────────────── */
.dash-badge-loja {
    background: #e0e7ff;
    color: #4338ca;
    font-weight: 500;
    font-size: 0.72rem;
    border-radius: 20px;
    padding: 0.2em 0.65em;
}

.dash-num {
    display: inline-block;
    min-width: 28px;
    padding: 0.2em 0.55em;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
}

.dash-num-zero {
    color: #cbd5e1;
    font-size: 0.8rem;
}

.dash-num-gray   { background: #f1f5f9; color: #475569; }
.dash-num-yellow { background: #fef9c3; color: #92400e; }
.dash-num-cyan   { background: #cffafe; color: #0e7490; }
.dash-num-red    { background: #fee2e2; color: #dc2626; }
.dash-num-green  { background: #dcfce7; color: #15803d; }
.dash-num-total  { background: #e0e7ff; color: #4338ca; }
.dash-num-indigo { background: #ede9fe; color: #6d28d9; }

.fw-500 { font-weight: 500; }

/* ─── Dashboard Bonificação — Pódio ────────────────────────────── */
.podio-card {
    border-radius: 12px;
    padding: 1.5rem 1rem;
    text-align: center;
    box-shadow: var(--card-shadow);
}

.podio-ouro   { background: linear-gradient(135deg, #fef9c3, #fde68a); border: 2px solid #f59e0b; }
.podio-prata  { background: linear-gradient(135deg, #f1f5f9, #e2e8f0); border: 2px solid #94a3b8; }
.podio-bronze { background: linear-gradient(135deg, #fef3e2, #fcd9a0); border: 2px solid #d97706; }

.podio-pos {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 0.4rem;
    color: #475569;
}

.podio-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.podio-ouro   .podio-icon { color: #d97706; }
.podio-prata  .podio-icon { color: #64748b; }
.podio-bronze .podio-icon { color: #b45309; }

.podio-nome {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.15rem;
}

.podio-loja {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 0.6rem;
}

.podio-valor {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.25rem;
}

.podio-pecas {
    font-size: 0.78rem;
    color: #475569;
}

/* ─── Dashboard Bonificação — Ranking table ─────────────────────── */
.rank-badge {
    display: inline-block;
    padding: 0.2em 0.6em;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
}

.rank-badge-ouro   { background: #fde68a; color: #92400e; }
.rank-badge-prata  { background: #e2e8f0; color: #334155; }
.rank-badge-bronze { background: #fcd9a0; color: #92400e; }

.rank-pos {
    font-size: 0.82rem;
    color: #94a3b8;
    font-weight: 500;
}

tr.rank-ouro   td { background-color: rgba(253, 230, 138, 0.2); }
tr.rank-prata  td { background-color: rgba(226, 232, 240, 0.4); }
tr.rank-bronze td { background-color: rgba(252, 217, 160, 0.2); }

/* ─── Remove setas de input number ─────────────────────────────── */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

/* ─── Responsivo ────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar       { width: 100%; min-height: auto; position: relative; }
    .main-content  { margin-left: 0; padding: 1rem; }
}
