:root {
    --cm-blue: #41479B;
    --cm-blue-dark: #303575;
    --cm-green: #00A95A;
    --cm-green-dark: #008D4A;
    --cm-blue-soft: #EEF1FF;
    --cm-green-soft: #E7F8EF;
    --cm-bg: #F5F8FB;
    --cm-border: #DDE4EF;
    --cm-text: #2F3033;
    --rz-primary: var(--cm-blue);
    --rz-primary-light: #6067B6;
    --rz-primary-dark: var(--cm-blue-dark);
    --rz-secondary: var(--cm-green);
    --rz-secondary-light: #35C77B;
    --rz-secondary-dark: var(--cm-green-dark);
    --rz-success: var(--cm-green);
    --rz-info: #2672C9;
    --rz-body-background-color: var(--cm-bg);
}

body {
    --rz-primary: var(--cm-blue);
    --rz-primary-light: #6067B6;
    --rz-primary-dark: var(--cm-blue-dark);
    --rz-secondary: var(--cm-green);
    --rz-secondary-light: #35C77B;
    --rz-secondary-dark: var(--cm-green-dark);
    --rz-success: var(--cm-green);
    --rz-info: #2672C9;
    --rz-body-background-color: var(--cm-bg);
    background: var(--cm-bg);
}

.rz-background-color-secondary {
    background-color: var(--cm-blue) !important;
}

.rz-button.rz-primary,
.rz-button.rz-button-primary,
.rz-button.rz-primary.rz-variant-filled {
    background-color: var(--cm-blue) !important;
    border-color: var(--cm-blue) !important;
    color: #fff !important;
}

.rz-button.rz-primary:hover,
.rz-button.rz-button-primary:hover,
.rz-button.rz-primary.rz-variant-filled:hover {
    background-color: var(--cm-blue-dark) !important;
    border-color: var(--cm-blue-dark) !important;
}

.rz-button.rz-secondary,
.rz-button.rz-button-secondary,
.rz-button.rz-secondary.rz-variant-filled {
    background-color: var(--cm-green) !important;
    border-color: var(--cm-green) !important;
    color: #fff !important;
}

.rz-button.rz-secondary:hover,
.rz-button.rz-button-secondary:hover,
.rz-button.rz-secondary.rz-variant-filled:hover {
    background-color: var(--cm-green-dark) !important;
    border-color: var(--cm-green-dark) !important;
}

.rz-progressbar-value,
.rz-progressbar-indeterminate,
.rz-progressbar-circular-value {
    background-color: var(--cm-blue) !important;
    color: #fff;
}

.rz-progressbar-circular-value {
    stroke: var(--cm-blue) !important;
}

.rz-sidebar {
    border-right: 1px solid var(--cm-border);
    background: #fff;
}

.school-app-layout {
    --school-sidebar-width: min(300px, calc(100vw - 24px));
    --school-header-height: 54px;
}

.school-app-layout.rz-layout {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto 1fr auto !important;
    grid-template-areas:
        "rz-header"
        "rz-body"
        "rz-footer" !important;
}

.school-app-layout .rz-header {
    position: sticky;
    top: 0;
    z-index: 1100 !important;
}

.school-app-layout .sidebar-toggle {
    width: 44px;
    height: 44px;
    margin: 0 .15rem 0 0;
    border-radius: 12px !important;
    color: #fff !important;
    background: transparent !important;
    box-shadow: none !important;
}

.school-app-layout .sidebar-toggle:hover,
.school-app-layout .sidebar-toggle:focus,
.school-app-layout .sidebar-toggle:focus-visible,
.school-app-layout .sidebar-toggle:active {
    color: #fff !important;
    background: rgba(255, 255, 255, .14) !important;
    box-shadow: none !important;
    outline: none !important;
}

.school-app-layout .rz-body,
.school-app-layout .rz-footer {
    margin-left: 0 !important;
    margin-inline-start: 0 !important;
    width: 100% !important;
}

.school-app-layout .rz-body {
    min-width: 0;
}

.school-app-layout .rz-sidebar {
    grid-area: unset !important;
    position: fixed !important;
    top: var(--school-header-height) !important;
    bottom: 0 !important;
    left: 0 !important;
    width: var(--school-sidebar-width) !important;
    min-width: var(--school-sidebar-width) !important;
    max-width: calc(100vw - 24px);
    z-index: 1090 !important;
    opacity: 1;
    overflow-y: auto;
    transform: translateX(-105%);
    box-shadow: 16px 0 34px rgba(15, 23, 42, .18);
    transition: transform .18s ease, box-shadow .18s ease;
}

.school-app-layout .rz-sidebar.rz-sidebar-expanded {
    width: var(--school-sidebar-width) !important;
    min-width: var(--school-sidebar-width) !important;
    opacity: 1;
    transform: translateX(0);
}

