:root {
    --brand: #00A0E3;      /* logo blue */
    --brand-2: #33B7EC;
    --ink: #0F141C;        /* deep background */
    --panel: 23, 30, 38;   /* logo navy (rgb, used with rgba) */
    --text: #E6EDF5;
    --text-dim: #9FB0C3;
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.14);
}

html, body {
    margin: 0;
    font-family: 'Roboto', Helvetica, Arial, sans-serif;
    color: var(--text);
    /* Full-screen data-center background under a dark veil for readability. */
    background-image:
        linear-gradient(180deg, rgba(15, 20, 30, 0.66) 0%, rgba(9, 13, 20, 0.82) 100%),
        url('bg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-color: var(--ink);
    min-height: 100vh;
}

/* Frosted (translucent) foreground surfaces – dark glass. */
.mud-paper:not(.mud-popover):not(.mud-popover-paper):not(.mud-picker):not(.mud-menu-paper) {
    background-color: rgba(var(--panel), 0.44) !important;
    color: var(--text);
    -webkit-backdrop-filter: saturate(150%) blur(16px);
    backdrop-filter: saturate(150%) blur(16px);
    border: 1px solid var(--line);
    border-radius: 18px !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35) !important;
}

.mud-nav-link.active {
    background-color: var(--brand) !important;
    color: #04222f !important;
    border-radius: 12px !important;
}
.mud-nav-link.active .mud-icon-root { color: #04222f !important; }
.mud-nav-link { color: var(--text) !important; }
.mud-nav-link .mud-icon-root { color: var(--text-dim); }

.mud-dialog {
    /* A touch lighter than the shell so popups read as raised, not pitch-black. */
    background-color: rgba(38, 48, 63, 0.86) !important;
    color: var(--text);
    -webkit-backdrop-filter: saturate(150%) blur(20px);
    backdrop-filter: saturate(150%) blur(20px);
    border: 1px solid var(--line-strong);
    border-radius: 20px !important;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55) !important;
}

.mud-table-container { background-color: transparent !important; }
.mud-table-root tbody .mud-table-row:hover { background-color: rgba(0, 160, 227, 0.10) !important; }
.mud-table { overflow: hidden !important; }
.mud-button-root { border-radius: 10px !important; }

.mud-popover.mud-popover-open {
    background-color: #232e3e !important;
    color: var(--text);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

.mud-tooltip {
    background-color: #1a222d !important;
    color: var(--text) !important;
    border: 1px solid var(--line-strong);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

/* App-shell: sidebar + content together in ONE floating, translucent, rounded box. */
.app-shell {
    display: flex;
    margin: 18px;
    min-height: calc(100vh - 36px);
    background-color: rgba(var(--panel), 0.30);
    -webkit-backdrop-filter: saturate(150%) blur(18px);
    backdrop-filter: saturate(150%) blur(18px);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.app-sidebar {
    width: 250px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    padding: 14px 12px;
    background-color: rgba(255, 255, 255, 0.03);
    border-right: 1px solid var(--line);
}

.app-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 6px 18px;
}
.app-brand img { width: 100%; max-width: 190px; height: auto; display: block; }

.app-nav { flex: 1; overflow-y: auto; }
.app-nav .mud-nav-menu { background: transparent; }

.app-sidebar-footer {
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.app-topbar {
    height: 58px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 22px;
    border-bottom: 1px solid var(--line);
}
.app-nav-toggle { display: none; }

.app-content { flex: 1; overflow-y: auto; padding: 22px 24px; }

/* Cards INSIDE the shell: a touch more opaque and without a second blur (crisp, readable). */
.app-shell .mud-paper:not(.mud-popover):not(.mud-popover-paper):not(.mud-picker):not(.mud-menu-paper) {
    background-color: rgba(var(--panel), 0.55) !important;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

.page-title { margin: 0 0 20px; font-weight: 600; color: var(--text); }

/* Text colour helpers so MudBlazor's default dark text stays readable on the glass. */
.mud-typography { color: var(--text); }
.mud-input-label, .mud-input-helper-text { color: var(--text-dim) !important; }

/* DigitalOcean-style selectable option tiles (used in the create dialogs). */
.opt-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.opt-tile {
    display: flex; align-items: center; gap: 8px;
    border: 2px solid var(--line-strong); border-radius: 12px; padding: 10px 14px;
    min-width: 130px; background: rgba(255, 255, 255, 0.03); color: var(--text);
    cursor: pointer; font-weight: 600; transition: .12s;
}
.opt-tile:hover { border-color: var(--brand-2); }
.opt-tile.selected { border-color: var(--brand); background: rgba(0, 160, 227, 0.12); }
.opt-tile .opt-check { color: var(--brand); opacity: 0; transition: .12s; }
.opt-tile.selected .opt-check { opacity: 1; }

@media (max-width: 900px) {
    .app-shell { flex-direction: column; margin: 10px; min-height: calc(100vh - 20px); }
    .app-sidebar {
        width: auto;
        display: none;
        border-right: none;
        border-bottom: 1px solid var(--line);
    }
    .app-sidebar.open { display: flex; }
    .app-nav-toggle { display: inline-flex; }
}

#blazor-error-ui {
    background: #2b2233;
    color: #ffd9a8;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.4);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }
