/* ======================================================
SUPREMA OS - CSS GLOBAL COMPLETO
====================================================== */

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

:root {
--cor-primaria: #0d6efd;
--cor-secundaria: #1f2937;
--cor-fundo: #f4f6f9;
--cor-menu: #1f2937;
--cor-topo: #ffffff;
--cor-texto-menu: #d1d5db;
--cor-botao: #0d6efd;
--cor-botao-texto: #ffffff;
--cor-card: #ffffff;
--cor-borda: #e5e7eb;
--cor-texto: #1f2937;
--cor-texto-suave: #6b7280;
--cor-hover-menu: rgba(255, 255, 255, 0.08);
--sombra-card: 0 4px 14px rgba(0, 0, 0, 0.06);
--radius: 16px;
--sidebar-width: 260px;
}

html,
body {
width: 100%;
min-height: 100%;
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
background: var(--cor-fundo);
color: var(--cor-texto);
}

/* ======================================================
LINKS E TEXTOS
====================================================== */

a {
text-decoration: none;
}

.text-muted {
color: var(--cor-texto-suave) !important;
}

/* ======================================================
LOGIN
====================================================== */

.login-page {
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
padding: 20px;
background: linear-gradient(135deg, var(--cor-primaria), var(--cor-secundaria));
}

.login-card {
width: 100%;
max-width: 420px;
border: none;
border-radius: 20px;
box-shadow: 0 14px 40px rgba(0, 0, 0, 0.22);
overflow: hidden;
background: #fff;
}

.login-card .card-body {
padding: 35px;
}

.login-card h2 {
font-size: 30px;
font-weight: 800;
color: var(--cor-secundaria);
}

.login-card p {
color: var(--cor-texto-suave);
}

/* ======================================================
LAYOUT INTERNO
====================================================== */

.system-wrapper {
display: flex;
min-height: 100vh;
}

.sidebar {
width: var(--sidebar-width);
background: var(--cor-menu);
color: #fff;
position: fixed;
top: 0;
left: 0;
bottom: 0;
overflow-y: auto;
padding: 20px 0;
z-index: 1000;
}

.sidebar-brand {
display: flex;
align-items: center;
gap: 10px;
padding: 0 22px 20px;
margin-bottom: 15px;
border-bottom: 1px solid rgba(255, 255, 255, 0.08);
color: #fff;
font-size: 19px;
font-weight: 800;
}

.sidebar-brand i {
font-size: 20px;
}

.sidebar-menu {
list-style: none;
margin: 0;
padding: 0;
}

.sidebar-menu li {
margin: 4px 0;
}

.sidebar-menu li a {
display: flex;
align-items: center;
gap: 12px;
color: var(--cor-texto-menu);
padding: 13px 22px;
transition: all 0.2s ease;
font-size: 16px;
font-weight: 500;
border-left: 4px solid transparent;
}

.sidebar-menu li a i {
width: 18px;
text-align: center;
}

.sidebar-menu li a:hover {
background: var(--cor-hover-menu);
color: #fff;
border-left-color: var(--cor-primaria);
}

.main-content {
margin-left: var(--sidebar-width);
width: calc(100% - var(--sidebar-width));
padding: 25px;
}

/* ======================================================
TOPBAR
====================================================== */

.topbar {
background: var(--cor-topo);
border-radius: var(--radius);
padding: 18px 22px;
box-shadow: var(--sombra-card);
margin-bottom: 22px;
}

.topbar h4 {
margin: 0;
font-size: 24px;
font-weight: 800;
color: var(--cor-texto);
}

.topbar small {
color: var(--cor-texto-suave);
}

/* ======================================================
CARDS
====================================================== */

.page-card {
background: var(--cor-card);
border-radius: var(--radius);
padding: 22px;
box-shadow: var(--sombra-card);
border: 1px solid transparent;
margin-bottom: 20px;
}