.school-app-layout .rz-sidebar.rz-sidebar-collapsed {
    width: var(--school-sidebar-width) !important;
    min-width: var(--school-sidebar-width) !important;
    opacity: 1;
    transform: translateX(-105%);
}

.school-app-layout .rz-sidebar .rz-panel-menu {
    padding-top: .6rem;
}

.rz-panel-menu .rz-navigation-item-active,
.rz-panel-menu .rz-navigation-item-wrapper-active,
.rz-panel-menu .rz-navigation-item-link.rz-state-active {
    background: var(--cm-blue-soft) !important;
    color: var(--cm-blue) !important;
}

.rz-panel-menu .rz-navigation-item-link:hover {
    background: var(--cm-green-soft) !important;
    color: var(--cm-blue) !important;
}

.rz-panel-menu .rz-navigation-item-icon,
.rz-panel-menu .rz-navigation-item-active .rz-navigation-item-icon {
    color: currentColor;
}

.rz-card,
.rz-dialog,
.rz-popup {
    border-color: var(--cm-border);
}

.rz-popup,
.rz-datepicker-calendar,
.rz-datepicker-calendar-container,
.rz-calendar,
.rz-dropdown-panel,
.rz-multiselect-panel {
    z-index: 3000 !important;
}

.rz-dialog-mask {
    z-index: 2000 !important;
}

.rz-dialog-wrapper {
    z-index: 2110 !important;
}

.rz-dialog {
    z-index: 2120 !important;
}

.rz-dialog:has(.student-modal) {
    max-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.rz-dialog:has(.student-modal) .rz-dialog-titlebar {
    flex: 0 0 auto;
}

.rz-dialog:has(.student-modal) .rz-dialog-content {
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.rz-textbox:focus,
.rz-dropdown:focus,
.rz-dropdown.rz-state-focused,
.rz-datepicker:focus,
.rz-inputtext:focus,
.rz-state-focused {
    border-color: var(--cm-blue) !important;
    box-shadow: 0 0 0 2px rgba(65, 71, 155, .14) !important;
}

.startup-loading {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.startup-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 32px;
    border-radius: 16px;
    background: white;
    box-shadow: 0 8px 30px rgba(0,0,0,.08);
}

.startup-spinner {
    width: 52px;
    height: 52px;
    border: 5px solid #e5e7eb;
    border-top: 5px solid var(--cm-blue);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

.startup-text {
    font-size: 16px;
    color: #374151;
    font-weight: 500;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}

    #blazor-error-ui .error-box {
        width: 320px;
        background: #fff;
        border-left: 5px solid #d32f2f;
        border-radius: 12px;
        box-shadow: 0 8px 30px rgba(0,0,0,.15);
        padding: 16px;
    }

    #blazor-error-ui .error-title {
        font-size: 16px;
        font-weight: 700;
        color: #b71c1c;
        margin-bottom: 8px;
    }

    #blazor-error-ui .error-message {
        font-size: 14px;
        color: #444;
        margin-bottom: 12px;
    }

    #blazor-error-ui .error-actions {
        display: flex;
        gap: 12px;
    }

    #blazor-error-ui .reload,
    #blazor-error-ui .dismiss {
        text-decoration: none;
        cursor: pointer;
        font-size: 14px;
        font-weight: 600;
        color: var(--cm-blue);
    }

