/**
 * Helptec Finance Dashboard - Modern Design System
 * Brand: Blue/Azure palette inspired by Helptec
 */

/* ═══════════════════════════════════════════
   CSS VARIABLES - Design Tokens
   ═══════════════════════════════════════════ */
:root {
    /* Brand Colors */
    --primary: #0066CC;
    --primary-dark: #004C99;
    --primary-darker: #003366;
    --primary-light: #338FE6;
    --primary-bg: #E8F4FD;

    /* Accent */
    --accent: #00AACC;
    --accent-light: #33CCDD;
    --accent-bg: #E0F7FA;

    /* Semantic */
    --success: #10B981;
    --success-bg: #D1FAE5;
    --danger: #EF4444;
    --danger-bg: #FEE2E2;
    --warning: #F59E0B;
    --warning-bg: #FEF3C7;
    --info: #3B82F6;
    --info-bg: #DBEAFE;

    /* Neutrals */
    --gray-50: #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1E293B;
    --gray-900: #0F172A;

    /* Layout */
    --sidebar-width: 260px;
    --topbar-height: 64px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.06);

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ═══════════════════════════════════════════
   GLOBAL RESET & BASE
   ═══════════════════════════════════════════ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: var(--font-sans);
    background-color: var(--gray-50);
    color: var(--gray-800);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ═══════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════ */
.wrapper {
    min-height: 100vh;
    display: flex;
}

.main-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.content-wrapper {
    flex: 1;
    padding: 1.75rem;
    max-width: 1600px;
}

/* ═══════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════ */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary-darker) 0%, var(--primary-dark) 50%, var(--primary) 100%);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1050;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}

.sidebar-header {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.15);
}

.sidebar-header h4 {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -0.01em;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-header small {
    display: block;
    margin-top: 4px;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 0.05em;
}

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

.sidebar-item {
    list-style: none;
}

.sidebar-section {
    margin-top: 1.25rem;
    margin-bottom: 0.4rem;
    padding: 0 1.25rem;
}

.sidebar-section span {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.3);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    padding: 0.55rem 1.25rem;
    margin: 1px 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.8;
}

.sidebar-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border-left-color: var(--accent);
}

.sidebar-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border-left-color: var(--accent-light);
    font-weight: 600;
}

/* ═══════════════════════════════════════════
   TOPBAR
   ═══════════════════════════════════════════ */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}

.topbar h5 {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--gray-800);
    letter-spacing: -0.01em;
}

.sidebar-toggle {
    color: var(--primary);
    border: none;
    padding: 0.4rem;
    font-size: 1.1rem;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.sidebar-toggle:hover {
    background: var(--primary-bg);
    color: var(--primary-dark);
}

/* ═══════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════ */
.footer {
    background: var(--gray-800);
    color: var(--gray-400);
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-700);
    font-size: 0.75rem;
}

/* ═══════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════ */
.card {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    background: #fff;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--gray-700);
}

.card-header h5 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gray-700);
    margin: 0;
}

.card-header h5 i {
    color: var(--primary);
    margin-right: 0.5rem;
}

.card-body {
    padding: 1.25rem;
}

/* KPI Cards - Dashboard */
.card.bg-light {
    background: #fff !important;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.card.bg-light::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.card.bg-light:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card.bg-light h6 {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-500);
}

.card.bg-light h3 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--gray-800);
}

/* ═══════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════ */
.table {
    background: #fff;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 0;
    font-size: 0.85rem;
}

.table thead {
    background: var(--gray-50);
}

.table thead th,
.table-light th {
    background: var(--gray-50) !important;
    color: var(--gray-600) !important;
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}

.table tbody tr {
    border-color: var(--gray-100);
    transition: background-color 0.15s ease;
}

.table tbody tr:hover {
    background-color: var(--primary-bg) !important;
}

.table tbody td {
    padding: 0.7rem 1rem;
    vertical-align: middle;
    color: var(--gray-700);
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(0,102,204,0.015);
}

/* ═══════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════ */
.form-label {
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.82rem;
    margin-bottom: 0.35rem;
}

.form-control,
.form-select {
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.85rem;
    font-size: 0.88rem;
    color: var(--gray-800);
    background: #fff;
    transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.12);
    outline: none;
}

