:root {
    --ink: #132238;
    --muted: #64748b;
    --line: #e2e8f0;
    --surface: #ffffff;
    --soft: #f6f8fb;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --sidebar: #0f172a;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background: var(--soft);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1040;
    width: 280px;
    display: flex;
    flex-direction: column;
    padding: 24px 18px;
    background: var(--sidebar);
    color: #fff;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
    color: #fff;
    text-decoration: none;
    font-size: 1.15rem;
    font-weight: 800;
}

.brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 8px;
    background: var(--primary);
}

.sidebar-nav { gap: 6px; }

.sidebar .nav-link,
.logout {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 600;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active,
.logout:hover {
    background: rgba(255,255,255,.1);
    color: #fff;
}

.logout { margin-top: auto; }

.main-content {
    width: 100%;
    margin-left: 280px;
    padding: 28px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.topbar h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 0;
}

.topbar-kicker {
    margin: 0 0 4px;
    color: var(--muted);
    font-size: .88rem;
    font-weight: 700;
    text-transform: uppercase;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--muted);
    font-weight: 700;
}

.btn-icon {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--line);
    background: #fff;
}

.panel,
.stat-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .05);
}

.panel { padding: 20px; }

.stat-card {
    padding: 18px;
    min-height: 132px;
}

.stat-card .icon {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    margin-bottom: 12px;
    border-radius: 8px;
    background: #eef4ff;
    color: var(--primary);
    font-size: 1.2rem;
}

.stat-card p { margin: 0; color: var(--muted); font-weight: 700; }
.stat-card strong { display: block; margin-top: 6px; font-size: 1.55rem; }

.table {
    --bs-table-bg: transparent;
    vertical-align: middle;
}

.quotes-table-wrap { overflow-x: auto; }

.status-menu {
    min-width: 170px;
    box-shadow: 0 16px 36px rgba(15, 23, 42, .14);
    border-color: var(--line);
    border-radius: 8px;
    padding: 6px;
}

.status-menu.dropdown-menu-floating {
    position: fixed !important;
    z-index: 2050;
    display: block;
}

.table thead th {
    color: var(--muted);
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: 0;
}

.badge-status {
    border-radius: 8px;
    padding: 7px 10px;
    font-weight: 800;
}

.status-pendente { background: #fff7ed; color: var(--warning); }
.status-aprovado { background: #ecfdf5; color: var(--success); }
.status-recusado { background: #fef2f2; color: var(--danger); }

.form-label { font-weight: 700; color: #334155; }
.form-control, .form-select { border-radius: 8px; border-color: var(--line); min-height: 44px; }
.btn { border-radius: 8px; font-weight: 700; }

.delete-modal {
    border: 0;
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .24);
}

.delete-modal .modal-header {
    align-items: flex-start;
    padding: 22px 22px 0;
}

.delete-modal .modal-body,
.delete-modal .modal-footer {
    padding-left: 22px;
    padding-right: 22px;
}

.delete-modal-icon {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 8px;
    background: #fef2f2;
    color: var(--danger);
    font-size: 1.35rem;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        linear-gradient(135deg, rgba(37,99,235,.92), rgba(15,23,42,.95)),
        url("https://images.unsplash.com/photo-1503387762-592deb58ef4e?auto=format&fit=crop&w=1800&q=80") center/cover;
}

.login-card {
    width: min(440px, 100%);
    padding: 30px;
    border-radius: 8px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 24px 70px rgba(15,23,42,.28);
}

.quote-print { background: #fff; color: #111827; }

@media print {
    .sidebar, .topbar, .no-print, .alert { display: none !important; }
    .main-content { margin: 0; padding: 0; }
    .panel { border: 0; box-shadow: none; padding: 0; }
    body { background: #fff; }
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .2s ease;
    }
    .sidebar.open { transform: translateX(0); }
    .main-content {
        margin-left: 0;
        padding: 18px;
    }
    .topbar { align-items: flex-start; }
    .user-chip { display: none; }
}
