:root {
    --lms-ink: #071426;
    --lms-surface: rgba(255, 255, 255, 0.9);
    --lms-border: rgba(148, 163, 184, 0.2);
    --lms-shadow: 0 24px 64px rgba(15, 23, 42, 0.16);
}

.lms-app {
    background:
        radial-gradient(circle at top left, rgba(30, 64, 175, 0.18), transparent 34%),
        radial-gradient(circle at bottom right, rgba(249, 115, 22, 0.16), transparent 30%),
        linear-gradient(180deg, #f7fbff 0%, #eef4ff 46%, #f8fafc 100%);
}

.lms-grid-bg {
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
    background-size: 28px 28px;
}

.lms-orb {
    position: absolute;
    border-radius: 9999px;
    filter: blur(40px);
    opacity: 0.75;
    pointer-events: none;
}

.lms-panel {
    background: var(--lms-surface);
    border: 1px solid var(--lms-border);
    box-shadow: var(--lms-shadow);
    backdrop-filter: blur(16px);
}

.lms-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.9rem;
    border-radius: 9999px;
    background: rgba(30, 64, 175, 0.08);
    color: #1d4ed8;
    font-size: 0.85rem;
    font-weight: 700;
}

.lms-kpi {
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 1.25rem;
    background: rgba(255, 255, 255, 0.84);
    padding: 1.25rem;
}

.lms-shell {
    min-height: 100vh;
    background: #f6f8fc;
    font-size: 0.9rem;
}

.lms-dashboard-card {
    border-radius: 0.9rem;
    border: 1px solid rgba(203, 213, 225, 0.82);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.055);
}

.lms-sidebar-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.68rem 0.78rem;
    border-radius: 0.65rem;
    border: 1px solid transparent;
    background: transparent;
    color: #334155;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.lms-sidebar-item:hover,
.lms-sidebar-item.is-active {
    background: rgba(30, 64, 175, 0.08);
    border-color: rgba(30, 64, 175, 0.16);
    color: #1e40af;
}

.lms-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0;
    color: #0f172a;
}

.lms-subtle {
    color: #64748b;
}

.lms-mini-list > * + * {
    margin-top: 0.75rem;
}

.lms-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.22rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.66rem;
    font-weight: 700;
    line-height: 1.15;
    white-space: nowrap;
}

.lms-badge-blue {
    background: rgba(37, 99, 235, 0.1);
    color: #1d4ed8;
}

.lms-badge-orange {
    background: rgba(249, 115, 22, 0.12);
    color: #ea580c;
}

.lms-badge-green {
    background: rgba(22, 163, 74, 0.12);
    color: #15803d;
}

.lms-badge-slate {
    background: rgba(100, 116, 139, 0.12);
    color: #475569;
}

.lms-table-wrap {
    overflow-x: auto;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 0.75rem;
    background: #fff;
}

.lms-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
}

.lms-table th,
.lms-table td {
    padding: 0.62rem 0.72rem;
    text-align: left;
    border-bottom: 1px solid rgba(226, 232, 240, 0.85);
    font-size: 0.82rem;
    vertical-align: top;
}

.lms-table th {
    background: rgba(248, 250, 252, 0.95);
    color: #334155;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.lms-table tbody tr:last-child td {
    border-bottom: 0;
}

.lms-empty {
    border: 1px dashed rgba(148, 163, 184, 0.45);
    border-radius: 0.8rem;
    background: rgba(248, 250, 252, 0.9);
    padding: 1rem;
    text-align: center;
    color: #64748b;
    font-size: 0.86rem;
}

.lms-notice {
    display: none;
    border-radius: 0.75rem;
    padding: 0.72rem 0.85rem;
    font-size: 0.84rem;
    font-weight: 600;
}

.lms-notice[data-visible="true"] {
    display: block;
}

.lms-notice[data-tone="info"] {
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
}

.lms-notice[data-tone="success"] {
    background: rgba(34, 197, 94, 0.12);
    color: #15803d;
}

.lms-notice[data-tone="error"] {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

.lms-notice[data-tone="warning"] {
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
}

.lms-check-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.lms-check-card {
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 0.75rem;
    padding: 0.65rem 0.75rem;
    background: rgba(255, 255, 255, 0.96);
}

.lms-scrollbar::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.lms-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.55);
    border-radius: 9999px;
}