.form-control:disabled,
.form-control[readonly] {
    background: var(--gray-100);
    color: var(--gray-500);
}

/* ═══════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════ */
.btn {
    font-weight: 600;
    padding: 0.5rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    letter-spacing: 0.01em;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.btn-success {
    background: var(--success);
    border-color: var(--success);
}
.btn-success:hover {
    background: #059669;
    border-color: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}
.btn-outline-primary:hover {
    background: var(--primary);
    color: #fff;
}

.btn-outline-danger {
    color: var(--danger);
    border-color: var(--gray-300);
    background: transparent;
}
.btn-outline-danger:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.btn-secondary {
    background: var(--gray-200);
    border-color: var(--gray-200);
    color: var(--gray-700);
}
.btn-secondary:hover {
    background: var(--gray-300);
    border-color: var(--gray-300);
    color: var(--gray-800);
}

.btn-sm {
    padding: 0.3rem 0.7rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 0.65rem 1.5rem;
    font-size: 0.9rem;
}

/* ═══════════════════════════════════════════
   ALERTS
   ═══════════════════════════════════════════ */
.alert {
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.85rem 1.15rem;
    font-size: 0.85rem;
    animation: alertSlide 0.3s ease;
}

@keyframes alertSlide {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.alert-success {
    background: var(--success-bg);
    color: #065F46;
    border-left: 4px solid var(--success);
}
.alert-danger {
    background: var(--danger-bg);
    color: #991B1B;
    border-left: 4px solid var(--danger);
}
.alert-warning {
    background: var(--warning-bg);
    color: #92400E;
    border-left: 4px solid var(--warning);
}
.alert-info {
    background: var(--info-bg);
    color: #1E40AF;
    border-left: 4px solid var(--info);
}

/* Cost Alert Specific */
.alert-cost-warning {
    background: linear-gradient(135deg, #FFF7ED, #FEF3C7);
    border: 1px solid #FCD34D;
    border-left: 5px solid var(--warning);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
}

.alert-cost-warning .cost-alert-title {
    font-weight: 700;
    color: #92400E;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.alert-cost-warning .cost-alert-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0;
    border-bottom: 1px solid rgba(251, 191, 36, 0.2);
    font-size: 0.82rem;
}

.alert-cost-warning .cost-alert-item:last-child {
    border-bottom: none;
}

.alert-cost-warning .cost-category {
    font-weight: 600;
    color: var(--gray-700);
}

.alert-cost-warning .cost-change {
    font-weight: 700;
    color: var(--danger);
    background: var(--danger-bg);
    padding: 0.15rem 0.5rem;
    border-radius: 100px;
    font-size: 0.75rem;
}

/* ═══════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════ */
.badge {
    padding: 0.3rem 0.6rem;
    font-weight: 600;
    font-size: 0.72rem;
    border-radius: 100px;
    letter-spacing: 0.02em;
}

.bg-success { background: var(--success) !important; }
.bg-danger { background: var(--danger) !important; }
.bg-warning { background: var(--warning) !important; color: #92400E !important; }
.bg-info { background: var(--info) !important; }

/* ═══════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════ */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-darker) 0%, var(--primary) 40%, var(--accent) 100%);
    position: relative;
}

.login-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.login-card {
    background: rgba(255, 255, 255, 0.97);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl), 0 0 60px rgba(0, 0, 0, 0.08);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

.login-card h2 {
    color: var(--primary);
    font-weight: 800;
    font-size: 1.6rem;
    text-align: center;
    letter-spacing: -0.02em;
}

.login-card .subtitle {
    text-align: center;
    color: var(--gray-500);
    font-size: 0.85rem;
    margin-bottom: 2rem;
}

.login-card .form-group {
    margin-bottom: 1.25rem;
}

.login-card .form-control {
    padding: 0.7rem 1rem;
    border-radius: var(--radius-sm);
}

.login-card .btn-login {
    width: 100%;
    padding: 0.75rem;
    font-weight: 700;
    font-size: 0.9rem;
    margin-top: 0.75rem;
    background: var(--primary);
    border-color: var(--primary);
    border-radius: var(--radius-sm);
    text-transform: none;
    letter-spacing: 0;
}

.login-card .btn-login:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.35);
}

.login-error {
    background: var(--danger-bg);
    color: #991B1B;
    border: none;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--danger);
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
}

