/* ==========================================================
   OScar - Tema Escuro Automotivo
   ========================================================== */

:root {
    --preto:        #131313;
    --preto-2:      #1a1a1a;
    --cinza-escuro: #222222;
    --cinza:        #2d2d2d;
    --cinza-claro:  #3a3a3a;
    --borda:        #383838;
    --vermelho:     #c0392b;
    --vermelho-2:   #e04a3a;
    --laranja:      #e67e22;
    --laranja-2:    #f39c12;
    --verde:        #27ae60;
    --azul:         #2980b9;
    --amarelo:      #f1c40f;
    --branco:       #ffffff;
    --texto:        #e8e8e8;
    --texto-suave:  #a0a0a0;
    --texto-fraco:  #6f6f6f;
    --raio:         10px;
    --raio-sm:      6px;
    --sombra:       0 4px 18px rgba(0, 0, 0, .45);
    --sidebar-w:    252px;
    --transicao:    all .2s ease;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Roboto', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--preto);
    color: var(--texto);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--laranja); text-decoration: none; transition: var(--transicao); }
a:hover { color: var(--laranja-2); }

h1, h2, h3, h4, h5 { font-weight: 700; line-height: 1.25; color: var(--branco); }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: 1rem; }

img { max-width: 100%; height: auto; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--preto-2); }
::-webkit-scrollbar-thumb { background: var(--cinza-claro); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--vermelho); }

/* ---------------- Layout ---------------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    background: var(--preto-2);
    border-right: 1px solid var(--borda);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform .25s ease;
}

.sidebar-brand {
    padding: 20px 18px;
    border-bottom: 1px solid var(--borda);
    display: flex;
    align-items: center;
    gap: 11px;
}

.sidebar-brand .logo-mark {
    width: 40px; height: 40px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--vermelho), var(--laranja));
    display: grid; place-items: center;
    color: #fff; font-size: 19px;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(192, 57, 43, .4);
}

.sidebar-brand h1 { font-size: 1.3rem; letter-spacing: .5px; }
.sidebar-brand span { display: block; font-size: .67rem; color: var(--texto-fraco); text-transform: uppercase; letter-spacing: 1.2px; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 14px 10px 24px; }

.nav-section {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: 1.3px;
    color: var(--texto-fraco);
    padding: 16px 12px 7px;
    font-weight: 700;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 13px;
    border-radius: var(--raio-sm);
    color: var(--texto-suave);
    font-size: .92rem;
    font-weight: 500;
    margin-bottom: 2px;
    border-left: 3px solid transparent;
    transition: var(--transicao);
}

.nav-item i { width: 18px; text-align: center; font-size: 15px; }
.nav-item:hover { background: var(--cinza); color: var(--branco); }

.nav-item.active {
    background: linear-gradient(90deg, rgba(192, 57, 43, .22), transparent);
    color: var(--branco);
    border-left-color: var(--vermelho);
}

.nav-item.active i { color: var(--laranja); }

.nav-badge {
    margin-left: auto;
    background: var(--vermelho);
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 20px;
}

.sidebar-footer { padding: 13px 16px; border-top: 1px solid var(--borda); font-size: .72rem; color: var(--texto-fraco); }

.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }

.topbar {
    height: 62px;
    background: var(--preto-2);
    border-bottom: 1px solid var(--borda);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 22px;
    position: sticky;
    top: 0;
    z-index: 900;
}

.topbar-search { flex: 1; max-width: 420px; position: relative; }
.topbar-search i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--texto-fraco); font-size: 13px; }
.topbar-search input { padding-left: 36px; height: 38px; }

.btn-icon {
    width: 38px; height: 38px;
    border-radius: var(--raio-sm);
    background: var(--cinza);
    border: 1px solid var(--borda);
    color: var(--texto-suave);
    display: grid; place-items: center;
    cursor: pointer;
    position: relative;
    transition: var(--transicao);
}

.btn-icon:hover { background: var(--cinza-claro); color: var(--branco); }

.btn-icon .dot {
    position: absolute; top: 6px; right: 7px;
    width: 8px; height: 8px;
    background: var(--vermelho);
    border-radius: 50%;
    border: 2px solid var(--preto-2);
}

.user-chip {
    display: flex; align-items: center; gap: 10px;
    padding: 5px 12px 5px 6px;
    background: var(--cinza);
    border: 1px solid var(--borda);
    border-radius: 30px;
    cursor: pointer;
}

.user-chip .avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--vermelho), var(--laranja));
    display: grid; place-items: center;
    color: #fff; font-weight: 700; font-size: .8rem;
}

.user-chip .info { line-height: 1.15; }
.user-chip .info strong { font-size: .82rem; color: var(--branco); display: block; }
.user-chip .info small { font-size: .68rem; color: var(--texto-fraco); text-transform: capitalize; }

.content { padding: 24px; flex: 1; }

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.page-head .subtitle { color: var(--texto-suave); font-size: .88rem; margin-top: 3px; }

/* ---------------- Cards ---------------- */
.card {
    background: var(--cinza-escuro);
    border: 1px solid var(--borda);
    border-radius: var(--raio);
    box-shadow: var(--sombra);
    overflow: hidden;
}