.lms-scrollbar::-webkit-scrollbar-track {
    background: rgba(241, 245, 249, 0.9);
}

.lms-anchor-section {
    scroll-margin-top: 7rem;
}

.lms-view-panel[hidden] {
    display: none !important;
}

.lms-view-stack > * + * {
    margin-top: 1rem;
}

.lms-portal-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
}

.lms-portal-layout > * {
    min-width: 0;
}

.lms-inline-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.lms-inline-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border-radius: 0.65rem;
    border: 1px solid rgba(226, 232, 240, 0.95);
    background: rgba(255, 255, 255, 0.95);
    color: #334155;
    font-size: 0.76rem;
    font-weight: 700;
    padding: 0.42rem 0.65rem;
    transition: all 0.2s ease;
}

.lms-inline-button:hover,
.lms-inline-button.is-active {
    border-color: rgba(30, 64, 175, 0.2);
    background: rgba(30, 64, 175, 0.08);
    color: #1e40af;
}

.lms-inline-button-danger {
    border-color: rgba(248, 113, 113, 0.22);
    background: rgba(254, 242, 242, 0.92);
    color: #b91c1c;
}

.lms-inline-button-danger:hover {
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(254, 226, 226, 0.98);
    color: #991b1b;
}

.lms-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.lms-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.34rem 0.62rem;
    border-radius: 9999px;
    background: rgba(248, 250, 252, 0.96);
    border: 1px solid rgba(226, 232, 240, 0.95);
    color: #334155;
    font-size: 0.76rem;
    font-weight: 600;
}

.lms-student-density,
.lms-teacher-density,
.lms-parent-density {
    font-size: 0.86rem;
}

.lms-student-density header h1,
.lms-teacher-density header h1,
.lms-parent-density header h1 {
    font-size: 1.18rem !important;
    line-height: 1.35 !important;
}

.lms-student-density header p:first-child,
.lms-teacher-density header p:first-child,
.lms-parent-density header p:first-child {
    font-size: 0.68rem !important;
    letter-spacing: 0.08em !important;
}

.lms-student-density header p:last-child,
.lms-teacher-density header p:last-child,
.lms-parent-density header p:last-child {
    font-size: 0.78rem !important;
}

#student-view-nav .lms-sidebar-item,
#teacher-view-nav .lms-sidebar-item,
#parent-view-nav .lms-sidebar-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

#student-view-nav .lms-sidebar-item > i,
#teacher-view-nav .lms-sidebar-item > i,
#parent-view-nav .lms-sidebar-item > i {
    width: 1rem;
    text-align: center;
    color: currentColor;
    font-size: 0.78rem;
    opacity: 0.82;
}

#student-class-tabs .lms-sidebar-item,
#teacher-class-list .lms-sidebar-item,
#parent-child-tabs .lms-sidebar-item {
    border-color: rgba(226, 232, 240, 0.9);
    background: rgba(255, 255, 255, 0.78);
    padding: 0.62rem 0.72rem;
}

#student-class-tabs .lms-sidebar-item.is-active,
#teacher-class-list .lms-sidebar-item.is-active,
#parent-child-tabs .lms-sidebar-item.is-active {
    background: rgba(30, 64, 175, 0.08);
}

.lms-stat-grid {
    grid-template-columns: repeat(auto-fit, minmax(124px, 1fr)) !important;
    gap: 0.72rem !important;
}

.lms-stat-card {
    min-height: 5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.lms-stat-card > p:first-child {
    font-size: 0.73rem !important;
    font-weight: 700;
    line-height: 1.2;
}

.lms-stat-card > p:last-child {
    margin-top: 0.45rem !important;
    font-size: 1.34rem !important;
    line-height: 1.5rem !important;
    overflow-wrap: anywhere;
}

#teacher-summary {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
    gap: 0.75rem !important;
}

#teacher-summary .lms-dashboard-card {
    min-height: 5.1rem;
}

#student-view-stack .lms-view-panel,
#teacher-view-stack .lms-view-panel,
#parent-view-stack .lms-view-panel {
    scroll-margin-top: 5.5rem;
}

