:root {
    color-scheme: dark;
    --bg: #2b2c2e;
    --sidebar: #242527;
    --panel: #35373a;
    --panel-2: #404347;
    --surface: #303235;
    --surface-2: #292b2d;
    --line: #54575c;
    --line-soft: #474a4e;
    --text: #f5f5f5;
    --muted: #b7babd;
    --muted-2: #8f9398;
    --accent: #e0e1e2;
    --good: #55c98d;
    --warn: #e6b85c;
    --bad: #ef7474;
    --shadow: 0 14px 34px rgba(0, 0, 0, .16);
}

* { box-sizing: border-box; }

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
}

body { min-height: 100vh; }
button, input { font: inherit; }
button { color: inherit; }

.app-shell {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 250px;
    padding: 22px 16px;
    display: flex;
    flex-direction: column;
    background: var(--sidebar);
    border-right: 1px solid #44474b;
    z-index: 20;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 2px 8px 24px;
    min-height: 68px;
}

.elwerk-logo {
    display: block;
    width: 108px;
    height: auto;
    max-height: 40px;
    object-fit: contain;
    flex: 0 0 auto;
}

.brand-copy {
    min-width: 0;
}

.brand-copy strong,
.brand-copy span {
    display: block;
}

.brand-copy strong {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -.01em;
}

.brand-copy span {
    margin-top: 3px;
    color: var(--muted-2);
    font-size: 11px;
}

.nav {
    display: grid;
    gap: 7px;
}

.nav-item {
    width: 100%;
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #c1c4c7;
    cursor: pointer;
    text-align: left;
    transition: background .14s ease, color .14s ease;
}

.nav-item:hover {
    background: #333538;
    color: #fff;
}

.nav-item.active {
    background: #393b3f;
    color: #fff;
    box-shadow: inset 3px 0 0 #d0d2d3;
}

.nav-mark {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #696d72;
    flex: 0 0 auto;
}

.nav-item.active .nav-mark { background: #e0e1e2; }

.sidebar-footer {
    margin-top: auto;
    padding: 18px 8px 2px;
    border-top: 1px solid #44474b;
}

.system-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

.system-status strong,
.system-status span { display: block; }

.system-status strong {
    font-size: 11px;
    font-weight: 650;
}

.system-status span:not(.status-dot) {
    margin-top: 2px;
    color: var(--muted-2);
    font-size: 11px;
}

.sidebar-product {
    margin-top: 16px;
    color: #777b80;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .12em;
}

.status-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: #70757b;
}

.status-dot.ok {
    background: var(--good);
    box-shadow: 0 0 0 4px rgba(85, 201, 141, .08);
}

.status-dot.error { background: var(--bad); }
.status-dot.pending { background: var(--warn); }

.main {
    flex: 1;
    min-width: 0;
    margin-left: 250px;
    padding: 34px;
}

.view {
    display: none;
    max-width: 1250px;
    margin: 0 auto;
}

.view.active { display: block; }
.hidden { display: none !important; }

.page-header {
    margin: 0 0 26px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.eyebrow {
    color: #b2b5b8;
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: 11px;
    font-weight: 750;
}

h1 {
    margin: 4px 0 7px;
    font-size: clamp(30px, 4vw, 42px);
    line-height: 1.05;
    letter-spacing: -.035em;
    font-weight: 720;
}

.muted {
    margin: 0;
    color: var(--muted);
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.metric-card,
.panel {
    background: var(--panel);
    border: 1px solid #55585d;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.metric-card {
    min-height: 136px;
    padding: 18px;
    display: flex;
    flex-direction: column;
}

.metric-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.metric-label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
}

.metric-indicator {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #676b70;
}

.metric-value {
    margin-top: 20px;
    font-size: 32px;
    line-height: 1;
    letter-spacing: -.04em;
    font-weight: 720;
}

.metric-value.ok { color: var(--good); }
.metric-value.error { color: var(--bad); }
.metric-value.muted { color: var(--muted); }

.metric-sub {
    margin-top: auto;
    padding-top: 9px;
    color: var(--muted-2);
    font-size: 11px;
}

.panel {
    overflow: hidden;
    margin-bottom: 18px;
}

.panel + .panel { margin-top: 18px; }

.panel-head {
    min-height: 74px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--line-soft);
}

