:root {
    --bg: #f9fafb;
    --surface: #ffffff;
    --surface-2: #f3f4f6;
    --border: #e5e7eb;
    --text: #111827;
    --text-muted: #6b7280;
    --accent: #4f46e5;
    --accent-hover: #4338ca;
    --accent-tint: rgba(79, 70, 229, 0.08);
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --sidebar-width: 240px;
    --topbar-height: 56px;
    --radius: 4px;
    --transition: 150ms ease;
    --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.06);
}

[data-theme="dark"] {
    --bg: #0f1117;
    --surface: #1a1d27;
    --surface-2: #222534;
    --border: #2e3146;
    --text: #e8eaf0;
    --text-muted: #8b90a7;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-tint: rgba(99, 102, 241, 0.12);
    --danger: #f87171;
    --danger-hover: #fca5a5;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: var(--accent-hover);
}

button,
input,
select,
textarea {
    font: inherit;
}

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

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-right: 1px solid var(--border);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 7px;
    background: var(--accent-tint);
    color: var(--accent);
    flex-shrink: 0;
}

.sidebar-brand {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem 0;
    flex: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.625rem 1rem;
    color: var(--text-muted);
    border-left: 3px solid transparent;
    transition:
        color var(--transition),
        background var(--transition),
        border-color var(--transition);
}

.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    flex-shrink: 0;
}

.nav-label {
    font-size: 0.9rem;
}

.nav-link:hover {
    color: var(--text);
    background: var(--surface-2);
}

.nav-link.active {
    color: var(--text);
    background: var(--accent-tint);
    border-left-color: var(--accent);
}

.nav-link.active .nav-icon {
    color: var(--accent);
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border);
}

.theme-label {
    margin: 0 0 0.5rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.theme-toggle {
    display: flex;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
}

.theme-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    background: transparent;
    border: 0;
    color: var(--text-muted);
    cursor: pointer;
    transition:
        background var(--transition),
        color var(--transition);
}

.theme-btn + .theme-btn {
    border-left: 1px solid var(--border);
}

.theme-btn:hover {
    background: var(--surface-2);
    color: var(--text);
}

.theme-btn.active {
    background: var(--accent-tint);
    color: var(--accent);
}

.user-block {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    margin-top: 0.9rem;
    padding: 0.55rem 0.6rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    text-align: left;
    cursor: default;
    transition: background var(--transition);
}

.user-block:disabled {
    cursor: default;
    opacity: 1;
}

.user-block:not(:disabled):hover {
    background: var(--surface-2);
    cursor: pointer;
}

.user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-tint);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    flex-shrink: 0;
    /* Override accent-tint inheritance so light theme keeps text white */
    color: #ffffff;
}