.lms-shell header > div,
.lms-shell main.lms-portal-layout {
    max-width: min(92rem, calc(100vw - 1.5rem)) !important;
}

.lms-shell header > div {
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
    gap: 0.75rem !important;
}

.lms-shell main.lms-portal-layout {
    padding-top: 1rem !important;
    padding-bottom: 1.5rem !important;
}

.lms-shell header h1,
.lms-shell .font-heading.text-3xl,
.lms-shell .font-heading.text-2xl {
    font-size: 1.35rem !important;
    line-height: 1.25 !important;
    letter-spacing: 0 !important;
}

.lms-shell header p,
.lms-shell .text-sm,
.lms-shell label,
.lms-shell select,
.lms-shell input,
.lms-shell textarea,
.lms-shell button {
    font-size: 0.84rem;
}

.lms-shell .tracking-\[0\.2em\] {
    letter-spacing: 0.08em !important;
}

.lms-shell .p-6 {
    padding: 1rem !important;
}

.lms-shell .p-5 {
    padding: 0.9rem !important;
}

.lms-shell .gap-6 {
    gap: 1rem !important;
}

.lms-shell .gap-5 {
    gap: 0.85rem !important;
}

.lms-shell .space-y-6 > * + *,
.lms-shell .space-y-5 > * + * {
    margin-top: 1rem !important;
}

.lms-shell .space-y-4 > * + * {
    margin-top: 0.75rem !important;
}

.lms-shell .mb-5 {
    margin-bottom: 0.85rem !important;
}

.lms-shell .mt-6 {
    margin-top: 1rem !important;
}

.lms-shell .pt-5 {
    padding-top: 0.85rem !important;
}

.lms-shell input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.lms-shell select,
.lms-shell textarea {
    min-height: 2.55rem;
    border-radius: 0.7rem !important;
    padding: 0.58rem 0.78rem !important;
    line-height: 1.3;
}

.lms-shell input[type="file"] {
    border-radius: 0.7rem !important;
    padding: 0.5rem 0.78rem !important;
    font-size: 0.8rem;
}

.lms-shell button.rounded-2xl,
.lms-shell a.rounded-xl,
.lms-shell .rounded-2xl,
.lms-shell .rounded-xl {
    border-radius: 0.7rem !important;
}

.lms-shell button:not(.lms-sidebar-item):not(.lms-inline-button),
.lms-shell a.inline-flex {
    padding-top: 0.55rem !important;
    padding-bottom: 0.55rem !important;
}

.lms-shell .rounded-\[1\.35rem\],
.lms-shell .rounded-\[1\.25rem\] {
    border-radius: 0.8rem !important;
}

.lms-shell .w-12.h-12,
.lms-shell .w-14.h-14 {
    width: 2.4rem !important;
    height: 2.4rem !important;
    border-radius: 0.75rem !important;
    font-size: 0.95rem !important;
}

.lms-shell .min-w-\[260px\] {
    min-width: min(100%, 13rem) !important;
}

.lms-shell .text-4xl {
    font-size: 1.65rem !important;
    line-height: 1.9rem !important;
}

.lms-shell .text-3xl {
    font-size: 1.45rem !important;
    line-height: 1.75rem !important;
}

.lms-shell .text-2xl {
    font-size: 1.18rem !important;
    line-height: 1.55rem !important;
}

#admin-overview-section > .grid,
#admin-fee-overview,
.lms-shell main > section > section.grid {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)) !important;
}

#admin-fee-overview .lms-dashboard-card {
    min-height: 6rem;
}

#admin-fee-invoice-list .lms-table {
    min-width: 960px;
}

#admin-fee-invoice-list .lms-inline-actions {
    min-width: 8.75rem;
}

#student-fees-panel .lms-table {
    min-width: 820px;
}

#student-fees-panel .grid.sm\:grid-cols-2 {
    align-items: stretch;
}

#student-fees-panel .grid.sm\:grid-cols-2 > div {
    min-width: 0;
}

#student-view-stack .lms-mini-list > article,
#student-view-stack .lms-view-panel article.rounded-2xl,
#teacher-view-stack .lms-view-panel article.rounded-2xl,
#teacher-view-stack .lms-view-panel div.rounded-2xl,
#parent-view-stack .lms-view-panel article.rounded-2xl,
#parent-view-stack .lms-view-panel div.rounded-2xl {
    border-radius: 0.75rem !important;
}

