/*
    App-level styles that sit on top of Bootstrap and brand.css (loaded in that order).

    The brand palette lives in brand.css as the --pa-* tokens; this file only adds the neutral scale
    Bootstrap has no exact counterpart for. Anything Bootstrap or brand.css already provides — the
    reboot's body reset, link colours, button and form-control looks — is deliberately absent here.
*/

:root {
    --ink: #1a1a1a;
    --muted: #5b6470;
    --line: #e3e6ea;

    --danger: #b91c1c;

    color: var(--ink);
}

.app-main {
    max-width: 48rem;
    margin: 3rem auto;
    padding: 0 1rem;
}

/* --- Internal back-office (Interactive Server) ---
   The shell mirrors the parent portal's (see PortalLayout.razor.css): same width, same green rule under
   a Bootstrap .navbar. Server components have no scoped stylesheets, so the admin rules live here. */
.admin-shell {
    min-height: 100vh;
    max-width: 72rem;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
}

.admin-header {
    padding: 0 0 1rem;
    border-bottom: 3px solid var(--pa-green);
}

.admin-header .brand-logo {
    height: 2.25rem;
    width: auto;
}

.admin-header .realm {
    font-size: 0.95rem;
}

.admin-header .admin-account-name {
    font-size: 0.9rem;
}

.admin-header form {
    margin: 0;
}

/* Collapsed menu: the links stack, so give them room and left-align the labels (mirrors the portal). */
@media (max-width: 575.98px) {
    .admin-header .navbar-collapse {
        padding-top: 0.5rem;
    }

    .admin-header .admin-account-name {
        display: block;
        padding-top: 0.5rem;
    }
}

.admin-main {
    margin: 1.5rem 0 0;
}

/* Page head: title, an optional badge or count, and the back button pushed right with .ms-auto. Both
   detail views (portal + back-office) build their head the same way, hence the shared rule; on those the
   muted sub-line (Schuljahr) is what spaces the head off the cards below. */
.page-head,
.detail-head {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-head h1,
.detail-head h1 {
    margin: 0;
    font-size: 1.5rem;
}

/* Only .page-head needs this: on the detail views the muted sub-line (Schuljahr) already does the
   spacing, and adding it there would double the gap. */
.page-head {
    margin-bottom: 1.25rem;
}

/* Sub-heading above a group of cards or a table inside one. */
.section-title {
    margin: 1.5rem 0 0.75rem;
    font-size: 1.05rem;
}

/* One that introduces a whole group of cards ("Betreuungsmodule") has to carry across the gap between
   them, so it wears the same display look as a card heading: Vollkorn, green, bold italic (brand.css). */
h2.section-title {
    font-family: var(--pa-display-font);
    font-size: 1.35rem;
    font-style: italic;
    font-weight: 700;
    color: var(--pa-green);
}

.card .section-title {
    margin-top: 1.25rem;
}

table.grid {
    width: 100%;
    border-collapse: collapse;
}

table.grid th,
table.grid td {
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

table.grid tbody tr:last-child th,
table.grid tbody tr:last-child td {
    border-bottom: none;
}

/* Row actions sit together and never wrap onto two lines. */
.row-actions {
    display: inline-flex;
    gap: 0.35rem;
    justify-content: flex-end;
}

/* An amount cell should not stretch to the column width — the field is four digits and a currency. */
.amount-input {
    max-width: 13rem;
}

/* --- Shared info panel (Informationstexte from the paper form) ---
   The panel is a Bootstrap alert (see Components/InfoPanel.razor) wearing brand.css's tint and green
   left rule; only the type scale below is bespoke. */
.info-panel {
    font-size: 0.9rem;
    color: #2b3a1e;
}

.info-panel > :first-child {
    margin-top: 0;
}

.info-panel > :last-child {
    margin-bottom: 0;
}

.info-panel h4 {
    margin: 0 0 0.35rem;
    font-size: 0.95rem;
    color: var(--pa-petrol);
}

/* Footer hint in the AGB dialog, shown until the reader has scrolled to the end. */
.doc-foot-hint {
    color: var(--muted);
    font-size: 0.85rem;
}

/* The admin config forms are plain Bootstrap now (.form-label / .form-control / .form-select /
   .form-check / .input-group); only the compact label scale is ours, matching the portal's forms. */
.admin-main .form-label {
    font-size: 0.85rem;
    margin-bottom: 0.2rem;
}

.field-error {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.muted {
    color: var(--muted);
    font-size: 0.85rem;
}

/* Cards are Bootstrap's (.card + .card-body, with brand.css's .card-accent green top rule). Only the
   headings inside them are ours, shared by the parent and the back-office detail views. The h2 carries
   the paed-aktiv.de display look: Vollkorn (see brand.css), green, bold italic. */
.card h2 {
    font-family: var(--pa-display-font);
    font-size: 1.5rem;
    font-style: italic;
    font-weight: 700;
    color: var(--pa-green);
    margin: 0 0 0.75rem;
    padding: 0.15rem 0 0.35rem;
}

.card h3 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
}

/* --- Icon-only nav item (NavIconLink) ---
   Worn by both the portal and the back-office headers. Bootstrap's .nav-link carries the sizing; this
   adds the square hover pill and the destructive (sign-out) tone. */
.nav-icon {
    display: inline-flex;
    align-items: center;
    border-radius: 0.5rem;
    color: var(--pa-petrol);
}

/* BsIcon renders its <svg> inside a <span>, which sits on the text baseline and would otherwise hang
   low in the hover pill. */
.nav-icon .bs-svg {
    display: inline-flex;
    align-items: center;
    line-height: 0;
}

.nav-icon svg {
    display: block;
}

.nav-icon:hover,
.nav-icon:focus {
    background: var(--pa-tint);
    color: var(--pa-petrol-dark);
}

.nav-icon-danger {
    color: var(--bs-danger);
}

.nav-icon-danger:hover,
.nav-icon-danger:focus {
    background: var(--bs-danger-bg-subtle);
    color: var(--bs-danger);
}

/* Icon-only from sm up: a square target instead of the wide text padding .nav-link assumes. */
@media (min-width: 576px) {
    .nav-icon {
        justify-content: center;
        width: 2.25rem;
        height: 2.25rem;
        padding: 0;
    }
}

/* Square icon-only target for IconButton/IconLink: Bootstrap's .btn padding assumes a text label, and
   BsIcon's <svg> sits inside a <span> that would otherwise hang below the baseline. Global rather than
   scoped so the two components share one rule. */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    flex: 0 0 auto;
}

.icon-btn .bs-svg {
    display: inline-flex;
    align-items: center;
    line-height: 0;
}

.icon-btn svg {
    display: block;
}

/* --- Registration list card ---
   One row-height card per registration, shared by the parent dashboard and the back-office overview so a
   registration reads the same in both realms. Full width and deliberately compact — it replaces a table
   row, so many fit on screen: a title line, one muted meta line, then the status badge and the call to
   action. The whole card is the link; the green rule on the left is the brand accent. */
.reg-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: .75rem;
}