.user-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-email {
    font-size: 0.72rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-caret {
    display: inline-flex;
    align-items: center;
    color: var(--text-muted);
    flex-shrink: 0;
}

.content-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 1.5rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.topbar-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.main-content {
    padding: 1.5rem;
    flex: 1;
}

.page-stack {
    display: grid;
    gap: 1.5rem;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.page-heading {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.page-subtitle {
    margin: 0.35rem 0 0;
    color: var(--text-muted);
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.panel-body {
    padding: 1.25rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.45rem 0.9rem;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition:
        background var(--transition),
        border-color var(--transition),
        color var(--transition);
}

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #ffffff;
}

.btn-secondary {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    background: var(--surface-2);
    color: var(--text);
}

.btn-danger {
    background: transparent;
    border-color: var(--danger);
    color: var(--danger);
}

.btn-danger:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: #ffffff;
}

.segment-control {
    display: inline-flex;
    padding: 0.25rem;
    gap: 0.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.segment-link {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.75rem;
    border-radius: calc(var(--radius) - 1px);
    color: var(--text-muted);
    transition:
        background var(--transition),
        color var(--transition);
}

.segment-link:hover {
    background: var(--surface-2);
    color: var(--text);
}

.segment-link.active {
    background: var(--accent-tint);
    color: var(--accent);
    font-weight: 600;
}

.table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 1.25rem;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 0.5rem;
}

.filter-bar label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.filter-bar .checkbox-inline {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    color: var(--text);
}

.data-table thead th {
    padding: 0.85rem 1rem;
    background: var(--surface-2);
    color: var(--text-muted);
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.data-table tbody td {
    padding: 0.95rem 1rem;
    border-top: 1px solid var(--border);
    vertical-align: middle;
}

.data-table tbody tr:hover td {
    background: var(--surface-2);
}

.table-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-active {
    background: var(--accent-tint);
    color: var(--accent);
}

.badge-archived {
    background: var(--surface-2);
    color: var(--text-muted);
}

.badge-suspended {
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
}

.badge-cancelled {
    background: rgba(220, 38, 38, 0.12);
    color: var(--danger);
}

.empty-state {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-muted);
}

.form-card {
    max-width: 44rem;
}

.form-grid {
    display: grid;
    gap: 1rem;
}

.field {
    display: grid;
    gap: 0.4rem;
}

.field label {
    font-weight: 600;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 0.65rem 0.75rem;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    transition:
        border-color var(--transition),
        box-shadow var(--transition),
        background var(--transition);
}

/* Native checkbox/radio: don't stretch to full width, don't get the
 * input-style padding / background / border — they need to stay
 * inline with the label text inside <label class="check">. */
.field input[type="checkbox"],
.field input[type="radio"] {
    width: auto;
    padding: 0;
    background: transparent;
    border: 0;
    margin-right: 0.45rem;
    vertical-align: middle;
}
.field label.check {
    display: inline-flex;
    align-items: center;
    gap: 0.1rem;
}

.field select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
    cursor: pointer;
}

[data-theme="dark"] .field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b90a7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

.field textarea {
    min-height: 8rem;
    resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-tint);
}

.field-validation-error,
.validation-summary-errors {
    color: var(--danger);
}

.validation-summary-errors ul {
    margin: 0;
    padding-left: 1.2rem;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-top: 0.5rem;
}

.notice {
    padding: 1rem 1.1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
}

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

.notice-info {
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
    color: var(--text);
    margin: 0 0 1rem;
}

.bulk-action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin: 1rem 0 0.5rem;
}

.bulk-action-info {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-right: 0.5rem;
}

.danger-zone {
    border-top: 1px solid var(--border);
    margin-top: 1.5rem;
    padding-top: 1.5rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 1rem;
    margin: 0;
}

.detail-item {
    display: grid;
    gap: 0.35rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
}

.detail-item dt {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.detail-item dd {
    margin: 0;
    color: var(--text);
}

.status-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
    justify-content: space-between;
    margin-top: 1.25rem;
}

.action-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-top: 1.25rem;
}

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

/* --- Products page header ----------------------------------------- */
.products-page-header__title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.badge-soft {
    background: var(--accent-tint, rgba(99, 102, 241, 0.12));
    color: var(--accent, #6366f1);
}

/* --- Search input with leading icon ------------------------------- */
.search-input {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-width: 18rem;
}

.search-input__icon {
    position: absolute;
    left: 0.7rem;
    color: var(--text-muted);
    pointer-events: none;
}

.search-input input {
    width: 100%;
    padding-left: 2rem;
}

.filter-bar--products {
    gap: 1.25rem;
    align-items: center;
}

.filter-bar--products .filter-bar__search {
    flex: 1 1 22rem;
}

/* --- Toggle switch (replaces the bare checkbox for "Geloeschte
       einblenden" etc.) -------------------------------------------- */
.toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    cursor: pointer;
    user-select: none;
    color: var(--text);
    font-size: 0.9rem;
}

