/* ==========================================================================
   Kundenportal PS-Public Relations – Designsystem
   Basis: Bootstrap 5.3 (Raster, Utilities). Alles Optische steht hier.
   Linie der Schwesterseiten drohne-leasen.de / emojirate.de:
   Papier-Flächen, Graphit-Text, EIN Akzent (PSPR-Grün), Elevation über
   Ränder statt Schatten, Statusfarben nur für Status.
   ========================================================================== */

@font-face {
    font-family: "Work Sans";
    src: url("../fonts/work-sans-variable.woff2") format("woff2-variations"),
         url("../fonts/work-sans-variable.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    /* Neutrale */
    --c-ink: #1b1e23;          /* Text, dunkle Flächen */
    --c-ink-2: #3d424b;        /* Fließtext auf Weiß */
    --c-muted: #5a6070;        /* Zweittext, 6:1 auf Weiß */
    --c-line: #e3e5e9;         /* Ränder */
    --c-line-strong: #cdd1d8;  /* Feldränder, Hover */
    --c-paper: #f5f6f4;        /* App-Hintergrund */
    --c-paper-2: #eceeeb;      /* Hover auf Papier */
    --c-white: #ffffff;

    /* Akzent: bedeutet immer „handeln“ oder „ausgewählt“.
       Auf Grün steht dunkle Schrift (7,7:1); Grün als Text nur in --c-accent-text. */
    --c-accent: #30c27c;
    --c-accent-hover: #2bb070;
    --c-accent-text: #157a4b;  /* 5,3:1 auf Weiß */
    --c-accent-soft: #e7f7ef;
    --c-accent-line: #bfe9d3;

    /* Status – weiche Fläche + dunkle Schrift */
    --c-success-bg: #e4f5ec; --c-success-fg: #13663f; --c-success-line: #bfe4cf;
    --c-warning-bg: #fff4d6; --c-warning-fg: #7a5200; --c-warning-line: #f4dc9c;
    --c-danger-bg:  #fcebea; --c-danger-fg:  #af2318; --c-danger-line:  #f2c3be;
    --c-info-bg:    #e8f0fb; --c-info-fg:    #1f4e8c; --c-info-line:    #c6d8f2;
    --c-neutral-bg: #eef0f2; --c-neutral-fg: #3e4450; --c-neutral-line: #d9dde3;

    /* Radien: Hierarchie statt „ein Radius für alles“ */
    --r-sheet: 24px;   /* Sidebar, Login-Flächen */
    --r-card: 20px;    /* Karten */
    --r-inner: 14px;   /* Listeneinträge, Hinweisflächen */
    --r-control: 12px; /* Buttons, Felder */
    --r-chip: 10px;    /* Icon-Chips */

    --shadow-overlay: 0 12px 40px rgba(27, 30, 35, 0.14), 0 2px 6px rgba(27, 30, 35, 0.06);

    --font: "Work Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

    /* Bootstrap-Variablen auf die Tokens legen */
    --bs-body-font-family: var(--font);
    --bs-body-font-size: 0.9375rem;
    --bs-body-line-height: 1.55;
    --bs-body-color: var(--c-ink-2);
    --bs-body-bg: var(--c-paper);
    --bs-emphasis-color: var(--c-ink);
    --bs-heading-color: var(--c-ink);
    --bs-secondary-color: var(--c-muted);
    --bs-border-color: var(--c-line);
    --bs-border-radius: var(--r-control);
    --bs-border-radius-sm: 8px;
    --bs-border-radius-lg: var(--r-card);
    --bs-link-color: var(--c-accent-text);
    --bs-link-color-rgb: 21, 122, 75;
    --bs-link-hover-color: var(--c-ink);
    --bs-link-hover-color-rgb: 27, 30, 35;
    --bs-primary: var(--c-accent);
    --bs-primary-rgb: 48, 194, 124;
    --bs-focus-ring-color: rgba(48, 194, 124, 0.3);
    --bs-secondary-bg: var(--c-paper);
    --bs-tertiary-bg: var(--c-paper);
}

/* ── Grundlagen ─────────────────────────────────────────────────────────── */

html {
    background-color: var(--c-paper);
}

body {
    font-feature-settings: "kern" 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, .h1, .h2, .h3, .h4 {
    color: var(--c-ink);
    letter-spacing: -0.02em;
    overflow-wrap: break-word;
}

.num,
.table td,
.meta-list dd,
.stat-value {
    font-variant-numeric: tabular-nums;
}

a {
    text-underline-offset: 3px;
}

/* Links im Fließtext nicht nur über die Farbe erkennbar (WCAG 1.4.1) */
main p a:not(.btn),
.form-text a,
.text-link {
    color: var(--c-ink);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--c-accent);
    text-decoration-thickness: 2px;
}

main p a:not(.btn):hover,
.text-link:hover {
    text-decoration-color: var(--c-ink);
}

::selection {
    background: var(--c-accent-soft);
    color: var(--c-ink);
}

:where(a, button, summary, [tabindex], input[type="checkbox"], input[type="radio"], select):focus-visible {
    outline: 2px solid var(--c-accent-text);
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    left: 16px;
    top: -60px;
    z-index: 10000;
    padding: 10px 16px;
    border-radius: var(--r-control);
    background: var(--c-ink);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
}

.skip-link:focus {
    top: 12px;
    color: #fff;
}

/* ── App-Gerüst ─────────────────────────────────────────────────────────── */

.app {
    display: grid;
    grid-template-columns: 264px minmax(0, 1fr);
    gap: 24px;
    min-height: 100vh;
    padding: 16px 24px 16px 16px;
}

.app-sidebar {
    position: sticky;
    top: 16px;
    height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
    background: var(--c-white);
    border: 1px solid var(--c-line);
    border-radius: var(--r-sheet);
    padding: 20px 14px 14px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.app-brand {
    display: flex;
    align-items: center;
    padding: 4px 10px 20px;
}

.app-brand img {
    height: 44px;
    width: auto;
}

.app-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.app-content {
    flex: 1 0 auto;
    width: 100%;
    outline: none;
}

.app-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
    padding: 24px 0 8px;
    font-size: 0.8125rem;
    color: var(--c-muted);
}

.app-footer a {
    color: var(--c-muted);
}

/* ── Navigation ─────────────────────────────────────────────────────────── */

.nav-main {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-main ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item-link {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 42px;
    padding: 9px 12px;
    border: 0;
    border-radius: var(--r-control);
    background: transparent;
    color: var(--c-ink);
    font-size: 0.9375rem;
    font-weight: 500;
    text-align: left;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.nav-item-link:hover {
    background: var(--c-paper);
    color: var(--c-ink);
}

.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    flex-shrink: 0;
    color: var(--c-muted);
    font-size: 1.05rem;
}

.nav-item-link .nav-chevron {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--c-muted);
    transition: transform 0.2s ease;
}

.nav-item-link[aria-expanded="true"] .nav-chevron {
    transform: rotate(180deg);
}

.nav-item-link.is-active {
    background: var(--c-accent-soft);
    font-weight: 600;
}

.nav-item-link.is-active .nav-icon,
.nav-item-link.is-section .nav-icon {
    color: var(--c-accent-text);
}

.nav-item-link.is-section {
    font-weight: 600;
}

.nav-sub {
    margin: 2px 0 6px 21px !important;
    padding-left: 12px !important;
    border-left: 1px solid var(--c-line);
}

.nav-sub[hidden] {
    display: none;
}

.nav-sub a {
    display: block;
    padding: 7px 10px;
    border-radius: var(--r-chip);
    color: var(--c-muted);
    font-size: 0.9rem;
    text-decoration: none;
}

.nav-sub a:hover {
    background: var(--c-paper);
    color: var(--c-ink);
}

.nav-sub a.is-active {
    position: relative;
    color: var(--c-ink);
    font-weight: 600;
}

.nav-sub a.is-active::before {
    content: "";
    position: absolute;
    left: -13px;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 3px;
    background: var(--c-accent);
}

.nav-divider {
    height: 1px;
    margin: 12px 10px;
    background: var(--c-line);
}

.sidebar-help {
    margin-top: auto;
    padding: 16px 12px 4px;
    border-top: 1px solid var(--c-line);
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--c-muted);
}