.card-head {
    padding: 15px 19px;
    border-bottom: 1px solid var(--borda);
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap;
}

.card-head h3 { font-size: 1rem; display: flex; align-items: center; gap: 9px; }
.card-head h3 i { color: var(--laranja); }
.card-body { padding: 19px; }
.card-body.tight { padding: 0; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.col-span-2 { grid-column: span 2; }

/* ---------------- Stat cards ---------------- */
.stat {
    background: var(--cinza-escuro);
    border: 1px solid var(--borda);
    border-radius: var(--raio);
    padding: 19px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
    transition: var(--transicao);
}

.stat::after {
    content: '';
    position: absolute; left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--vermelho);
}

.stat:hover { transform: translateY(-2px); border-color: var(--cinza-claro); }
.stat.laranja::after { background: var(--laranja); }
.stat.verde::after   { background: var(--verde); }
.stat.azul::after    { background: var(--azul); }
.stat.amarelo::after { background: var(--amarelo); }

.stat-icon {
    width: 50px; height: 50px;
    border-radius: 12px;
    display: grid; place-items: center;
    font-size: 21px;
    background: rgba(192, 57, 43, .15);
    color: var(--vermelho-2);
    flex-shrink: 0;
}

.stat.laranja .stat-icon { background: rgba(230, 126, 34, .15); color: var(--laranja); }
.stat.verde .stat-icon   { background: rgba(39, 174, 96, .15);  color: var(--verde); }
.stat.azul .stat-icon    { background: rgba(41, 128, 185, .15); color: #4aa3df; }
.stat.amarelo .stat-icon { background: rgba(241, 196, 15, .15); color: var(--amarelo); }

.stat-value { font-size: 1.65rem; font-weight: 700; color: var(--branco); line-height: 1.1; }
.stat-label { font-size: .78rem; color: var(--texto-suave); text-transform: uppercase; letter-spacing: .6px; }

/* ---------------- Botões ---------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--raio-sm);
    border: 1px solid transparent;
    font-family: inherit;
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transicao);
    white-space: nowrap;
    text-decoration: none;
}

.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--vermelho); color: #fff; }
.btn-primary:hover { background: var(--vermelho-2); color: #fff; box-shadow: 0 4px 14px rgba(192, 57, 43, .35); }
.btn-orange { background: var(--laranja); color: #fff; }
.btn-orange:hover { background: var(--laranja-2); color: #fff; }
.btn-success { background: var(--verde); color: #fff; }
.btn-success:hover { background: #2ecc71; color: #fff; }
.btn-info { background: var(--azul); color: #fff; }
.btn-info:hover { background: #3498db; color: #fff; }
.btn-dark { background: var(--cinza); color: var(--texto); border-color: var(--borda); }
.btn-dark:hover { background: var(--cinza-claro); color: var(--branco); }
.btn-outline { background: transparent; border-color: var(--borda); color: var(--texto-suave); }
.btn-outline:hover { border-color: var(--laranja); color: var(--laranja); }
.btn-danger { background: transparent; border-color: rgba(192, 57, 43, .55); color: var(--vermelho-2); }
.btn-danger:hover { background: var(--vermelho); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: .78rem; }
.btn-lg { padding: 13px 26px; font-size: .96rem; }
.btn-block { width: 100%; }

.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------- Formulários ---------------- */
.form-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 15px; }
.f1  { grid-column: span 1; }  .f2  { grid-column: span 2; }
.f3  { grid-column: span 3; }  .f4  { grid-column: span 4; }
.f5  { grid-column: span 5; }  .f6  { grid-column: span 6; }
.f7  { grid-column: span 7; }  .f8  { grid-column: span 8; }
.f9  { grid-column: span 9; }  .f10 { grid-column: span 10; }
.f12 { grid-column: span 12; }