/* ═══════════════════════════════════════════
   CHARTS
   ═══════════════════════════════════════════ */
.chart-container {
    position: relative;
    background: #fff;
    border-radius: var(--radius-md);
    padding: 1.25rem;
    height: 400px;
}

canvas {
    max-height: 400px;
}

/* ═══════════════════════════════════════════
   TYPOGRAPHY HELPERS
   ═══════════════════════════════════════════ */
h1, h2, h3, h4, h5, h6 {
    letter-spacing: -0.01em;
    color: var(--gray-800);
}

h1 { font-size: 1.65rem; font-weight: 800; }
h2 { font-size: 1.35rem; font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 700; }

.text-success { color: var(--success) !important; }
.text-danger  { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-muted   { color: var(--gray-500) !important; }

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

/* ═══════════════════════════════════════════
   CUSTOM SCROLLBAR
   ═══════════════════════════════════════════ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--gray-100);
}
::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
/* Sidebar overlay backdrop */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1040;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.sidebar-backdrop.active {
    display: block;
    opacity: 1;
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.active {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0 !important;
    }
    .content-wrapper {
        padding: 1rem;
    }
    /* Scrollable tables on tablet */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
        border: 1px solid var(--gray-200);
        border-radius: var(--radius-sm);
    }
}

@media (max-width: 767.98px) {
    /* Compact KPI cards */
    .card.bg-light h3 {
        font-size: 1.1rem;
    }
    .card.bg-light h6 {
        font-size: 0.62rem;
    }
    .card.bg-light .card-body {
        padding: 0.75rem 0.85rem;
    }
    h1 {
        font-size: 1.2rem;
    }
    h5 {
        font-size: 0.9rem;
    }
    /* Compact tables */
    .table {
        font-size: 0.75rem;
    }
    .table thead th,
    .table tbody td {
        padding: 0.4rem 0.5rem;
        white-space: nowrap;
    }
    .table thead th {
        font-size: 0.65rem;
    }
    /* Sticky first column for data tables */
    .table-responsive .table th:first-child,
    .table-responsive .table td:first-child {
        position: sticky;
        left: 0;
        background: #fff;
        z-index: 2;
        box-shadow: 2px 0 4px rgba(0,0,0,0.06);
    }
    .table-responsive .table thead th:first-child {
        background: var(--gray-50);
        z-index: 3;
    }
    /* Compact card headers */
    .card-header {
        padding: 0.7rem 0.85rem;
    }
    .card-body {
        padding: 0.85rem;
    }
    .login-card {
        margin: 1rem;
        padding: 1.75rem;
    }
    .chart-container, canvas {
        max-height: 260px;
        height: 260px;
    }
    /* Touch-friendly buttons */
    .btn {
        min-height: 38px;
        padding: 0.45rem 0.85rem;
    }
    .btn-sm {
        min-height: 32px;
        padding: 0.3rem 0.6rem;
    }
    /* Topbar compact */
    .topbar .container-fluid {
        padding: 0.5rem 0.75rem;
    }
    .topbar h5 {
        font-size: 0.85rem;
    }
    /* Badge compact */
    .badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.45rem;
    }
    /* Stack filters vertically */
    .d-flex.gap-2 {
        flex-wrap: wrap;
    }
    /* Form selects */
    .form-select-sm {
        font-size: 0.78rem;
        min-height: 34px;
    }
    /* Pagination compact */
    .pagination .page-link {
        padding: 0.3rem 0.55rem;
        font-size: 0.75rem;
    }
    /* Alerts compact */
    .alert {
        padding: 0.6rem 0.85rem;
        font-size: 0.78rem;
    }
    /* Modal on mobile */
    .modal-dialog {
        margin: 0.5rem;
    }
    .modal-lg {
        max-width: calc(100% - 1rem);
    }
}