.reg-card {
    border: 1px solid var(--line);
    border-left: 4px solid var(--pa-green);
    border-radius: 8px;
    padding: .9rem 1.1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    text-decoration: none;
    color: inherit;
    transition: border-color .12s, box-shadow .12s;
}

.reg-card:hover {
    border-color: var(--pa-petrol);
    border-left-color: var(--pa-petrol);
    box-shadow: 0 2px 10px rgba(24, 70, 105, .08);
}

.reg-card:focus-visible {
    outline: 2px solid var(--pa-petrol);
    outline-offset: 2px;
}

.reg-main {
    min-width: 0;
}

.reg-card .who {
    font-weight: 600;
    color: var(--pa-petrol);
}

.reg-card .meta {
    color: var(--muted);
    font-size: .9rem;
}

.reg-card .note {
    color: #92400e;
    font-size: .9rem;
    margin: .35rem 0 0;
}

.reg-side {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 0 0 auto;
}

.reg-cta {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    color: var(--pa-petrol);
    font-size: .9rem;
    font-weight: 600;
    white-space: nowrap;
}

.reg-cta svg {
    transition: transform .12s;
}

.reg-card:hover .reg-cta svg {
    transform: translateX(3px);
}

/* The module header inside the facility editor: label plus its active/inactive badge. */
.module-head {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.module-head h3 {
    margin: 0;
}

/* --- Admin registration detail (read-only) --- */
.detail-sub {
    font-size: 0.95rem;
    color: var(--pa-petrol);
    margin: 1rem 0 0.5rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: minmax(11rem, 16rem) 1fr;
    gap: 0.4rem 1rem;
    margin: 0;
}

.detail-grid dt {
    color: var(--muted);
    font-size: 0.9rem;
}

.detail-grid dd {
    margin: 0;
}

.detail-empty {
    color: var(--muted);
    font-style: italic;
    margin: 0;
}

@media (max-width: 32rem) {
    .detail-grid {
        grid-template-columns: 1fr;
        gap: 0.1rem 0;
    }

    .detail-grid dd {
        margin-bottom: 0.5rem;
    }
}

/* Status badges are Bootstrap `.badge text-bg-*`; the tone comes from RegistrationStatusText.Tone(),
   shared by the portal and the back-office. The reviewer's note is a BsAlert (AlertType.Warning). */

/* --- Parent account (login / register / logout) --- */
.account {
    max-width: 26rem;
    margin: 2rem auto;
}

.account-logo {
    display: block;
    height: 2.5rem;
    width: auto;
    margin-bottom: 1.25rem;
}

.account h1 {
    color: var(--pa-petrol);
    font-size: 1.4rem;
}

/* The fields are plain Bootstrap (.form-label / .form-control / .btn); only the compact label scale is
   ours, matching the wizard and the admin forms. */
.account .form-label {
    font-size: 0.85rem;
    margin-bottom: 0.2rem;
}

/* Blazor's ValidationMessage writes its own class and drops any we pass, so it is styled by name. */
.account .validation-message {
    color: var(--danger);
    font-size: 0.8rem;
}

/* The parent master-data page styles itself (Client/Pages/Portal/Profile.razor.css), and toasts are the
   package's BsToasts host — PortalToasts (Client) raises them with German headings. */

/* --- AGB long-form content (dialog + /portal/terms page) --- */
.doc-content {
    font-size: 0.9rem;
    color: var(--ink);
}

.doc-content h3 {
    font-size: 1.05rem;
    color: var(--pa-petrol);
    margin: 1.4rem 0 0.4rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--line);
}

.doc-content h3:first-of-type {
    border-top: none;
    padding-top: 0;
    margin-top: 0.5rem;
}

.doc-content h4 {
    font-size: 0.95rem;
    color: var(--pa-petrol);
    margin: 1rem 0 0.3rem;
}

.doc-content p {
    margin: 0.4rem 0;
}

.doc-content ol, .doc-content ul {
    margin: 0.4rem 0;
    padding-left: 1.4rem;
}

.doc-content .doc-meta {
    color: var(--muted);
    font-size: 0.85rem;
}