.sidebar-help a {
    color: var(--c-ink);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--c-accent);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

/* ── Kopfzeile ──────────────────────────────────────────────────────────── */

.app-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 0 0 20px;
}

.app-topbar .crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.875rem;
    color: var(--c-muted);
    min-width: 0;
}

.crumbs li {
    display: flex;
    align-items: center;
    gap: 6px;
}

.crumbs li + li::before {
    content: "/";
    color: var(--c-line-strong);
}

.crumbs a {
    color: var(--c-muted);
    text-decoration: none;
}

.crumbs a:hover {
    color: var(--c-ink);
    text-decoration: underline;
}

.crumbs [aria-current="page"] {
    color: var(--c-ink);
    font-weight: 500;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--c-line);
    border-radius: var(--r-control);
    background: var(--c-white);
    color: var(--c-ink);
    font-size: 1.15rem;
    text-decoration: none;
    transition: border-color 0.15s ease;
}

.icon-btn:hover,
.icon-btn[aria-expanded="true"] {
    border-color: var(--c-ink);
    color: var(--c-ink);
}

.icon-btn .count-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border: 2px solid var(--c-paper);
    border-radius: 999px;
    background: var(--c-danger-fg);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
}

.avatar-btn {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: var(--c-ink);
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.nav-toggle {
    display: none;
}

.topbar-logo {
    display: none;
}

/* Suche */
.topbar-search {
    position: relative;
    width: clamp(240px, 24vw, 440px);
}

.topbar-search .bi-search {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--c-muted);
    pointer-events: none;
}

.topbar-search input {
    width: 100%;
    height: 42px;
    padding: 0 14px 0 40px;
    border: 1px solid var(--c-line);
    border-radius: var(--r-control);
    background: var(--c-white);
    color: var(--c-ink);
    font-size: 0.9375rem;
}

.topbar-search input::placeholder {
    color: var(--c-muted);
}

.topbar-search input:focus {
    outline: none;
    border-color: var(--c-ink);
    box-shadow: 0 0 0 4px var(--bs-focus-ring-color);
}

#search-results-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: max(100%, 360px);
    max-height: 440px;
    overflow-y: auto;
    padding: 6px;
    background: var(--c-white);
    border: 1px solid var(--c-line);
    border-radius: var(--r-inner);
    box-shadow: var(--shadow-overlay);
    z-index: 1050;
}

.search-section-label {
    padding: 10px 10px 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--c-muted);
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: var(--r-chip);
    color: var(--c-ink);
    font-size: 0.875rem;
    text-decoration: none;
}

.search-result-item:hover,
.search-result-item:focus {
    background: var(--c-paper);
    color: var(--c-ink);
    outline: none;
}

.search-result-icon {
    flex-shrink: 0;
    width: 20px;
    color: var(--c-muted);
    font-size: 1.05rem;
    text-align: center;
}

.search-result-meta {
    margin-top: 1px;
    font-size: 0.78rem;
    color: var(--c-muted);
}

.search-empty,
.search-spinner {
    padding: 18px;
    text-align: center;
    color: var(--c-muted);
    font-size: 0.875rem;
}

.search-spinner i {
    display: inline-block;
    animation: spin 0.6s linear infinite;
}

mark {
    padding: 0 2px;
    border-radius: 3px;
    background: var(--c-accent-soft);
    color: inherit;
}

/* Dropdowns (Benachrichtigungen, Benutzermenü, Filter) */
.dropdown-menu {
    --bs-dropdown-border-color: var(--c-line);
    --bs-dropdown-border-radius: var(--r-inner);
    --bs-dropdown-link-active-bg: var(--c-accent-soft);
    --bs-dropdown-link-active-color: var(--c-ink);
    --bs-dropdown-link-hover-bg: var(--c-paper);
    padding: 6px;
    box-shadow: var(--shadow-overlay);
}

.dropdown-item {
    border-radius: var(--r-chip);
    padding: 8px 10px;
    color: var(--c-ink);
}

.dropdown-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px 10px;
    font-weight: 600;
    color: var(--c-ink);
}

.dropdown-panel-head .btn-link {
    padding: 0;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--c-accent-text);
}

.notif-list {
    max-height: 340px;
    overflow-y: auto;
}

.notif-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px;
    border-radius: var(--r-chip);
    color: var(--c-ink);
    font-size: 0.875rem;
    text-decoration: none;
}

.notif-item:hover {
    background: var(--c-paper);
    color: var(--c-ink);
}

.notif-item .notif-dot {
    width: 8px;
    height: 8px;
    margin-top: 7px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--c-accent);
}

.notif-item time {
    display: block;
    font-size: 0.78rem;
    color: var(--c-muted);
}

.notif-empty {
    padding: 14px 10px;
    font-size: 0.875rem;
    color: var(--c-muted);
}

.user-menu-head {
    padding: 8px 10px 10px;
    border-bottom: 1px solid var(--c-line);
    margin-bottom: 6px;
}

.user-menu-head strong {
    display: block;
    color: var(--c-ink);
}

.user-menu-head span {
    font-size: 0.8125rem;
    color: var(--c-muted);
}

/* ── Seitenkopf ─────────────────────────────────────────────────────────── */

.page-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px 24px;
    margin-bottom: 28px;
}

.page-title {
    margin: 0;
    font-size: clamp(1.625rem, 1.25rem + 1.2vw, 2.125rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.page-lead {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    margin: 10px 0 0;
    color: var(--c-muted);
    font-size: 1rem;
}

.page-lead strong {
    color: var(--c-ink);
    font-weight: 600;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* ── Karten ─────────────────────────────────────────────────────────────── */

.card {
    --bs-card-border-color: var(--c-line);
    --bs-card-border-radius: var(--r-card);
    --bs-card-inner-border-radius: calc(var(--r-card) - 1px);
    --bs-card-spacer-y: 24px;
    --bs-card-spacer-x: 24px;
    --bs-card-cap-bg: transparent;
    margin-bottom: 24px;
    background: var(--c-white);
}

.card-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    padding: 22px 24px 0;
    border-bottom: 0;
}

.card-title,
.card-header .card-title {
    margin: 0;
    font-size: 1.0625rem;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: -0.01em;
    color: var(--c-ink);
}

.card-subtitle {
    margin: 2px 0 0;
    font-size: 0.875rem;
    color: var(--c-muted);
}

.card-body {
    padding: 18px 24px 24px;
}

.card-header + .card-body {
    padding-top: 16px;
}

.card-link-more {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--c-accent-text);
    text-decoration: none;
    white-space: nowrap;
}

.card-link-more:hover {
    color: var(--c-ink);
    text-decoration: underline;
}

/* Dunkle Hervorhebung – nur für „Was ansteht“ */
.card-dark {
    --bs-card-border-color: var(--c-ink);
    background: var(--c-ink);
    color: #d6d9de;
}

.card-dark .card-title,
.card-dark h2,
.card-dark strong {
    color: #fff;
}

/* Dashboard-Raster: gestapelt → zwei Spalten → breit (Inhalt links, Zahlen rechts) */
.dash-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "overview" "todo" "tickets" "invoices" "orders";
    margin-bottom: 24px;
}

.dash-grid > * {
    min-width: 0;
    margin-bottom: 0;
}

.area-todo { grid-area: todo; }
.area-overview { grid-area: overview; }
.area-tickets { grid-area: tickets; }
.area-invoices { grid-area: invoices; }
.area-orders { grid-area: orders; }

@media (min-width: 992px) {
    .dash-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-areas:
            "overview overview"
            "todo todo"
            "tickets tickets"
            "invoices orders";
    }
}

@media (min-width: 1600px) {
    .dash-grid {
        grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
        grid-template-areas:
            "overview overview"
            "todo todo"
            "tickets invoices"
            "tickets orders";
        align-items: start;
    }

}

/* Übersicht: drei Kennzahlen in einer Fläche, getrennt durch Linien */
.overview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border: 1px solid var(--c-line);
    border-radius: var(--r-card);
    background: var(--c-white);
    overflow: hidden;
}

.overview-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 20px 24px;
    color: var(--c-ink);
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.overview-item + .overview-item {
    border-left: 1px solid var(--c-line);
}

.overview-item:hover {
    background: var(--c-paper);
    color: var(--c-ink);
}

.overview-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}

.overview-label {
    font-weight: 600;
}

.overview-hint {
    font-size: 0.8125rem;
    color: var(--c-muted);
}

.stat-mini {
    padding: 14px 16px;
    border: 1px solid var(--c-line);
    border-radius: var(--r-inner);
    background: var(--c-white);
}

.stat-mini .fs-4 {
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--c-ink);
}

/* Was ansteht */
.todo-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.todo-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.todo-item:first-child {
    padding-top: 0;
    border-top: 0;
}

.todo-item:last-child {
    padding-bottom: 0;
}

.todo-text {
    flex: 1;
    min-width: 0;
}

.todo-text strong {
    display: block;
    font-weight: 600;
}

.todo-text span {
    font-size: 0.875rem;
    color: #b4b9c1;
}

.todo-done {
    margin: 0;
    color: #d6d9de;
}

.todo-done strong {
    display: block;
    color: #fff;
}

/* Leerzustände */
.empty-state {
    padding: 36px 24px;
    border: 2px dashed var(--c-line);
    border-radius: var(--r-inner);
    text-align: center;
    color: var(--c-muted);
}

.empty-state .empty-icon {
    display: block;
    margin-bottom: 10px;
    color: var(--c-muted);
    font-size: 1.5rem;
    line-height: 1;
}

.empty-state h3 {
    margin: 0 0 4px;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.empty-state p {
    margin: 0 auto;
    max-width: 46ch;
    font-size: 0.9rem;
}

.empty-state .btn {
    margin-top: 16px;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */

.btn {
    --bs-btn-font-weight: 600;
    --bs-btn-padding-x: 1.125rem;
    --bs-btn-padding-y: 0.625rem;
    --bs-btn-font-size: 0.9375rem;
    --bs-btn-border-radius: var(--r-control);
    --bs-btn-focus-box-shadow: 0 0 0 4px var(--bs-focus-ring-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    white-space: nowrap;
}

.btn-sm {
    --bs-btn-padding-x: 0.875rem;
    --bs-btn-padding-y: 0.375rem;
    --bs-btn-font-size: 0.875rem;
    --bs-btn-border-radius: var(--r-chip);
    min-height: 36px;
}

/* Primär: Grün mit dunkler Schrift */
.btn-primary,
.btn-success {
    --bs-btn-color: var(--c-ink);
    --bs-btn-bg: var(--c-accent);
    --bs-btn-border-color: var(--c-accent);
    --bs-btn-hover-color: var(--c-ink);
    --bs-btn-hover-bg: var(--c-accent-hover);
    --bs-btn-hover-border-color: var(--c-accent-hover);
    --bs-btn-active-color: var(--c-ink);
    --bs-btn-active-bg: var(--c-accent-hover);
    --bs-btn-active-border-color: var(--c-accent-hover);
    --bs-btn-disabled-color: var(--c-ink);
    --bs-btn-disabled-bg: var(--c-accent);
    --bs-btn-disabled-border-color: var(--c-accent);
}

/* Sekundär: weiß mit Rand */
.btn-light,
.btn-secondary,
.btn-outline-secondary,
.btn-default {
    --bs-btn-color: var(--c-ink);
    --bs-btn-bg: var(--c-white);
    --bs-btn-border-color: var(--c-line-strong);
    --bs-btn-hover-color: var(--c-ink);
    --bs-btn-hover-bg: var(--c-white);
    --bs-btn-hover-border-color: var(--c-ink);
    --bs-btn-active-color: var(--c-ink);
    --bs-btn-active-bg: var(--c-paper);
    --bs-btn-active-border-color: var(--c-ink);
}

.btn-outline-secondary.active {
    --bs-btn-active-bg: var(--c-ink);
    --bs-btn-active-color: #fff;
}

/* Destruktiv: zurückhaltend, damit es nicht wie die Hauptaktion wirkt */
.btn-danger,
.btn-outline-danger {
    --bs-btn-color: var(--c-danger-fg);
    --bs-btn-bg: var(--c-white);
    --bs-btn-border-color: var(--c-danger-line);
    --bs-btn-hover-color: var(--c-danger-fg);
    --bs-btn-hover-bg: var(--c-danger-bg);
    --bs-btn-hover-border-color: var(--c-danger-fg);
    --bs-btn-active-color: var(--c-danger-fg);
    --bs-btn-active-bg: var(--c-danger-bg);
    --bs-btn-active-border-color: var(--c-danger-fg);
}

.btn-dark {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--c-ink);
    --bs-btn-border-color: var(--c-ink);
    --bs-btn-hover-bg: #31353d;
    --bs-btn-hover-border-color: #31353d;
}

.btn-link {
    --bs-btn-color: var(--c-accent-text);
    --bs-btn-hover-color: var(--c-ink);
    --bs-btn-font-weight: 600;
    min-height: 0;
}

.btn-inline {
    display: inline;
    min-height: 0;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-weight: 600;
    color: var(--c-accent-text);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.btn-inline.is-danger {
    color: var(--c-danger-fg);
}

/* Filter als Segmente */
.segmented {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--c-line);
    border-radius: var(--r-control);
    background: var(--c-paper);
}

.segmented a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 9px;
    color: var(--c-ink-2);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

.segmented a:hover {
    background: var(--c-white);
    color: var(--c-ink);
}

.segmented a[aria-current] {
    background: var(--c-white);
    color: var(--c-ink);
    font-weight: 600;
    box-shadow: 0 0 0 1px var(--c-line-strong);
}

.segmented .seg-count {
    min-width: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--c-paper-2);
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
}

/* ── Formulare ──────────────────────────────────────────────────────────── */

.form-label {
    margin-bottom: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--c-ink);
}

.form-control,
.form-select {
    min-height: 46px;
    padding: 0.625rem 0.875rem;
    border-color: var(--c-line-strong);
    border-radius: var(--r-control);
    background-color: var(--c-white);
    color: var(--c-ink);
    font-size: 0.9375rem;
}

.form-select {
    padding-right: 2.5rem;
}

.form-control::placeholder {
    color: #858b97;
}

.form-control:focus,
.form-select:focus {
    background-color: var(--c-white);
    border-color: var(--c-ink);
    box-shadow: 0 0 0 4px var(--bs-focus-ring-color);
}

.form-control[readonly] {
    background-color: var(--c-paper);
}

.form-control[type="file"] {
    padding: 0.5rem;
    line-height: 1.8;
}

.form-control::file-selector-button {
    margin: -0.5rem 0.875rem -0.5rem -0.5rem;
    padding: 0.625rem 1rem;
    border: 0;
    border-right: 1px solid var(--c-line-strong);
    background: var(--c-paper);
    color: var(--c-ink);
    font-weight: 600;
}

.form-text {
    margin-top: 6px;
    font-size: 0.8125rem;
    color: var(--c-muted);
}

.form-check-input {
    border-color: var(--c-line-strong);
}

.form-check-input:checked {
    background-color: var(--c-accent);
    border-color: var(--c-accent);
}

.form-check-input:focus {
    border-color: var(--c-ink);
    box-shadow: 0 0 0 4px var(--bs-focus-ring-color);
}

.form-switch .form-check-input {
    width: 2.75em;
    height: 1.5em;
    margin-top: 0;
}

.form-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 0;
}

.form-switch .form-check-input {
    margin-left: 0;
    float: none;
}

.form-switch .form-check-label {
    font-weight: 500;
    color: var(--c-ink);
}

.required-mark {
    color: var(--c-danger-fg);
}

.inline-form-error {
    display: none;
    margin-top: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--c-danger-fg);
}

.inline-form-error.is-visible {
    display: block;
}

.form-control[aria-invalid="true"],
.ql-editor[aria-invalid="true"] {
    border-color: var(--c-danger-fg);
}

.form-section + .form-section {
    margin-top: 28px;
    padding-top: 28px;
    border-top: 1px solid var(--c-line);
}

.form-section-title {
    margin: 0 0 4px;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.form-section-lead {
    margin: 0 0 16px;
    font-size: 0.875rem;
    color: var(--c-muted);
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
}

/* Quill-Editor an Felder angleichen */
.ql-toolbar.ql-snow {
    border-color: var(--c-line-strong) !important;
    border-radius: var(--r-control) var(--r-control) 0 0;
    background: var(--c-paper);
    font-family: var(--font) !important;
}

.ql-container.ql-snow {
    border-color: var(--c-line-strong) !important;
    border-radius: 0 0 var(--r-control) var(--r-control);
    background: var(--c-white);
    font-family: var(--font) !important;
    font-size: 0.9375rem !important;
}

.ql-editor.ql-blank::before {
    color: #858b97 !important;
    font-style: normal !important;
}

.file-list {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.file-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 8px 8px 14px;
    border: 1px solid var(--c-line);
    border-radius: var(--r-inner);
    font-size: 0.875rem;
}

/* ── Tabellen ───────────────────────────────────────────────────────────── */

.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--c-ink-2);
    --bs-table-border-color: var(--c-line);
    margin-bottom: 0;
}

.table > :not(caption) > * > * {
    padding: 13px 14px;
    vertical-align: middle;
}

.table > thead > tr > th {
    padding-top: 0;
    padding-bottom: 10px;
    border-bottom-color: var(--c-line);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--c-muted);
    white-space: nowrap;
}

.card .table > :not(caption) > * > *:first-child {
    padding-left: 0;
}

.card .table > :not(caption) > * > *:last-child {
    padding-right: 0;
}

.table > tbody > tr:last-child > * {
    border-bottom: 0;
}

.table td.text-end,
.table th.text-end {
    white-space: nowrap;
}

.table tfoot td,
.table tfoot th {
    border-top: 1px solid var(--c-line);
    border-bottom: 0;
    font-weight: 600;
    color: var(--c-ink);
}

tr[data-href] {
    cursor: pointer;
}

tr[data-href]:hover > td {
    background: var(--c-paper);
}

.row-link {
    color: var(--c-ink);
    font-weight: 600;
    text-decoration: none;
}

.row-link:hover {
    color: var(--c-ink);
    text-decoration: underline;
    text-decoration-color: var(--c-accent);
    text-decoration-thickness: 2px;
}

@media (min-width: 768px) {
    .table-stack > thead > tr > th:first-child {
        width: 42%;
    }
}

.cell-sub {
    display: block;
    font-size: 0.8125rem;
    color: var(--c-muted);
}

/* Mobil: Listen-Tabellen werden zu gestapelten Zeilen */
@media (max-width: 767.98px) {
    .table-stack thead {
        display: none;
    }

    .table-stack,
    .table-stack tbody,
    .table-stack tr,
    .table-stack td {
        display: block;
        width: 100%;
    }

    .table-stack tr {
        position: relative;
        padding: 14px 16px;
        border: 1px solid var(--c-line);
        border-radius: var(--r-inner);
        background: var(--c-white);
    }

    .table-stack tr + tr {
        margin-top: 10px;
    }

    .card .table-stack > tbody > tr > td,
    .table-stack > tbody > tr > td {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: 16px;
        padding: 4px 0;
        border: 0;
        text-align: right;
    }

    .table-stack > tbody > tr > td::before {
        content: attr(data-label);
        flex-shrink: 0;
        font-size: 0.8125rem;
        font-weight: 500;
        color: var(--c-muted);
        text-align: left;
    }

    .table-stack > tbody > tr > td:first-child {
        display: block;
        padding-bottom: 8px;
        text-align: left;
        font-size: 1rem;
    }

    .table-stack > tbody > tr > td:first-child::before {
        content: none;
    }

    tr[data-href]:hover > td {
        background: transparent;
    }

    .table-stack tfoot {
        display: block;
    }

    .table-stack tfoot tr {
        display: flex;
        justify-content: space-between;
        padding: 10px 16px;
        border: 0;
        background: transparent;
    }

    .table-stack tfoot td {
        border: 0;
        padding: 0;
    }

    /* In Detailkarten: schlichte Zeilen mit Trennlinie statt Karten in der Karte */
    .card:not(.is-list) .table-stack tr {
        padding: 12px 0;
        border: 0;
        border-bottom: 1px solid var(--c-line);
        border-radius: 0;
        background: transparent;
    }

    .card:not(.is-list) .table-stack tr + tr {
        margin-top: 0;
    }

    .card:not(.is-list) .table-stack tbody tr:first-child {
        padding-top: 0;
    }

    .card:not(.is-list) .table-stack tfoot tr {
        padding: 12px 0 0;
        border-bottom: 0;
    }
}

/* ── Status-Pillen ──────────────────────────────────────────────────────── */

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px 3px 8px;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
}

.pill::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.pill.no-dot::before { content: none; }
.pill.no-dot { padding-left: 10px; }

.tone-success { background: var(--c-success-bg); color: var(--c-success-fg); }
.tone-warning { background: var(--c-warning-bg); color: var(--c-warning-fg); }
.tone-danger  { background: var(--c-danger-bg);  color: var(--c-danger-fg); }
.tone-info    { background: var(--c-info-bg);    color: var(--c-info-fg); }
.tone-neutral { background: var(--c-neutral-bg); color: var(--c-neutral-fg); }
.tone-accent  { background: var(--c-accent-soft); color: var(--c-accent-text); }

/* ── Statusfläche (z. B. Zahlungsstatus einer Rechnung) ─────────────────── */

.callout {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
    padding: 18px 20px;
    border: 1px solid transparent;
    border-radius: var(--r-card);
}

.callout-icon {
    flex-shrink: 0;
    margin-top: 1px;
    font-size: 1.375rem;
    line-height: 1;
}

.callout-body {
    flex: 1;
    min-width: 0;
}

.callout-title {
    margin: 0 0 2px;
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: inherit;
}

.callout-text {
    margin: 0;
    color: var(--c-ink-2);
}

.callout-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-self: center;
}

.callout.tone-success { border-color: var(--c-success-line); }
.callout.tone-warning { border-color: var(--c-warning-line); }
.callout.tone-danger  { border-color: var(--c-danger-line); }
.callout.tone-info    { border-color: var(--c-info-line); }
.callout.tone-neutral { border-color: var(--c-neutral-line); }

.paybar {
    height: 8px;
    margin-top: 12px;
    border-radius: 999px;
    background: rgba(27, 30, 35, 0.1);
    overflow: hidden;
}

.paybar span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--c-accent);
}

.paybar-legend {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 6px;
    font-size: 0.8125rem;
    color: var(--c-ink-2);
}

