/* Block for logo with brand below */
.brand-logo-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 3rem;
}

.brand-title-below {
    font-weight: 700;
    font-size: 1.3em;
    letter-spacing: -0.5px;
    text-transform: uppercase;
    color: var(--text-primary);
    line-height: 1.1;
    margin-top: 0.3em;
    text-align: center;
}
:root {
    /* UDT Brand Colors */
    --udt-green: #61CE70;
    --udt-blue: #2D7FBD;
    --udt-red: #E3002D;
    --bg-dark: #000000;
    --bg-panel: #111111;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;

    /* Gradients */
    --brand-gradient: linear-gradient(90deg, var(--udt-green) 0%, var(--udt-blue) 100%);

    /* Layout */
    --font-family: 'Montserrat', sans-serif;
    --card-radius: 2px;
    /* Geometric/Sharp feel */
    --border-color: #333333;
}

body {
    margin: 0;
    font-family: var(--font-family);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Background Geometry (Subtle Triangles) */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(45deg, transparent 48%, rgba(97, 206, 112, 0.05) 50%, transparent 52%),
        linear-gradient(-45deg, transparent 48%, rgba(45, 127, 189, 0.05) 50%, transparent 52%);
    background-size: 60px 60px;
    z-index: -1;
    pointer-events: none;
}

/* --- DASHBOARD LAYOUT --- */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
    width: 250px;
    background: var(--bg-panel);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    position: sticky;
    top: 0;
    height: 100vh;
    box-sizing: border-box;
}


/* Brand row for logo and title inline */
/* Brand row for logo and title inline, with perfect alignment and equal size */
/* Brand row for logo and title inline, with 2:1 logo:title height ratio */
/* Brand row for logo and title inline, bottom-aligned */
.brand-row {
    display: flex;
    align-items: flex-end;
    gap: 0.5em;
    margin-bottom: 3rem;
    justify-content: flex-start;
}

.logo-inline {
    display: flex;
    align-items: center;
}
.logo-inline svg {
    height: 2.5em; /* 25% larger than previous 2em */
    width: auto;
    display: block;
    vertical-align: bottom;
}

.brand-title {
    font-weight: 700;
    font-size: 1em;
    letter-spacing: -0.5px;
    text-transform: uppercase;
    color: var(--text-primary);
    line-height: 1;
    display: flex;
    align-items: center;
    height: 1em;
    margin-left: 0.5em;
}

.highlight {
    color: var(--udt-green);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--card-radius);
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-item.active {
    background: rgba(45, 127, 189, 0.1);
    color: white;
    border-left: 3px solid var(--udt-blue);
}

.user-profile {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
}

.avatar {
    width: 36px;
    height: 36px;
    background: var(--brand-gradient);
    color: white;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    /* Square avatar for geometric look */
    border-radius: 2px;
}

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

.name {
    font-weight: 600;
    font-size: 0.9rem;
}

.role {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 2px;
}

/* MAIN CONTENT */
.main-content {
    flex: 1;
    padding: 2rem 3rem;
    overflow-y: auto;
}

/* TOP BAR */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
}

.top-bar h1 {
    font-size: 2rem;
    margin: 0;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.controls {
    display: flex;
    gap: 1rem;
}

.input-field {
    background: transparent;
    border: 1px solid var(--border-color);
    color: white;
    padding: 10px 15px;
    border-radius: var(--card-radius);
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
}

.input-field:focus {
    border-color: var(--udt-blue);
}

.search-bar {
    width: 250px;
}

button {
    cursor: pointer;
    font-family: inherit;
}

.btn-primary {
    background: var(--brand-gradient);
    border: none;
    color: white;
    padding: 10px 24px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: var(--card-radius);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(97, 206, 112, 0.3);
}

/* DASHBOARD GRID */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

/* CARDS COMMON */
.glass-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
}

/* METRIC CARDS */
.metric-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 140px;
    position: relative;
    overflow: hidden;
}

.metric-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--brand-gradient);
    opacity: 0.5;
}

.metric-card h3 {
    font-size: 0.9rem;
    margin: 0;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 2.8rem;
    font-weight: 700;
    margin: 0.5rem 0;
    color: white;
}

.metric-value.critical {
    color: var(--udt-red);
}

.metric-trend {
    font-size: 0.85rem;
    align-self: flex-start;
    padding: 4px 0;
    font-weight: 600;
}

.metric-trend.positive {
    color: var(--udt-green);
}

.metric-trend.negative {
    color: var(--udt-red);
}

.metric-trend.neutral {
    color: var(--text-secondary);
}

/* CHARTS */
.chart-container {
    background: rgba(25, 25, 35, 0.6);
    /* Glass effect base */
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    grid-column: span 2;
    /* Increase width for better aspect ratio */
    padding: 1.5rem;
    height: 420px;
    /* Fixed height to constrain canvas */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Ensure nothing spills out */
    /* Override glass-panel logic for background if needed, but keeping consistent */
}

.chart-container canvas {
    flex: 1;
    min-height: 0;
    /* Crucial for firefox/chrome flex items to shrink */
    max-height: 100%;
}

.chart-container.wide-chart {
    grid-column: span 4;
}

.chart-container h3 {
    margin: 0 0 1.5rem 0;
    font-weight: 600;
    font-size: 1.1rem;
    color: white;
    border-left: 3px solid var(--udt-green);
    padding-left: 10px;
}

.chart-footer {
    margin-top: auto;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: right;
    padding-top: 1rem;
    font-style: italic;
    opacity: 0.7;
}

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

    .chart-container.wide-chart {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 1rem;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        z-index: 100;
        background: black;
    }

    .sidebar nav,
    .user-profile {
        display: none;
        /* Simplify for mobile */
    }

    .brand {
        margin-bottom: 0;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .chart-container,
    .chart-container.wide-chart {
        grid-column: span 1;
    }

    .main-content {
        padding: 1.5rem;
    }

    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .controls {
        width: 100%;
    }

    .search-bar {
        width: 100%;
    }
}