/* Quran Manager — design system CSS (docs/design-system.md). Colours come from MudBlazor's
   palette variables, so everything here follows light and dark automatically. */

@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('../fonts/inter-latin-var.woff2') format('woff2'); }
@font-face { font-family: 'Amiri'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/amiri-arabic-400.woff2') format('woff2'); }
@font-face { font-family: 'Amiri'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/amiri-arabic-700.woff2') format('woff2'); }
@font-face { font-family: 'Noto Nastaliq Urdu'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/noto-nastaliq-urdu-400.woff2') format('woff2'); }

:root { --qm-bottom-nav-height: 64px; }

/* Small utilities MudBlazor lacks */
.qm-min-w-0 { min-width: 0; }
/* One line, cut with an ellipsis — the app bars' academy name on a phone, among others. MudBlazor 9 has no such class. */
.text-truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* A link among a table's text is underlined, not told by colour alone (WCAG 1.4.1; the Phase 9 sweep). */
.mud-table-cell .mud-link, .qm-cell-lines .mud-link { text-decoration: underline; }
/* A message preview beside its sender: it shrinks, never the sender (ConversationListPanel). */
.qm-preview { min-width: 0; flex: 1 1 auto; }
/* MudBlazor 9 has no text-nowrap either; dates in lists stacked over three lines on a phone without it. */
.text-nowrap { white-space: nowrap; }
/* Sign out is a form's button (it posts), dressed as the menu items above it (the review's PUB.i34). */
.qm-signout.mud-button-root { padding: 8px 16px 8px 12px; border-radius: 0; font-weight: 400; font-size: 1rem; letter-spacing: normal; text-transform: none; color: var(--mud-palette-text-primary); }
.qm-signout .mud-button-icon-start { margin-left: 0; margin-right: 16px; }
.qm-form { max-width: 720px; }
/* Money in a table (design system §7): right-aligned, never broken across lines. */
.qm-money { text-align: right; white-space: nowrap; }
.qm-void { text-decoration: line-through; }
/* A table cell of several lines (wrapped in one <div>), as MudTable stacks it on a phone (Breakpoint.Sm): the label keeps
   one line and the cell's lines sit together on the right, one under another. */
@media (max-width: 960px) {
    .mud-sm-table .mud-table-cell.qm-cell-lines::before { flex: none; white-space: nowrap; }
    .mud-sm-table .mud-table-cell.qm-cell-lines > div { min-width: 0; text-align: end; }
}
/* A secret shown once (a reset password): easy to read aloud and retype. System monospace, so no font request. */
.qm-secret { font-family: ui-monospace, Consolas, monospace; font-size: 1.25rem; letter-spacing: .08em; padding: 4px 8px; border-radius: 6px; background: var(--mud-palette-background-gray); user-select: all; }
.qm-chip-inherit { color: inherit !important; border-color: currentColor !important; }

/* Cards (design system §7.1) — one padding, one title style, one footer position, everywhere.
   Cards in the same grid row stretch to the row's height; several cards in one grid cell share it. */
.qm-card { display: flex; flex-direction: column; min-width: 0; }
.mud-grid-item:has(> .qm-card) { display: flex; flex-direction: column; gap: 12px; }
.mud-grid-item > .qm-card { flex: 1 1 auto; }
/* A long snackbar message wraps and the box grows with it, never cutting off its last line. */
.mud-snackbar { height: auto !important; max-height: none !important; }
.mud-snackbar-content-message { flex: 1 1 auto; min-width: 0; }

/* The public site (MarketingLayout): the page fills the window, so a short page keeps its footer at the bottom. */
.qm-site-main { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; box-sizing: border-box; }
.qm-site-body { flex: 1 0 auto; }

/* A detail page whose cards differ a lot in length (a student's page): each card keeps its own height instead of the row's. */
.qm-grid-natural > .mud-grid-item { align-self: flex-start; }
.qm-card-header { display: flex; align-items: center; gap: 8px; padding: 16px 16px 0; }
.qm-card-body { flex: 1 1 auto; padding: 16px; }
.qm-card-body.qm-card-body-after-header { padding-top: 12px; }
.qm-card-body.qm-card-body-before-footer { padding-bottom: 12px; }
.qm-card-body.qm-card-body-flush { padding-left: 0; padding-right: 0; }
.qm-card-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 16px 16px; margin-top: auto; }
.qm-stat { flex-direction: row; align-items: center; gap: 16px; padding: 16px; }
.qm-stat-text { min-width: 0; }
@media (min-width: 600px) {
    .qm-card-header { padding: 24px 24px 0; }
    .qm-card-body { padding: 24px; }
    .qm-card-body.qm-card-body-after-header { padding-top: 12px; }
    .qm-card-body.qm-card-body-before-footer { padding-bottom: 12px; }
    .qm-card-body.qm-card-body-flush { padding-left: 0; padding-right: 0; }
    .qm-card-footer { padding: 0 24px 24px; }
    .qm-stat { padding: 24px; }
}
/* A list running edge to edge inside a card keeps its text in line with the card title. */
.qm-card-body-flush .mud-list-item { padding-left: 16px; padding-right: 16px; }
@media (min-width: 600px) { .qm-card-body-flush .mud-list-item { padding-left: 24px; padding-right: 24px; } }
.qm-section-title { margin-bottom: 12px; }
.qm-section { margin-bottom: 32px; }

/* Right-to-left content (design system §4) */
.qm-rtl { unicode-bidi: plaintext; line-height: 1.9; }
/* Whatever a person typed takes its direction from its first letter, as dir="auto" does (RQ-42, Phase 9): a name, message or
   lesson note in Arabic or Urdu runs right to left; English around it is unchanged. */
.mud-typography, .mud-table-cell, .mud-list-item-text, .mud-chip-content, .mud-alert-message { unicode-bidi: plaintext; }
.qm-ar { font-family: 'Amiri', serif; font-size: 1.2em; }
.qm-ur { font-family: 'Noto Nastaliq Urdu', 'Amiri', serif; line-height: 2.2; }

/* The geometric pattern — marketing hero, certificates, empty states only (design system §5) */
.qm-pattern { position: relative; isolation: isolate; overflow: hidden; }
.qm-pattern::before { content: ""; position: absolute; inset: 0; background-image: url('../img/pattern.svg'); background-size: 96px; opacity: .14; z-index: -1; pointer-events: none; }

/* Bottom tab bar — PortalLayout on phones (design system §6) */
.qm-bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; height: var(--qm-bottom-nav-height); padding-bottom: env(safe-area-inset-bottom);
                 background: var(--mud-palette-surface); border-top: 1px solid var(--mud-palette-lines-default); z-index: 1250; }
.qm-bottom-nav a { flex: 1; min-height: 44px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
                   color: var(--mud-palette-text-secondary); text-decoration: none; font-size: .75rem; font-weight: 500; }
.qm-bottom-nav a.active { color: var(--mud-palette-primary); font-weight: 600; }
@media (max-width: 959.98px) {
    .qm-portal-main { padding-bottom: calc(var(--qm-bottom-nav-height) + 16px); }
    .qm-portal .mud-main-content { margin-left: 0 !important; }  /* the sidebar is hidden on phones */
}

/* Account pages — a centred card (design system §6) */
.qm-auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 16px; background: var(--mud-palette-background); }
.qm-auth-card { width: 100%; max-width: 440px; }

/* Live class (design system §6) — always dark */
.qm-live { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: #0B100E; color: #E8EDEB; }
.qm-live-stage { flex: 1; position: relative; margin: 0 16px; border-radius: 16px; overflow: hidden; background: #141C19; display: flex; align-items: center; justify-content: center; min-height: 360px; }
.qm-live-self { position: absolute; right: 16px; bottom: 16px; width: 22%; min-width: 120px; aspect-ratio: 4 / 3; border-radius: 12px; background: #22302B; border: 2px solid rgba(255,255,255,.12); display: flex; align-items: center; justify-content: center; }
.qm-live-controls { display: flex; justify-content: center; gap: 12px; padding: 16px; flex-wrap: wrap; }
.qm-live-dot { width: 10px; height: 10px; border-radius: 50%; background: #F2B8B5; display: inline-block; animation: qm-pulse 1.6s infinite; }
/* The live page (screen inventory §5): the stage fills the screen; videos letterbox; marks are drawn over the picture. */
.qm-live-bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.qm-live-rec { flex-shrink: 0; margin: 0; }
.qm-narrow-only { display: none; }
@media (max-width: 599.98px) { .qm-wide-only { display: none; } .qm-narrow-only { display: inline; } .qm-live-bar { gap: 8px; } }
.qm-ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qm-live-stage { min-height: calc(100vh - 150px); min-height: calc(100dvh - 150px); }
/* The device check (/live/check): no call to lay out, so the preview and its panel stack from the top, with no gap between. */
.qm-live-stage-full { min-height: 0; margin-bottom: 16px; flex-direction: column; justify-content: flex-start; gap: 16px; padding: 16px; }
.qm-live-stage-full .qm-live-self-check { position: relative; left: auto; top: auto; transform: none; width: min(360px, 100%); }
.qm-live-stage-full .qm-live-panel { position: static; transform: none; width: min(440px, 100%); max-height: none; }
.qm-live-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #141C19; }
.qm-live-annotate { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; touch-action: none; }
.qm-live-self { overflow: hidden; z-index: 3; }
.qm-live-self video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.qm-live-self-label { position: absolute; font-size: 12px; color: #E8EDEB; }
.qm-live-self-check { left: 50%; right: auto; top: 16px; bottom: auto; transform: translateX(-50%); width: min(360px, 70%); }
.qm-live-panel { position: absolute; z-index: 4; bottom: 16px; left: 50%; transform: translateX(-50%); width: min(440px, calc(100% - 32px));
                 max-height: calc(100% - 32px); overflow: auto; background: #1B2622; border-radius: 16px; padding: 16px; }
.qm-live-center { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 16px; }
.qm-live-message { position: absolute; z-index: 4; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
                   text-align: center; padding: 16px; background: rgba(11, 16, 14, .55); }
.qm-live-notice { position: absolute; z-index: 4; left: 50%; bottom: 16px; transform: translateX(-50%); background: rgba(0, 0, 0, .7); padding: 6px 12px;
                  border-radius: 20px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.qm-live-notice-top { top: 16px; bottom: auto; }
.qm-live-level { height: 8px; background: #22302B; border-radius: 4px; overflow: hidden; }
.qm-live-level-bar { height: 100%; width: 0; background: #66BB6A; transition: width .08s; }
.qm-live-ring { animation: qm-pulse 1.2s infinite; }
.qm-live-chat { position: fixed; right: 0; top: 0; bottom: 0; width: min(360px, 100%); z-index: 1300; display: flex; flex-direction: column;
                background: #141C19; color: #E8EDEB; border-left: 1px solid rgba(255, 255, 255, .08); }
.qm-live-chat-list { flex: 1; overflow-y: auto; padding: 0 12px; display: flex; flex-direction: column; gap: 8px; }
.qm-live-chat-msg { align-self: flex-start; max-width: 85%; padding: 8px 10px; border-radius: 10px; background: #22302B; word-break: break-word; }
.qm-live-chat-msg.qm-mine { align-self: flex-end; background: #1E4D3D; }
.qm-live-chat-meta { opacity: .7; text-align: right; margin-top: 2px; }
/* The calling sign (client review CR-43): a phone that shakes, with rings spreading from it; still for reduced motion. */
.qm-calling { position: relative; width: 72px; height: 72px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-block: 28px;
              background: var(--mud-palette-success); color: #fff; }
.qm-calling::before, .qm-calling::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--mud-palette-success);
                                          animation: qm-calling-ring 2s ease-out infinite; }
.qm-calling::after { animation-delay: 1s; }
.qm-calling .mud-icon-root { font-size: 2rem; animation: qm-calling-shake 2s ease-in-out infinite; }
@keyframes qm-calling-ring { from { transform: scale(1); opacity: .8; } to { transform: scale(1.9); opacity: 0; } }
@keyframes qm-calling-shake { 0%, 40%, 100% { transform: rotate(0); } 5%, 15%, 25% { transform: rotate(-14deg); } 10%, 20%, 30% { transform: rotate(14deg); } }
@media (prefers-reduced-motion: reduce) { .qm-calling::before, .qm-calling::after, .qm-calling .mud-icon-root { animation: none; } }
/* The connection's strength (CR-43): four rising bars, the lit ones coloured by how good it is. */
.qm-signal { display: inline-flex; align-items: flex-end; gap: 2px; height: 18px; vertical-align: middle; }
.qm-signal > span { width: 4px; border-radius: 1px; background: rgba(128, 128, 128, .35); }
.qm-signal > span:nth-child(1) { height: 25%; }
.qm-signal > span:nth-child(2) { height: 50%; }
.qm-signal > span:nth-child(3) { height: 75%; }
.qm-signal > span:nth-child(4) { height: 100%; }
.qm-signal[data-level="good"] > span.qm-on { background: var(--mud-palette-success); }
.qm-signal[data-level="fair"] > span.qm-on { background: var(--mud-palette-warning); }
.qm-signal[data-level="poor"] > span.qm-on { background: var(--mud-palette-error); }
.qm-signal-pair { display: inline-flex; align-items: center; gap: 2px; opacity: .85; }
/* The annotation colours (CR-45). */
.qm-swatches { display: flex; gap: 8px; padding: 8px 16px; }
.qm-swatch-dot { width: 24px; height: 24px; border-radius: 50%; border: 2px solid rgba(128, 128, 128, .6); padding: 0; cursor: pointer; }
.qm-swatch-dot.qm-on { outline: 2px solid var(--mud-palette-primary); outline-offset: 2px; }
.qm-swatch-dot:focus-visible { outline: 2px solid var(--mud-palette-primary); outline-offset: 2px; }
/* Before joining on a computer: the preview and the settings stack together in the middle, with no empty band between. */
@media (min-width: 600px) {
    .qm-live-stage-check { flex-direction: column; gap: 16px; padding: 16px; }
    .qm-live-stage-check .qm-live-self-check { position: relative; left: auto; top: auto; transform: none; width: min(360px, 100%); flex: none; }
    .qm-live-stage-check .qm-live-panel { position: relative; bottom: auto; left: auto; transform: none; max-height: none; }
}
@keyframes qm-pulse { 50% { opacity: .35; } }

/* Marketing (design system §6) */
.qm-hero { padding: 72px 16px 88px; background: var(--mud-palette-primary); color: var(--mud-palette-primary-text); }
.qm-hero .mud-typography { color: inherit; }
.qm-hero-grid { display: grid; gap: 40px; align-items: center; }
.qm-hero-picture { display: block; width: 100%; max-width: 640px; border-radius: 12px; box-shadow: 0 16px 48px rgba(0, 0, 0, .28); }
@media (min-width: 960px) { .qm-hero-grid { grid-template-columns: 1.05fr 1fr; } }
.qm-shot { margin: 0; }
.qm-shot img { display: block; width: 100%; border-radius: 12px; border: 1px solid var(--mud-palette-lines-default); box-shadow: 0 6px 20px rgba(0, 0, 0, .08); }
.qm-shot figcaption { margin-top: 10px; text-align: center; }
.qm-plan-recommended { outline: 2px solid var(--mud-palette-secondary); outline-offset: -2px; }
.qm-site-band { background: var(--mud-palette-primary); color: var(--mud-palette-primary-text); }
.qm-site-band .mud-typography { color: inherit; }
.qm-site-footer a { color: inherit; }
/* WhatsApp's own green darkened so white text keeps 4.5:1. */
.qm-whatsapp { position: fixed; right: 16px; bottom: 16px; z-index: 1200; display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 999px;
               background: #0b7a5c; color: #fff; font-weight: 600; text-decoration: none; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); }
.qm-whatsapp:hover, .qm-whatsapp:focus-visible { background: #075e47; }
@media (max-width: 599.98px) { .qm-whatsapp { padding: 14px; } .qm-whatsapp-label { display: none; } }

/* Colour swatches on the design page */
.qm-swatch { height: 64px; border-radius: 10px; border: 1px solid var(--mud-palette-lines-default); }

/* Blazor's unhandled-error bar */
#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; width: 100%; z-index: 2000; padding: .75rem 1.25rem;
                   background: var(--mud-palette-error); color: var(--mud-palette-error-text); }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }
#blazor-error-ui a { color: inherit; }

/* Images: the crop frame and the previews of an academy's logo, cover and signature (API contract §12.1, §13.3) */
.qm-crop-frame { width: 100%; }
.qm-crop-canvas { display: block; width: 100%; height: auto; border-radius: 10px; background: var(--mud-palette-background-gray); touch-action: none; cursor: grab; }
.qm-image-preview { display: block; width: 100%; border-radius: 10px; background: var(--mud-palette-background-gray); object-fit: cover; }
.qm-image-logo { max-width: 160px; aspect-ratio: 1; }
.qm-image-cover { aspect-ratio: 3; }
.qm-image-signature { max-width: 300px; aspect-ratio: 3; object-fit: contain; }
.qm-appbar-logo { width: 32px; height: 32px; border-radius: 6px; object-fit: cover; background: #FFFFFF; }

/* The Admin's look and feel (client review CR-15): a colour swatch beside its field, and the light and dark previews. */
.qm-colour-swatch { width: 56px; height: 56px; flex: 0 0 auto; padding: 4px; border: 1px solid var(--mud-palette-lines-inputs); border-radius: 10px; background: var(--mud-palette-surface); cursor: pointer; }
.qm-theme-preview { flex: 1 1 200px; padding: 12px 16px; border: 1px solid var(--mud-palette-lines-default); border-radius: 10px; }
.qm-theme-preview-button { display: inline-block; padding: 6px 16px; border-radius: 10px; font-weight: 600; font-size: .875rem; }
.qm-theme-preview-chip { display: inline-block; padding: 2px 10px; border-radius: 16px; font-size: .75rem; font-weight: 600; }

/* Phase 3 */
.qm-field-narrow { width: 120px; flex: 0 0 auto; }
.qm-field-currency { width: 150px; flex: 0 0 auto; }
.qm-time-pair { display: flex; gap: 12px; max-width: 480px; }
.qm-time-pair > * { flex: 1 1 0; min-width: 0; }
.qm-scroll-list { max-height: 420px; overflow-y: auto; }
/* On a phone the page scrolls, not a box inside it, which hid marks below its fold (the review's PORTAL.I11). */
@media (max-width: 599.98px) { .qm-scroll-list { max-height: none; overflow-y: visible; } }
.qm-dictation-bar { max-width: 320px; }
.qm-child-switcher { max-width: 220px; text-transform: none; }
.qm-child-switcher .mud-button-label { min-width: 0; }
.qm-chat { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow-y: auto; padding: 4px 0; }
.qm-bubble { max-width: 80%; padding: 8px 12px; border-radius: 10px; background: var(--mud-palette-background-gray); align-self: flex-start; white-space: pre-wrap; word-break: break-word; }
.qm-bubble-mine { align-self: flex-end; background: var(--mud-palette-primary); color: var(--mud-palette-primary-text); }
.qm-bubble-mine .mud-text-secondary, .qm-bubble-mine a { color: var(--mud-palette-primary-text) !important; }
.qm-bubble-meta { font-size: 12px; opacity: 0.8; margin-top: 2px; }
.qm-unread { font-weight: 600; }
.qm-pre-line { white-space: pre-line; }
.qm-chat-image { max-width: 240px; max-height: 240px; border-radius: 8px; display: block; }
/* A voice note or a sound, and a video, played in the chat (client review CR-48). */
.qm-chat-audio { display: block; width: 260px; max-width: 100%; height: 40px; }
.qm-chat-video { display: block; width: 280px; max-width: 100%; max-height: 240px; border-radius: 8px; background: #000; }
/* Unread announcements above the page (client review CR-50): the theme's accent, two lines until "Read more". */
.qm-announcements { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.qm-announcement { display: flex; align-items: flex-start; gap: 12px; padding: 12px 8px 12px 16px; border-radius: 12px;
                   background: var(--mud-palette-secondary); color: var(--mud-palette-secondary-text); }
.qm-announcement-icon { flex: none; margin-top: 2px; }
.qm-announcement-text { flex: 1; min-width: 0; }
.qm-announcement-title { font-weight: 600; overflow-wrap: anywhere; }
.qm-announcement-body { margin-top: 2px; white-space: pre-wrap; overflow-wrap: anywhere; }
.qm-announcement-body.qm-clamp { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.qm-announcement-more { margin-left: -8px; text-transform: none; }
/* A file in a message: the clip, then the name and size on its own line, wrapping as one block beside the clip. */
.qm-chat-file { display: flex; align-items: flex-start; gap: 4px; white-space: normal; overflow-wrap: anywhere; }
.qm-chat-file > .mud-icon-root { flex: none; margin-top: 2px; }
.qm-chat-file > span { min-width: 0; }
/* Marks on a phone (UC-ATT-08): the date and the quality share the first line, the lesson and its note take the full width below. */
@media (max-width: 599.98px) {
    /* As specific as MudBlazor's own simple-table rules, which otherwise keep the table layout. */
    .qm-marks-table.mud-simple-table table, .qm-marks-table.mud-simple-table table tbody { display: block; }
    .qm-marks-table.mud-simple-table table * tr { display: grid; grid-template-columns: 1fr auto; align-items: center; border-bottom: 1px solid var(--mud-palette-table-lines); }
    .qm-marks-table.mud-simple-table table * tr > td { border-bottom: none; }
    .qm-marks-table.mud-simple-table table * tr > td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; padding-top: 0; }
    /* A student's attendance the same way: the date and the status on one line, the lesson below (the review's PORTAL.I15). */
    .qm-attendance-table.mud-simple-table table, .qm-attendance-table.mud-simple-table table tbody { display: block; }
    .qm-attendance-table.mud-simple-table table * tr { display: grid; grid-template-columns: 1fr auto; align-items: center; border-bottom: 1px solid var(--mud-palette-table-lines); }
    .qm-attendance-table.mud-simple-table table * tr > td { border-bottom: none; }
    .qm-attendance-table.mud-simple-table table * tr > td:nth-child(3) { grid-column: 1 / -1; grid-row: 2; padding-top: 0; }
    .qm-attendance-table.mud-simple-table table * tr > td:nth-child(3):empty { display: none; }
}

/* Phase 4 — expenses, petty cash, compensation, reports */
.qm-removed { text-decoration: line-through; opacity: 0.7; }
/* Wide enough for "30 Sep 2026" beside a clear button and the calendar, and for "September 2026" in a month select. */
.qm-field-date { width: 210px; flex: 0 0 auto; }
.qm-report-indent { padding-left: 24px !important; }
.qm-report-total td { font-weight: 600; }

/* The academy history's filters (UC-LIVE-14): side by side on desktop, two to a row on a phone. Sized on the flex items
   themselves — MudBlazor puts a Class on an inner element. */
.qm-filters > * { width: 180px; flex: 0 0 auto; }
@media (max-width: 599.98px) { .qm-filters > * { width: calc(50% - 6px); } }
/* A list's filters as equal columns: a filter that wraps keeps its column's width instead of stretching across a row of
   its own, and a filter that comes and goes (a teacher list) does not resize the others. Two to a row on a phone. */
.qm-filter-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.qm-filter-row > * { min-width: 0; width: 100%; }
/* On a phone the first field, the search, takes the whole row so its hint is never cut (the review's PUB.i35). */
@media (max-width: 599.98px) { .qm-filter-row { grid-template-columns: 1fr 1fr; } .qm-filter-row > :first-child { grid-column: 1 / -1; } }
.qm-row-open { width: 40px; text-align: right; color: var(--mud-palette-text-secondary); }

/* A recording in the app's player (UC-LIVE-10): the frame fits the dialog, black behind the picture. */
.qm-recording-player { display: block; width: 100%; max-height: 70vh; background: #000; border-radius: 8px; }

/* The ringing overlay (UC-LIVE-06): bottom-right on desktop; full width above the portal's tab bar on a phone. */
.qm-incoming-call { position: fixed; right: 24px; bottom: 24px; width: 360px; max-width: calc(100vw - 32px); padding: 16px; z-index: 1450; }
/* MudBlazor gives every child of a layout with a persistent drawer the drawer's width as a left margin; on a phone that
   pushed the overlay off the screen. */
.mud-layout > .qm-incoming-call { margin: 0 !important; }
.qm-incoming-call-icon { width: 48px; height: 48px; flex: 0 0 auto; border-radius: 50%; display: flex; align-items: center; justify-content: center;
                         background: var(--mud-palette-success); color: var(--mud-palette-success-text); animation: qm-ring 1.4s ease-in-out infinite; }
@keyframes qm-ring { 0%, 100% { box-shadow: 0 0 0 0 rgba(46, 125, 50, .45); } 50% { box-shadow: 0 0 0 10px rgba(46, 125, 50, 0); } }
@media (prefers-reduced-motion: reduce) { .qm-incoming-call-icon { animation: none; } }
@media (max-width: 599.98px) {
    .qm-incoming-call { left: 8px; right: auto; bottom: 8px; width: calc(100vw - 16px); max-width: none; box-sizing: border-box; }
}
@media (max-width: 959.98px) {
    .qm-portal .qm-incoming-call { bottom: calc(var(--qm-bottom-nav-height) + 8px); }
}

/* Phase 6 — certificates. The page is paper, always light (design system §10); it keeps its shape while it loads. */
.qm-certificate-image { display: block; width: 100%; height: auto; aspect-ratio: 842 / 595; border-radius: 8px; background: #FFFDF6;
                        border: 1px solid var(--mud-palette-lines-default); }
.qm-design-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 599.98px) { .qm-design-options { grid-template-columns: 1fr; } }
.qm-design-option { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; text-align: left; cursor: pointer; font: inherit;
                    color: var(--mud-palette-text-primary); background: var(--mud-palette-surface); border: 1px solid var(--mud-palette-lines-default); border-radius: 10px; }
.qm-design-option:hover { border-color: var(--mud-palette-primary); }
.qm-design-option:focus-visible { outline: 2px solid var(--mud-palette-primary); outline-offset: 2px; }
.qm-design-selected { border: 2px solid var(--mud-palette-primary); padding: 11px; }
.qm-design-name { font-weight: 600; }
.qm-design-description { font-size: .8125rem; color: var(--mud-palette-text-secondary); }
/* Each colour scheme's primary and accent, as Infrastructure/Documents/CertificatePalette draws them (client review CR-52):
   the swatches below take the scheme chosen on the form. */
.qm-cert-emerald, .qm-design-options { --qm-cert-primary: #0F5E4C; --qm-cert-accent: #C9A227; }
.qm-cert-gold { --qm-cert-primary: #6B4F12; --qm-cert-accent: #D4AF37; }
.qm-cert-navy { --qm-cert-primary: #1B3260; --qm-cert-accent: #B8963A; }
.qm-cert-maroon { --qm-cert-primary: #6E1A2B; --qm-cert-accent: #C9A227; }
.qm-cert-charcoal { --qm-cert-primary: #2F3437; --qm-cert-accent: #8E959B; }
.qm-design-swatch { display: block; width: 100%; height: 56px; border-radius: 4px; background: #FFFDF6; margin-bottom: 4px; }
.qm-design-classic { border: 3px double var(--qm-cert-accent); }
.qm-design-modern { background: linear-gradient(to right, var(--qm-cert-primary) 0 18%, var(--qm-cert-accent) 18% 19%, #FFFFFF 19%); border: 1px solid var(--mud-palette-lines-default); }
.qm-design-ornate { border: 3px solid var(--qm-cert-primary); box-shadow: inset 0 0 0 2px #FFFDF6, inset 0 0 0 3px var(--qm-cert-accent); }
.qm-design-elegant { border: 1px solid var(--qm-cert-primary); border-radius: 12px; box-shadow: inset 0 0 0 3px #FFFDF6, inset 0 0 0 4px var(--qm-cert-accent); }
.qm-design-minimal { background: linear-gradient(to bottom, var(--qm-cert-primary) 0 7px, var(--qm-cert-accent) 7px 9px, #FFFFFF 9px calc(100% - 9px),
                     var(--qm-cert-accent) calc(100% - 9px) calc(100% - 7px), var(--qm-cert-primary) calc(100% - 7px)); border: 1px solid var(--mud-palette-lines-default); }
.qm-design-geometric { border: 9px solid var(--qm-cert-primary); outline: 2px dotted var(--qm-cert-accent); outline-offset: -6px; box-shadow: inset 0 0 0 2px #FFFDF6, inset 0 0 0 3px var(--qm-cert-accent); }
.qm-colour-options { display: flex; flex-wrap: wrap; gap: 8px; }
.qm-colour-option { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; cursor: pointer; font: inherit; color: var(--mud-palette-text-primary);
                    background: var(--mud-palette-surface); border: 1px solid var(--mud-palette-lines-default); border-radius: 999px; }
.qm-colour-option:hover { border-color: var(--mud-palette-primary); }
.qm-colour-option:focus-visible { outline: 2px solid var(--mud-palette-primary); outline-offset: 2px; }
.qm-colour-selected { border: 2px solid var(--mud-palette-primary); padding: 5px 13px 5px 5px; }
.qm-colour-dot { display: block; width: 22px; height: 22px; border-radius: 50%;
                 background: radial-gradient(circle, var(--qm-cert-primary) 0 52%, var(--qm-cert-accent) 52% 68%, var(--qm-cert-primary) 68%); }

/* The weekly schedule's booked/capacity chip, a link to the teacher's time slots (client review CR-33). */
.qm-chip-link { display: inline-flex; text-decoration: none; border-radius: 16px; }
.qm-chip-link .mud-chip { cursor: pointer; }
.qm-chip-link:focus-visible { outline: 2px solid var(--mud-palette-primary); outline-offset: 2px; }

/* The register's dictation language, beside All present (client review CR-34). */
.qm-dictation-language { min-width: 160px; max-width: 200px; }

/* The account menu's activator: the initials avatar as a bare button. */
.qm-avatar-button { background: none; border: 0; padding: 0; cursor: pointer; border-radius: 50%; line-height: 0; }
.qm-avatar-button:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

/* The notification bell's unread count, on the bell's top-right inside the app bar. */
.qm-bell { position: relative; display: inline-flex; }
.qm-bell-count { position: absolute; top: 6px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; box-sizing: border-box;
                 background: var(--mud-palette-secondary); color: var(--mud-palette-secondary-text); font-size: 11px; font-weight: 600;
                 line-height: 18px; text-align: center; pointer-events: none; }

/* A receipt or challan number never breaks across lines (R-2026-00001). */
.qm-cell-lines a { white-space: nowrap; }

/* The academy group (decision 51): an unread count beside its menu entry; a thread that opens at its newest message (a
   column-reverse scroller keeps the bottom in view as messages arrive), day separators, each sender's name and kind, and
   reactions under a message. The bubbles are the conversations' own. */
.qm-nav-count { display: inline-block; margin-left: 8px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; box-sizing: border-box;
                background: var(--mud-palette-secondary); color: var(--mud-palette-secondary-text); font-size: 11px; font-weight: 600;
                line-height: 20px; text-align: center; vertical-align: middle; }
.qm-group-thread { display: flex; flex-direction: column-reverse; height: 60vh; min-height: 280px; overflow-y: auto; }
.qm-group-thread > .qm-chat { max-height: none; overflow: visible; }
.qm-day { align-self: center; margin: 8px 0 4px; padding: 2px 12px; border-radius: 12px; font-size: 12px; background: var(--mud-palette-background-gray); }
.qm-group-msg { display: flex; flex-direction: column; align-items: flex-start; align-self: flex-start; max-width: 85%; min-width: 0; }
.qm-group-msg.qm-mine { align-self: flex-end; align-items: flex-end; }
.qm-group-msg > .qm-bubble { max-width: 100%; }
.qm-group-msg.qm-focus > .qm-bubble { outline: 2px solid var(--mud-palette-secondary); outline-offset: 2px; }
.qm-bubble-sender { font-size: 12px; font-weight: 600; color: var(--mud-palette-primary); }
.qm-bubble-deleted { font-style: italic; opacity: 0.75; }
.qm-group-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 2px; }
.qm-reaction { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 8px; border-radius: 13px; cursor: pointer; font: inherit; font-size: 13px;
               border: 1px solid var(--mud-palette-lines-default); background: var(--mud-palette-surface); color: var(--mud-palette-text-primary); }
.qm-reaction.qm-on { border-color: var(--mud-palette-primary); background: var(--mud-palette-action-default-hover); }
.qm-emoji-row { display: flex; gap: 2px; padding: 4px 8px; }
.qm-emoji { padding: 4px 6px; border: none; border-radius: 8px; background: none; cursor: pointer; font-size: 22px; line-height: 1; }
.qm-emoji:hover, .qm-emoji.qm-on { background: var(--mud-palette-action-default-hover); }
