html, body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #dce6f0;
    color: #1f2d3d;
    margin: 0;
}

code {
    color: #1f2d3d;
}

.app-shell {
    min-height: 100vh;
    display: flex;
}

.app-shell main {
    min-width: 0;
    flex: 1;
    min-height: 100vh;
    background: linear-gradient(135deg, #e9f0f7 0%, #f7f9fc 55%, #edf3f8 100%);
}

.sidebar {
    flex: 0 0 270px;
    min-height: 100vh;
    color: #d7e3ed;
    background: linear-gradient(180deg, #102b46 0%, #173f5f 100%);
}

.sidebar .top-row {
    height: 3.5rem;
    background: linear-gradient(180deg, #102b46 0%, #173f5f 100%);
}

.sidebar .navbar-brand {
    color: #fff;
}

.sidebar .brand-lockup {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}

.sidebar .brand-lockup img {
    width: 2.1rem;
    height: 2.1rem;
    flex: 0 0 2.1rem;
    object-fit: contain;
    border-radius: 0.45rem;
    background: rgba(255, 255, 255, 0.12);
}

.sidebar .brand-lockup > span:last-child {
    display: grid;
    min-width: 0;
    line-height: 1.15;
}

.sidebar .brand-lockup strong,
.sidebar .brand-lockup small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar .brand-lockup small {
    color: #a8bfd2;
    font-size: 0.68rem;
    font-weight: 400;
    margin-top: 0.18rem;
}

.sidebar .nav-scrollable {
    display: block;
    height: calc(100vh - 3.5rem);
    overflow-y: auto;
}

.sidebar .nav-item {
    font-size: 0.9rem;
    padding: 0 0.75rem 0.5rem;
}

.sidebar .nav-link {
    color: #d7d7d7;
    background: none;
    border: none;
    border-radius: 0.8rem;
    min-height: 3rem;
    display: flex;
    align-items: center;
    width: 100%;
    text-decoration: none;
}

.sidebar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.18);
    color: white;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.sidebar .muted-link {
    color: #9db2bf;
    font-size: 0.85rem;
    opacity: 0.9;
}

.top-row-label {
    margin-right: auto;
    color: #708197;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

body {
    min-height: 100vh;
}

@media (max-width: 640.98px) {
    .sidebar {
        min-height: 3.5rem;
    }

    .sidebar .nav-scrollable {
        height: auto;
        max-height: calc(100vh - 3.5rem);
    }

    .app-shell main {
        min-height: calc(100vh - 3.5rem);
    }
}

a, .btn-link {
    color: #0d6efd;
}

.btn {
    border-radius: 0.7rem;
    font-weight: 600;
    padding: 0.7rem 1.1rem;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    border: none;
    box-shadow: 0 10px 20px rgba(13, 110, 253, 0.18);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0b5ed7 0%, #0947a4 100%);
}

.btn-outline-secondary {
    border-radius: 0.7rem;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus, .form-select:focus {
  box-shadow: 0 0 0 0.15rem rgba(13, 110, 253, 0.25);
}

.content {
    padding-top: 1.5rem;
    padding-bottom: 2rem;
}

h1 {
    margin-bottom: 1rem;
    font-size: clamp(2rem, 2vw + 1rem, 2.5rem);
    letter-spacing: -0.04em;
    color: #152434;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg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NTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

.dashboard-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    margin-top: 1.25rem;
}

.metric-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid rgba(112, 136, 163, 0.2);
    border-radius: 1rem;
    padding: 1.1rem 1rem;
    display: flex;
    flex-direction: column;
    min-height: 120px;
    box-shadow: 0 10px 30px rgba(17, 34, 52, 0.06);
}

.metric-card span {
    color: #5b6f86;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-card strong {
    color: #18314f;
    margin-top: 0.5rem;
    font-size: clamp(1.6rem, 2vw, 2.2rem);
    line-height: 1.2;
}

.status-ok {
    color: #1f8a5d !important;
}

.status-warning {
    color: #c77800 !important;
}

.status-error {
    color: #b42318 !important;
}

.crud-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.eyebrow {
    color: #5f7892;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.settings-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
    gap: 1.25rem;
    align-items: start;
}

.quick-actions {
    display: grid;
    gap: 0.8rem;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.quick-action {
    align-items: start;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(124, 147, 170, 0.25);
    border-radius: 0.95rem;
    color: #18314f;
    display: grid;
    gap: 0.25rem;
    padding: 0.9rem;
    text-decoration: none;
}

.quick-action:hover {
    border-color: rgba(13, 110, 253, 0.4);
    color: #0a58ca;
}

.quick-action span {
    color: #2f78b7;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.quick-action strong {
    font-size: 0.98rem;
}

.quick-action small {
    color: #708197;
}

.dns-settings-grid {
    display: grid;
    gap: 0.8rem;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.setting-tile {
    background: #f7fbff;
    border: 1px solid rgba(124, 147, 170, 0.22);
    border-radius: 0.8rem;
    display: grid;
    gap: 0.2rem;
    padding: 0.85rem;
}

.setting-tile span {
    color: #5f7892;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.setting-tile strong {
    color: #18314f;
    overflow-wrap: anywhere;
}

.secret-note {
    align-items: start;
    background: rgba(255, 193, 7, 0.12);
    border: 1px solid rgba(199, 120, 0, 0.22);
    border-radius: 0.8rem;
    color: #6b4b00;
    display: grid;
    gap: 0.25rem;
    padding: 0.85rem;
}

.provider-choice-grid {
    display: grid;
    gap: 0.8rem;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.provider-choice {
    background: #f7fbff;
    border: 1px solid rgba(124, 147, 170, 0.24);
    border-radius: 0.9rem;
    cursor: pointer;
    display: grid;
    gap: 0.25rem;
    grid-template-columns: auto minmax(0, 1fr);
    padding: 0.9rem;
}

.provider-choice input {
    margin-top: 0.25rem;
}

.provider-choice span,
.provider-choice small {
    grid-column: 2;
}

.provider-choice span {
    color: #18314f;
    font-weight: 800;
}

.provider-choice small {
    color: #708197;
}

.provider-choice.selected {
    border-color: rgba(13, 110, 253, 0.55);
    box-shadow: 0 10px 22px rgba(13, 110, 253, 0.08);
}

.provider-choice.disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.agent-enrollment-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: end;
}

.agent-enrollment-form label {
    display: block;
    color: #344d67;
    font-size: 0.83rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.token-panel code {
    display: block;
    overflow-wrap: anywhere;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 0.45rem;
    color: #6b3e00;
}

.section-heading {
    display: flex;
    align-items: start;
    justify-content: space-between;
}

.section-heading h2 {
    margin: 0.2rem 0 0;
    color: #18314f;
}

.settings-mark {
    display: grid;
    width: 2.5rem;
    height: 2.5rem;
    place-items: center;
    border-radius: 0.7rem;
    background: #e6f0fb;
    color: #0d6efd;
    font-weight: 700;
}

.settings-form {
    display: grid;
    gap: 1rem;
    margin-top: 1.5rem;
}

.settings-form label {
    display: block;
    color: #344d67;
    font-size: 0.83rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.form-text {
    display: block;
    color: #708197;
    margin-top: 0.35rem;
}

.save-message {
    color: #1f8a5d;
    font-weight: 700;
}

.branding-preview {
    display: grid;
    gap: 0.75rem;
}

.preview-sidebar {
    min-height: 260px;
    padding: 1rem;
    border-radius: 1rem;
    background: linear-gradient(180deg, #102b46 0%, #173f5f 100%);
    box-shadow: 0 12px 28px rgba(28, 42, 64, 0.12);
}

.preview-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0.25rem 1.4rem;
    color: white;
}

.preview-brand img,
.preview-logo {
    width: 2rem;
    height: 2rem;
    display: grid;
    place-items: center;
    object-fit: contain;
    border-radius: 0.45rem;
    background: rgba(255, 255, 255, 0.14);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
}

.preview-brand > span:last-child {
    display: grid;
    min-width: 0;
}

.preview-brand strong,
.preview-brand small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-brand small {
    color: #a8bfd2;
    font-size: 0.68rem;
}

.preview-nav {
    margin: 0.25rem 0;
    padding: 0.7rem 0.8rem;
    border-radius: 0.4rem;
    color: #d7e3ed;
}

.preview-nav.active {
    background: rgba(255, 255, 255, 0.18);
    color: white;
}

.crud-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(124, 147, 170, 0.25);
    border-radius: 1rem;
    box-shadow: 0 12px 28px rgba(28, 42, 64, 0.06);
    padding: 1rem 1rem 0.5rem;
}

.form-control, .form-select {
    border-radius: 0.75rem;
    border: 1px solid #cedae5;
    padding: 0.7rem 0.85rem;
    background: #fff;
}

.table {
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 0.5rem;
}

.table thead th {
    background: #f2f6fb;
    color: #344d67;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #dfe8f1;
}

.table tbody td {
    vertical-align: middle;
    padding: 0.8rem 0.75rem;
    border-bottom: 1px solid #edf2f7;
}

.table tbody tr:hover {
    background: rgba(13, 110, 253, 0.02);
}

.inventory-row td {
    background: #f7fafd;
    padding-top: 0.25rem;
}

.iis-inventory-list {
    display: grid;
    gap: 0.5rem;
}

.iis-site-item {
    display: grid;
    grid-template-columns: minmax(120px, 0.35fr) minmax(180px, 1fr) minmax(180px, 1fr);
    gap: 0.75rem;
    align-items: center;
    padding: 0.65rem 0.75rem;
    border-left: 3px solid #2f78b7;
    border-radius: 0.35rem;
    background: white;
}

.iis-site-item span,
.iis-site-item small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #5f7892;
}

.badge {
    border-radius: 999px;
    padding: 0.45rem 0.7rem;
    font-weight: 600;
    font-size: 0.72rem;
}

.text-bg-success {
    background-color: rgba(31, 138, 93, 0.15) !important;
    color: #1f8a5d !important;
}

.text-bg-danger {
    background-color: rgba(180, 35, 24, 0.12) !important;
    color: #b42318 !important;
}

.text-bg-secondary {
    background-color: rgba(91, 111, 134, 0.12) !important;
    color: #5b6f86 !important;
}

.input-group-text {
    background: #f4f7fb;
    color: #425771;
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: 0.01em;
}

.muted-link {
    color: rgba(228, 233, 240, 0.8);
}

.top-row a {
    color: #0d6efd;
    text-decoration: none;
    font-weight: 600;
}

.top-row a:hover {
    text-decoration: underline;
}

.entity-link {
    color: #18314f;
    font-weight: 800;
    text-decoration: none;
}

.entity-link:hover {
    color: #0a58ca;
    text-decoration: underline;
}

.back-link {
    color: #5f7892;
    display: inline-block;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    text-decoration: none;
}

.back-link:hover {
    color: #0a58ca;
    text-decoration: underline;
}

.customer-hero {
    align-items: end;
    background:
        radial-gradient(circle at 14% 18%, rgba(47, 120, 183, 0.18), transparent 26%),
        linear-gradient(135deg, #ffffff 0%, #eef6fb 58%, #f7fbf8 100%);
    border: 1px solid rgba(124, 147, 170, 0.28);
    border-radius: 1.1rem;
    box-shadow: 0 16px 34px rgba(28, 42, 64, 0.08);
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding: 1.25rem;
}

.customer-hero h1 {
    margin: 0.2rem 0 0.15rem;
}

.customer-hero p {
    color: #5b6f86;
    font-weight: 700;
    margin: 0;
}

.hero-status {
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid rgba(124, 147, 170, 0.22);
    border-radius: 0.95rem;
    display: grid;
    gap: 0.25rem;
    min-width: 160px;
    padding: 0.9rem;
}

.hero-status strong {
    color: #18314f;
    font-size: 1.1rem;
}

.hero-status small {
    color: #708197;
}

.customer-status-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.workspace-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.compact-form {
    margin-top: 1rem;
}

@media (max-width: 640.98px) {
    .customer-hero {
        align-items: stretch;
        display: grid;
    }
}

@media (max-width: 640.98px) {
    .app-shell {
        display: block;
    }

    .top-row-label {
        display: none;
    }

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

    .agent-enrollment-form {
        grid-template-columns: 1fr;
    }

    .iis-site-item {
        grid-template-columns: 1fr;
        gap: 0.15rem;
    }
}
.customer-tile {
    color: inherit;
    text-decoration: none;
}

.customer-tile:hover,
.customer-tile:focus-visible {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}