.card-resumo {
border: none;
border-radius: var(--radius);
box-shadow: var(--sombra-card);
background: var(--cor-card);
overflow: hidden;
}

.card-resumo .card-body {
padding: 22px;
}

.card-resumo .titulo {
font-size: 14px;
color: var(--cor-texto-suave);
margin-bottom: 10px;
font-weight: 600;
}

.card-resumo .valor {
font-size: 30px;
font-weight: 800;
line-height: 1.2;
}

/* ======================================================
BOTÕES
====================================================== */

.btn {
border-radius: 10px !important;
font-weight: 600;
padding: 10px 16px;
box-shadow: none !important;
}

.btn-primary,
.btn-success {
background: var(--cor-botao) !important;
border-color: var(--cor-botao) !important;
color: var(--cor-botao-texto) !important;
}

.btn-primary:hover,
.btn-success:hover {
filter: brightness(0.95);
}

.btn-secondary {
background: #6c757d !important;
border-color: #6c757d !important;
}

.btn-danger {
background: #dc3545 !important;
border-color: #dc3545 !important;
}

.btn-warning {
background: #ffc107 !important;
border-color: #ffc107 !important;
}

.btn-info {
background: #0dcaf0 !important;
border-color: #0dcaf0 !important;
}

/* ======================================================
FORMULÁRIOS
====================================================== */

.form-label {
font-weight: 600;
color: var(--cor-texto);
margin-bottom: 6px;
}

.form-control,
.form-select {
border-radius: 10px !important;
border: 1px solid var(--cor-borda) !important;
padding: 10px 14px !important;
min-height: 44px;
font-size: 15px;
transition: all 0.2s ease;
background: #fff;
}

.form-control:focus,
.form-select:focus {
border-color: var(--cor-primaria) !important;
box-shadow: 0 0 0 0.15rem rgba(13, 110, 253, 0.15) !important;
}

textarea.form-control {
min-height: 100px;
}

/* ======================================================
TABELAS
====================================================== */

.table {
margin-bottom: 0;
vertical-align: middle;
}

.table thead th {
background: #f8fafc;
color: var(--cor-texto);
font-weight: 700;
font-size: 14px;
border-bottom: 1px solid var(--cor-borda);
white-space: nowrap;
}

.table td,
.table th {
padding: 14px 12px;
}

.table-hover tbody tr:hover {
background: #f8fbff;
}

/* ======================================================
ALERTAS
====================================================== */

.alert {
border: none;
border-radius: 12px;
padding: 14px 16px;
font-weight: 500;
}

.alert-success {
background: #d1e7dd;
color: #0f5132;
}

.alert-danger {
background: #f8d7da;
color: #842029;
}

.alert-info {
background: #cff4fc;
color: #055160;
}

.alert-warning {
background: #fff3cd;
color: #664d03;
}

/* ======================================================
BADGES
====================================================== */

.badge {
padding: 8px 10px;
border-radius: 999px;
font-size: 12px;
font-weight: 700;
}

/* ======================================================
UTILITÁRIOS
====================================================== */

.text-primary {
color: var(--cor-primaria) !important;
}

.text-danger {
color: #dc3545 !important;
}

.text-success {
color: #198754 !important;
}

.fw-bold {
font-weight: 700 !important;
}

/* ======================================================
TABELA DE ITENS / ORÇAMENTOS / ESTOQUE
====================================================== */

.table-responsive {
border-radius: 12px;
}

.total-linha[readonly] {
background: #f8f9fa !important;
font-weight: 600;
}

/* ======================================================
ÁREA DE CONFIGURAÇÕES
====================================================== */

.form-control-color {
width: 100% !important;
min-width: 100%;
height: 46px;
padding: 6px !important;
border-radius: 10px !important;
cursor: pointer;
}

/* ======================================================
RESPONSIVO
====================================================== */

@media (max-width: 1200px) {
.card-resumo .valor {
font-size: 26px;
}
}