#student-view-stack .lms-view-panel > .flex,
#student-fees-panel > .flex {
    gap: 0.8rem !important;
}

#student-overview-panel .min-w-\[260px\],
#student-fees-panel .min-w-\[260px\] {
    min-width: min(100%, 12rem) !important;
}

#student-overview-panel .grid.sm\:grid-cols-2 > div,
#student-fees-panel .grid.sm\:grid-cols-2 > div {
    padding: 0.78rem !important;
}

#student-overview-panel h2 {
    font-size: 1.22rem !important;
    line-height: 1.45rem !important;
}

#student-attendance-panel .grid.grid-cols-2 {
    gap: 0.65rem !important;
}

#student-marks-panel .lms-table {
    min-width: 560px;
}

#assignment-marks-panel [data-assignment-mark-row] {
    grid-template-columns: minmax(0, 1.15fr) minmax(4.5rem, 6.25rem) minmax(4.5rem, 6.25rem) minmax(7rem, 8.75rem) minmax(0, 1.2fr) !important;
    border-radius: 0.75rem !important;
    padding: 0.7rem 0.8rem !important;
    gap: 0.55rem !important;
}

#assignment-marks-panel [data-assignment-mark-row] input,
#assignment-marks-panel [data-assignment-mark-row] select,
#attendance-student-list input,
#attendance-student-list select {
    min-height: 2.25rem;
    border-radius: 0.62rem !important;
    padding: 0.46rem 0.62rem !important;
    font-size: 0.78rem;
}

#teacher-monthly-report-panel .lms-table {
    min-width: 560px;
}

#teacher-monthly-report-panel .lms-monthly-report-panel,
#teacher-monthly-report-panel .lms-monthly-top-card {
    border-radius: 0.75rem !important;
}

#admin-fee-overview .lms-badge,
#admin-overview-section .lms-badge {
    align-self: flex-start;
}

.lms-portal-density,
.lms-teacher-density {
    color: #1e293b;
}

.lms-teacher-density .lms-dashboard-card {
    border-radius: 0.9rem;
}

.lms-teacher-density .lms-view-stack > * + * {
    margin-top: 1rem;
}

.lms-teacher-density .lms-section-title {
    font-size: 0.95rem;
}

.lms-teacher-density .lms-badge {
    gap: 0.3rem;
    padding: 0.24rem 0.52rem;
    font-size: 0.68rem;
}

.lms-teacher-density .lms-inline-button {
    border-radius: 0.65rem;
    font-size: 0.76rem;
    padding: 0.42rem 0.65rem;
}

.lms-teacher-density .lms-sidebar-item {
    padding: 0.68rem 0.78rem;
}

.lms-teacher-density .lms-table th,
.lms-teacher-density .lms-table td {
    padding: 0.62rem 0.72rem;
}

.lms-teacher-density .lms-empty {
    padding: 1rem;
    font-size: 0.88rem;
}

.lms-teacher-density .lms-chip {
    padding: 0.35rem 0.65rem;
    font-size: 0.76rem;
}

.lms-teacher-density input:not([type="checkbox"]):not([type="radio"]),
.lms-teacher-density select,
.lms-teacher-density textarea {
    border-radius: 0.7rem;
    font-size: 0.84rem;
}

.lms-teacher-density #teacher-summary .text-3xl {
    font-size: 1.34rem;
    line-height: 1.5rem;
}

.lms-student-mark-row {
    border-color: rgba(226, 232, 240, 0.92);
}

.lms-student-mark-row:hover {
    transform: translateY(-1px);
}

.lms-student-mark-stat {
    min-height: 4.25rem;
}

.lms-student-mark-entry {
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.04);
}

.lms-monthly-report-shell {
    align-items: stretch;
}

.lms-monthly-report-panel {
    min-height: 100%;
}

.lms-monthly-top-card {
    min-height: 100%;
}

.lms-certificate-page {
    min-height: 100vh;
    background: #f8fafc;
}

.certificate-stage {
    display: flex;
    justify-content: center;
}

