/* ===========================
   Emendas Parlamentares - Custom CSS
   Color scheme: Deep Blue #1e3a5f | Accent Green #28a745 | Orange #fd7e14
   =========================== */

:root {
    --primary-dark: #1e3a5f;
    --primary-medium: #2d5484;
    --accent-green: #28a745;
    --accent-orange: #fd7e14;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 0px;
    --bg-subtle: #f8f9fb;
}

/* ---- General ---- */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-subtle);
    font-size: 0.9rem;
}

/* ---- Layout ---- */
#wrapper {
    display: flex;
    min-height: 100vh;
}

#sidebar-wrapper {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: linear-gradient(180deg, #1e3a5f 0%, #0d2240 100%);
    transition: width 0.25s ease;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

#sidebar-wrapper.collapsed {
    width: 0;
    overflow: hidden;
}

#page-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ---- Sidebar ---- */
.sidebar-heading {
    background: rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    min-height: 70px;
}

.sidebar-section-header {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    padding: 1rem 1rem 0.25rem;
}

.sidebar-nav .list-group-item {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.75);
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
    border-radius: 0;
    transition: all 0.15s ease;
}

.sidebar-nav .list-group-item:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.sidebar-nav .list-group-item.active {
    background: var(--accent-green) !important;
    color: #fff !important;
    font-weight: 600;
}

/* ---- Navbar ---- */
.navbar {
    min-height: 60px;
}

/* ---- Colors ---- */
.bg-primary-custom {
    background-color: var(--primary-dark) !important;
}

.btn-primary-custom {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    color: white;
}
.btn-primary-custom:hover {
    background-color: var(--primary-medium);
    border-color: var(--primary-medium);
    color: white;
}

.text-accent { color: var(--accent-green) !important; }
.text-muted-custom { color: rgba(255,255,255,0.45) !important; }

/* ---- KPI Cards ---- */
.kpi-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    border-radius: 0.75rem !important;
}
.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1) !important;
}

.display-kpi {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.bg-primary-light { background: rgba(13, 110, 253, 0.1); }
.bg-success-light { background: rgba(25, 135, 84, 0.1); }
.bg-warning-light { background: rgba(255, 193, 7, 0.15); }
.bg-danger-light { background: rgba(220, 53, 69, 0.1); }
.bg-info-light { background: rgba(13, 202, 240, 0.1); }

/* ---- Cards ---- */
.card {
    border-radius: 0.75rem !important;
}

.card-hover {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card-hover:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12) !important;
}

.card-header {
    border-radius: 0.75rem 0.75rem 0 0 !important;
}

/* ---- Login Page ---- */
.bg-login {
    background: linear-gradient(135deg, #1e3a5f 0%, #0d2240 50%, #1a4a2e 100%);
    min-height: 100vh;
}

/* ---- Timeline ---- */
.timeline {
    position: relative;
    padding-left: 1.5rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #dee2e6;
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
    padding-left: 1rem;
}

.timeline-marker {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #dee2e6;
    position: absolute;
    left: -1.5rem;
    top: 2px;
}

.timeline-content {
    background: var(--bg-subtle);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid #e9ecef;
}

.timeline-sm .timeline-item {
    padding-bottom: 1rem;
}
.timeline-sm .timeline-content {
    padding: 0.5rem 0.75rem;
}

/* ---- Detail Labels ---- */
.detail-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

/* ---- Typography helpers ---- */
.xsmall { font-size: 0.7rem; }

/* ---- Table improvements ---- */
.table > :not(caption) > * > * {
    padding: 0.65rem 0.75rem;
}

/* ---- Badge tweaks ---- */
.badge {
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* ---- Form improvements ---- */
.form-control:focus, .form-select:focus {
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 0.2rem rgba(30, 58, 95, 0.15);
}

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

/* ---- Progress bars ---- */
.progress {
    height: 8px;
    border-radius: 4px;
}

/* ---- Toasts ---- */
#toast-container .toast {
    min-width: 300px;
    margin-bottom: 0.5rem;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    #sidebar-wrapper {
        position: fixed;
        z-index: 1050;
        width: 0;
        overflow: hidden;
    }
    #sidebar-wrapper.show {
        width: var(--sidebar-width);
    }
    #page-content-wrapper {
        width: 100%;
    }
}

/* ---- Scrollbar ---- */
#sidebar-wrapper::-webkit-scrollbar {
    width: 4px;
}
#sidebar-wrapper::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
}
#sidebar-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
}

/* ---- Public portal ---- */
.navbar.bg-primary-custom {
    background: linear-gradient(135deg, #1e3a5f 0%, #0d2240 100%) !important;
}

/* ---- Alert subtle ---- */
.alert-sm {
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
}