@media (max-width: 991px) {
.sidebar {
position: relative;
width: 100%;
height: auto;
padding-bottom: 10px;
}

.sidebar-brand {
padding-bottom: 16px;
}

.main-content {
margin-left: 0;
width: 100%;
padding: 18px;
}

.system-wrapper {
display: block;
}

.topbar,
.page-card {
border-radius: 14px;
}
}

@media (max-width: 768px) {
.main-content {
padding: 14px;
}

.topbar {
padding: 16px;
}

.topbar h4 {
font-size: 21px;
}

.page-card {
padding: 16px;
}

.card-resumo .card-body {
padding: 18px;
}

.card-resumo .valor {
font-size: 24px;
}

.sidebar-menu li a {
font-size: 15px;
padding: 12px 18px;
}

.table td,
.table th {
padding: 10px 8px;
font-size: 14px;
}
}

@media (max-width: 576px) {
.login-card .card-body {
padding: 24px;
}

.topbar h4 {
font-size: 20px;
}

.btn {
width: 100%;
}

.d-flex.gap-2 {
flex-direction: column;
}
}

/* ===== LOGO CORRETA ===== */
.sidebar-logo {
    height: 60px !important;
    max-width: 160px !important;
    width: auto !important;
    object-fit: contain !important;
    display: block;
    margin: 0 auto 8px auto;
}

.sidebar-brand {
    text-align: center;
    padding: 16px;
}

/* ===== MENU MOBILE DESLIZANTE ===== */
.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: .3s;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-slide-menu {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100vh;
    background: #fff;
    z-index: 9999;
    padding: 20px;
    transition: .3s;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-slide-menu.active {
    right: 0;
}

.mobile-slide-menu a {
    padding: 14px;
    border-radius: 12px;
    background: #f1f5f9;
    text-decoration: none;
    color: #333;
    font-weight: 600;
}

.mobile-slide-menu a i {
    margin-right: 10px;
    color: var(--cor-primaria);
}

.mobile-slide-menu .logout {
    margin-top: auto;
    background: #fee2e2;
    color: #b91c1c;
}

.mobile-slide-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.mobile-slide-header button {
    border: none;
    background: #eee;
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

/* ======================================================
PROJETO ELÉTRICO - MODAL DO ORÇAMENTO
====================================================== */

.projeto-eletrico-resumo {
    background: #fff8db;
    border: 1px solid #ffe08a;
    border-radius: 14px;
    padding: 16px;
}

.projeto-eletrico-resumo h6 {
    font-weight: 800;
    margin-bottom: 10px;
    color: #664d03;
}

.projeto-eletrico-resumo ul {
    margin: 0;
    padding-left: 18px;
}

.projeto-eletrico-resumo li {
    margin-bottom: 6px;
}

#modalProjetoEletrico .modal-content {
    border: none;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
}

#modalProjetoEletrico .modal-header {
    padding: 18px 22px;
}

#modalProjetoEletrico .modal-title {
    font-weight: 800;
}

#modalProjetoEletrico .modal-body {
    padding: 22px;
}

#modalProjetoEletrico .form-label {
    font-size: 14px;
}

#modalProjetoEletrico .form-control,
#modalProjetoEletrico .form-select {
    min-height: 45px;
}

#listaProjetoEletricoGerada {
    display: none;
}

@media (max-width: 576px) {
    #modalProjetoEletrico .modal-dialog {
        margin: 8px;
    }

    #modalProjetoEletrico .modal-body {
        padding: 16px;
    }
}

