@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

:root {
    --oslw-blue: #36a3db;
    --oslw-blue-strong: #0f75d8;
    --oslw-blue-soft: #8fb7dd;
    --oslw-selected: #dceaf7;
    --oslw-navy: #0b2a4a;
    --surface-muted: #f4f6f8;
    --surface: #ffffff;
    --border: #d5dde5;
    --text-main: #1f2933;
    --text-muted: #6b7280;
    --rz-primary: #0f75d8 !important;
    --rz-primary-light: #dceaf7 !important;
    --rz-primary-lighter: #edf6fc !important;
    --rz-primary-dark: #0b5fb1 !important;
}

html,
body {
    min-height: 100%;
    margin: 0;
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    color: var(--text-main);
    background: var(--surface-muted);
}

* {
    box-sizing: border-box;
}

h1,
h2,
h3,
p,
dl {
    margin-top: 0;
}

h1:focus {
    outline: none;
}

a,
.btn-link {
    color: var(--oslw-blue-strong);
}

button,
input {
    font: inherit;
}

.builder-card {
    width: 100%;
    margin-bottom: 20px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.version-card {
    max-width: 720px;
}

.element-card {
    min-height: 480px;
}

.section-header,
.inner-panel-header,
.page-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header {
    margin-bottom: 18px;
}

.section-header .oi,
.inner-panel-header .oi {
    color: var(--oslw-blue-strong);
}

.section-header h2,
.page-section-header h2 {
    margin: 0;
    color: #102a43;
    font-size: 1.12rem;
    font-weight: 700;
}

.page-section-header {
    align-items: flex-start;
}

.page-section-header p {
    margin: 3px 0 0;
    color: var(--text-muted);
}

.inner-panel {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
}

.inner-panel-header {
    margin-bottom: 12px;
}

.inner-panel-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #102a43;
}

.version-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(280px, 1.15fr);
    gap: 18px;
}

.element-grid {
    display: grid;
    grid-template-columns: minmax(210px, 1fr) minmax(210px, 1fr) minmax(420px, 3fr);
    gap: 14px;
    padding-top: 14px;
}

.services-grid {
    display: grid;
    grid-template-columns: minmax(260px, 360px) minmax(320px, 1fr);
    gap: 14px;
    padding-top: 14px;
}

.selection-list {
    width: 100%;
    min-height: 160px;
    max-height: 240px;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fbfdff;
}

.selection-list.tall {
    height: 240px;
}

.selection-item {
    width: 100%;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 14px;
    border: 0;
    border-bottom: 1px solid #e6edf3;
    background: transparent;
    color: var(--text-main);
    text-align: left;
    font-weight: 600;
}

.selection-item:last-child {
    border-bottom: 0;
}

.selection-item:hover {
    background: #eef6fc;
}

.selection-item.is-selected {
    background: var(--oslw-selected);
    color: #0056b3;
}

.detail-panel {
    min-width: 0;
    padding: 14px 18px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
}

.detail-panel.compact {
    align-self: stretch;
}

.definition-grid {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    column-gap: 34px;
    margin-bottom: 0;
}

.definition-grid dt,
.definition-grid dd {
    min-height: 34px;
    display: flex;
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px solid #e2e8f0;
}

.definition-grid dt {
    color: #243b53;
    font-weight: 700;
    white-space: nowrap;
}

.definition-grid dd {
    margin: 0;
    min-width: 0;
    color: var(--text-main);
    overflow-wrap: anywhere;
}

.definition-grid dt:last-of-type,
.definition-grid dd:last-of-type {
    border-bottom: 0;
}

.details-panel {
    min-width: 0;
}

.details-grid {
    grid-template-columns: minmax(140px, max-content) minmax(0, 1fr);
}

.icon-value {
    justify-content: space-between;
    gap: 12px;
}

.icon-value img {
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
}