.notice-bell {
    position: relative;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: rgba(255,255,255,.14);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.notice-bell-wrap {
    position: relative;
    display: inline-flex;
}

.notice-bell span {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: #e53935;
    color: #fff;
    font-size: .72rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.notice-bell-panel {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: min(380px, calc(100vw - 24px));
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 18px 48px rgba(15,23,42,.18);
    color: #343942;
    z-index: 1200;
    overflow: hidden;
}

.notice-bell-panel-head {
    padding: 1rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
    border-bottom: 1px solid #eef0f4;
}

.notice-bell-panel-head strong {
    display: block;
    font-size: .98rem;
    font-weight: 800;
}

.notice-bell-panel-head span {
    display: block;
    margin-top: .18rem;
    color: #727985;
    font-size: .82rem;
}

.notice-bell-loading,
.notice-bell-empty {
    min-height: 110px;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .65rem;
    color: #727985;
    font-weight: 700;
}

.notice-bell-skeleton {
    display: grid;
    gap: .75rem;
    padding: 1rem;
}

.notice-bell-skeleton-row {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: .75rem;
    align-items: center;
}

.notice-bell-skeleton-row > div {
    display: grid;
    gap: .25rem;
}

.notice-bell-list {
    max-height: 360px;
    overflow: auto;
    display: grid;
}

.notice-bell-item {
    padding: .95rem 1rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .75rem;
    border-bottom: 1px solid #f0f2f5;
}

.notice-bell-item-title {
    font-weight: 800;
    color: #30343b;
    line-height: 1.25;
}

.notice-bell-item p {
    margin: .35rem 0 .55rem;
    color: #5c6470;
    line-height: 1.45;
    font-size: .9rem;
}

.notice-bell-item-meta {
    display: flex;
    gap: .55rem;
    align-items: center;
    flex-wrap: wrap;
    color: #7a828f;
    font-size: .78rem;
}

.notice-bell-panel-footer {
    padding: .85rem 1rem;
    display: flex;
    justify-content: flex-end;
    background: #fafbfc;
}

.notice-banner,
.notice-card,
.notice-admin-filters {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(15,23,42,.06);
}

.notice-banner {
    padding: 1rem;
}

.notice-banner.loading,
.dialog-loading {
    min-height: 160px;
    display: flex;
    gap: .75rem;
    align-items: center;
    justify-content: center;
    color: #555;
    font-weight: 700;
}

.notice-banner-skeleton {
    display: grid;
    gap: .85rem;
}

.notice-banner-skeleton-head {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: .75rem;
    align-items: center;
}

.notice-mini-card-skeleton {
    align-items: center;
}

.notice-mini-card-skeleton > div {
    display: grid;
    gap: .28rem;
    width: 100%;
}

.notice-banner-head,
.notice-page-header,
.notice-mini-card,
.notice-card {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.notice-banner-head {
    align-items: center;
    margin-bottom: .85rem;
}

.notice-title-line {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: #d32f2f;
}

.notice-banner-head span,
.notice-page-header p {
    color: #666;
}

.notice-banner-list,
.notice-list,
.notice-admin-grid {
    display: grid;
    gap: .75rem;
}

.notice-mini-card,
.notice-card {
    padding: .9rem;
    align-items: flex-start;
}

.notice-mini-card h4,
.notice-card h3,
.notice-detail h3 {
    margin: 0;
    color: #303030;
    font-weight: 800;
}

.notice-mini-card p,
.notice-card p,
.notice-detail p {
    color: #555;
    margin: .35rem 0 .6rem;
    line-height: 1.45;
}

.notice-mini-actions,
.notice-card-actions,
.dialog-actions {
    display: flex;
    gap: .5rem;
    align-items: center;
    flex-wrap: wrap;
}

.notice-mini-meta,
.notice-card-meta,
.notice-detail-meta,
.notice-detail-footer {
    display: flex;
    gap: .55rem;
    flex-wrap: wrap;
    color: #777;
    font-size: .85rem;
}

.priority {
    display: inline-flex;
    border-radius: 999px;
    padding: .15rem .55rem;
    font-size: .76rem;
    font-weight: 800;
}

.priority.normal {
    color: var(--cm-blue);
    background: var(--cm-blue-soft);
}

.priority.importante {
    color: #8a5300;
    background: #fff3cd;
}

.priority.urgente {
    color: #b71c1c;
    background: #ffebee;
}

.notice-page,
.notice-admin-page {
    max-width: 1180px;
    margin: 0 auto;
}

.notice-page-header {
    align-items: center;
    margin-bottom: 1rem;
}

.notice-page-header h2 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 800;
    color: #303030;
}

.notice-card.unread {
    border-left: 5px solid #e53935;
}

.notice-card.read {
    opacity: .82;
}

.notice-empty {
    border: 1px dashed #d5d9e2;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    color: #777;
    background: #fff;
}

.notice-admin-filters {
    padding: 1rem;
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(180px, 220px) minmax(180px, 220px) auto auto;
    gap: .65rem;
    margin-bottom: 1rem;
}

.notice-admin-top {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    justify-content: space-between;
}

.notice-form {
    display: grid;
    gap: .9rem;
}

.notice-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
}

.notice-active-check {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    min-height: 42px;
}

.notice-detail-footer {
    border-top: 1px solid #eee;
    padding-top: .8rem;
    margin-top: 1rem;
    justify-content: space-between;
}

@media (max-width: 760px) {
    .notice-banner-head,
    .notice-mini-card,
    .notice-card,
    .notice-page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .notice-admin-filters,
    .notice-form-grid {
        grid-template-columns: 1fr;
    }
}

.rz-dialog:has(.notice-detail),
.rz-dialog:has(.notice-form),
.rz-dialog:has(.read-status-dialog) {
    border-radius: 16px;
    overflow: hidden;
}

.rz-dialog:has(.notice-detail) .rz-dialog-titlebar {
    padding: 1.35rem 1.55rem 1rem;
    border-bottom: 1px solid #eef0f4;
}

.rz-dialog:has(.notice-detail) .rz-dialog-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #30343b;
}

