/* ==========================================================
   National Liquidity Dashboard - Core Styling
   ========================================================== */
   
:root {
    /* Color Palette - Dark Mode Premium */
    --bg-dark: #0a0e17;
    --bg-panel: #131a2a;
    --bg-panel-hover: #1a2333;
    --bg-sidebar: #0d121c;
    
    /* Brand Colors */
    --neon-cyan: #00f0ff;
    --neon-blue: #0066ff;
    --neon-green: #00ff88;
    --neon-purple: #8a2be2;
    --neon-red: #ff3366;
    
    /* Gradients */
    --primary-gradient: linear-gradient(135deg, var(--neon-cyan), var(--neon-blue));
    
    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Metrics */
    --border-radius-lg: 16px;
    --border-radius-md: 12px;
    --border-radius-sm: 8px;
    --transition-fast: 0.2s ease;
    
    /* Effects */
    --glass-border: rgba(255, 255, 255, 0.05);
    --glow-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
}

/* Typography Utility */
.math-var {
    font-family: 'Times New Roman', serif;
    font-style: italic;
    font-weight: bold;
}
.text-green { color: var(--neon-green); }
.text-yellow { color: #ffeb3b; }

.metaphor {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-muted);
    font-style: italic;
}

/* Layout Grid */
.dashboard-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 24px 0;
}

.brand {
    padding: 0 24px 32px;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 24px;
}

.brand-logo {
    max-height: 48px;
    width: auto;
    object-fit: contain;
    margin-bottom: 8px;
    display: block;
}

.logo {
    display: inline-block;
    background: var(--primary-gradient);
    color: #fff;
    font-weight: bold;
    font-size: 20px;
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 12px;
}

.brand h1 {
    font-size: 16px;
    letter-spacing: 0.5px;
}

.brand .subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-menu {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 16px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--border-radius-md);
    transition: var(--transition-fast);
    font-size: 14px;
    font-weight: 500;
}

.nav-item:hover {
    background-color: var(--bg-panel-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background-color: rgba(0, 240, 255, 0.1);
    color: var(--neon-cyan);
    border-left: 3px solid var(--neon-cyan);
}

.nav-section {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 24px 0 8px 16px;
    font-weight: 600;
}

.node-indicator {
    font-size: 8px;
    color: var(--neon-green);
    box-shadow: 0 0 10px var(--neon-green);
    border-radius: 50%;
}

.user-profile {
    padding: 24px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 16px;
}

.avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-info .name { font-size: 14px; font-weight: 600; }
.user-info .role { font-size: 12px; color: var(--neon-cyan); }

/* Main Content */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: radial-gradient(circle at top right, rgba(0, 102, 255, 0.05), transparent 400px);
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 32px 40px;
    border-bottom: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-title h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 4px;
}

.last-updated {
    font-size: 12px;
    color: var(--text-secondary);
}

.header-actions {
    display: flex;
    gap: 12px;
}

/* Buttons */
.btn {
    padding: 10px 16px;
    border-radius: var(--border-radius-sm);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-fast);
    border: none;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 240, 255, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(0, 240, 255, 0.5);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Views Wrapper */
.views-wrapper {
    padding: 32px 40px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.view-section {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.view-section.active {
    display: block;
}

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

/* Traffic Light Status Panel */
.status-panel {
    background: var(--bg-panel);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.traffic-light {
    display: flex;
    gap: 12px;
    background: #000;
    padding: 12px 24px;
    border-radius: 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.light {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #333;
    transition: all 0.3s ease;
    opacity: 0.3;
}

.light.red.active { background: #ff3366; box-shadow: 0 0 20px #ff3366, inset 0 0 10px #fff; opacity: 1; }
.light.amber.active { background: #ffeb3b; box-shadow: 0 0 20px #ffeb3b, inset 0 0 10px #fff; opacity: 1; }
.light.green.active { background: #00ff88; box-shadow: 0 0 20px #00ff88, inset 0 0 10px #fff; opacity: 1; }

.status-text h2 {
    font-size: 20px;
    margin-bottom: 4px;
}
.status-text p {
    font-size: 14px;
    color: var(--text-secondary);
}

.status-safe { color: #00ff88; }
.status-caution { color: #ffeb3b; }
.status-action { color: #ff3366; }

.col-span-2 {
    grid-column: span 2;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.metric-card {
    background: var(--bg-panel);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.3s;
}

.metric-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.1);
}

.highlight-card {
    background: linear-gradient(135deg, rgba(20, 26, 41, 0.8), rgba(0, 30, 80, 0.8));
    border: 1px solid rgba(0, 240, 255, 0.3);
    box-shadow: var(--glow-shadow);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.card-header h3 {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.icon-accent {
    color: var(--neon-cyan);
    font-size: 20px;
}

.card-value {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
}

.gradient-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.currency {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.card-footer {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.trend-up {
    color: var(--neon-red); /* High rate usually bad for FX, meaning depreciation */
}

/* Gauges */
.gauge-container {
    position: relative;
    width: 100%;
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: -10px;
}

#pressure-score-val {
    position: absolute;
    bottom: 10px;
    font-size: 24px;
    font-weight: 700;
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.panel {
    background: var(--bg-panel);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    display: flex;
    flex-direction: column;
}

.panel-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-primary {
    background: rgba(0, 240, 255, 0.1);
    color: var(--neon-cyan);
    border: 1px solid rgba(0, 240, 255, 0.3);
}

.panel-body {
    padding: 24px;
    flex-grow: 1;
}

.chart-wrapper {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Table / Operational View */
.table-actions {
    display: flex;
    gap: 12px;
}

.search-input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-sm);
    padding: 8px 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: var(--transition-fast);
}

.search-input:focus {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.1);
}

.table-container {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th {
    padding: 16px 24px;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--glass-border);
    cursor: pointer;
    user-select: none;
}

.data-table th i {
    font-size: 10px;
    margin-left: 6px;
    color: var(--text-muted);
}

.data-table th:hover {
    color: var(--text-primary);
}

.data-table td {
    padding: 16px 24px;
    font-size: 14px;
    border-bottom: 1px solid var(--glass-border);
}

.data-table tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.vessel-name {
    font-weight: 600;
    color: #fff;
}

.tag {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.tag-food { background: rgba(0, 255, 136, 0.1); color: var(--neon-green); }
.tag-fuel { background: rgba(255, 51, 102, 0.1); color: var(--neon-red); }
.tag-containers { background: rgba(0, 102, 255, 0.1); color: var(--neon-blue); }
.tag-livestock { background: rgba(255, 165, 0, 0.1); color: #ffa500; }
.tag-general { background: rgba(138, 43, 226, 0.1); color: var(--neon-purple); }

.pressure-high { color: var(--neon-red); font-weight: 600; }
.pressure-mod { color: var(--neon-cyan); }
.pressure-low { color: var(--text-muted); }

/* Forms */
.data-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.form-group label {
    font-size: 13px;
    color: var(--text-secondary);
}

.form-control {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-sm);
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: var(--transition-fast);
}

.form-control:focus {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.1);
}

.form-actions {
    margin-top: 10px;
    display: flex;
    align-items: center;
}

.hidden { display: none !important; }

/* Responsive adjustments */
@media (max-width: 1200px) {
    .metrics-grid { grid-template-columns: repeat(2, 1fr); }
    .charts-grid { grid-template-columns: 1fr; }
}