/* ======================================================
DASHBOARD MODERNO - ADMIN E TÉCNICO
====================================================== */
.dashboard-pro {
    background: linear-gradient(180deg, #f8fbff 0%, var(--cor-fundo) 38%, var(--cor-fundo) 100%);
}

.dashboard-hero {
    background: radial-gradient(circle at top right, rgba(59, 130, 246, .38), transparent 34%), linear-gradient(135deg, #0f172a, #1d4ed8);
    color: #fff;
    border-radius: 28px;
    padding: 28px;
    box-shadow: 0 22px 55px rgba(15, 23, 42, .22);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    overflow: hidden;
}

.dashboard-hero h2 {
    font-size: clamp(26px, 4vw, 42px);
    font-weight: 900;
    margin: 4px 0 6px;
}

.dashboard-hero p {
    margin: 0;
    color: rgba(255,255,255,.78);
    font-weight: 500;
}

.hero-kicker {
    display: inline-flex;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.18);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.quick-action-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.quick-action {
    background: rgba(255,255,255,.9);
    border: 1px solid #e8eef7;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .06);
    border-radius: 20px;
    padding: 18px;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    transition: .2s ease;
}

.quick-action:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 36px rgba(15, 23, 42, .1);
    color: var(--cor-primaria);
}

.quick-action i {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef6ff;
    color: var(--cor-primaria);
}

.metric-card, .finance-card, .panel-pro, .current-job-card {
    background: rgba(255,255,255,.94);
    border: 1px solid #e8eef7;
    border-radius: 24px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, .07);
}

