:root {
    --opm-primary: #5c090a;
    --opm-primary-dark: #3b0506;
    --opm-surface: rgba(248, 249, 250, 0.97);
    --opm-border: #d7b9ba;
    --opm-success: #198754;
    --opm-success-dark: #146c43;
}

body {
    background-color: var(--opm-primary);
}

body.auth-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.16), transparent 32%),
        linear-gradient(180deg, #762325 0%, var(--opm-primary) 45%, var(--opm-primary-dark) 100%);
    color: #212529;
}

.auth-navbar {
    background-color: var(--opm-primary);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.18);
}

.auth-navbar .navbar-brand img {
    width: clamp(72px, 11vw, 120px);
    height: auto;
}

.auth-shell {
    padding-block: 2rem 3rem;
}

.auth-card {
    border-radius: 1.25rem;
    background: var(--opm-surface);
    overflow: hidden;
}

.auth-title {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.auth-subtitle {
    max-width: 34rem;
    margin-inline: auto;
    color: #6c757d;
}

.auth-feedback {
    border-radius: 0.9rem;
}

.auth-card .form-control {
    min-height: 48px;
    padding-inline: 0.95rem;
    border-radius: 0.85rem;
    border-color: var(--opm-border);
}

.auth-card .form-control:focus {
    border-color: #a44f52;
    box-shadow: 0 0 0 0.25rem rgba(92, 9, 10, 0.14);
}

.auth-card .form-control.is-invalid {
    background-image: none;
}

.auth-card .btn-success {
    min-height: 52px;
    border-radius: 0.9rem;
    background-color: var(--opm-success);
    border-color: var(--opm-success);
    font-weight: 600;
}

.auth-card .btn-success:hover,
.auth-card .btn-success:focus {
    background-color: var(--opm-success-dark);
    border-color: var(--opm-success-dark);
}

.auth-link-copy a {
    color: var(--opm-primary);
    font-weight: 600;
}

.auth-link-copy a:hover,
.auth-link-copy a:focus {
    color: var(--opm-primary-dark);
}

@media (max-width: 767.98px) {
    .auth-shell {
        padding-block: 1.25rem 2rem;
    }

    .auth-card {
        border-radius: 1rem;
    }
}

body.dashboard-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.12), transparent 28%),
        radial-gradient(circle at top right, rgba(255, 205, 120, 0.12), transparent 24%),
        linear-gradient(180deg, #6f1618 0%, var(--opm-primary) 40%, var(--opm-primary-dark) 100%);
    color: #f8f9fa;
}

.dashboard-shell {
    padding-top: 2.25rem;
}

.app-navbar-host {
    padding: 0;
    background:
        linear-gradient(180deg, rgba(92, 9, 10, 0.98), rgba(74, 6, 7, 0.96)),
        #5c090a;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.16);
}

.app-navbar-shell {
    padding-inline: clamp(1rem, 3vw, 2.5rem);
}

.app-navbar-surface {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    min-height: 74px;
    padding: 0.85rem 0;
}

.app-navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
    color: #fff8f0;
    text-decoration: none;
    flex-shrink: 0;
}

.app-navbar-brand img {
    width: 52px;
    height: 52px;
    object-fit: contain;
}

.app-navbar-brand strong,
.app-navbar-brand small {
    display: block;
    line-height: 1.1;
}

.app-navbar-brand strong {
    font-size: 1rem;
    letter-spacing: 0.01em;
}

.app-navbar-brand small {
    color: rgba(255, 248, 240, 0.74);
    font-size: 0.77rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.app-navbar-toggler {
    margin-left: auto;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 0.95rem;
    padding: 0.55rem 0.7rem;
}

.app-navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 210, 126, 0.2);
}

.app-navbar-toggler .navbar-toggler-icon {
    filter: invert(1);
}

.app-navbar-collapse {
    flex-grow: 1;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.app-navbar-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 auto;
}

.app-navbar-link {
    padding: 0.7rem 1rem;
    border-radius: 999px;
    color: rgba(255, 248, 240, 0.82);
    font-weight: 700;
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.app-navbar-link:hover,
.app-navbar-link:focus {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.app-navbar-link.is-active {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 -2px 0 #ffd89b;
}

.app-navbar-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-height: 46px;
    padding: 0.65rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff9f2;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.08);
    text-decoration: none;
}

