html, body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: #1f2733;
    background: #f2f4f8;
}

h1 {
    font-size: 1.5rem;
    margin-top: 0;
}

.lead {
    font-size: 1.05rem;
}

.hint {
    color: #6b7280;
    max-width: 60ch;
}

/* Login / access-denied / error cards (EmptyLayout). */
.login-shell {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem;
}

.login-card {
    width: 100%;
    max-width: 22rem;
    background: #ffffff;
    border: 1px solid #e0e4ea;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(27, 42, 74, 0.08);
}

.login-card h1 {
    margin-bottom: 0.25rem;
}

.login-card .subtitle {
    margin-top: 0;
    color: #6b7280;
}

.login-card label {
    display: block;
    margin: 1rem 0;
}

.login-card label span {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.login-card input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.6rem 0.7rem;
    border: 1px solid #c4c9d4;
    border-radius: 6px;
    font-size: 1rem;
}

.login-card button {
    width: 100%;
    padding: 0.7rem;
    border: none;
    border-radius: 6px;
    background: #1b2a4a;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.login-card button:hover {
    background: #26385f;
}

.login-card .error {
    background: #fdecec;
    border: 1px solid #f3b4b4;
    color: #a12020;
    padding: 0.6rem 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
}

/* Secondary link row on the auth cards (e.g. "Passwort vergessen?", "Zurück zur Anmeldung"). */
.login-aux {
    margin: 1rem 0 0;
    text-align: center;
    font-size: 0.9rem;
}

.login-aux a {
    color: #1b2a4a;
    text-decoration: underline;
}

/* ---- Feature pages (WP-18): events, licenses ---- */
.card {
    background: #ffffff;
    border: 1px solid #e0e4ea;
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin: 1rem 0;
    box-shadow: 0 4px 16px rgba(27, 42, 74, 0.05);
}

.card h2 {
    margin-top: 0;
    font-size: 1.1rem;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.form-row label {
    display: flex;
    flex-direction: column;
    font-size: 0.9rem;
    font-weight: 600;
    gap: 0.3rem;
}

.form-row input,
.form-row select {
    padding: 0.5rem 0.6rem;
    border: 1px solid #c4c9d4;
    border-radius: 6px;
    font-size: 1rem;
}

/* Inline checkbox field: keep the box and its caption on one baseline. */
.form-row label.checkbox {
    flex-direction: row;
    align-items: center;
    gap: 0.4rem;
}

.form-row button,
button.link {
    padding: 0.55rem 0.9rem;
    border: none;
    border-radius: 6px;
    background: #1b2a4a;
    color: #ffffff;
    font-weight: 600;
    cursor: pointer;
}

button.link {
    background: transparent;
    color: #1b2a4a;
    text-decoration: underline;
    padding: 0.2rem 0.4rem;
}

button.link.danger {
    color: #a12020;
}

.form-row button:disabled,
button.link:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

/* ROC-216 §2: multi-view-page checkbox list + sell-item/deposit preview on the event device assignment. */
.viewpage-choices {
    border: 1px solid #eceef3;
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.viewpage-choices legend {
    padding: 0 0.3rem;
}

.sellitem-preview {
    margin-top: 0.4rem;
}

.sellitem-list {
    margin: 0.3rem 0 0;
    padding-left: 1.1rem;
    font-size: 0.9rem;
}

/* ROC-216 §1: inline device rename editor on the devices page. */
.rename-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.75rem;
}

.data-table th,
.data-table td {
    text-align: left;
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid #eceef3;
    font-size: 0.95rem;
}

.badge {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    background: #eceef3;
    color: #1f2733;
}

.badge-draft, .badge-requested, .badge-invited, .badge-pending { background: #fff3d6; color: #8a5a00; }
.badge-active, .badge-approved, .badge-fulfilled { background: #dcf5e4; color: #1c6b3a; }
.badge-suspended, .badge-blocked { background: #ffe4cf; color: #8a3d00; }
.badge-closed, .badge-rejected, .badge-revoked, .badge-expired, .badge-disabled, .badge-retired { background: #fdecec; color: #a12020; }

.quota {
    list-style: none;
    display: flex;
    gap: 2rem;
    padding: 0;
    margin: 0;
}

.quota li {
    display: flex;
    flex-direction: column;
}

.quota li span {
    color: #6b7280;
    font-size: 0.85rem;
}

.quota li strong {
    font-size: 1.5rem;
}

.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.tile {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    background: #ffffff;
    border: 1px solid #e0e4ea;
    border-radius: 10px;
    padding: 1.1rem 1.25rem;
    box-shadow: 0 4px 16px rgba(27, 42, 74, 0.05);
}

.tile-warn {
    border-color: #f3b4b4;
    background: #fdf4f4;
}

.tile-label {
    color: #6b7280;
    font-size: 0.85rem;
}

.tile-value {
    font-size: 1.75rem;
    line-height: 1.1;
}

.tile-note {
    color: #6b7280;
    font-size: 0.8rem;
}

.error {
    background: #fdecec;
    border: 1px solid #f3b4b4;
    color: #a12020;
    padding: 0.6rem 0.75rem;
    border-radius: 6px;
}

.success {
    background: #dcf5e4;
    border: 1px solid #a6e0bd;
    color: #1c6b3a;
    padding: 0.6rem 0.75rem;
    border-radius: 6px;
}

.enrollment-code {
    border: 1px solid #a6e0bd;
    background: #f2fbf5;
}

.enrollment-code .code {
    display: inline-block;
    font-family: "Cascadia Code", "Consolas", monospace;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    padding: 0.4rem 0.8rem;
    background: #ffffff;
    border: 1px solid #cfe8d8;
    border-radius: 6px;
    color: #1c6b3a;
}

/* ---- Sidebar navigation groups ---- */
/* Links are grouped into labelled sections. A section whose links are all hidden by role policy
   contains no ".nav-link", so it collapses to nothing and never shows an orphaned heading. */
.nav-section {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-bottom: 0.75rem;
}

.nav-section:not(:has(.nav-link)) {
    display: none;
}

.nav-section-title {
    padding: 0.35rem 0.9rem 0.2rem;
    color: #9fb3d1;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Sidebar links. These MUST live in the global stylesheet, not NavMenu's scoped .razor.css: each
   link is rendered by the framework <NavLink> child component, whose root <a> does not inherit
   NavMenu's CSS-isolation scope attribute, so a scoped ".nav-link" rule would never match it and the
   anchors would fall back to the near-invisible default link colour on the dark sidebar. */
.nav-link {
    display: block;
    padding: 0.55rem 0.9rem;
    border-radius: 6px;
    color: #eaf1fb;
    text-decoration: none;
    font-size: 0.95rem;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.10);
    color: #ffffff;
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-weight: 600;
    box-shadow: inset 3px 0 0 #6ea8ff;
}

/* ---- Ro-Cos cross-tenant admin area (WP-20b) ---- */
/* Sub-navigation strip linking the Ro-Cos admin pages. */
.admin-subnav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.5rem 0 1rem;
}

.admin-subnav a {
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    background: #e7ebf3;
    color: #1b2a4a;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.admin-subnav a.active,
.admin-subnav a:hover {
    background: #1b2a4a;
    color: #ffffff;
}

/* Inline filter bar (e.g. the tenant selector on the oversight and licensing pages). */
.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;
    font-size: 0.9rem;
    font-weight: 600;
    gap: 0.3rem;
}

.filter-bar select {
    padding: 0.5rem 0.6rem;
    border: 1px solid #c4c9d4;
    border-radius: 6px;
    font-size: 1rem;
    min-width: 16rem;
}