.toggle input[type="checkbox"] {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.toggle__track {
    position: relative;
    width: 2.2rem;
    height: 1.2rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    transition: background 160ms ease, border-color 160ms ease;
}

.toggle__thumb {
    position: absolute;
    top: 50%;
    left: 0.15rem;
    width: 0.9rem;
    height: 0.9rem;
    background: var(--surface, #fff);
    border-radius: 50%;
    transform: translateY(-50%);
    transition: left 160ms ease, background 160ms ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

.toggle input[type="checkbox"]:checked + .toggle__track {
    background: var(--accent, #6366f1);
    border-color: var(--accent, #6366f1);
}

.toggle input[type="checkbox"]:checked + .toggle__track .toggle__thumb {
    left: calc(100% - 0.9rem - 0.15rem);
}

.toggle input[type="checkbox"]:focus-visible + .toggle__track {
    outline: 2px solid var(--accent, #6366f1);
    outline-offset: 2px;
}

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

.toggle--disabled .toggle__track {
    cursor: not-allowed;
}

/* --- Button variants: icon-leading button + star toggle ----------- */
.btn-icon-leading {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-star {
    appearance: none;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 0.3rem;
    cursor: pointer;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.btn-star:hover {
    background: var(--surface-2);
    color: var(--text);
}

.btn-star--on {
    color: #f5a623;
}

.btn-star--on:hover {
    color: #d18a17;
    background: rgba(245, 166, 35, 0.12);
}

/* --- Bulk-action bar with leading "Aktionen" label ---------------- */
.bulk-action-bar--labeled .bulk-action-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-right: 0.35rem;
}

/* --- Numbered pagination strip ------------------------------------ */
.pagination--products {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: center;
    margin-top: 1.25rem;
}

.pagination__page-size {
    display: inline-flex;
}

.pagination__page-size-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.pagination__page-size-label select {
    padding: 0.3rem 1.5rem 0.3rem 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface, #fff);
    color: var(--text);
    font-size: 0.85rem;
    cursor: pointer;
}

.pagination__nav {
    display: inline-flex;
    gap: 0.25rem;
    align-items: center;
    justify-self: center;
}

.pagination__page,
.pagination__step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.5rem;
    border-radius: 6px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.pagination__page:hover,
.pagination__step:hover {
    background: var(--surface-2);
}

.pagination__page--current {
    background: var(--accent, #6366f1);
    color: #fff;
    border-color: var(--accent, #6366f1);
}

.pagination__page--current:hover {
    background: var(--accent, #6366f1);
}

.pagination__step--disabled {
    color: var(--text-muted);
    opacity: 0.5;
    pointer-events: none;
}

.pagination__ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    color: var(--text-muted);
    user-select: none;
}

.pagination__range {
    color: var(--text-muted);
    font-size: 0.85rem;
    justify-self: end;
    white-space: nowrap;
}

/* --- Tenant product detail page ----------------------------------- */
.product-detail__header {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.product-detail__head-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
}

.product-detail__head-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.product-detail__head-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.product-detail__grid {
    display: grid;
    gap: 1rem;
}

.product-detail__grid--top {
    grid-template-columns: 2fr 1fr;
}

.product-detail__grid--middle,
.product-detail__grid--bottom {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 960px) {
    .product-detail__grid--top,
    .product-detail__grid--middle,
    .product-detail__grid--bottom {
        grid-template-columns: 1fr;
    }
}

.panel-head {
    padding: 0.85rem 1rem 0.6rem;
    border-bottom: 1px solid var(--border);
}

.panel-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
}

.panel-title-icon {
    color: #f5a623;
    margin-right: 0.3rem;
}

.panel-footer {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
}

/* --- Key/value display lists -------------------------------------- */
.kv-list {
    display: grid;
    gap: 0.85rem;
    margin: 0;
}

.kv-list--compact {
    gap: 0.5rem;
    font-size: 0.85rem;
}

.kv-row {
    display: grid;
    grid-template-columns: minmax(8rem, 13rem) minmax(0, 1fr);
    gap: 1rem;
    align-items: baseline;
}

/* `display: grid` above overrides the browser's [hidden] rule on a
   .kv-row (same specificity, declared later) — restore the hide
   behaviour explicitly so the "Alle Felder anzeigen" toggle has
   something to toggle. */
.kv-row[hidden] {
    display: none;
}

.kv-row dt {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.kv-row dd {
    margin: 0;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    word-break: break-word;
}

.kv-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.82rem;
}

.kv-mono--ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.kv-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--accent, #6366f1);
    text-decoration: none;
    word-break: break-all;
}

.kv-link--break {
    word-break: break-all;
}

.kv-link:hover {
    text-decoration: underline;
}

/* --- Inline copy button ------------------------------------------- */
.btn-copy {
    appearance: none;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 0.2rem;
    cursor: pointer;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 120ms ease, color 120ms ease;
}

.btn-copy:hover {
    color: var(--text);
    background: var(--surface-2);
}

.btn-copy--flash {
    color: var(--accent, #6366f1);
}

/* --- Vorschaubild ------------------------------------------------- */
.product-detail__preview {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.product-detail__preview-image {
    background: var(--surface-2);
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-detail__preview-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-detail__preview-url {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    font-size: 0.82rem;
}

/* --- Description collapsible ------------------------------------- */
.product-detail__description {
    color: var(--text);
    line-height: 1.55;
    max-height: 16rem;
    overflow: hidden;
    position: relative;
    transition: max-height 220ms ease;
}

.product-detail__description.is-expanded {
    max-height: 80rem;
}

.product-detail__description p {
    margin: 0 0 0.7rem;
}

.product-detail__description:not(.is-expanded)::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 2.5rem;
    background: linear-gradient(180deg, transparent, var(--surface, #fff));
    pointer-events: none;
}

.product-detail__more-desc,
.product-detail__more-fields {
    margin-top: 0.75rem;
}

/* --- JSON code block ---------------------------------------------- */
.product-detail__json {
    background: var(--surface-2);
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
    margin: 0 0 0.75rem;
    max-height: 18rem;
    overflow: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.78rem;
    line-height: 1.45;
    color: var(--text);
}

.product-detail__json code {
    background: transparent;
    padding: 0;
}

/* --- Keyword chip strip ------------------------------------------ */
.keyword-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.keyword-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 500;
}

/* --- Action stack (right column of the bottom row) ---------------- */
.action-stack {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.action-stack__item {
    width: 100%;
    justify-content: center;
}

.btn-icon-trailing {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-danger {
    background: rgba(220, 38, 38, 0.08);
    color: var(--danger, #dc2626);
    border: 1px solid rgba(220, 38, 38, 0.25);
}

.btn-danger:hover:not(:disabled) {
    background: rgba(220, 38, 38, 0.15);
}

.btn-danger:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

.tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
}

.tile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 0.5rem;
}

.tile-label {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tile-state-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #888;
    display: inline-block;
}

.tile[data-state="ok"] .tile-state-dot { background: #2ea043; }
.tile[data-state="degraded"] .tile-state-dot { background: #d29922; }
.tile[data-state="down"] .tile-state-dot { background: #da3633; }

.tile-primary {
    margin: 0.25rem 0;
    font-size: 1.4rem;
    font-weight: 600;
}

.tile-secondary {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.tile-updated {
    margin: 0.75rem 0 0;
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* ---- Product detail dialog ---- */

.product-detail-dialog {
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    max-width: 720px;
    width: calc(100% - 2rem);
    box-shadow: 0 16px 40px rgba(17, 24, 39, 0.18);
}

.product-detail-dialog::backdrop {
    background: rgba(17, 24, 39, 0.45);
}

.product-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    gap: 1rem;
}

.product-detail-header h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
}

.product-detail-close {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
}

.product-detail-close:hover {
    color: var(--text);
}

.product-detail-body {
    padding: 1rem 1.25rem;
    max-height: 70vh;
    overflow: auto;
}

.product-detail-section {
    margin-bottom: 1.25rem;
}

.product-detail-section:last-child {
    margin-bottom: 0;
}

.product-detail-section h4 {
    margin: 0 0 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.product-detail-grid {
    display: grid;
    grid-template-columns: max-content 1fr;
    row-gap: 0.4rem;
    column-gap: 1rem;
    font-size: 0.9rem;
}

.product-detail-grid dt {
    color: var(--text-muted);
    font-weight: 500;
}

.product-detail-grid dd {
    margin: 0;
    word-break: break-word;
}

.product-detail-grid dd a {
    color: var(--accent);
}

.product-detail-raw {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8rem;
    white-space: pre;
    overflow: auto;
    max-height: 22rem;
    margin: 0;
}

.product-detail-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.product-detail-error {
    color: var(--danger);
    padding: 0.5rem 0;
}

.row-trigger {
    background: transparent;
    border: none;
    padding: 0;
    color: var(--accent);
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.row-trigger:hover {
    text-decoration: underline;
}

.theme-swatches {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
    margin-top: 12px;
}
.theme-swatch {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}
.theme-swatch__chip {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1px solid var(--border, #e5e7eb);
    display: inline-block;
    flex: 0 0 auto;
}
.theme-swatch__value {
    color: var(--text-muted, #6b7280);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.field-list-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.field-list {
    list-style: none;
    margin: 0 0 16px 0;
    padding: 0;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 6px;
    max-height: 480px;
    overflow-y: auto;
}
.field-list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border, #e5e7eb);
}
.field-list-row:last-child {
    border-bottom: none;
}
.field-list-row:nth-child(even) {
    background: var(--surface, #f9fafb);
}
.field-list-label {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
    cursor: pointer;
}
.field-list-key {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
}
.field-list-meta {
    color: var(--text-muted, #6b7280);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* The .field grid forces width:100% on every input — that breaks the
   compact in-list checkboxes and radios, pushing each row off-screen.
   Reset the inputs that live inside a field-list row back to native
   sizing. */
.field-list input[type="checkbox"],
.field-list input[type="radio"] {
    width: auto;
    padding: 0;
    margin: 0;
    flex: 0 0 auto;
}

.panel-heading {
    margin: 0 0 1rem;
    font-size: 1.05rem;
}

.category-section {
    margin: 16px 0 8px;
}
.category-tree {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}
.category-group {
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 6px;
    background: var(--surface, #f9fafb);
}
.category-group[open] {
    background: var(--surface-elevated, #ffffff);
}
.category-group-summary {
    list-style: none;
    cursor: pointer;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    user-select: none;
    border-radius: 6px;
}
.category-group-summary::-webkit-details-marker { display: none; }
.category-group-summary::before {
    content: "▸";
    color: var(--text-muted, #6b7280);
    transition: transform 0.15s ease;
    display: inline-block;
}
.category-group[open] > .category-group-summary::before {
    transform: rotate(90deg);
}
.category-group-summary .field-list-key {
    flex: 1 1 auto;
    font-size: 13px;
}
.category-list {
    margin: 0;
    border: none;
    border-top: 1px solid var(--border, #e5e7eb);
    border-radius: 0 0 6px 6px;
    max-height: 320px;
}
.category-row[data-depth="1"] { padding-left: 28px; }
.category-row[data-depth="2"] { padding-left: 44px; }
.category-row[data-depth="3"] { padding-left: 60px; }

.inline-tags {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.inline-tags > li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tenant-state-options {
    display: inline-flex;
    gap: 16px;
    align-items: center;
    flex: 0 0 auto;
}
.tenant-state-options > label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}

.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--border, #e5e7eb);
    border-top-color: var(--brand, #2563eb);
    border-radius: 50%;
    vertical-align: -2px;
    margin-right: 6px;
    animation: spinner-rotate 0.8s linear infinite;
}
@keyframes spinner-rotate {
    to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
    .spinner { animation-duration: 2.4s; }
}

/* Promoted-products keyword editor (issue #23) */
.chip-list {
    list-style: none;
    padding: 0;
    margin: 0 0 16px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 13px;
    background: #f1f5f9;
    color: #1e293b;
    border: 1px solid #cbd5e1;
}
.chip-llm {
    background: #f1f5f9;
    color: #475569;
}
.chip-manual {
    background: #dbeafe;
    color: #1d4ed8;
    border-color: #93c5fd;
}
.chip-remove {
    background: none;
    border: 0;
    color: inherit;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 0 0 0 2px;
}
.inline-form {
    display: inline;
    margin: 0;
    padding: 0;
}

/* Tenant detail — page header */
.tenant-page-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
}
.tenant-page-header__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.6rem;
}
.tenant-page-header__crumb {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.tenant-page-header__crumb a {
    color: var(--text-muted);
    text-decoration: none;
}
.tenant-page-header__crumb a:hover {
    color: var(--text);
}
.tenant-page-header__crumb .crumb-sep {
    color: var(--text-muted);
}
.tenant-page-header__row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.tenant-page-header__title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex: 1;
    min-width: 0;
}
.tenant-page-header__title .page-heading {
    margin: 0;
}

.topbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.topbar-breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
}
.topbar-breadcrumb a:hover {
    color: var(--text);
}
.topbar-breadcrumb .crumb-sep {
    color: var(--text-muted);
}
.tenant-page-header__meta {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    align-items: flex-end;
    margin-left: auto;
    font-size: 0.78rem;
}
.tenant-page-header__meta > div {
    display: flex;
    gap: 0.4rem;
}
.tenant-page-header__meta .meta-label {
    color: var(--text-muted);
}
.tenant-page-header__meta .meta-value {
    color: var(--text);
}
.tenant-page-header__actions {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
}
.btn-icon:hover:not([disabled]) {
    color: var(--text);
    background: var(--surface-2);
}
.btn-icon[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Tenant detail — sticky section nav (scroll-stepper) */
.tenant-section-nav {
    position: sticky;
    top: var(--topbar-height);
    z-index: 5;
    display: flex;
    gap: 0.25rem;
    padding: 0 0.25rem;
    margin: 0 -0.25rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    scrollbar-width: thin;
}
.tenant-section-nav a {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.85rem 0.85rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: color 120ms ease, border-color 120ms ease;
}
.tenant-section-nav a:hover {
    color: var(--text);
}
.tenant-section-nav a.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
.tenant-section-nav .nav-icon {
    display: inline-flex;
    align-items: center;
}

.tenant-section {
    scroll-margin-top: calc(var(--topbar-height) + 56px);
}

/* ---- Info card — reusable icon + label + value tile ---- */
.info-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
}
.info-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: var(--accent-tint);
    color: var(--accent);
    flex-shrink: 0;
}
.info-card__body {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}
.info-card__label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.info-card__value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    word-break: break-word;
}
.info-card__value a {
    color: var(--accent);
}

/* Row of info-cards (Scraper, AI Provider, Embeddings) */
.info-card-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

/* Übersicht two-column layout: main grid + quick actions sidebar */
.overview-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 1.25rem;
    align-items: start;
}
.overview-grid__main .info-card-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 1100px) {
    .overview-grid { grid-template-columns: 1fr; }
    .overview-grid__main .info-card-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
    .overview-grid__main .info-card-row { grid-template-columns: 1fr; }
}

/* Quick-actions sidebar */
.quick-actions {
    display: flex;
    flex-direction: column;
}
.quick-actions .panel-body {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.quick-actions .panel-heading {
    margin: 0 0 0.35rem;
}
.quick-actions .btn,
.quick-actions form > .btn,
.quick-actions form {
    width: 100%;
    justify-content: center;
}
.quick-actions form {
    display: flex;
    flex-direction: column;
}
.quick-actions__sep {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 0.4rem 0 0.2rem;
}

/* Subsection inside a panel (e.g. Scraper + Embeddings grouped
 * under a single "Produkte" panel). Smaller than panel-heading,
 * spaced like a section break. */
.subsection-heading {
    margin: 1.25rem 0 0.75rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}
.panel-heading + .subsection-heading {
    /* First subsection sits flush with the panel heading. */
    margin-top: 0.5rem;
}
.subsection-divider {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 1.5rem 0 0;
}

/* Side-by-side subsections inside one panel. Use when two short
 * subsections fit comfortably next to each other. Stacks on narrow
 * viewports. */
.subsection-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem 2rem;
    align-items: start;
}
.subsection-row__col {
    /* Each column is its own flex column so children stack predictably
     * and the natural .subsection-heading top margin determines the
     * baseline. We intentionally do NOT zero out the heading's margin
     * here — both columns share the same heading rule and align by
     * default; removing the margin caused visual drift in practice. */
    min-width: 0;
    display: flex;
    flex-direction: column;
}
@media (max-width: 900px) {
    .subsection-row { grid-template-columns: 1fr; gap: 1.5rem 0; }
}

/* Compact panel variant — for short single-input form panels in the
 * Chat section (Standortabfrage, Produktdarstellung, etc.) so they
 * don't take up as much vertical space as the richer Chat Theme or
 * Promoted-Products panels. */
.panel--compact .panel-body {
    padding: 0.9rem 1.1rem;
}
.panel--compact .panel-heading {
    font-size: 0.95rem;
    margin: 0 0 0.4rem;
}
.panel--compact .form-grid {
    gap: 0.5rem;
}
.panel--compact .field {
    margin: 0;
}

/* Login page (no sidebar, no user chip) */
.login-body {
    margin: 0;
    min-height: 100vh;
    background: var(--background, #f6f7fb);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    color: var(--text, #1f2233);
}

.login-shell {
    width: 100%;
    max-width: 420px;
    padding: 32px 24px;
}

.login-card {
    background: var(--surface, #ffffff);
    border: 1px solid var(--border, #e3e5ee);
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.04);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    color: var(--primary, #4f46e5);
}

.login-brand .sidebar-brand {
    margin: 0;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 14px;
    color: var(--text, #1f2233);
}

.login-page h1 {
    margin: 0 0 20px;
    font-size: 28px;
    font-weight: 700;
}

.login-page form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-error {
    background: var(--danger-bg, #fff1f2);
    border: 1px solid var(--danger-border, #fecdd3);
    color: var(--danger-text, #9f1239);
    padding: 12px 14px;
    border-radius: 8px;
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

.login-error code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    background: rgba(0, 0, 0, 0.05);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 12.5px;
}

.user-block-form {
    margin: 0;
    width: 100%;
}

.user-block-form .user-block {
    width: 100%;
    cursor: pointer;
}

.user-account-link {
    display: block;
    margin-bottom: 6px;
    padding: 6px 10px;
    border-radius: 6px;
    color: var(--muted, #6b7280);
    font-size: 12.5px;
    text-decoration: none;
    text-align: center;
}

.user-account-link:hover {
    background: var(--hover-bg, rgba(0, 0, 0, 0.04));
    color: inherit;
}

/* ===== Mein Konto (/me) ===== */

.me-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 1rem;
}

.me-panel-head .panel-heading { margin: 0; }

.me-profile-grid {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(160px, 1fr) minmax(220px, 1.5fr);
    gap: 16px;
    align-items: stretch;
    padding-top: 4px;
}

.me-profile-identity,
.me-profile-field {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    padding: 14px 16px;
}

.me-profile-identity { display: flex; align-items: center; gap: 14px; }
.me-profile-field { display: flex; flex-direction: column; gap: 6px; justify-content: center; }

.me-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.04em;
    flex: 0 0 auto;
}

.me-profile-name { font-weight: 600; color: var(--text); }
.me-profile-email-inline { color: var(--text-muted); font-size: 13px; }

.me-profile-label { font-size: 12px; color: var(--text-muted); }
.me-profile-value { color: var(--text); font-size: 14px; word-break: break-all; }

.me-inline-form {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.me-divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.me-subhead { margin: 0 0 8px; font-size: 14px; font-weight: 600; }

/* Authentication */
.me-auth-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 4px 0 16px;
}

.me-auth-icon {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: var(--accent-tint);
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.me-auth-title {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.me-auth-sub { color: var(--text-muted); font-size: 13px; }

.me-auth-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

/* Security cards */
.me-security-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.me-security-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
    text-align: left;
    font: inherit;
}

.me-security-card--button {
    /* Reset native <button> chrome so it visually matches the <a> siblings. */
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
}

.me-security-card:hover {
    border-color: var(--accent);
    background: var(--accent-tint);
}

.me-security-card__icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--accent-tint);
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.me-security-card__title { font-weight: 600; }
.me-security-card__sub { color: var(--text-muted); font-size: 13px; }
.me-security-card__chevron { color: var(--text-muted); font-size: 20px; line-height: 1; }

/* Danger zone */
.me-danger-panel {
    border-color: var(--danger);
    background: rgba(220, 38, 38, 0.04);
}

[data-theme="dark"] .me-danger-panel {
    background: rgba(248, 113, 113, 0.08);
}

.me-danger-panel .panel-body { padding: 14px 18px; }
.me-danger-panel .panel-heading { margin-bottom: 10px; font-size: 1rem; }

.me-danger-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 14px;
    align-items: center;
}

.me-danger-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(220, 38, 38, 0.12);
    color: var(--danger);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.me-danger-title { font-weight: 600; color: var(--text); }
.me-danger-sub { color: var(--text-muted); font-size: 13px; }

.me-danger-form {
    border-color: var(--danger);
}

/* Smaller screens — collapse the dense grids to a single column. */
@media (max-width: 900px) {
    .me-profile-grid,
    .me-auth-stats,
    .me-danger-row,
    .me-auth-row {
        grid-template-columns: 1fr;
    }
}