.app-navbar-logout:hover,
.app-navbar-logout:focus {
    color: #4a1d0c;
    background: #fff1d6;
    border-color: #fff1d6;
}

.dashboard-hero,
.dashboard-stat-card,
.dashboard-action-card,
.dashboard-preview-card,
.dashboard-empty-state,
.school-list-card,
.school-form-card,
.inscricao-context-card {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 1.35rem;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(14px);
    box-shadow: 0 22px 45px rgba(0, 0, 0, 0.12);
}

.dashboard-hero {
    padding: 1.75rem;
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    justify-content: space-between;
}

.dashboard-hero-compact {
    align-items: center;
}

.dashboard-eyebrow {
    display: inline-block;
    margin-bottom: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.8rem;
    font-weight: 700;
    color: #ffd27e;
}

.dashboard-hero-title {
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.05;
    margin-bottom: 0.85rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.dashboard-hero-copy {
    max-width: 42rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
}

.dashboard-stat-card {
    padding: 1.25rem 1.35rem;
    height: 100%;
}

.dashboard-stat-label {
    display: block;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.92rem;
    margin-bottom: 0.55rem;
}

.dashboard-stat-value {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    line-height: 1;
}

.dashboard-action-link {
    color: inherit;
    text-decoration: none;
}

.dashboard-action-card {
    padding: 1.5rem;
    height: 100%;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.dashboard-action-card:hover,
.dashboard-action-card:focus-within {
    transform: translateY(-4px);
    border-color: rgba(255, 210, 126, 0.55);
    background: rgba(255, 255, 255, 0.12);
}

.dashboard-action-icon {
    width: 3rem;
    height: 3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    background: rgba(255, 210, 126, 0.18);
    color: #ffd27e;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.dashboard-action-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.dashboard-action-copy {
    color: rgba(255, 255, 255, 0.78);
    margin-bottom: 1rem;
}

.dashboard-preview-card,
.school-list-card,
.dashboard-empty-state {
    padding: 1.5rem;
}

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

.dashboard-preview-card h3 {
    font-size: 1.15rem;
    margin-bottom: 0.35rem;
}

.dashboard-preview-meta,
.school-address {
    color: rgba(255, 255, 255, 0.76);
}

.dashboard-empty-state {
    text-align: center;
}

.school-list-card {
    color: #fff;
}

.school-total-pill {
    align-self: flex-start;
    padding: 0.5rem 0.85rem;
    border-radius: 999px;
    background: rgba(255, 210, 126, 0.16);
    color: #ffd27e;
    font-weight: 700;
    white-space: nowrap;
}

.school-metric {
    height: 100%;
    padding: 0.9rem 1rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.08);
}

.school-metric-label {
    display: block;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.88rem;
    margin-bottom: 0.35rem;
}

.school-actions .btn {
    min-height: 48px;
    border-radius: 0.9rem;
}

.school-actions a {
    align-content: center;
}

.school-form-card {
    background: rgba(248, 249, 250, 0.98);
    color: #212529;
}

.school-form-card .dashboard-eyebrow {
    color: var(--opm-primary);
}

.school-form-card .auth-subtitle {
    max-width: none;
    margin-inline: 0;
}

.school-context-input,
.school-context-input[readonly] {
    background-color: #eef3f8;
    color: #495057;
    font-weight: 600;
}

.inscricao-context-card {
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}

.inscricao-toolbar-card,
.inscricao-summary-card,
.inscricao-level-card,
.inscricao-actions-card,
.inscricao-table-card,
.inscricao-empty-state {
    background: rgba(248, 249, 250, 0.98);
    color: #212529;
}

.inscricao-toolbar-copy,
.inscricao-level-hint {
    color: #6c757d;
    font-size: 0.95rem;
}

.inscricao-toolbar-note {
    min-height: 100%;
    padding: 1rem 1.1rem;
    border-radius: 1rem;
    background: #f4ecec;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.inscricao-toolbar-note strong {
    color: var(--opm-primary);
}

.inscricao-summary-card,
.inscricao-toolbar-card,
.inscricao-level-card,
.inscricao-actions-card,
.inscricao-table-card,
.inscricao-empty-state {
    padding: 1.35rem 1.45rem;
    border-radius: 1.35rem;
    border: 1px solid rgba(92, 9, 10, 0.08);
    box-shadow: 0 16px 32px rgba(32, 25, 25, 0.08);
}

.inscricao-summary-card .dashboard-eyebrow,
.inscricao-toolbar-card .dashboard-eyebrow,
.inscricao-level-card .dashboard-eyebrow,
.inscricao-actions-card .dashboard-eyebrow,
.inscricao-table-card .dashboard-eyebrow,
.inscricao-empty-state .dashboard-eyebrow {
    color: var(--opm-primary);
}

.inscricao-scope-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.inscricao-table-card {
    overflow: hidden;
}

.inscricao-level-table-card .inscricao-limit-pill {
    align-self: flex-start;
}

.inscricao-table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.inscricao-table-actions .btn {
    min-height: 48px;
    border-radius: 0.9rem;
}

.inscricao-table {
    border-radius: 1rem;
    overflow: hidden;
}

.inscricao-table th {
    white-space: nowrap;
    background: #f5e9e9;
    color: #4f0b0c;
    font-size: 0.9rem;
}

.inscricao-table td {
    vertical-align: middle;
}

.inscricao-table th:nth-child(1),
.inscricao-table td:nth-child(1) {
    min-width: 260px;
}

.inscricao-table th:nth-child(2),
.inscricao-table td:nth-child(2),
.inscricao-table th:nth-child(3),
.inscricao-table td:nth-child(3),
.inscricao-table th:nth-child(4),
.inscricao-table td:nth-child(4) {
    min-width: 180px;
}

.inscricao-table th:nth-child(5),
.inscricao-table td:nth-child(5) {
    min-width: 180px;
}

.inscricao-table .form-control,
.inscricao-table .form-select,
.inscricao-toolbar-card .form-select {
    min-height: 46px;
    border-radius: 0.9rem;
    border-color: #dcc5c6;
}

.inscricao-table .form-control:focus,
.inscricao-table .form-select:focus,
.inscricao-toolbar-card .form-select:focus {
    border-color: #a44f52;
    box-shadow: 0 0 0 0.25rem rgba(92, 9, 10, 0.12);
}

.inscricao-readonly-code,
.inscricao-readonly-code:disabled,
.inscricao-readonly-code[readonly] {
    background: #eef3f8;
    color: #495057;
    font-weight: 600;
}

.inscricao-limit-pill {
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    background: rgba(25, 135, 84, 0.12);
    color: #146c43;
    font-weight: 700;
}

.inscricao-limit-pill.is-danger {
    background: rgba(220, 53, 69, 0.12);
    color: #b02a37;
}

.inscricao-status-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: #eef2f6;
    color: #495057;
    font-weight: 600;
    font-size: 0.88rem;
}