.lms-certificate-sheet {
    width: min(100%, 980px);
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.38);
    border-radius: 0.9rem;
    padding: clamp(1rem, 2vw, 1.5rem);
    box-shadow: 0 26px 70px rgba(15, 23, 42, 0.12);
}

.lms-certificate-border {
    position: relative;
    min-height: 640px;
    overflow: hidden;
    border: 8px double #1e40af;
    border-radius: 0.45rem;
    padding: clamp(1.35rem, 4vw, 3.25rem);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
}

.lms-certificate-watermark {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: rgba(30, 64, 175, 0.055);
    font-family: Poppins, sans-serif;
    font-size: clamp(9rem, 24vw, 19rem);
    font-weight: 800;
    pointer-events: none;
}

.lms-certificate-head,
.lms-certificate-body,
.lms-certificate-footer {
    position: relative;
    z-index: 1;
}

.lms-certificate-head {
    min-height: 7rem;
    text-align: center;
}

.lms-certificate-logo {
    position: absolute;
    top: 0;
    left: 0;
    width: min(132px, 31vw);
    max-height: 82px;
    object-fit: contain;
}

.lms-certificate-title-block {
    max-width: 620px;
    margin: 0 auto;
    padding: 0.35rem clamp(0.5rem, 4vw, 2rem) 0;
}

.lms-certificate-kicker {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.55rem;
    color: #f97316;
    font-size: clamp(1.25rem, 2.7vw, 1.85rem);
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.lms-certificate-divider {
    width: 2px;
    height: 1.25em;
    border-radius: 999px;
    background: #1e40af;
}

.lms-certificate-head h2 {
    margin-top: 0.9rem;
    color: #0f172a;
    font-family: Poppins, sans-serif;
    font-size: clamp(1.35rem, 3.65vw, 2.45rem);
    font-weight: 800;
    line-height: 1.08;
    text-align: center;
}

.lms-certificate-body {
    margin: clamp(2rem, 7vw, 4.5rem) auto 0;
    max-width: 760px;
    text-align: center;
}

.lms-certificate-line {
    color: #475569;
    font-size: clamp(1rem, 2vw, 1.2rem);
    font-weight: 600;
}

.lms-certificate-body h3 {
    margin: 0.65rem auto;
    color: #1e40af;
    font-family: Poppins, sans-serif;
    font-size: clamp(2rem, 7vw, 4.35rem);
    font-weight: 800;
    line-height: 1.08;
    overflow-wrap: anywhere;
}

.lms-certificate-body h4 {
    margin: 0.8rem auto 0;
    color: #0f172a;
    font-family: Poppins, sans-serif;
    font-size: clamp(1.35rem, 3.5vw, 2.35rem);
    font-weight: 700;
    line-height: 1.2;
}

.lms-certificate-description {
    margin: 1.25rem auto 0;
    max-width: 680px;
    color: #334155;
    font-size: clamp(0.98rem, 2vw, 1.13rem);
    line-height: 1.8;
}

.lms-certificate-context {
    margin-top: 1.25rem;
    color: #ea580c;
    font-size: 0.95rem;
    font-weight: 800;
    text-transform: uppercase;
}

.lms-certificate-footer {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    align-items: end;
    margin-top: clamp(2rem, 6vw, 4.25rem);
    color: #0f172a;
    text-align: center;
}

.lms-certificate-small,
.lms-certificate-signature p {
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
}

.lms-certificate-signature span {
    display: block;
    width: min(180px, 100%);
    height: 1px;
    margin: 0 auto 0.65rem;
    background: #0f172a;
}

.lms-certificate-mini {
    position: relative;
    overflow: hidden;
    border: 4px double rgba(30, 64, 175, 0.7);
    border-radius: 0.65rem;
    background: #ffffff;
    padding: 1rem;
    min-height: 12rem;
}

.lms-certificate-mini::before {
    content: "TS";
    position: absolute;
    right: 0.5rem;
    bottom: -1.1rem;
    color: rgba(30, 64, 175, 0.055);
    font-family: Poppins, sans-serif;
    font-size: 5.25rem;
    font-weight: 800;
}

.lms-certificate-mini > * {
    position: relative;
    z-index: 1;
}

.lms-certificate-mini-logo {
    width: 8.5rem;
    max-height: 3rem;
    object-fit: contain;
}

@media (max-width: 640px) {
    .lms-certificate-head {
        min-height: 10rem;
        padding-top: 4.6rem;
    }

    .lms-certificate-logo {
        width: 5.75rem;
    }
}

@media print {
    .certificate-toolbar,
    #certificate-notice {
        display: none !important;
    }

    body.lms-certificate-page {
        background: #ffffff !important;
    }

    body.lms-certificate-page main {
        max-width: none !important;
        padding: 0 !important;
    }

    .lms-certificate-sheet {
        width: 100%;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        padding: 0;
    }

    .lms-certificate-border {
        min-height: 100vh;
        border-radius: 0;
    }
}

