/* ===== SETTINGS PAGE (sticky section nav + one visible panel) ===== */

.settings-head {
    margin-bottom: 18px;
}

.settings-head h1 {
    font-size: 20px;
    margin: 0 0 2px;
}

.settings-sub {
    color: var(--text-muted);
    font-size: 13px;
    margin: 0;
}

.settings-layout {
    display: flex;
    gap: 22px;
    align-items: flex-start;
}

/* Left navigation: sticky so it stays in view while the panel scrolls. */
.settings-nav {
    flex: 0 0 210px;
    position: sticky;
    top: 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.settings-nav__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 6px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
}

.settings-nav__item:hover {
    background: #f0eee9;
}

/* Non-clickable group label (e.g. "E-Mail") over its sub-items. */
.settings-nav__group {
    padding: 12px 12px 4px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.settings-nav__item--sub {
    padding-left: 22px;
    font-weight: 500;
}

.settings-nav__item.is-active {
    background: var(--sidebar-bg);
    color: var(--white);
}

/* An amber dot flags a bereich that needs attention (e.g. a missing
   Kontonummer) even while its panel is hidden. Turns gold on the navy
   active row so it stays visible. */
.settings-nav__badge {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f59e0b;
}

.settings-nav__item.is-active .settings-nav__badge {
    background: var(--gold, #f2c037);
}

.settings-content {
    flex: 1;
    min-width: 0;
}

.settings-panel {
    scroll-margin-top: 16px;
}

/* Only hide inactive panels once the controller has enhanced the page; without
   JS, every panel stays visible as a plain stacked list. */
.settings.is-enhanced .settings-panel {
    display: none;
}

.settings.is-enhanced .settings-panel.is-active {
    display: block;
    animation: settings-fade 0.12s ease;
}

@keyframes settings-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Link tiles (Stammdaten): a card that is itself the link to another page. */
.tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}

.link-tile {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.link-tile:hover {
    border-color: var(--primary);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.link-tile__title {
    font-size: 14px;
    font-weight: 700;
}

.link-tile__desc {
    font-size: 12.5px;
    color: var(--text-muted);
}

.link-tile__go {
    margin-top: 2px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--primary);
}

/* Edit/Save toolbar pinned to the top-right of a settings card, so the
   "Bearbeiten" affordance is visible immediately instead of below a tall
   stack of (locked) fields. */
.settings-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 14px;
}

.settings-actions > div {
    display: flex;
    gap: 8px;
}

/* Labelled sub-group inside a settings card (e.g. the send-text blocks:
   Institute / Sonstige / Signatur), separated by a hairline. */
.settings-subgroup {
    padding: 16px 0;
    border-top: 1px solid var(--border);
}

.settings-subgroup:first-of-type {
    padding-top: 4px;
    border-top: 0;
}

.settings-subgroup__title {
    margin: 0 0 12px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--sidebar-bg);
}

/* Read-only calculation parameter (e.g. the fixed Lotteriesteuersatz) shown
   next to an editable one. */
.param-grid {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.param-ro {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 220px;
    margin-bottom: 14px;
}

.param-ro__val {
    padding: 8px 10px;
    border: 1.5px dashed #d7d5cf;
    border-radius: 4px;
    background: #f4f2ee;
    color: #555;
    font-size: 14px;
}

.param-ro__lock {
    font-size: 11px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: #8a8a8a;
}

@media (max-width: 820px) {
    .settings-layout {
        flex-direction: column;
    }

    .settings-nav {
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        width: 100%;
    }

    .settings-nav__item {
        flex: 1 1 auto;
        justify-content: center;
    }
}
