html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* =========================================================
   MS ACADEMY BRANDING
   Shared with AcademyERP.Website
   ========================================================= */

   :root {
    --academy-primary: #1268cf;
    --academy-primary-dark: #082f6b;
    --academy-primary-deep: #061d42;
    --academy-primary-light: #edf5ff;

    --academy-accent: #d7ad55;
    --academy-accent-light: #f5e6bd;

    --academy-dark: #071f4d;
    --academy-text: #536582;
    --academy-light: #f5f8fd;

    --academy-white: #ffffff;
    --academy-border: #dbe6f5;

    --academy-shadow: 0 12px 35px rgba(7, 31, 77, 0.08);
}

/* Global */
html,
body {
    font-family:
        "Helvetica Neue",
        Helvetica,
        Arial,
        sans-serif;

    background: var(--academy-light);
    color: var(--academy-dark);
}

/* =========================================================
   BRAND
   ========================================================= */

/* =========================================================
   BRAND
   ========================================================= */

   .academy-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
}

.academy-brand-sidebar {
    padding: 16px 14px;
    border-bottom: 1px solid var(--academy-border);
}

.academy-logo {
    width: 195px;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    display: block;
}

.academy-brand-text {
    display: none;
}

.academy-name,
.academy-tagline {
    display: none;
}
.academy-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.academy-name {
    color: var(--academy-dark);
    font-size: 1.12rem;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.academy-tagline {
    color: var(--academy-primary);
    font-size: 0.58rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    margin-top: 5px;
}

/* =========================================================
   PORTAL HEADER
   ========================================================= */

.academy-portal-title {
    font-weight: 600;
    letter-spacing: 0.01em;
}

/* =========================================================
   NAVIGATION
   ========================================================= */

.mud-nav-link {
    color: var(--academy-dark) !important;
    border-radius: 6px;
    margin: 2px 8px;
}

.mud-nav-link .mud-icon-root {
    color: var(--academy-primary);
}

.mud-nav-link:hover {
    color: var(--academy-primary) !important;
    background: var(--academy-primary-light) !important;
}

.mud-nav-link.active {
    color: var(--academy-primary) !important;
    background: var(--academy-primary-light) !important;
    font-weight: 600;
}

.mud-nav-link.active .mud-icon-root {
    color: var(--academy-primary);
}

/* Navigation groups */
.mud-nav-group > .mud-nav-link {
    font-weight: 600;
}

/* =========================================================
   APP BAR
   ========================================================= */

.mud-appbar {
    background:
        linear-gradient(
            135deg,
            var(--academy-primary-deep) 0%,
            var(--academy-primary-dark) 48%,
            var(--academy-primary) 100%
        ) !important;

    box-shadow: 0 4px 18px rgba(7, 31, 77, 0.15) !important;
}

/* =========================================================
   DRAWER
   ========================================================= */

.mud-drawer {
    background: var(--academy-white) !important;
    border-right: 1px solid var(--academy-border);
}

/* =========================================================
   BUTTONS
   ========================================================= */

.mud-button-filled.mud-button-filled-primary {
    background: var(--academy-primary) !important;
    border-color: var(--academy-primary) !important;
}

.mud-button-filled.mud-button-filled-primary:hover {
    background: var(--academy-primary-dark) !important;
    border-color: var(--academy-primary-dark) !important;
}

/* =========================================================
   LINKS
   ========================================================= */

a,
.btn-link {
    color: var(--academy-primary);
}

a:hover,
.btn-link:hover {
    color: var(--academy-primary-dark);
}

/* =========================================================
   CARDS / PAPERS
   ========================================================= */

.mud-paper {
    border: 1px solid var(--academy-border);
    border-radius: 8px;
}

.mud-card {
    border: 1px solid var(--academy-border);
    border-radius: 8px;
}

/* =========================================================
   FORM FOCUS
   ========================================================= */

.mud-input-control:focus-within .mud-input-label {
    color: var(--academy-primary) !important;
}

.mud-input:focus {
    color: var(--academy-dark);
}

/* =========================================================
   GOLD ACCENT
   ========================================================= */

.academy-accent {
    color: var(--academy-accent);
}

.academy-accent-border {
    border-color: var(--academy-accent) !important;
}

.academy-accent-bg {
    background: var(--academy-accent-light);
}

/* =========================================================
   PAGE BACKGROUND
   ========================================================= */

.mud-main-content {
    background: var(--academy-light);
}

.academy-logo-sidebar {
    width: 195px;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* =========================================================
   RESPONSIVE TABLES
   ========================================================= */

   html,
   body {
       max-width: 100%;
       overflow-x: hidden;
   }
   
   .mud-main-content,
   .mud-container,
   .mud-paper,
   .mud-card,
   .mud-grid {
       min-width: 0 !important;
       max-width: 100%;
       box-sizing: border-box;
   }
   
   .mud-table-container {
       display: block;
       width: 100% !important;
       max-width: 100% !important;
       min-width: 0 !important;
       overflow-x: auto !important;
       overflow-y: hidden;
       -webkit-overflow-scrolling: touch;
       box-sizing: border-box;
   }
   
   .mud-table {
       width: 100%;
       min-width: 0 !important;
   }
   
   .mud-table-root {
       width: max-content;
       min-width: 100%;
   }
   
   @media (max-width: 600px) {
       .mud-table-root {
           display: table !important;
           width: max-content !important;
           min-width: 100%;
       }
   
       .mud-table-head {
           display: table-header-group !important;
       }
   
       .mud-table-body {
           display: table-row-group !important;
       }
   
       .mud-table-row {
           display: table-row !important;
       }
   
       .mud-table-cell,
       .mud-table-cell:first-child,
       .mud-table-cell:last-child {
           display: table-cell !important;
           position: static !important;
           width: auto !important;
           min-width: 110px;
           white-space: nowrap;
       }
   
       .mud-table-cell::before {
           display: none !important;
           content: none !important;
       }
   
       .mud-table-head .mud-table-cell {
           display: table-cell !important;
           font-weight: 700;
           white-space: nowrap;
       }
   
       .mud-main-content {
           padding-left: 8px !important;
           padding-right: 8px !important;
       }
   
       .mud-input-control,
       .mud-select,
       .mud-button {
           max-width: 100%;
       }
   }

/* =========================================================
   MOBILE RESPONSIVE FIXES
   ========================================================= */

   html,
   body {
       max-width: 100%;
       overflow-x: hidden;
   }
   
   .mud-main-content {
       min-width: 0 !important;
       max-width: 100% !important;
       overflow-x: hidden;
   }
   
   .mud-container {
       max-width: 100% !important;
   }
   
   /* Keep MudBlazor tables as REAL TABLES on mobile.
      They will scroll horizontally instead of becoming cards. */
   .mud-table-container {
       width: 100%;
       max-width: 100%;
       overflow-x: auto !important;
       -webkit-overflow-scrolling: touch;
   }
   
   .mud-table {
       min-width: max-content;
   }
   
   @media (max-width: 600px) {
   
       /* Force normal table structure */
       .mud-table-root {
           display: table !important;
           width: max-content !important;
           min-width: 100%;
       }
   
       .mud-table-head {
           display: table-header-group !important;
       }
   
       .mud-table-body {
           display: table-row-group !important;
       }
   
       .mud-table-row {
           display: table-row !important;
       }
   
       .mud-table-cell,
       .mud-table-cell:first-child,
       .mud-table-cell:last-child {
           display: table-cell !important;
           position: static !important;
           width: auto !important;
           min-width: 110px;
           white-space: nowrap;
       }
   
       .mud-table-cell::before {
           display: none !important;
           content: none !important;
       }
   
       .mud-table-head .mud-table-cell {
           display: table-cell !important;
           font-weight: 700;
           white-space: nowrap;
       }
   
       /* Prevent page-level horizontal overflow */
       .mud-grid,
       .mud-paper,
       .mud-card {
           max-width: 100%;
           min-width: 0;
       }
   
       /* Mobile page spacing */
       .mud-main-content {
           padding-left: 8px !important;
           padding-right: 8px !important;
       }
   
       /* Inputs/buttons must not force the page wider */
       .mud-input-control,
       .mud-select,
       .mud-button {
           max-width: 100%;
       }
   }
   /* =========================================================
   SIDEBAR NOTIFICATION COUNTS
   ========================================================= */

.academy-nav-notification-item {
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
    gap: 8px;
}

.academy-nav-notification-item > span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.academy-notification-count {
    margin-left: auto;
    flex-shrink: 0;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #dc2626;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

/* =========================================================
   TEACHER REPORT UNLOCK DIALOG
   ========================================================= */

   .academy-unlock-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.45);
}

.academy-unlock-dialog {
    width: 100%;
    max-width: 520px;
    padding: 24px;
    box-sizing: border-box;
}

@media (max-width: 600px) {
    .academy-unlock-overlay {
        padding: 12px;
    }

    .academy-unlock-dialog {
        max-width: 100%;
        padding: 18px;
    }
}
/* Class Reports - mobile responsive */
.class-report-header {
    min-width: 0;
}

.class-report-actions {
    flex-wrap: wrap;
}

@media (max-width: 600px) {

    .class-report-header {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        width: 100% !important;
        gap: 12px !important;
    }

    .class-report-header > .mud-stack {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
        gap: 8px !important;
    }

    .class-report-actions {
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        align-items: stretch !important;
        width: 100% !important;
        gap: 8px !important;
    }

    .class-report-actions .mud-button-root {
        width: 100% !important;
        max-width: 100% !important;
        min-height: 48px;
        justify-content: center;
        box-sizing: border-box;
    }
}
/* Fees - mobile responsive */
.fee-invoice-header {
    min-width: 0;
}

.fee-invoice-actions {
    flex-wrap: wrap;
}

@media (max-width: 600px) {

    .fee-invoice-header {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        width: 100% !important;
        gap: 12px !important;
    }

    .fee-invoice-header > .mud-stack {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
        gap: 8px !important;
    }

    .fee-invoice-actions {
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        align-items: stretch !important;
        width: 100% !important;
        gap: 8px !important;
    }

    .fee-invoice-actions .mud-button-root {
        width: 100% !important;
        max-width: 100% !important;
        min-height: 48px;
        justify-content: center;
        box-sizing: border-box;
    }
}
/* Teachers - mobile responsive filters */
.teacher-filter-stack {
    min-width: 0;
}

.teacher-search-field {
    width: 280px;
}

@media (max-width: 600px) {
    .teacher-filter-stack {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
        gap: 10px !important;
    }

    .teacher-search-field {
        width: 100% !important;
        max-width: 100% !important;
    }

    .teacher-filter-stack .mud-input-control,
    .teacher-filter-stack .mud-select {
        width: 100% !important;
        max-width: 100% !important;
    }
}