.metric-card {
    padding: 18px;
    min-height: 148px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.metric-card span, .finance-card span {
    color: #64748b;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.metric-card strong {
    font-size: 34px;
    font-weight: 900;
    line-height: 1;
    color: #0f172a;
}

.metric-icon {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.bg-soft-blue { background: #dbeafe; color: #1d4ed8; }
.bg-soft-indigo { background: #e0e7ff; color: #4338ca; }
.bg-soft-yellow { background: #fef3c7; color: #b45309; }
.bg-soft-green { background: #dcfce7; color: #15803d; }
.bg-soft-red { background: #fee2e2; color: #b91c1c; }

.finance-card {
    padding: 22px;
    min-height: 130px;
}

.finance-card strong {
    display: block;
    font-size: clamp(22px, 3vw, 31px);
    font-weight: 900;
    margin: 8px 0 4px;
    color: #0f172a;
}

.finance-card small {
    color: #64748b;
    font-weight: 600;
}

.finance-card.highlight {
    background: linear-gradient(135deg, #0f172a, #2563eb);
    color: #fff;
}

.finance-card.highlight span, .finance-card.highlight small { color: rgba(255,255,255,.78); }
.finance-card.highlight strong { color: #fff; }

.panel-pro, .current-job-card {
    padding: 22px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.panel-header h5 {
    margin: 0;
    font-size: 18px;
    font-weight: 900;
    color: #0f172a;
}

.panel-header small {
    color: #64748b;
    font-weight: 600;
}

.reminder-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.reminder-summary div {
    border-radius: 16px;
    padding: 14px;
    background: #f8fafc;
    border: 1px solid #eef2f7;
}

.reminder-summary strong {
    display: block;
    font-size: 24px;
    font-weight: 900;
}

.reminder-summary span {
    font-size: 12px;
    color: #64748b;
    font-weight: 700;
}

.reminder-list-pro {
    display: grid;
    gap: 12px;
}

.reminder-item-pro {
    border: 1px solid #edf2f7;
    border-left: 6px solid #3b82f6;
    background: #fff;
    border-radius: 18px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    gap: 14px;
}

.reminder-item-pro.priority-alta { border-left-color: #ef4444; }
.reminder-item-pro.priority-media { border-left-color: #f59e0b; }
.reminder-item-pro.priority-baixa { border-left-color: #22c55e; }

.reminder-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.reminder-main strong { color: #0f172a; }
.reminder-main small { display: block; color: #64748b; font-weight: 600; margin-top: 3px; }
.reminder-main p { margin: 8px 0 0; color: #64748b; }
.reminder-main audio { width: 100%; max-width: 320px; height: 34px; margin-top: 10px; }

.pill, .live-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eef6ff;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.live-pill { background: #dcfce7; color: #15803d; }

.reminder-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 92px;
}

.empty-state {
    min-height: 110px;
    border: 1px dashed #dbe3ef;
    border-radius: 18px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #64748b;
    font-weight: 700;
    text-align: center;
    padding: 18px;
}

.empty-state.large { min-height: 230px; flex-direction: column; }
.empty-state i { font-size: 24px; color: #94a3b8; }

.compact-list, .stock-list-pro {
    display: grid;
    gap: 10px;
}

.compact-item, .stock-item-pro {
    display: block;
    padding: 14px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid #eef2f7;
    color: #111827;
}

.compact-item span, .stock-item-pro strong {
    display: block;
    font-weight: 900;
}

.compact-item small, .stock-item-pro small {
    color: #64748b;
    font-weight: 600;
}

.modern-table thead th {
    background: #f8fafc;
    border-bottom: 1px solid #e8eef7;
}

.technician-hero {
    background: radial-gradient(circle at top right, rgba(34, 197, 94, .35), transparent 34%), linear-gradient(135deg, #052e16, #166534);
}

.current-job-card {
    min-height: 100%;
}

.job-focus {
    background: linear-gradient(180deg, #f8fafc, #ffffff);
    border-radius: 22px;
    border: 1px solid #e8eef7;
    padding: 24px;
}

.job-status {
    display: inline-flex;
    padding: 7px 12px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 900;
    text-transform: uppercase;
    font-size: 12px;
}

.job-focus h3 {
    margin: 14px 0;
    font-size: clamp(24px, 4vw, 34px);
    font-weight: 900;
    color: #0f172a;
}

.job-focus p {
    color: #475569;
    font-weight: 700;
    margin-bottom: 8px;
}

.job-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.service-card-pro {
    border: 1px solid #e8eef7;
    border-radius: 20px;
    padding: 18px;
    background: #fff;
}

.service-top, .service-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.service-top span:first-child {
    font-weight: 900;
    color: #1d4ed8;
}

.service-card-pro h5 {
    font-weight: 900;
    margin: 12px 0 6px;
}

.service-card-pro p, .service-card-pro small {
    color: #64748b;
    font-weight: 700;
}

.service-actions { margin-top: 14px; }

@media (max-width: 991px) {
    .dashboard-hero { align-items: flex-start; flex-direction: column; }
    .hero-actions { justify-content: flex-start; width: 100%; }
    .quick-action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 576px) {
    .dashboard-pro { padding: 12px; }
    .dashboard-hero { border-radius: 22px; padding: 22px; }
    .quick-action-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .quick-action { padding: 14px; flex-direction: column; align-items: flex-start; }
    .metric-card { min-height: 132px; padding: 15px; }
    .metric-card strong { font-size: 29px; }
    .reminder-summary { grid-template-columns: 1fr; }
    .reminder-item-pro { flex-direction: column; }
    .reminder-actions { flex-direction: row; min-width: 0; }
    .service-grid { grid-template-columns: 1fr; }
    .job-actions .btn, .hero-actions .btn { width: 100%; }
}

/* =========================================================
MODAL PROJETO ELÉTRICO MOBILE
========================================================= */

@media (max-width: 768px){

    #modalProjetoEletrico .modal-dialog{
        margin: 10px auto;
        max-width: calc(100% - 20px);
    }

    #modalProjetoEletrico .modal-content{
        border-radius: 16px;
        overflow: hidden;
    }

    #modalProjetoEletrico .modal-body{
        max-height: 70vh;
        overflow-y: auto;
        padding-bottom: 15px;
    }

    #modalProjetoEletrico .modal-footer{
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
        background: #fff;
        border-top: 1px solid #ddd;
    }

    #modalProjetoEletrico .modal-footer .btn{
        flex: 1;
        min-height: 48px;
    }
}