@media (max-width: 575.98px) {
    .topbar .container-fluid {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    /* Hide "Accesso effettuato come" label */
    .topbar .text-end small.text-muted {
        display: none;
    }
    .chart-container, canvas {
        max-height: 200px;
        height: 200px;
    }
    /* Full width action buttons */
    .d-flex.justify-content-between {
        flex-direction: column;
        gap: 0.75rem;
    }
    /* KPI card row: 2 per row */
    .col-lg-3.col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    /* Heatmap cells tighter */
    .heatmap-cell {
        padding: 4px 2px !important;
        font-size: 0.65rem;
    }
}

/* ═══════════════════════════════════════════
   PRINT
   ═══════════════════════════════════════════ */
@media print {
    .sidebar, .topbar, .footer, .sidebar-toggle, .btn, .alert-cost-warning { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .content-wrapper { padding: 0; }
    body { background: #fff; font-size: 11pt; }
    .card, .table { box-shadow: none; border: 1px solid var(--gray-300); page-break-inside: avoid; }
}

/* ═══════════════════════════════════════════
   TRANSITION UTILITY
   ═══════════════════════════════════════════ */
.fade-in {
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Border-color helpers used in pages */
.border-success { border-color: var(--success) !important; }
.border-danger  { border-color: var(--danger) !important; }
.border-3 { border-width: 3px !important; }

/* ═══════════════════════════════════════════
   FINANCIAL DATA ENHANCEMENTS
   ═══════════════════════════════════════════ */

/* Health Score Circle */
.health-score-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    position: relative;
    background: #fff;
    box-shadow: var(--shadow-md);
}

.health-score-circle .score-value {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
}

.health-score-circle .score-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 4px;
}

.health-score-circle.score-good {
    border: 4px solid var(--success);
    color: var(--success);
}

.health-score-circle.score-warning {
    border: 4px solid var(--warning);
    color: var(--warning);
}

.health-score-circle.score-danger {
    border: 4px solid var(--danger);
    color: var(--danger);
}

/* KPI Mini Cards */
.kpi-mini {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: #fff;
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
    transition: all 0.2s ease;
}

.kpi-mini:hover {
    box-shadow: var(--shadow-sm);
}

.kpi-mini .kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.kpi-mini .kpi-icon.bg-success-light { background: var(--success-bg); color: var(--success); }
.kpi-mini .kpi-icon.bg-danger-light { background: var(--danger-bg); color: var(--danger); }
.kpi-mini .kpi-icon.bg-warning-light { background: var(--warning-bg); color: var(--warning); }
.kpi-mini .kpi-icon.bg-info-light { background: var(--info-bg); color: var(--info); }
.kpi-mini .kpi-icon.bg-primary-light { background: var(--primary-bg); color: var(--primary); }

.kpi-mini .kpi-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-800);
    line-height: 1.2;
}

.kpi-mini .kpi-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Traffic Light Indicator */
.traffic-light {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.65rem;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 600;
}

.traffic-light.tl-green { background: var(--success-bg); color: #065F46; }
.traffic-light.tl-yellow { background: var(--warning-bg); color: #92400E; }
.traffic-light.tl-red { background: var(--danger-bg); color: #991B1B; }

/* Metric Comparison Row */
.metric-compare {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--gray-100);
}

.metric-compare:last-child {
    border-bottom: none;
}

.metric-compare .metric-name {
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.85rem;
}

.metric-compare .metric-values {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.metric-compare .metric-current {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--gray-800);
}

.metric-compare .metric-change {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 100px;
}

.metric-change.positive { background: var(--success-bg); color: #065F46; }
.metric-change.negative { background: var(--danger-bg); color: #991B1B; }

/* Progress Bar Custom */
.progress-thin {
    height: 6px;
    border-radius: 3px;
    background: var(--gray-200);
    overflow: hidden;
}

.progress-thin .bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Input Group Styling Enhancement */
.input-group-text {
    background: var(--gray-50);
    border: 1.5px solid var(--gray-300);
    color: var(--gray-500);
    font-size: 0.82rem;
    font-weight: 600;
}

/* Summary Row in tables */
.table .summary-row td {
    font-weight: 700;
    background: var(--gray-50) !important;
    border-top: 2px solid var(--gray-300);
    color: var(--gray-800);
}

/* Quick navigation pills */
.nav-pills-custom .nav-link {
    color: var(--gray-600);
    font-weight: 600;
    font-size: 0.82rem;
    border-radius: 100px;
    padding: 0.4rem 1rem;
    transition: all 0.2s ease;
}

.nav-pills-custom .nav-link.active {
    background: var(--primary);
    color: #fff;
}

.nav-pills-custom .nav-link:hover:not(.active) {
    background: var(--gray-100);
}