.panel-title {
    margin-top: 4px;
    font-size: 18px;
    line-height: 1.2;
    font-weight: 680;
    letter-spacing: -.02em;
}

.panel-sub {
    margin-top: 5px;
    color: var(--muted);
    font-size: 11px;
}

.panel-body { padding: 18px; }

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: var(--line-soft);
}

.info-card,
.config-item {
    min-height: 78px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #323437;
}

.info-card span,
.config-item span {
    margin-bottom: 7px;
    color: var(--muted-2);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.info-card strong,
.config-item strong {
    font-size: 12px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.panel-actions,
.action-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.panel-actions { padding-top: 16px; }
.action-strip { margin: 10px 0; }

.btn {
    min-height: 38px;
    padding: 0 15px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: #45484c;
    color: var(--text);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    transition: background .14s ease, border-color .14s ease, opacity .14s ease;
}

.btn:hover:not(:disabled) {
    background: #505358;
    border-color: #73777c;
}

.btn:disabled {
    opacity: .35;
    cursor: not-allowed;
}

.btn.primary {
    background: #e0e1e2;
    border-color: #e0e1e2;
    color: #202123;
}

.btn.primary:hover:not(:disabled) {
    background: #fff;
    border-color: #fff;
}

.btn.secondary {
    background: #45484c;
    border-color: #62666b;
}

.btn.compact {
    min-width: 74px;
    min-height: 32px;
    padding: 0 11px;
}

.badge {
    padding: 6px 9px;
    border: 1px solid #62666b;
    border-radius: 999px;
    background: #414347;
    color: #d6d8da;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .05em;
}

.badge.warn {
    border-color: rgba(230, 184, 92, .35);
    color: #f0ce89;
}

.badge.ok {
    border-color: rgba(85, 201, 141, .38);
    color: #8fe0b5;
}

.inline-status {
    color: var(--muted);
    font-size: 11px;
}

.inline-status.ok { color: var(--good); }
.inline-status.error,
.error-text { color: var(--bad); }

.config-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: var(--line-soft);
}

.notice {
    margin-top: 14px;
    padding: 13px 14px;
    border: 1px solid #56595e;
    border-left: 3px solid #c3c6c9;
    border-radius: 10px;
    background: #303235;
    color: #d1d3d5;
    line-height: 1.55;
    font-size: 12px;
}

.notice.warning { border-left-color: var(--warn); }

code {
    padding: 1px 5px;
    border: 1px solid #4b4e52;
    border-radius: 5px;
    background: #292b2d;
    color: #eceeef;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.locks-list,
.log-list { min-height: 220px; }

.lock-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 110px 80px auto;
    align-items: center;
    gap: 14px;
    min-height: 72px;
    padding: 12px 18px;
    border-bottom: 1px solid #4a4d51;
}

.lock-row:last-child { border-bottom: 0; }
.lock-row:hover { background: rgba(255, 255, 255, .025); }

.lock-name {
    font-size: 13px;
    font-weight: 650;
}

.lock-meta {
    margin-top: 4px;
    color: var(--muted-2);
    font-size: 10px;
}

.lock-state {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
}

.lock-state.online { color: var(--good); }
.lock-state.offline { color: var(--bad); }

.row-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-column {
    min-width: 0;
    padding: 18px;
}

.detail-column + .detail-column {
    border-left: 1px solid var(--line-soft);
}

.subhead {
    margin-bottom: 12px;
    color: #dedfe0;
    font-size: 11px;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.input {
    min-width: 180px;
    min-height: 38px;
    padding: 7px 10px;
    border: 1px solid #585c61;
    border-radius: 9px;
    outline: none;
    background: #292b2d;
    color: var(--text);
}

.input:focus {
    border-color: #8a8e93;
    box-shadow: 0 0 0 3px rgba(220, 222, 224, .08);
}

.timed-pin-row {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) minmax(175px, 1fr) minmax(175px, 1fr) auto;
    gap: 8px;
    margin: 10px 0;
}

.timed-pin-row .input {
    width: 100%;
    min-width: 0;
}

.data-list {
    min-height: 140px;
    max-height: 360px;
    overflow: auto;
    margin-top: 10px;
    border: 1px solid #4a4d51;
    border-radius: 10px;
    background: #303235;
}

.data-row {
    min-height: 54px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 12px;
    padding: 9px 11px;
    border-bottom: 1px solid #4a4d51;
}

.data-row:last-child { border-bottom: 0; }

.data-row strong {
    font-size: 12px;
    font-weight: 650;
}

.data-sub {
    margin-top: 2px;
    color: var(--muted-2);
    font-size: 10px;
}

.log-data-row { grid-template-columns: minmax(0, 1fr) auto; }

.pin-value {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 14px;
    letter-spacing: .08em;
}

.mini-btn {
    min-height: 28px;
    padding: 0 8px;
    border: 1px solid #666a6f;
    border-radius: 7px;
    background: #3b3d40;
    color: #eee;
    cursor: pointer;
    font-size: 10px;
    font-weight: 700;
}

.mini-btn:hover:not(:disabled) {
    border-color: var(--bad);
    color: #ffc1c1;
}

.log-row {
    display: grid;
    grid-template-columns: 180px 80px 150px minmax(0, 1fr);
    gap: 12px;
    padding: 11px 18px;
    border-bottom: 1px solid #4a4d51;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
}

.log-row:last-child { border-bottom: 0; }
.log-ok { color: var(--good); }
.log-fail { color: var(--bad); }

.empty-state {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px;
    color: var(--muted);
    text-align: center;
}

.empty-title {
    margin-bottom: 6px;
    color: var(--text);
    font-weight: 650;
}

.empty-text {
    max-width: 520px;
    font-size: 12px;
}

.empty-small {
    min-height: 138px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    color: var(--muted);
    text-align: center;
    font-size: 11px;
}

.toast {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 100;
    max-width: 520px;
    padding: 12px 14px;
    border: 1px solid #62666b;
    border-radius: 10px;
    background: #242527;
    box-shadow: 0 18px 44px rgba(0, 0, 0, .28);
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: .18s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.error { border-color: rgba(239, 116, 116, .65); }

::selection {
    background: #d0d2d3;
    color: #202123;
}

@media (max-width: 1080px) {
    .config-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .detail-grid { grid-template-columns: 1fr; }
    .detail-column + .detail-column {
        border-left: 0;
        border-top: 1px solid var(--line-soft);
    }
    .timed-pin-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 820px) {
    .app-shell { display: block; }

    .sidebar {
        position: static;
        width: 100%;
        padding: 14px 16px 10px;
        border-right: 0;
        border-bottom: 1px solid #44474b;
    }

    .sidebar-brand { padding: 0 2px 12px; }
    .elwerk-logo { width: 92px; max-height: 34px; }

    .nav {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .nav-item {
        width: auto;
        min-width: max-content;
        min-height: 38px;
    }

    .nav-item.active { box-shadow: inset 0 -3px 0 #d0d2d3; }
    .nav-mark { display: none; }
    .sidebar-footer { display: none; }

    .main {
        margin-left: 0;
        padding: 24px 16px;
    }

    .page-header {
        align-items: stretch;
        flex-direction: column;
    }

    .page-header .btn { align-self: flex-start; }

    .status-grid,
    .info-grid,
    .config-grid { grid-template-columns: 1fr; }

    .lock-row,
    .log-row,
    .data-row,
    .timed-pin-row { grid-template-columns: 1fr; }

    .row-actions { justify-content: flex-start; }
    .input { width: 100%; }
}


/* External API */
.external-header {
    align-items: center;
}

.site-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.site-toolbar .select-input {
    min-width: 210px;
}

.select-input {
    appearance: none;
    padding-right: 34px;
    background-image:
        linear-gradient(45deg, transparent 50%, #aeb2b6 50%),
        linear-gradient(135deg, #aeb2b6 50%, transparent 50%);
    background-position:
        calc(100% - 16px) 50%,
        calc(100% - 11px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.external-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.endpoint-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: var(--line-soft);
}

.endpoint-card > div {
    min-height: 72px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 7px;
    background: #323437;
}

.endpoint-card span,
.mapping-form label > span,
.mapping-target span,
.secret-box span {
    color: var(--muted-2);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.form-line {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.form-line .input {
    flex: 1 1 280px;
}

.secret-box {
    margin-top: 14px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border: 1px solid rgba(230, 184, 92, .45);
    border-radius: 10px;
    background: rgba(230, 184, 92, .07);
}

.secret-box > div {
    min-width: 0;
}

.secret-box code {
    display: block;
    margin-top: 7px;
    overflow-wrap: anywhere;
    user-select: all;
}

.compact-list,
.mapping-list {
    margin-top: 16px;
    overflow: hidden;
    border: 1px solid #4a4d51;
    border-radius: 10px;
    background: #303235;
}

.compact-row {
    min-height: 58px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid #4a4d51;
}

.compact-row:last-child {
    border-bottom: 0;
}

.compact-row .grow {
    flex: 1;
    min-width: 0;
}

.compact-row strong,
.compact-row span {
    display: block;
}

.compact-row strong {
    font-size: 12px;
    font-weight: 650;
}

.compact-row .grow span {
    margin-top: 3px;
    color: var(--muted-2);
    font-size: 10px;
}

.mapping-form {
    display: grid;
    grid-template-columns: minmax(180px, 1.2fr) minmax(160px, 1fr) 140px minmax(160px, 1fr) minmax(160px, 1fr) auto;
    gap: 9px;
    align-items: end;
}

.mapping-form label {
    min-width: 0;
}

.mapping-form label > span {
    display: block;
    margin-bottom: 7px;
}

.mapping-form .input {
    width: 100%;
    min-width: 0;
}

.mapping-add {
    white-space: nowrap;
}

.mapping-row {
    min-height: 70px;
    display: grid;
    grid-template-columns: minmax(220px, 1.4fr) minmax(130px, .8fr) minmax(180px, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 11px 12px;
    border-bottom: 1px solid #4a4d51;
}

.mapping-row:last-child {
    border-bottom: 0;
}

.mapping-row:hover {
    background: rgba(255, 255, 255, .025);
}

.mapping-reference strong,
.mapping-reference code {
    display: block;
}

.mapping-reference strong {
    margin-bottom: 5px;
    font-size: 12px;
}

.mapping-reference code {
    width: fit-content;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.provider-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border: 1px solid #5b5f64;
    border-radius: 999px;
    background: #414347;
    color: #d6d8da;
    font-size: 10px;
    font-weight: 750;
}

.mapping-target strong {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    overflow-wrap: anywhere;
}

.external-log {
    min-height: 220px;
}

.api-log-row {
    border-bottom: 1px solid #4a4d51;
}

.api-log-row:last-child {
    border-bottom: 0;
}

.api-log-row summary {
    min-height: 58px;
    display: grid;
    grid-template-columns: 165px 130px minmax(160px, 1fr) minmax(170px, 1fr) 150px;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    cursor: pointer;
    list-style: none;
}

.api-log-row summary::-webkit-details-marker {
    display: none;
}

.api-log-row summary:hover {
    background: rgba(255, 255, 255, .025);
}

.api-log-time,
.api-log-client,
.api-log-target {
    color: var(--muted);
    font-size: 10px;
}

.api-log-reference {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    overflow-wrap: anywhere;
}

.api-status {
    width: fit-content;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .05em;
}

.api-status.status-success {
    color: #9be4be;
    background: rgba(85, 201, 141, .10);
}

.api-status.status-pending {
    color: #f0ce89;
    background: rgba(230, 184, 92, .10);
}

.api-status.status-error {
    color: #ffc1c1;
    background: rgba(239, 116, 116, .10);
}

.api-log-detail {
    padding: 0 18px 16px;
}

.api-log-facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid #4a4d51;
    border-radius: 9px;
    background: #4a4d51;
}

.api-log-facts > div {
    padding: 10px;
    background: #303235;
}

.api-log-facts span,
.api-log-facts strong {
    display: block;
}

.api-log-facts span {
    color: var(--muted-2);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.api-log-facts strong {
    margin-top: 5px;
    font-size: 10px;
    overflow-wrap: anywhere;
}

.api-log-message {
    margin-top: 10px;
    color: #d6d8da;
    font-size: 11px;
}

.api-log-detail pre {
    margin: 10px 0 0;
    padding: 12px;
    max-height: 260px;
    overflow: auto;
    border: 1px solid #44474b;
    border-radius: 9px;
    background: #242527;
    color: #d7dadc;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 10px;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

@media (max-width: 1180px) {
    .external-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mapping-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mapping-add {
        align-self: stretch;
    }

    .mapping-row {
        grid-template-columns: 1fr 1fr;
    }

    .api-log-row summary {
        grid-template-columns: 150px 120px 1fr;
    }

    .api-log-target,
    .api-log-client {
        display: none;
    }
}

@media (max-width: 820px) {
    .site-toolbar {
        width: 100%;
        justify-content: flex-start;
    }

    .site-toolbar .input,
    .site-toolbar .btn {
        width: 100%;
    }

    .external-kpis,
    .endpoint-card,
    .mapping-form,
    .mapping-row,
    .api-log-facts,
    .api-log-row summary {
        grid-template-columns: 1fr;
    }

    .compact-row,
    .secret-box {
        align-items: stretch;
        flex-direction: column;
    }

    .api-log-target,
    .api-log-client {
        display: block;
    }
}


.api-log-section-label {
    margin-top: 12px;
    color: var(--muted-2);
    font-size: 9px;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: .08em;
}


.endpoint-card code {
    display: block;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.url-config-line .input {
    flex: 1 1 280px;
}


/* Gate Central-style authentication */
.auth-page {
    min-height: 100vh;
    background: var(--bg);
}

.auth-main {
    min-height: 100vh;
    padding: 24px;
    display: grid;
    place-items: center;
}

.auth-wrap {
    width: min(100%, 430px);
}

.auth-card {
    background: #35373a;
    border: 1px solid #55585d;
    border-radius: 18px;
    padding: 28px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .25);
}

.auth-brand.auth-brand-elwerk {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 24px;
}

.elwerk-logo-auth {
    width: 176px;
    max-height: 64px;
}

.auth-brand-copy {
    min-width: 0;
}

.auth-brand-copy strong,
.auth-brand-copy span {
    display: block;
}

.auth-brand-copy strong {
    font-size: 14px;
    font-weight: 700;
}

.auth-brand-copy span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.auth-card h1 {
    margin-top: 4px;
}

.form-stack {
    display: grid;
    gap: 16px;
    margin-top: 24px;
}

.form-stack label {
    display: grid;
    gap: 7px;
    color: #d2d4d6;
    font-size: 13px;
    font-weight: 650;
}

.form-stack input {
    width: 100%;
    min-height: 42px;
    padding: 11px 12px;
    border: 1px solid #585c61;
    border-radius: 10px;
    outline: none;
    background: #292b2d;
    color: #f5f5f5;
}

.form-stack input:focus {
    border-color: #8a8e93;
    box-shadow: 0 0 0 3px rgba(220, 222, 224, .08);
}

.button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 15px;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
}

.button.primary {
    background: #e0e1e2;
    border-color: #e0e1e2;
    color: #202123;
}

.button.primary:hover {
    background: #ffffff;
    border-color: #ffffff;
}

.alert {
    margin: 18px 0 0;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 11px;
}

.alert-error {
    color: #ffc1c1;
    border-color: rgba(239, 116, 116, .35);
    background: rgba(239, 116, 116, .08);
}

.sidebar-user {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #44474b;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
}

.sidebar-user strong,
.sidebar-user span {
    display: block;
}

.sidebar-user strong {
    font-size: 11px;
    font-weight: 650;
}

.sidebar-user span {
    margin-top: 3px;
    color: var(--muted-2);
    font-size: 10px;
    overflow-wrap: anywhere;
}

.sidebar-user form {
    margin: 0;
}

.logout-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted-2);
    cursor: pointer;
    font-size: 10px;
}

.logout-button:hover {
    color: #fff;
}

@media (max-width: 560px) {
    .auth-main {
        padding: 14px;
    }

    .auth-card {
        padding: 22px;
    }

    .auth-brand.auth-brand-elwerk {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .elwerk-logo-auth {
        width: 150px;
    }
}


/* Customer API documentation */
.api-docs {
    display: grid;
    gap: 14px;
}

.api-doc-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.api-doc-block {
    min-width: 0;
    overflow: hidden;
    border: 1px solid #4d5054;
    border-radius: 12px;
    background: #303235;
}

.api-doc-heading {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid #474a4e;
}

.api-doc-heading > div {
    display: flex;
    align-items: center;
    gap: 9px;
}

.api-doc-heading strong {
    font-size: 12px;
    font-weight: 700;
}

.api-doc-step {
    width: 23px;
    height: 23px;
    display: inline-grid;
    place-items: center;
    border: 1px solid #62666b;
    border-radius: 999px;
    color: #d9dbdd;
    font-size: 10px;
    font-weight: 800;
}

.api-doc-code {
    display: block;
    margin: 0;
    padding: 14px;
    border: 0;
    border-radius: 0;
    background: #292b2d;
    color: #f1f2f3;
    font-size: 12px;
    line-height: 1.5;
    overflow-wrap: anywhere;
    user-select: all;
}

.api-doc-pre {
    margin: 0;
    min-height: 150px;
    padding: 14px;
    overflow: auto;
    background: #292b2d;
    color: #dde0e2;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    user-select: all;
}

.api-doc-curl {
    min-height: 130px;
}

.api-field-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.api-field-card {
    min-height: 128px;
    padding: 13px;
    border: 1px solid #4d5054;
    border-radius: 11px;
    background: #323437;
}

.api-field-card code {
    display: inline-block;
    margin-bottom: 10px;
}

.api-field-card strong,
.api-field-card span {
    display: block;
}

.api-field-card strong {
    margin-bottom: 6px;
    font-size: 11px;
    line-height: 1.4;
}

.api-field-card span {
    color: var(--muted);
    font-size: 10px;
    line-height: 1.5;
}

.api-reference-list {
    background: #292b2d;
}

.api-reference-row {
    min-height: 58px;
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 10px 12px;
    border-bottom: 1px solid #45484c;
}

.api-reference-row:last-child {
    border-bottom: 0;
}

.api-reference-row.disabled {
    opacity: .48;
}

.api-reference-row > div:first-child {
    min-width: 0;
}

.api-reference-row code,
.api-reference-row strong {
    display: block;
}

.api-reference-row code {
    width: fit-content;
    max-width: 100%;
    margin-bottom: 5px;
    overflow-wrap: anywhere;
}

.api-reference-row strong {
    font-size: 11px;
}

.api-reference-row small {
    display: block;
    margin-top: 5px;
    color: var(--muted-2);
    font-size: 9px;
}

.approval-checks {
    display: grid;
    gap: 10px;
    min-height: 150px;
    padding: 14px;
    background: #292b2d;
    align-content: center;
}

.approval-checks > div {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #d8dadc;
    font-size: 11px;
}

.check-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--good);
    box-shadow: 0 0 0 4px rgba(85, 201, 141, .07);
}

.api-status-table {
    overflow: hidden;
    border: 1px solid #4d5054;
    border-radius: 12px;
    background: #303235;
}

.api-status-table > div {
    min-height: 42px;
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-bottom: 1px solid #45484c;
    font-size: 10px;
}

.api-status-table > div:last-child {
    border-bottom: 0;
}

.api-status-table .api-status-head {
    min-height: 36px;
    background: #292b2d;
    color: var(--muted-2);
    font-size: 9px;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: .07em;
}

.api-status-table strong {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
}

.api-status-table .http-ok {
    color: var(--good);
}

.api-status-table .http-retry {
    color: var(--warn);
}

@media (max-width: 980px) {
    .api-doc-grid,
    .api-field-grid {
        grid-template-columns: 1fr;
    }

    .api-reference-row {
        grid-template-columns: 1fr auto;
    }

    .api-reference-row > div:nth-child(2) {
        grid-column: 1;
    }
}

@media (max-width: 620px) {
    .api-status-table > div {
        grid-template-columns: 56px 1fr;
    }

    .api-status-table > div > span:last-child {
        grid-column: 2;
        color: var(--muted-2);
    }

    .api-reference-row {
        grid-template-columns: 1fr;
    }
}


/* One-time code simulator */
.simulator-use-form {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(180px, .7fr) auto;
    gap: 10px;
    align-items: end;
}

.simulator-use-form label {
    min-width: 0;
}

.simulator-use-form label > span {
    display: block;
    margin-bottom: 7px;
    color: var(--muted-2);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.simulator-use-form .input {
    width: 100%;
    min-width: 0;
}

.simulator-code-input {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 18px;
    font-weight: 750;
    letter-spacing: .16em;
}

.simulator-result {
    display: block;
    margin-top: 12px;
}

@media (max-width: 820px) {
    .simulator-use-form {
        grid-template-columns: 1fr;
    }
}
