/* Shared Jazzmin shell and the gateway dashboard. */
:root {
    --gateway-ink: #172b42;
    --gateway-muted: #52647a;
    --gateway-accent: #1559a6;
    --gateway-line: #dce3ec;
    --gateway-canvas: #f3f6fa;
}

html[data-bs-theme="dark"] {
    --gateway-ink: #edf2f8;
    --gateway-muted: #b0bfd1;
    --gateway-accent: #8bc0ff;
    --gateway-line: #3d4e63;
    --gateway-canvas: #1c2633;
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

::selection { background: #cce1fa; color: #172b42; }
a, button, input, select, textarea, summary { caret-color: var(--gateway-accent); }
:focus-visible { outline: 3px solid var(--gateway-accent); outline-offset: 3px; }

.app-header { min-height: 56px; }
.app-header .nav-link { min-width: 44px; min-height: 44px; }
.app-sidebar { --bs-secondary-bg: #172b42; --bs-secondary-bg-rgb: 23, 43, 66; }
.sidebar-brand { min-height: 56px; }
.app-sidebar .nav-header { white-space: normal; color: #bdccdd; }
.app-sidebar .nav-link p { white-space: normal; overflow-wrap: anywhere; }
.app-sidebar .user-panel { overflow-wrap: anywhere; }
.app-main { background: var(--gateway-canvas); }
.gateway-dashboard .app-content-header { display: none; }
.gateway-home { width: 100%; padding: 32px 20px 40px; color: var(--gateway-ink); }
.gateway-heading { margin-bottom: 32px; }
.gateway-heading h1 { margin: 0 0 8px; font-size: 1.75rem; font-weight: 650; }
.gateway-heading p, .gateway-help { color: var(--gateway-muted); margin: 0; }
.gateway-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 300px); gap: 40px; }
.gateway-layout h2 { font-size: 1.125rem; font-weight: 650; margin: 0 0 20px; }
.gateway-app { border-top: 1px solid var(--gateway-line); }
.gateway-app h3, .gateway-tools summary { font-size: .875rem; font-weight: 650; margin: 0; padding: 18px 0 10px; }
.gateway-models { list-style: none; padding: 0; margin: 0 0 16px; }
.gateway-models li { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 4px 0; }
.gateway-model-name { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; min-width: 0; }
.gateway-model-name i { width: 20px; color: var(--gateway-muted); text-align: center; }
.gateway-model-name a { font-weight: 550; padding: 10px 0; overflow-wrap: anywhere; }
.gateway-home a { color: var(--gateway-accent); text-underline-offset: 3px; }
.gateway-home a:hover { text-decoration: underline; }
.gateway-add { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--gateway-line); border-radius: 6px; white-space: nowrap; font-size: .875rem; }
.gateway-add:hover { background: var(--bs-tertiary-bg); }
.gateway-readonly { color: var(--gateway-muted); font-size: .75rem; }
.gateway-tools summary { padding: 16px 0; min-height: 48px; cursor: pointer; color: var(--gateway-muted); }
.gateway-tools[open] summary { color: var(--gateway-ink); }
.gateway-history { min-width: 0; }
.gateway-history h2 { margin-bottom: 8px; }
.gateway-help { font-size: .875rem; line-height: 1.5; }
.gateway-activity { list-style: none; padding: 0; margin: 20px 0 0; }
.gateway-activity li { padding: 18px 0; border-top: 1px solid var(--gateway-line); }
.gateway-action, .gateway-object, .gateway-activity time { display: block; }
.gateway-action { color: var(--gateway-muted); font-size: .75rem; margin-bottom: 6px; }
.gateway-object { overflow-wrap: anywhere; font-weight: 550; line-height: 1.5; }
.gateway-activity time { color: var(--gateway-muted); font-size: .8125rem; margin-top: 8px; font-variant-numeric: tabular-nums; }
.gateway-empty { color: var(--gateway-muted); line-height: 1.6; }

@media (max-width: 1199px) {
    .gateway-layout { grid-template-columns: minmax(0, 1fr); gap: 32px; }
}
@media (max-width: 575px) {
    .gateway-home { padding: 24px 4px; }
    .gateway-heading h1 { font-size: 1.5rem; }
    .gateway-models li { flex-wrap: wrap; padding: 8px 0; }
    .gateway-model-name { flex: 1 1 160px; gap: 8px; }
}

/* Stacked inline card: visual separation between records */
.inline-group .stacked .inline-related {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 12px 16px;
    margin-bottom: 12px;
    background-color: #fff;
}

/* Stacked inline header: reduce font weight for hierarchy */
.inline-group .stacked h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

/* Failsafe: any inline group with a table scrolls horizontally instead of overflowing the page */
.inline-group {
    overflow-x: auto;
}

/* Prevent main content from producing a page-level horizontal scrollbar */
#content {
    overflow-x: hidden;
}

/* Collapsible section header cursor hint */
.module.collapse-handler h2 {
    cursor: pointer;
}

/* Credential field: wrapper aligns input and eye button on the same row */
.credential-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Credential field: make editable inputs take all available width */
.credential-wrapper input.credential-field {
    flex: 1;
}

/* Eye toggle button: no background, icon-only */
.credential-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #6c757d;
    padding: 0 4px;
    font-size: 1rem;
    line-height: 1;
    flex-shrink: 0;
}

.credential-toggle-btn:hover {
    color: #343a40;
}

/* Readonly credential value: monospace so character width stays stable on reveal */
.credential-readonly {
    font-family: monospace;
    letter-spacing: 1px;
}