/* ── Detail-Listen ──────────────────────────────────────────────────────── */

.meta-list {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    column-gap: 24px;
    margin: 0;
}

.meta-list > div {
    display: contents;
}

.meta-list dt,
.meta-list dd {
    padding: 11px 0;
    border-bottom: 1px solid var(--c-line);
}

.meta-list > div:first-child > * {
    padding-top: 0;
}

.meta-list > div:last-child > * {
    padding-bottom: 0;
    border-bottom: 0;
}

.meta-list dt {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--c-muted);
    overflow-wrap: normal;
}

.meta-list dd {
    margin: 0;
    color: var(--c-ink);
    font-weight: 500;
    overflow-wrap: anywhere;
}

.meta-list dd .pill {
    white-space: normal;
}

.meta-list dd.is-strong {
    font-weight: 700;
}

/* Datei- und Dokumenteinträge */
.file-items {
    display: grid;
    gap: 8px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--c-line);
    border-radius: var(--r-inner);
    color: var(--c-ink);
    text-decoration: none;
    transition: border-color 0.15s ease;
}

a.file-item:hover,
.file-item:hover {
    border-color: var(--c-ink);
    color: var(--c-ink);
}

.file-icon {
    flex-shrink: 0;
    color: var(--c-muted);
    font-size: 1.25rem;
    line-height: 1;
}

.file-name {
    flex: 1;
    min-width: 0;
    font-size: 0.9rem;
    font-weight: 500;
    overflow-wrap: anywhere;
}

.file-name small {
    display: block;
    font-weight: 400;
    color: var(--c-muted);
}

.file-actions {
    display: flex;
    gap: 6px;
}

.file-actions .icon-btn {
    width: 36px;
    height: 36px;
    font-size: 1rem;
}

/* ── Gesprächsverlauf eines Tickets ─────────────────────────────────────── */

.thread {
    display: grid;
    gap: 14px;
}

.msg {
    max-width: min(820px, 80%);
}

.msg-own {
    justify-self: end;
}

.msg-bubble {
    padding: 14px 16px;
    border: 1px solid var(--c-line);
    border-radius: 18px 18px 18px 6px;
    background: var(--c-paper);
    color: var(--c-ink);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.msg-own .msg-bubble {
    border-color: var(--c-accent-line);
    border-radius: 18px 18px 6px 18px;
    background: var(--c-accent-soft);
}

.msg-bubble.is-rich {
    white-space: normal;
}

.msg-bubble.is-rich p:last-child,
.msg-bubble.is-rich ul:last-child,
.msg-bubble.is-rich ol:last-child {
    margin-bottom: 0;
}

.msg-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin-top: 6px;
    padding: 0 6px;
    font-size: 0.78rem;
    color: var(--c-muted);
}

.msg-own .msg-meta {
    justify-content: flex-end;
}

.msg-meta strong {
    font-weight: 600;
    color: var(--c-ink-2);
}

.thread-note {
    justify-self: center;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--c-paper);
    font-size: 0.78rem;
    color: var(--c-muted);
}

/* ── Login & Aktivierung ────────────────────────────────────────────────── */

.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
}

.auth-brand {
    width: 100%;
    max-width: 1040px;
    margin: 0 auto 32px;
}

.auth-brand img {
    height: 48px;
    width: auto;
}

.auth-grid {
    width: 100%;
    max-width: 1040px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.auth-card {
    padding: 36px;
    border: 1px solid var(--c-line);
    border-radius: var(--r-sheet);
    background: var(--c-white);
}

.auth-card h1 {
    margin: 0 0 8px;
    font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.25rem);
    font-weight: 700;
    letter-spacing: -0.03em;
}

.auth-card .auth-lead {
    margin: 0 0 28px;
    color: var(--c-muted);
    font-size: 1rem;
}

.auth-card .btn-primary,
.auth-card .btn-success {
    width: 100%;
    min-height: 50px;
    font-size: 1rem;
}

.auth-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 16px;
    margin-top: 20px;
    font-size: 0.875rem;
}

.auth-links a {
    font-weight: 600;
    color: var(--c-ink);
    text-decoration: underline;
    text-decoration-color: var(--c-accent);
    text-decoration-thickness: 2px;
}

.auth-side {
    display: grid;
    gap: 24px;
}

.auth-side .card-dark,
.auth-side .card-soft {
    margin: 0;
    padding: 28px;
    border-radius: var(--r-sheet);
}

.card-soft {
    background: var(--c-white);
    border: 1px solid var(--c-line);
}