.inscricao-status-new {
    background: rgba(25, 135, 84, 0.12);
    color: #146c43;
}

.inscricao-row-delete {
    border-radius: 0.85rem;
}

.inscricao-level-table-card .btn-outline-success,
.inscricao-actions-card .btn {
    min-height: 48px;
    border-radius: 0.9rem;
}

.inscricao-row-overflow td {
    background: rgba(220, 53, 69, 0.05);
}

.inscricao-table-empty {
    background: #fbf7f7;
}

.inscricao-save-all {
    min-width: 220px;
    min-height: 50px;
    border-radius: 0.95rem;
    font-weight: 600;
}

.inscricao-success-list {
    padding-left: 1.15rem;
}

.inscricao-success-list li + li {
    margin-top: 0.4rem;
}

.inscricao-empty-state {
    text-align: center;
}

.profile-shell {
    display: grid;
    gap: 1.5rem;
}

.profile-panel {
    padding: 1.5rem;
    border-radius: 1.5rem;
    background: rgba(255, 255, 255, 0.94);
    color: #2f241d;
    border: 1px solid rgba(131, 92, 65, 0.14);
    box-shadow: 0 18px 40px rgba(31, 16, 10, 0.12);
}

.profile-hero-panel {
    background:
        linear-gradient(135deg, rgba(92, 9, 10, 0.96), rgba(139, 59, 31, 0.94)),
        #5c090a;
    color: #fff9f2;
}

