:root {
    --bg-main: #f8f9fa;
    --bg-white: #ffffff;
    --bg-sidebar: #2582C5;
    --text-primary: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --accent-blue: #2563eb;
    --accent-green: #16a34a;
    --accent-orange: #ea580c;
    --accent-red: #dc2626;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    
    /* Responsive base typography scale */
    --fs-h1: clamp(22px, 2.5vw, 32px);
    --fs-title: clamp(18px, 2vw, 26px);
    --fs-body: clamp(12px, 1vw, 14px);
    --fs-small: clamp(10px, 0.8vw, 12px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-family);
}

body {
   /* background-color: #1a1a1a;*/
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    /*padding: clamp(0px, 2vw, 40px);*/
    font-size: var(--fs-body);
    color: var(--text-primary);
}

/* Master Layout Framework */
.dashboard-container {
    width: 100%;
    max-width: 2560px; /* Adapts beautifully to 2K, 4K setups without hyper-stretching */
    background: var(--bg-white);
    display: flex;
    min-height: 90vh;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Sidebar Styling Structure */
.sidebar {
    width: clamp(220px, 15vw, 280px);
    /*background-color: var(--bg-sidebar);*/
    background-color: #2582C5;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    /*border-right: 1px solid var(--border-color);*/
    flex-shrink: 0;
}

.logo-area {
    margin-bottom: 35px;
}

.logo-box {
    background: white;
    padding: 20px 15px;
    border-radius: 12px;
    border: 1px solid #fbcfe8;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.logo-icon {
    font-size: 28px;
    display: block;
    margin-bottom: 6px;
}

.logo-box strong {
    color: #1d4ed8;
    font-size: 22px;
    letter-spacing: -0.5px;
}

.tagline {
    font-size: 11px;
    line-height: 1.4;
    color: #475569;
    margin-top: 10px;
}
.tagline span {
    font-weight: 700;
    color: #1d4ed8;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    background: transparent;
    border: none;
    text-align: left;
    font-size: 14px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item.active {
    background-color: var(--bg-white);
    color: var(--accent-blue);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}
.nav-item:hover:not(.active) {
    background-color: rgba(255, 255, 255, 0.5);
    padding-left: 20px;
}

/* Core System Main Content Area */
.main-content {
    flex: 1;
    background: var(--bg-white);
    display: flex;
    flex-direction: column;
    min-width: 0; /* Prevents layout distortion in flex children holding canvas elements */
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 40px;
}

.header-title h1 {
    font-size: var(--fs-h1);
    font-weight: 800;
    color: #0f172a;
}

.breadcrumbs {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}
.breadcrumbs span {
    color: var(--text-primary);
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.icon-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #334155;
    padding: 6px;
    border-radius: 50%;
    transition: background 0.2s;
}
.icon-btn:hover {
    background-color: var(--bg-main);
}
.icon-btn svg {
    width: 26px;
    height: 26px;
}

/* Native Dropdowns Realization */
.dropdown-wrapper {
    position: relative;
}
.dropdown-menu {
    position: absolute;
    top: 130%;
    left: 0;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    min-width: 220px;
    z-index: 100;
    display: none;
    padding: 6px 0;
}
.dropdown-menu.dropdown-right {
    left: auto;
    right: 0;
}
.dropdown-menu.show {
    display: block;
    animation: slideFadeIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.dropdown-header {
    padding: 8px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}
.user-info-summary {
    padding: 6px 16px 12px;
}
.user-name { font-weight: 600; color: var(--text-primary); }
.user-role { font-size: 11px; color: var(--text-muted); }

.dropdown-menu hr {
    border: 0;
    height: 1px;
    background-color: var(--border-color);
    margin: 4px 0;
}
.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 13px;
}
.dropdown-menu a:hover {
    background-color: var(--bg-main);
}
.dropdown-menu a svg { width: 16px; height: 16px; color: var(--text-muted); }
.dropdown-menu a.danger { color: var(--accent-red); }

@keyframes slideFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.divider {
    border: 0;
    height: 1px;
    background-color: var(--border-color);
    margin: 0 40px;
}

/* Dashboard Metrics & Analysis Section View Layout */
.dashboard-body {
    padding: 40px;
}

.section-title {
    font-size: var(--fs-title);
    margin-bottom: 30px;
    font-weight: 700;
    text-align: center;
    letter-spacing: -0.5px;
}

/* Standard Responsive 2-Column Grid structure mapping */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 30px;
    align-items: start;
}

/* Column Flex Containers mapping */
.left-column, .right-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Internal Card Components Structure layouts */
.metrics-grid, .risk-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.mini-charts-grid, .regions-grid, .split-insights {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.metric-card, .chart-card, .table-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 20px;
    position: relative;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}
.card-header span {
    font-size: clamp(20px, 2.2vw, 28px);
    font-weight: 700;
    color: #0f172a;
}
.card-header h3 {
    font-size: 13px;
    color: #334155;
    font-weight: 600;
}

.info-icon {
    width: 14px;
    height: 14px;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.2s;
}
.info-icon:hover { color: var(--accent-blue); }

.label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.trend {
    font-size: 12px;
    font-weight: 600;
}
.trend.positive { color: var(--accent-green); }
.trend.negative { color: var(--accent-red); }
.trend small { color: var(--text-muted); font-weight: 400; }

/* Display Variant Helper classes mapping */
.metric-card.centered {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.highlight-text-gray {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
    margin: auto 0;
}
.large-number {
    font-size: 26px;
    font-weight: 700;
    margin-top: 5px;
}

/* Canvas Sizing Context wrappers mapping */
.chart-container-mini { height: 110px; position: relative; }
.chart-container-main { height: 210px; position: relative; }
.chart-container-doughnut { height: 140px; position: relative; }

/* Right Column Content Components mapping */
.action-header-card {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-radius: 6px;
}
.action-num { font-size: 26px; font-weight: 800; color: #0f172a; }
.action-text { font-size: 13px; color: var(--text-muted); font-weight: 500; }

.table-wrapper {
    overflow-x: auto;
    margin-top: 12px;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    text-align: left;
}
th {
    color: var(--text-muted);
    font-weight: 600;
    padding: 10px 12px;
    border-bottom: 2px solid var(--border-color);
    background: #fafafa;
}
td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}
tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.15s; }
tbody tr:hover td { background-color: #f8fafc; cursor: pointer; }

.badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
}
.badge-risk { background-color: #fee2e2; color: var(--accent-red); }

.simple-table th, .simple-table td { padding: 8px 6px; }
.text-right { text-align: right; }
.total-row td { font-weight: 700; border-top: 1px solid #94a3b8; color: #000; }

/* Country Component blocks layout metrics mapping */
.country-list-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.country-row-item {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}
.country-row-item:last-child { border-bottom: none; padding-bottom: 0; }
.country-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.country-name { font-size: 13px; font-weight: 700; color: #334155; }
.metric-box-group {
    display: flex;
    gap: 12px;
    width: 65%;
}
.box-pct, .box-val {
    background-color: #f1f5f9;
    padding: 12px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 4px;
    text-align: center;
}
.box-pct { width: 60%; color: #334155; }
.box-val { width: 40%; color: #475569; }

/* Interactive Toast Alert View notification styling */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #0f172a;
    color: white;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.3);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* Responsive Media Breakdown Intercepts */

/* 4K Native Optimization Engine block rules mapping */
@media (min-width: 2200px) {
    :root {
        --fs-h1: 38px;
        --fs-title: 32px;
        --fs-body: 16px;
    }
    .chart-container-mini { height: 180px; }
    .chart-container-main { height: 350px; }
    .chart-container-doughnut { height: 220px; }
}

/* Tablet Layout Framework Intercept mapping */
@media (max-width: 1200px) {
    .dashboard-grid { grid-template-columns: 1fr; gap: 24px; }
    .sidebar { width: 220px; }
}

/* Mobile & Small Device Adaptive Stack View layouts processing engine */
@media (max-width: 768px) {
    body { padding: 0; }
    .dashboard-container { flex-direction: column; min-height: 100vh; border-radius: 0; }
    .sidebar { width: 100%; padding: 15px; border-right: none; border-bottom: 1px solid var(--border-color); }
    .logo-area { display: none; }
    .nav-links { flex-direction: row; justify-content: center; width: 100%; }
    .nav-item { flex: 1; text-align: center; padding: 10px; }
    .main-header { padding: 20px; }
    .divider { margin: 0 20px; }
    .dashboard-body { padding: 20px; }
    .metrics-grid, .risk-grid { grid-template-columns: 1fr; gap: 12px; }
    .mini-charts-grid, .regions-grid, .split-insights { grid-template-columns: 1fr; gap: 16px; }
    .metric-box-group { width: 100%; max-width: 260px; }
}