.panel-meta {
    margin: 10px 0 0;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.muted-text {
    color: var(--text-muted);
}

.tab-action-panel {
    max-width: 460px;
    margin-top: 14px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fbfdff;
}

.service-actions {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.button-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.action-row {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.primary-button,
.rz-button.primary-action {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 18px;
    border: 1px solid var(--oslw-blue-strong);
    border-radius: 6px;
    background: var(--oslw-blue-strong);
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(15, 117, 216, 0.2);
}

.primary-button:hover,
.rz-button.primary-action:hover {
    border-color: #0b5fb1;
    background: #0b5fb1;
    color: #ffffff;
}

.rz-button.secondary-action {
    min-height: 42px;
    border-radius: 6px;
    font-weight: 700;
}

.icon-action.rz-button {
    border-radius: 6px;
}

.builder-tabs.rz-tabview {
    --rz-tabs-tab-color: var(--text-muted);
    --rz-tabs-tab-selected-color: var(--oslw-blue-strong);
    --rz-tabs-tab-selected-border-color: var(--oslw-blue-strong);
}

.builder-tabs .rz-tabview-nav {
    border-bottom: 1px solid var(--border);
}

.builder-tabs .rz-tabview-nav li a {
    min-height: 42px;
    padding: 0 18px;
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 800;
    text-transform: uppercase;
}

.builder-tabs .rz-tabview-nav li.rz-tabview-selected a,
.builder-tabs .rz-tabview-nav li a[aria-selected="true"] {
    color: var(--oslw-blue-strong);
    border-bottom: 3px solid var(--oslw-blue-strong);
}

.app-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    max-width: 100%;
    padding: 3px 9px;
    border: 1px solid #a8c7e7;
    border-radius: 6px;
    background: #edf6fc;
    color: #0f75d8;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.app-badge.production {
    border-color: #a7d7c5;
    background: #e8f7f0;
    color: #147854;
}

.app-badge.test {
    border-color: #8fb7dd;
    background: var(--oslw-selected);
    color: #0f5f9e;
}

.app-badge.branch,
.app-badge.version {
    background: var(--oslw-selected);
}

.app-badge.artifact {
    margin-top: 6px;
    border-color: #d5dde5;
    background: #f8fafc;
    color: #334e68;
}

.table-shell {
    width: 100%;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.builder-table {
    width: 100%;
    min-width: 680px;
    margin: 0;
    border-collapse: collapse;
    background: var(--surface);
}

.builder-table th,
.builder-table td {
    padding: 13px 16px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

.builder-table th {
    background: #f8fafc;
    color: #334e68;
    font-size: 0.82rem;
    font-weight: 800;
    text-align: left;
    text-transform: uppercase;
}

.builder-table tbody tr:last-child td {
    border-bottom: 0;
}

.builder-table tbody tr:hover {
    background: #fbfdff;
}

.table-title {
    font-weight: 700;
    color: #102a43;
}

.action-column {
    width: 96px;
    text-align: right;
}

.empty-state {
    min-height: 140px;
    display: grid;
    place-items: center;
    gap: 10px;
    padding: 24px;
    border: 1px dashed #bfd0df;
    border-radius: 6px;
    background: #fbfdff;
    color: var(--text-muted);
    text-align: center;
}

.empty-state .oi {
    color: var(--oslw-blue);
    font-size: 1.4rem;
}

.current-build-card {
    display: grid;
    grid-template-columns: minmax(260px, 2fr) minmax(160px, 1fr) minmax(160px, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}

.current-build-card > div {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fbfdff;
}

.current-build-card span:first-child {
    display: block;
    margin-bottom: 6px;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
}

.current-build-card strong {
    display: block;
    color: #102a43;
    overflow-wrap: anywhere;
}

.log-section {
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fbfdff;
    padding: 14px;
}

.log-panel {
    min-height: 160px;
    max-height: 320px;
    overflow: auto;
    padding: 12px 14px;
    border-radius: 6px;
    background: #111827;
    color: #e5e7eb;
    font-family: Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.88rem;
    line-height: 1.55;
}

.login-page {
    background: #eaf2f8;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 18px;
    background:
        linear-gradient(90deg, rgba(11, 42, 74, 0.96) 0, rgba(11, 42, 74, 0.96) 36%, rgba(244, 246, 248, 0.96) 36%),
        linear-gradient(180deg, #ffffff 0%, #f4f6f8 100%);
}

.login-panel {
    width: min(440px, 100%);
    padding: 30px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 18px 50px rgba(11, 42, 74, 0.22);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.login-brand img {
    width: 54px;
    height: 54px;
}

.login-brand p {
    margin: 0;
    color: #102a43;
    font-size: 1.15rem;
    font-weight: 800;
}

.login-brand span {
    color: var(--text-muted);
}

.login-panel h1 {
    margin-bottom: 6px;
    color: #102a43;
    font-size: 1.55rem;
    font-weight: 800;
}

.login-subtitle {
    margin-bottom: 22px;
    color: var(--text-muted);
}

.login-alert {
    margin-bottom: 16px;
    padding: 10px 12px;
    border: 1px solid #fecaca;
    border-radius: 6px;
    background: #fef2f2;
    color: #991b1b;
    font-weight: 700;
}

.login-form {
    display: grid;
    gap: 10px;
}

.login-form label {
    color: #334e68;
    font-weight: 700;
}

.login-form input {
    width: 100%;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #ffffff;
    color: var(--text-main);
}

.login-form input:focus {
    border-color: var(--oslw-blue-strong);
    outline: 3px solid rgba(54, 163, 219, 0.22);
}

.login-form button {
    min-height: 44px;
    margin-top: 8px;
    border: 1px solid var(--oslw-blue-strong);
    border-radius: 6px;
    background: var(--oslw-blue-strong);
    color: #ffffff;
    font-weight: 800;
}

.login-form button:hover {
    background: #0b5fb1;
}

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

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

.validation-message {
    color: #b42318;
}

#blazor-error-ui {
    background: #fff8db;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    padding: 1rem;
    border-radius: 6px;
    background: #b32121;
    color: #ffffff;
}

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

@media (max-width: 1180px) {
    .element-grid {
        grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr);
    }

    .details-panel {
        grid-column: 1 / -1;
    }
}

@media (max-width: 860px) {
    .version-grid,
    .element-grid,
    .services-grid,
    .current-build-card {
        grid-template-columns: 1fr;
    }

    .version-card {
        max-width: none;
    }

    .builder-card {
        padding: 16px;
    }

    .action-row {
        justify-content: stretch;
    }

    .primary-button,
    .rz-button.primary-action {
        width: 100%;
    }

    .login-shell {
        background: #f4f6f8;
    }
}

@media (max-width: 560px) {
    .definition-grid,
    .details-grid {
        grid-template-columns: 1fr;
    }

    .definition-grid dt {
        min-height: auto;
        padding-bottom: 2px;
        border-bottom: 0;
    }

    .definition-grid dd {
        padding-top: 0;
    }

    .builder-tabs .rz-tabview-nav {
        overflow-x: auto;
        white-space: nowrap;
    }
}
