/* ========================================
   Portal Condeti — Main Stylesheet
   ======================================== */

:root {
    --primary:       #1a3a5c;
    --primary-light: #1e4a78;
    --accent:        #e8710a;
    --accent-dark:   #c95e00;
    --sidebar-bg:    #12253a;
    --sidebar-width: 260px;
    --topbar-h:      60px;
    --bg:            #f0f2f5;
    --card-bg:       #ffffff;
    --text:          #2d3748;
    --text-muted:    #718096;
    --border:        #e2e8f0;
    --success:       #28a745;
    --danger:        #dc3545;
    --warning:       #ffc107;
    --info:          #17a2b8;
}

* { box-sizing: border-box; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); margin: 0; }

/* ── Layout ── */
.wrapper { display: flex; min-height: 100vh; }
#sidebar  { width: var(--sidebar-width); background: var(--sidebar-bg); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; height: 100vh; z-index: 1000; transition: transform .25s ease; overflow-y: auto; }
#content  { flex: 1; margin-left: var(--sidebar-width); display: flex; flex-direction: column; min-height: 100vh; transition: margin-left .25s ease; }

/* ── Sidebar ── */
.sidebar-header { padding: 24px 20px 20px; display: flex; flex-direction: column; align-items: center; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-logo   { max-width: 140px; max-height: 64px; object-fit: contain; margin-bottom: 10px; background: #fff; border-radius: 8px; padding: 6px 10px; }
.sidebar-company { color: #fff; font-size: .75rem; font-weight: 600; text-align: center; letter-spacing: .05em; text-transform: uppercase; opacity: .8; }

.sidebar-nav { list-style: none; padding: 12px 0; margin: 0; flex: 1; }
.sidebar-nav .nav-label { color: rgba(255,255,255,.35); font-size: .65rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 16px 20px 4px; }
.sidebar-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 20px; color: rgba(255,255,255,.7); text-decoration: none; font-size: .875rem; border-left: 3px solid transparent; transition: all .15s; }
.sidebar-nav a:hover  { color: #fff; background: rgba(255,255,255,.06); }
.sidebar-nav a.active { color: #fff; background: rgba(232,113,10,.15); border-left-color: var(--accent); font-weight: 600; }
.sidebar-nav i { font-size: 1rem; width: 18px; }

.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 10px; }
.user-avatar    { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; flex-shrink: 0; }
.user-details   { flex: 1; min-width: 0; }
.user-name  { display: block; color: #fff; font-size: .825rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role  { display: block; color: rgba(255,255,255,.45); font-size: .7rem; }
.btn-logout { color: rgba(255,255,255,.5); font-size: 1.1rem; text-decoration: none; transition: color .15s; }
.btn-logout:hover { color: #fff; }

/* ── Topbar ── */
.topbar { height: var(--topbar-h); background: var(--card-bg); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; position: sticky; top: 0; z-index: 100; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.btn-toggle { background: none; border: none; font-size: 1.4rem; color: var(--text-muted); cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.btn-toggle:hover { background: var(--bg); color: var(--text); }

/* ── Main Content ── */
.main-content { padding: 28px 32px; flex: 1; }

/* ── Page Header ── */
.page-header { margin-bottom: 24px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.page-header h1 { font-size: 1.5rem; font-weight: 700; color: var(--primary); margin: 0; }
.page-header .breadcrumb { margin: 0; }

/* ── Cards ── */
.card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.card-header { background: transparent; border-bottom: 1px solid var(--border); padding: 16px 20px; font-weight: 600; color: var(--primary); }

/* ── Stat Cards ── */
.stat-card { border-radius: 10px; padding: 20px; color: #fff; position: relative; overflow: hidden; }
.stat-card .stat-icon { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 3rem; opacity: .2; }
.stat-card .stat-value { font-size: 1.8rem; font-weight: 700; line-height: 1; }
.stat-card .stat-label { font-size: .8rem; opacity: .85; margin-top: 4px; }
.stat-card .stat-sub   { font-size: .75rem; opacity: .7; margin-top: 6px; }
.stat-blue   { background: linear-gradient(135deg, #1a3a5c, #1e4a78); }
.stat-orange { background: linear-gradient(135deg, #e8710a, #f08931); }
.stat-green  { background: linear-gradient(135deg, #1e8449, #27ae60); }
.stat-red    { background: linear-gradient(135deg, #922b21, #c0392b); }
.stat-purple { background: linear-gradient(135deg, #6c3483, #8e44ad); }

/* ── Buttons ── */
.btn-primary   { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-light); border-color: var(--primary-light); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }

/* ── Tables ── */
.table-hover tbody tr:hover { background: rgba(26,58,92,.04); }
.table th { color: var(--text-muted); font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; border-color: var(--border); }
.table td { vertical-align: middle; border-color: var(--border); font-size: .875rem; }

/* ── Badges (status) ── */
.badge-rascunho  { background: #718096; color: #fff; }
.badge-enviado   { background: #17a2b8; color: #fff; }
.badge-aprovado  { background: #28a745; color: #fff; }
.badge-rejeitado { background: #dc3545; color: #fff; }
.badge-cancelado { background: #6c757d; color: #fff; }

/* ── Forms ── */
.form-label { font-weight: 500; font-size: .875rem; color: var(--text); }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 .2rem rgba(26,58,92,.15); }
.input-group-text { background: var(--bg); border-color: var(--border); }

/* ── Orcamento Builder ── */
.items-table thead th { background: var(--primary); color: #fff; font-size: .75rem; }
.items-table .item-row td { padding: 6px 8px; }
.items-table .item-row:hover { background: rgba(26,58,92,.03); }
.total-box { background: var(--primary); color: #fff; border-radius: 8px; padding: 16px 20px; }
.total-box .total-label { font-size: .8rem; opacity: .75; }
.total-box .total-value { font-size: 1.6rem; font-weight: 700; }

/* ── Status colors ── */
.text-aprovado  { color: var(--success); }
.text-rejeitado { color: var(--danger); }
.text-enviado   { color: var(--info); }
.text-rascunho  { color: var(--text-muted); }

/* ── Approval Page ── */
.approval-wrapper { min-height: 100vh; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 40px 16px; }
.approval-card { background: #fff; border-radius: 16px; box-shadow: 0 4px 24px rgba(0,0,0,.1); max-width: 800px; width: 100%; overflow: hidden; }
.approval-header { background: var(--primary); color: #fff; padding: 32px 40px; }
.approval-header h2 { font-size: 1.1rem; font-weight: 400; opacity: .8; margin: 0 0 4px; }
.approval-header h1 { font-size: 1.8rem; font-weight: 700; margin: 0; }
.approval-body { padding: 32px 40px; }
.approval-footer { padding: 24px 40px; background: var(--bg); display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── Print / PDF ── */
@media print {
    #sidebar, .topbar, .btn, .page-header .btn, .alert, .no-print { display: none !important; }
    #content { margin: 0 !important; }
    .main-content { padding: 0 !important; }
    .card { box-shadow: none !important; border: 1px solid #ddd !important; }
    body { background: #fff !important; }
    .pdf-header { display: block !important; }
}
.pdf-header { display: none; }

/* ── Responsive ── */
@media (max-width: 768px) {
    #sidebar { transform: translateX(-100%); }
    #sidebar.open { transform: translateX(0); }
    #content { margin-left: 0; }
    .main-content { padding: 20px 16px; }
    .stat-card .stat-value { font-size: 1.4rem; }
}

/* ── Utilities ── */
.cursor-pointer { cursor: pointer; }
.rounded-lg { border-radius: 10px; }
.shadow-sm { box-shadow: 0 1px 3px rgba(0,0,0,.06) !important; }