@media (min-width: 1024px) {
    .lms-portal-layout {
        grid-template-columns: 240px minmax(0, 1fr);
    }

    .lms-portal-rail {
        position: sticky;
        top: 5.75rem;
        align-self: start;
    }
}

@media (max-width: 767px) {
    .lms-shell header > div,
    .lms-shell main.lms-portal-layout {
        max-width: calc(100vw - 1rem) !important;
    }

    .lms-shell header > div > div:last-child {
        width: 100%;
        flex-wrap: wrap;
    }

    .lms-shell header > div > div:last-child > * {
        flex: 1 1 9rem;
        justify-content: center;
    }

    .lms-shell .text-4xl {
        font-size: 1.42rem !important;
        line-height: 1.7rem !important;
    }

    .lms-shell .text-3xl {
        font-size: 1.25rem !important;
        line-height: 1.55rem !important;
    }

    .lms-shell .lms-dashboard-card {
        border-radius: 0.8rem;
    }

    .lms-shell .lms-table-wrap {
        margin-left: -0.25rem;
        margin-right: -0.25rem;
    }

    .lms-shell .lms-inline-actions {
        width: 100%;
    }

    .lms-shell .lms-inline-actions .lms-inline-button {
        flex: 1 1 auto;
    }

    #admin-overview-section > .grid,
    #admin-fee-overview,
    .lms-shell main > section > section.grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)) !important;
    }
}

@media (max-width: 1023px) {
    .lms-dashboard-stack {
        display: block;
    }

    .lms-portal-rail {
        position: static;
    }

    #student-view-nav,
    #teacher-view-nav,
    #parent-view-nav,
    #student-class-tabs,
    #teacher-class-list,
    #parent-child-tabs {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
        gap: 0.5rem;
    }

    #student-view-nav > * + *,
    #teacher-view-nav > * + *,
    #parent-view-nav > * + *,
    #student-class-tabs > * + *,
    #teacher-class-list > * + *,
    #parent-child-tabs > * + * {
        margin-top: 0 !important;
    }

    #assignment-marks-panel [data-assignment-mark-row] {
        grid-template-columns: minmax(0, 1fr) repeat(3, minmax(5rem, 1fr)) !important;
    }

    #assignment-marks-panel [data-assignment-mark-row] > div:first-child,
    #assignment-marks-panel [data-assignment-mark-row] > input:last-child {
        grid-column: 1 / -1;
    }

    #attendance-student-list > div {
        grid-template-columns: minmax(0, 1fr) minmax(8rem, 10rem) !important;
    }

    #attendance-student-list > div > input {
        grid-column: 1 / -1;
    }
}

@media (max-width: 1279px) {
    .lms-view-panel.grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .lms-view-panel.grid > * {
        min-width: 0;
    }

    .lms-monthly-report-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .lms-monthly-report-shell > * {
        min-width: 0;
    }
}

@media (max-width: 639px) {
    #student-view-nav,
    #teacher-view-nav,
    #parent-view-nav,
    #student-class-tabs,
    #teacher-class-list,
    #parent-child-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #student-view-nav .lms-sidebar-item,
    #teacher-view-nav .lms-sidebar-item,
    #parent-view-nav .lms-sidebar-item {
        justify-content: center;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .lms-stat-grid,
    #teacher-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    #assignment-marks-panel [data-assignment-mark-row],
    #attendance-student-list > div {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    #assignment-marks-panel [data-assignment-mark-row] > *,
    #attendance-student-list > div > * {
        grid-column: 1 / -1 !important;
    }
}