.profile-eyebrow {
    display: inline-block;
    margin-bottom: 0.65rem;
    color: #ffd27e;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 700;
}

.profile-title {
    margin: 0 0 0.75rem;
    font-size: clamp(2rem, 4vw, 2.8rem);
    line-height: 1.05;
}

.profile-copy {
    max-width: 48rem;
    color: rgba(255, 249, 242, 0.82);
}

.profile-feedback {
    border-radius: 1rem;
}

.profile-avatar-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.profile-avatar {
    width: min(210px, 100%);
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 50%;
    background: #f6f1e8;
    border: 4px solid rgba(92, 9, 10, 0.08);
    box-shadow: 0 16px 36px rgba(42, 18, 10, 0.18);
}

.profile-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
}

.profile-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    background: rgba(92, 9, 10, 0.1);
    color: #7d341b;
    font-weight: 700;
    font-size: 0.9rem;
}

.profile-badge.is-admin {
    background: rgba(13, 110, 253, 0.12);
    color: #0d6efd;
}

.profile-badge.is-super-admin {
    background: rgba(111, 66, 193, 0.14);
    color: #6f42c1;
}

.profile-badge.is-user {
    background: rgba(25, 135, 84, 0.12);
    color: #146c43;
}

.profile-badge.is-active {
    background: rgba(25, 135, 84, 0.12);
    color: #146c43;
}

.profile-badge.is-inactive,
.profile-badge-muted {
    background: rgba(108, 117, 125, 0.14);
    color: #5c6770;
}

.profile-form-panel .form-control {
    min-height: 50px;
    border-radius: 0.9rem;
    border-color: #d7b9ba;
}

.profile-form-panel .form-control:focus {
    border-color: #a44f52;
    box-shadow: 0 0 0 0.25rem rgba(92, 9, 10, 0.12);
}

.profile-form-panel .form-control[readonly] {
    background: #f3efea;
    color: #6b5648;
}

.profile-form-note {
    color: #7a5d49;
    font-size: 0.92rem;
}

@media (max-width: 991.98px) {
    .app-navbar-surface {
        flex-wrap: wrap;
    }

    .app-navbar-collapse {
        width: 100%;
        margin-top: 0.5rem;
    }

    .app-navbar-links {
        margin: 0;
    }

    .dashboard-hero {
        flex-direction: column;
    }
}

@media (max-width: 767.98px) {
    .app-navbar-host {
        padding: 0;
    }

    .app-navbar-shell {
        padding-inline: 1rem;
    }

    .app-navbar-surface {
        padding: 0.8rem 0;
        min-height: 68px;
    }

    .app-navbar-brand {
        max-width: calc(100% - 76px);
    }

    .app-navbar-brand strong {
        font-size: 0.95rem;
    }

    .app-navbar-collapse {
        padding-top: 0.3rem;
    }

    .app-navbar-links {
        width: 100%;
        flex-direction: column;
    }

    .app-navbar-link,
    .app-navbar-logout {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .dashboard-shell {
        padding-top: 1.25rem;
    }

    .dashboard-hero,
    .dashboard-preview-card,
    .dashboard-empty-state,
    .school-list-card,
    .profile-panel,
    .inscricao-context-card,
    .inscricao-toolbar-card,
    .inscricao-summary-card,
    .inscricao-level-card,
    .inscricao-actions-card,
    .inscricao-table-card,
    .inscricao-empty-state {
        padding: 1.2rem;
    }

    .inscricao-save-all,
    .inscricao-table-actions,
    .inscricao-table-actions .btn {
        width: 100%;
    }

    .profile-avatar {
        width: min(180px, 100%);
    }

    .profile-badges {
        width: 100%;
    }

    .profile-badge {
        width: 100%;
    }

    .profile-form-panel .btn {
        width: 100%;
    }
}