.field { display: flex; flex-direction: column; gap: 6px; }

.field label {
    font-size: .79rem;
    font-weight: 600;
    color: var(--texto-suave);
    text-transform: uppercase;
    letter-spacing: .5px;
}

.field label .req { color: var(--vermelho-2); }

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=time], input[type=tel], input[type=search],
input[type=color], select, textarea {
    width: 100%;
    background: var(--preto-2);
    border: 1px solid var(--borda);
    border-radius: var(--raio-sm);
    color: var(--texto);
    padding: 10px 13px;
    font-family: inherit;
    font-size: .9rem;
    transition: var(--transicao);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--laranja);
    box-shadow: 0 0 0 3px rgba(230, 126, 34, .13);
}

input::placeholder, textarea::placeholder { color: var(--texto-fraco); }
input[type=color] { padding: 4px; height: 42px; cursor: pointer; }
textarea { resize: vertical; min-height: 92px; }

select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23a0a0a0'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 9px center;
    background-size: 19px;
    padding-right: 33px;
}

.field .hint { font-size: .74rem; color: var(--texto-fraco); }
.field .error { font-size: .76rem; color: var(--vermelho-2); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--vermelho); }

.check {
    display: flex; align-items: center; gap: 9px;
    font-size: .88rem; color: var(--texto); cursor: pointer;
    user-select: none;
}

.check input { width: 17px; height: 17px; accent-color: var(--vermelho); cursor: pointer; }

.form-actions {
    display: flex; gap: 10px; flex-wrap: wrap;
    padding-top: 17px; margin-top: 17px;
    border-top: 1px solid var(--borda);
}

fieldset { border: 1px solid var(--borda); border-radius: var(--raio); padding: 17px; margin-bottom: 17px; }
legend { padding: 0 9px; font-size: .82rem; font-weight: 700; color: var(--laranja); text-transform: uppercase; letter-spacing: .8px; }

/* ---------------- Tabelas ---------------- */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: .88rem; }

thead th {
    background: var(--preto-2);
    color: var(--texto-suave);
    text-align: left;
    padding: 12px 14px;
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .7px;
    font-weight: 700;
    border-bottom: 1px solid var(--borda);
    white-space: nowrap;
}

tbody td { padding: 12px 14px; border-bottom: 1px solid rgba(56, 56, 56, .55); vertical-align: middle; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: rgba(255, 255, 255, .025); }
tbody tr:last-child td { border-bottom: none; }

td.num, th.num { text-align: right; white-space: nowrap; }
td.acoes { white-space: nowrap; text-align: right; }
td strong { color: var(--branco); }