.auth-side h2 {
    margin: 0 0 8px;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.auth-side p {
    margin: 0;
}

.auth-side .btn {
    margin-top: 20px;
}

.contact-lines {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    display: grid;
    gap: 10px;
    font-size: 0.9375rem;
}

.contact-lines li {
    display: flex;
    gap: 10px;
    align-items: center;
}

.contact-lines i {
    color: var(--c-accent-text);
}

.contact-lines a {
    color: var(--c-ink);
    font-weight: 600;
    text-decoration: none;
}

.auth-footer {
    width: 100%;
    max-width: 1040px;
    margin: auto auto 0;
    padding-top: 32px;
    font-size: 0.8125rem;
    color: var(--c-muted);
}

/* ── Ladeanzeige & Meldungen ────────────────────────────────────────────── */

.spinner {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    background: rgba(245, 246, 244, 0.82);
}

.spinner div {
    width: 44px;
    height: 44px;
    border: 4px solid var(--c-line);
    border-top-color: var(--c-accent);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.portal-toast-stack {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(420px, calc(100vw - 32px));
}

.portal-toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 14px 14px 16px;
    border-radius: var(--r-inner);
    box-shadow: var(--shadow-overlay);
    line-height: 1.45;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.portal-toast::before {
    font-family: "bootstrap-icons";
    font-size: 1.1rem;
    line-height: 1.3;
}

.portal-toast.is-success {
    background: var(--c-ink);
    color: #fff;
}

.portal-toast.is-success::before {
    content: "\f26a"; /* bi-check-circle-fill */
    color: var(--c-accent);
}

.portal-toast.is-error {
    background: var(--c-danger-fg);
    color: #fff;
}

.portal-toast.is-error::before {
    content: "\f332"; /* bi-exclamation-circle-fill */
}

.portal-toast > span {
    flex: 1;
}

.portal-toast.is-hiding {
    opacity: 0;
    transform: translateY(-12px);
}

.portal-toast-close {
    min-width: 28px;
    min-height: 28px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}

.portal-toast-close:hover {
    background: rgba(255, 255, 255, 0.14);
}

.portal-toast-close:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 1px;
}

/* Alerts (z. B. Rückmeldung nach Kennwortänderung) im Ton der Statusflächen */
.alert {
    border-radius: var(--r-inner);
}

.alert-success { --bs-alert-bg: var(--c-success-bg); --bs-alert-color: var(--c-success-fg); --bs-alert-border-color: var(--c-success-line); }
.alert-danger  { --bs-alert-bg: var(--c-danger-bg);  --bs-alert-color: var(--c-danger-fg);  --bs-alert-border-color: var(--c-danger-line); }

.title-count {
    margin-left: 4px;
    font-weight: 500;
    color: var(--c-muted);
}

.list-group-item {
    border-color: var(--c-line);
}

/* ── Mobil ──────────────────────────────────────────────────────────────── */

@media (max-width: 991.98px) {
    .app {
        grid-template-columns: minmax(0, 1fr);
        padding: 12px 16px 16px;
    }

    .app-sidebar {
        position: fixed;
        top: 12px;
        left: 12px;
        bottom: 12px;
        z-index: 1080;
        width: min(300px, calc(100vw - 48px));
        height: auto;
        box-shadow: var(--shadow-overlay);
        transform: translateX(calc(-100% - 24px));
        transition: transform 0.25s ease;
        visibility: hidden;
    }

    .app.is-nav-open .app-sidebar {
        transform: none;
        visibility: visible;
    }

    .app-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1070;
        background: rgba(27, 30, 35, 0.4);
    }

    .app-backdrop[hidden] {
        display: none;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .topbar-logo {
        display: inline-flex;
        align-items: center;
    }

    .topbar-logo img {
        height: 34px;
        width: auto;
    }

    .app-topbar .crumbs {
        display: none;
    }

    .topbar-search {
        display: none;
    }
}

@media (max-width: 767.98px) {
    .overview-item {
        padding: 14px 12px;
    }

    .overview-value {
        font-size: 1.5rem;
    }

    .overview-label {
        font-size: 0.8125rem;
        line-height: 1.3;
    }

    .overview-hint {
        display: none;
    }

    .todo-item {
        flex-wrap: wrap;
    }

    .todo-item > .btn {
        flex-basis: 100%;
    }

    /* Listen: die gestapelten Zeilen sind selbst die Karten – äußere Karte entfällt */
    .card.is-list {
        border: 0;
        background: transparent;
    }

    .card.is-list > .card-header {
        padding: 0 0 14px;
    }

    .card.is-list > .card-body,
    .card.is-list > .card-body.pt-4 {
        padding: 0 !important;
    }

    .segmented {
        display: flex;
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    .card {
        --bs-card-spacer-x: 18px;
    }

    .card-header {
        padding: 18px 18px 0;
    }

    .card-body {
        padding: 14px 18px 18px;
    }

    .page-heading {
        margin-bottom: 20px;
    }

    .page-actions,
    .page-actions form,
    .page-actions .btn {
        width: 100%;
    }

    .callout {
        flex-wrap: wrap;
        padding: 16px;
    }

    .callout-actions {
        width: 100%;
    }

    .callout-actions .btn {
        flex: 1;
    }

    .auth-card {
        padding: 24px 20px;
    }

    .meta-list {
        grid-template-columns: minmax(0, 1fr);
    }

    .meta-list dt {
        padding-bottom: 2px;
        border-bottom: 0;
    }

    .meta-list > div:last-child > dt {
        padding-bottom: 2px;
    }

    .meta-list > div:not(:first-child) > dt {
        padding-top: 11px;
    }

    .meta-list dd {
        padding-top: 0;
    }

    .msg {
        max-width: 94%;
    }

    .portal-toast-stack {
        top: 12px;
        right: 16px;
    }
}

@media (max-width: 860px) {
    .auth-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