.rz-dialog:has(.notice-detail) .rz-dialog-content {
    padding: 0;
}

.notice-detail {
    padding: 1.45rem 1.55rem 1.35rem;
    display: grid;
    gap: 1.25rem;
    color: #394150;
}

.notice-detail-header {
    display: grid;
    gap: .7rem;
}

.notice-detail-meta {
    display: flex;
    align-items: center;
    gap: .85rem;
    flex-wrap: wrap;
}

.notice-detail-date {
    color: #727985;
    font-size: .9rem;
    font-weight: 600;
}

.notice-detail h3 {
    margin: 0;
    max-width: 760px;
    font-size: clamp(1.45rem, 2vw, 1.8rem);
    line-height: 1.15;
    letter-spacing: 0;
    color: #262a31;
}

.notice-detail-message {
    max-width: 760px;
    padding: 1rem 1.1rem;
    border-radius: 14px;
    background: #fafbfc;
    border: 1px solid #eef0f4;
}

.notice-detail-message p {
    margin: 0;
    color: #4d5562;
    font-size: .98rem;
    line-height: 1.72;
}

.notice-detail-message p + p {
    margin-top: .85rem;
}

.notice-detail-footer {
    margin: .25rem 0 0;
    padding: 1rem 0 0;
    border-top: 1px solid #e8ebf0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.notice-detail-sender,
.notice-detail-read {
    display: grid;
    gap: .2rem;
}

.notice-detail-read {
    text-align: right;
}

.notice-detail-sender span,
.notice-detail-read span {
    color: #7a828f;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.notice-detail-sender strong,
.notice-detail-read strong {
    color: #424957;
    font-size: .92rem;
    font-weight: 700;
}

.dialog-actions {
    margin-top: .15rem;
    padding-top: .1rem;
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
}

.notice-action-button,
.notice-mini-actions .rz-button,
.notice-card-actions .rz-button {
    min-height: 38px;
    border-radius: 10px;
    padding-inline: 1rem;
}

.notice-bell {
    transition: background-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.notice-bell:hover {
    background: rgba(255,255,255,.22);
    transform: translateY(-1px);
}

.notice-bell span {
    box-shadow: 0 4px 10px rgba(229,57,53,.35);
    border: 2px solid rgba(255,255,255,.95);
}

.notice-banner {
    padding: 1.15rem;
    border-radius: 18px;
}

.notice-banner-head {
    margin-bottom: 1rem;
    gap: 1.25rem;
}

.notice-title-line {
    gap: .65rem;
    font-size: 1rem;
}

.notice-banner-list,
.notice-list,
.notice-admin-grid {
    gap: .9rem;
}

.notice-mini-card,
.notice-card {
    padding: 1.05rem;
    gap: 1.1rem;
    border-radius: 14px;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.notice-mini-card:hover,
.notice-card:hover {
    border-color: #d7dce5;
    box-shadow: 0 10px 24px rgba(15,23,42,.08);
    transform: translateY(-1px);
}

.notice-mini-card h4,
.notice-card h3 {
    line-height: 1.25;
}

.notice-mini-card p,
.notice-card p {
    margin: .5rem 0 .8rem;
    line-height: 1.6;
}

.notice-mini-meta,
.notice-card-meta {
    align-items: center;
    gap: .7rem;
}

.notice-mini-actions,
.notice-card-actions {
    gap: .65rem;
    justify-content: flex-end;
}

.priority {
    min-height: 24px;
    align-items: center;
    padding: .2rem .65rem;
    letter-spacing: .01em;
}

.notice-card.unread {
    border-left: 5px solid #e53935;
    box-shadow: 0 7px 20px rgba(229,57,53,.08);
}

.notice-card.read {
    opacity: 1;
    background: #fbfcfe;
}

.notice-lock-message {
    color: #8a5300;
    background: #fff3cd;
    border-radius: 999px;
    padding: .15rem .6rem;
    font-size: .78rem;
    font-weight: 800;
}

@media (max-width: 760px) {
    .rz-dialog:has(.notice-detail) {
        width: calc(100vw - 24px) !important;
    }

    .notice-detail {
        padding: 1.15rem;
        gap: 1rem;
    }

    .notice-detail-message {
        padding: .9rem;
    }

    .notice-detail-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .notice-detail-read {
        text-align: left;
    }

    .dialog-actions,
    .notice-mini-actions,
    .notice-card-actions {
        justify-content: stretch;
    }

    .dialog-actions .rz-button,
    .notice-mini-actions .rz-button,
    .notice-card-actions .rz-button {
        width: 100%;
    }
}