.empty { padding: 46px 20px; text-align: center; color: var(--texto-fraco); }
.empty i { font-size: 42px; opacity: .28; display: block; margin-bottom: 13px; }
.empty p { margin-bottom: 14px; }

/* ---------------- Badges ---------------- */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    white-space: nowrap;
}

.badge-success   { background: rgba(39, 174, 96, .16);  color: #37d47e; }
.badge-danger    { background: rgba(192, 57, 43, .17);  color: #e8604f; }
.badge-warning   { background: rgba(241, 196, 15, .15); color: #f1c40f; }
.badge-info      { background: rgba(41, 128, 185, .17); color: #56aae0; }
.badge-primary   { background: rgba(155, 89, 182, .17); color: #b07cc6; }
.badge-orange    { background: rgba(230, 126, 34, .17); color: var(--laranja); }
.badge-secondary { background: rgba(160, 160, 160, .13); color: var(--texto-suave); }
.badge-dark      { background: rgba(0, 0, 0, .35); color: var(--texto-fraco); }

.chip {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--cinza);
    border: 1px solid var(--borda);
    border-radius: 20px;
    padding: 3px 11px;
    font-size: .76rem;
    color: var(--texto-suave);
}

.pill-tabs { display: flex; gap: 7px; flex-wrap: wrap; }

.pill-tabs a {
    padding: 6px 14px;
    border-radius: 20px;
    background: var(--cinza);
    border: 1px solid var(--borda);
    color: var(--texto-suave);
    font-size: .82rem;
    font-weight: 600;
}

.pill-tabs a.active, .pill-tabs a:hover { background: var(--vermelho); border-color: var(--vermelho); color: #fff; }

/* ---------------- Alertas / toasts ---------------- */
.alert {
    display: flex; align-items: flex-start; gap: 11px;
    padding: 13px 16px;
    border-radius: var(--raio-sm);
    border-left: 4px solid;
    margin-bottom: 15px;
    font-size: .89rem;
}

.alert i { margin-top: 2px; }
.alert-success { background: rgba(39, 174, 96, .1);  border-color: var(--verde);    color: #6ee7a0; }
.alert-danger  { background: rgba(192, 57, 43, .1);  border-color: var(--vermelho); color: #f08d80; }
.alert-warning { background: rgba(241, 196, 15, .09); border-color: var(--amarelo); color: #f5d76e; }
.alert-info    { background: rgba(41, 128, 185, .1); border-color: var(--azul);     color: #7fc0ea; }

.toast-stack { position: fixed; top: 76px; right: 22px; z-index: 3000; display: flex; flex-direction: column; gap: 10px; max-width: 370px; }

.toast {
    display: flex; align-items: flex-start; gap: 11px;
    background: var(--cinza-escuro);
    border: 1px solid var(--borda);
    border-left: 4px solid var(--laranja);
    border-radius: var(--raio-sm);
    padding: 13px 16px;
    box-shadow: var(--sombra);
    animation: slideIn .3s ease;
    font-size: .88rem;
}

.toast.success { border-left-color: var(--verde); }
.toast.danger  { border-left-color: var(--vermelho); }
.toast.warning { border-left-color: var(--amarelo); }
.toast.info    { border-left-color: var(--azul); }
.toast .close { margin-left: auto; background: none; border: none; color: var(--texto-fraco); cursor: pointer; font-size: 15px; }

@keyframes slideIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }

/* ---------------- Modal ---------------- */
.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, .72);
    display: none;
    align-items: center; justify-content: center;
    z-index: 2000;
    padding: 20px;
    backdrop-filter: blur(2px);
}

.modal-backdrop.open { display: flex; }

.modal {
    background: var(--cinza-escuro);
    border: 1px solid var(--borda);
    border-radius: var(--raio);
    width: 100%; max-width: 520px;
    max-height: 90vh; overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
    animation: popIn .2s ease;
}

.modal.wide { max-width: 780px; }
.modal-head { padding: 17px 20px; border-bottom: 1px solid var(--borda); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { font-size: 1.05rem; }
.modal-body { padding: 20px; }
.modal-foot { padding: 15px 20px; border-top: 1px solid var(--borda); display: flex; gap: 10px; justify-content: flex-end; }
.modal .close-x { background: none; border: none; color: var(--texto-fraco); font-size: 19px; cursor: pointer; }

@keyframes popIn { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: none; } }

/* ---------------- Paginação ---------------- */
.pagination { display: flex; gap: 6px; align-items: center; justify-content: center; padding: 17px; flex-wrap: wrap; }

.pagination a, .pagination span {
    min-width: 36px; height: 36px;
    padding: 0 11px;
    border-radius: var(--raio-sm);
    background: var(--cinza);
    border: 1px solid var(--borda);
    color: var(--texto-suave);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .85rem; font-weight: 600;
}

.pagination a:hover { background: var(--cinza-claro); color: var(--branco); }
.pagination .current { background: var(--vermelho); border-color: var(--vermelho); color: #fff; }
.pagination .disabled { opacity: .4; pointer-events: none; }

/* ---------------- Filtros ---------------- */
.filters {
    display: flex; gap: 11px; flex-wrap: wrap; align-items: flex-end;
    background: var(--cinza-escuro);
    border: 1px solid var(--borda);
    border-radius: var(--raio);
    padding: 15px 17px;
    margin-bottom: 18px;
}

.filters .field { flex: 1; min-width: 155px; }

/* ---------------- Timeline ---------------- */
.timeline { position: relative; padding-left: 27px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 5px; bottom: 5px; width: 2px; background: var(--borda); }
.timeline-item { position: relative; padding-bottom: 19px; }

.timeline-item::before {
    content: '';
    position: absolute; left: -24px; top: 5px;
    width: 11px; height: 11px;
    border-radius: 50%;
    background: var(--laranja);
    border: 2px solid var(--cinza-escuro);
    box-shadow: 0 0 0 2px var(--laranja);
}

.timeline-item .time { font-size: .74rem; color: var(--texto-fraco); }
.timeline-item .desc { font-size: .89rem; }

/* ---------------- Calendário ---------------- */
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.calendar .dow { text-align: center; font-size: .72rem; font-weight: 700; color: var(--texto-fraco); text-transform: uppercase; padding: 7px 0; }

.calendar .day {
    min-height: 96px;
    background: var(--preto-2);
    border: 1px solid var(--borda);
    border-radius: var(--raio-sm);
    padding: 7px;
    font-size: .78rem;
    overflow: hidden;
}

.calendar .day.out { opacity: .38; }
.calendar .day.today { border-color: var(--laranja); box-shadow: inset 0 0 0 1px var(--laranja); }
.calendar .day .n { font-weight: 700; color: var(--texto-suave); margin-bottom: 5px; display: block; }
.calendar .day.today .n { color: var(--laranja); }

.cal-event {
    display: block;
    background: rgba(192, 57, 43, .2);
    border-left: 3px solid var(--vermelho);
    border-radius: 4px;
    padding: 3px 6px;
    margin-bottom: 3px;
    font-size: .71rem;
    color: var(--texto);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.cal-event.concluido      { background: rgba(39, 174, 96, .18);  border-color: var(--verde); }
.cal-event.cancelado      { background: rgba(120, 120, 120, .16); border-color: #777; opacity: .65; text-decoration: line-through; }
.cal-event.em_atendimento { background: rgba(230, 126, 34, .2);  border-color: var(--laranja); }
.cal-event.solicitado     { background: rgba(241, 196, 15, .16); border-color: var(--amarelo); }

/* ---------------- Barras / gráficos ---------------- */
.bars { display: flex; flex-direction: column; gap: 13px; }
.bar-row .bar-label { display: flex; justify-content: space-between; font-size: .82rem; margin-bottom: 5px; }
.bar-row .bar-label span:last-child { color: var(--texto-suave); font-weight: 600; }
.bar-track { height: 9px; background: var(--preto-2); border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--vermelho), var(--laranja)); border-radius: 6px; transition: width .5s ease; }
.bar-fill.verde  { background: linear-gradient(90deg, #1e8449, var(--verde)); }
.bar-fill.azul   { background: linear-gradient(90deg, #1f618d, #4aa3df); }
.bar-fill.amarelo{ background: linear-gradient(90deg, #b7950b, var(--amarelo)); }

.chart-columns { display: flex; align-items: flex-end; gap: 9px; height: 190px; padding-top: 12px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart-col .col-bar { width: 100%; background: linear-gradient(180deg, var(--laranja), var(--vermelho)); border-radius: 5px 5px 0 0; min-height: 3px; transition: var(--transicao); position: relative; }
.chart-col .col-bar:hover { filter: brightness(1.22); }
.chart-col .col-label { font-size: .67rem; color: var(--texto-fraco); white-space: nowrap; }
.chart-col .col-value { font-size: .68rem; color: var(--texto-suave); font-weight: 600; }

/* ---------------- Itens do orçamento ---------------- */
.item-row {
    background: var(--preto-2);
    border: 1px solid var(--borda);
    border-radius: var(--raio);
    padding: 15px;
    margin-bottom: 13px;
    position: relative;
}

.item-row .item-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.item-row .item-num { width: 26px; height: 26px; border-radius: 50%; background: var(--vermelho); color: #fff; display: grid; place-items: center; font-size: .76rem; font-weight: 700; flex-shrink: 0; }
.item-row .remove-item { margin-left: auto; background: none; border: none; color: var(--texto-fraco); cursor: pointer; font-size: 15px; padding: 5px; }
.item-row .remove-item:hover { color: var(--vermelho-2); }

.item-extra { display: none; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--borda); }
.item-extra.show { display: block; }
.item-extra .legend-mini { font-size: .74rem; font-weight: 700; color: var(--laranja); text-transform: uppercase; letter-spacing: .7px; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }

.totals-box { background: var(--preto-2); border: 1px solid var(--borda); border-radius: var(--raio); padding: 17px; }
.totals-line { display: flex; justify-content: space-between; padding: 7px 0; font-size: .9rem; }
.totals-line.total { border-top: 1px solid var(--borda); margin-top: 9px; padding-top: 13px; font-size: 1.25rem; font-weight: 700; color: var(--laranja); }

/* ---------------- Login ---------------- */
.auth-page {
    min-height: 100vh;
    display: grid; place-items: center;
    padding: 22px;
    background:
        radial-gradient(circle at 15% 15%, rgba(192, 57, 43, .16), transparent 45%),
        radial-gradient(circle at 85% 85%, rgba(230, 126, 34, .13), transparent 45%),
        var(--preto);
}

.auth-card {
    width: 100%; max-width: 415px;
    background: var(--cinza-escuro);
    border: 1px solid var(--borda);
    border-radius: 15px;
    box-shadow: 0 22px 60px rgba(0, 0, 0, .55);
    overflow: hidden;
}

.auth-head { padding: 34px 30px 22px; text-align: center; border-bottom: 1px solid var(--borda); }

.auth-head .logo-mark {
    width: 62px; height: 62px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--vermelho), var(--laranja));
    display: grid; place-items: center;
    color: #fff; font-size: 27px;
    margin: 0 auto 15px;
    box-shadow: 0 8px 24px rgba(192, 57, 43, .42);
}

.auth-head h1 { font-size: 1.8rem; letter-spacing: 1px; }
.auth-head p { color: var(--texto-fraco); font-size: .82rem; text-transform: uppercase; letter-spacing: 1.4px; margin-top: 3px; }
.auth-body { padding: 27px 30px 32px; }
.auth-body .field { margin-bottom: 15px; }
.auth-foot { text-align: center; font-size: .82rem; color: var(--texto-fraco); margin-top: 17px; }

/* ---------------- Portal do cliente ---------------- */
.portal-header {
    background: var(--preto-2);
    border-bottom: 1px solid var(--borda);
    padding: 0 22px;
    position: sticky; top: 0; z-index: 900;
}

.portal-header .row { display: flex; align-items: center; gap: 16px; height: 64px; }
.portal-nav { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 1px; }

.portal-nav a {
    padding: 12px 15px;
    color: var(--texto-suave);
    font-size: .87rem; font-weight: 600;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
}

.portal-nav a:hover { color: var(--branco); }
.portal-nav a.active { color: var(--laranja); border-bottom-color: var(--laranja); }
.portal-main { max-width: 1180px; margin: 0 auto; padding: 26px 22px; }

/* ---------------- Utilitários ---------------- */
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.flex-center { display: flex; align-items: center; gap: 9px; }
.flex-wrap { flex-wrap: wrap; }
.gap-sm { gap: 7px; } .gap { gap: 12px; } .gap-lg { gap: 20px; }
.mt-0 { margin-top: 0; } .mt { margin-top: 15px; } .mt-lg { margin-top: 25px; }
.mb-0 { margin-bottom: 0; } .mb { margin-bottom: 15px; } .mb-lg { margin-bottom: 25px; }
.text-muted { color: var(--texto-suave); }
.text-faint { color: var(--texto-fraco); }
.text-white { color: var(--branco); }
.text-orange { color: var(--laranja); }
.text-red { color: var(--vermelho-2); }
.text-green { color: var(--verde); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.small { font-size: .8rem; }
.smaller { font-size: .73rem; }
.bold { font-weight: 700; }
.upper { text-transform: uppercase; letter-spacing: .6px; }
.nowrap { white-space: nowrap; }
.w-100 { width: 100%; }
.hidden { display: none !important; }
.divider { height: 1px; background: var(--borda); margin: 17px 0; }

.info-list { display: grid; gap: 11px; }
.info-list .row { display: flex; justify-content: space-between; gap: 14px; font-size: .88rem; }
.info-list .row span:first-child { color: var(--texto-suave); }
.info-list .row span:last-child { color: var(--branco); text-align: right; font-weight: 500; }

.plate {
    display: inline-block;
    background: #f0f0f0;
    color: #111;
    font-weight: 800;
    letter-spacing: 1.6px;
    padding: 2px 9px;
    border-radius: 4px;
    font-size: .8rem;
    border: 2px solid #333;
    font-family: 'Courier New', monospace;
}

.sidebar-toggle { display: none; }

/* ---------------- Responsivo ---------------- */
@media (max-width: 1200px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 992px) {
    .grid-3, .grid-2 { grid-template-columns: 1fr; }
    .col-span-2 { grid-column: span 1; }
    .f3, .f4, .f5 { grid-column: span 6; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: none; }
    .main { margin-left: 0; }
    .sidebar-toggle { display: grid; }
    .content { padding: 16px; }
    .grid-4 { grid-template-columns: 1fr; }
    .form-grid > [class^="f"] { grid-column: span 12; }
    .topbar-search { display: none; }
    .user-chip .info { display: none; }
    .page-head { align-items: flex-start; flex-direction: column; }
    .calendar { font-size: .7rem; }
    .calendar .day { min-height: 66px; }
    .toast-stack { left: 14px; right: 14px; max-width: none; }
}

.backdrop-mobile { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 999; display: none; }
.backdrop-mobile.open { display: block; }

@media (min-width: 769px) { .backdrop-mobile { display: none !important; } }

@media print {
    .sidebar, .topbar, .no-print, .toast-stack { display: none !important; }
    .main { margin-left: 0; }
    body { background: #fff; color: #000; }
    .card { border: 1px solid #ccc; box-shadow: none; }
}
