@import url("https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;600;700;800&display=swap");

/* ==========================================================================
   Design tokens — taken verbatim from samples/qrmenu_loginpage_sample.html so
   the login screen and the dashboard read as one product.
   ========================================================================== */
:root {
    --primary: #941D3E;
    --primary-dark: #72152E;
    --primary-light: #F7E9EE;
    --gold: #B99A58;
    --gold-dark: #8D733C;
    --text: #24313A;
    --muted: #68747C;
    --border: #DCD7D3;
    --surface: #FFFFFF;
    --surface-soft: #FCFAF8;
    --danger: #C52B50;
    --success: #16845D;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
}

body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    font-family: "Tajawal", "Segoe UI", Tahoma, Arial, sans-serif;
    color: var(--text);
    background: var(--surface-soft);
}

button,
input {
    font: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

h1:focus {
    outline: none;
}

/* The sample draws every icon as a stroked path, never a filled one. */
.qm-icon {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ==========================================================================
   Login — animated background
   ========================================================================== */
.login-shell {
    min-height: 100vh;
    background: var(--primary);
}

.animated-background {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.animated-background::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.28;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 54px 54px;
    mask-image: radial-gradient(circle at center, #000 35%, transparent 88%);
}

.animated-background::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 15% 18%, rgba(185, 154, 88, 0.30), transparent 24%),
        radial-gradient(circle at 86% 82%, rgba(255, 255, 255, 0.13), transparent 26%),
        linear-gradient(135deg, rgba(255, 255, 255, .035), transparent 45%);
}

.bubble {
    position: absolute;
    display: block;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow:
        inset 0 0 40px rgba(255, 255, 255, .03),
        0 0 70px rgba(77, 5, 27, .12);
    animation: float 12s ease-in-out infinite;
}

.bubble-one {
    width: 340px;
    height: 340px;
    top: -145px;
    right: -90px;
}

.bubble-two {
    width: 250px;
    height: 250px;
    bottom: -90px;
    left: -65px;
    animation-delay: -4s;
}

.bubble-three {
    width: 105px;
    height: 105px;
    top: 19%;
    left: 13%;
    border-color: rgba(185, 154, 88, 0.35);
    animation-delay: -8s;
}

.floating-code {
    position: absolute;
    width: 122px;
    height: 122px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 9px;
    opacity: 0.12;
    animation: codeFloat 10s ease-in-out infinite;
}

.floating-code i {
    display: block;
    border: 4px solid white;
    border-radius: 6px;
}

.floating-code i:nth-child(2),
.floating-code i:nth-child(4),
.floating-code i:nth-child(6),
.floating-code i:nth-child(8) {
    border: 0;
    background: var(--gold);
    transform: scale(.42);
}

.code-one {
    top: 12%;
    left: 7%;
    transform: rotate(-10deg);
}

.code-two {
    right: 8%;
    bottom: 12%;
    transform: rotate(12deg) scale(.82);
    animation-delay: -5s;
    animation-name: codeFloatTwo;
}

/* ==========================================================================
   Login — card
   ========================================================================== */
.page {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 30px 18px;
}

.login-card {
    position: relative;
    width: min(100%, 410px);
    padding: 26px 26px 22px;
    border: 3px solid #FFFFFF;
    border-radius: 26px;
    background: #FFFFFF;
    box-shadow:
        0 28px 70px rgba(50, 4, 20, .34),
        0 0 0 7px rgba(255, 255, 255, 0.10);
}

.login-card::before {
    content: "";
    position: absolute;
    inset: 7px;
    z-index: 0;
    border: 1px solid rgba(148, 29, 62, 0.12);
    border-radius: 18px;
    pointer-events: none;
}

.brand,
.heading,
.login-card form,
.footer {
    position: relative;
    z-index: 1;
}

.brand {
    width: fit-content;
    max-width: 100%;
    margin: 0 auto 17px;
    padding: 7px 12px;
    border: 1px solid #E8E1DE;
    border-radius: 13px;
    background: #FFFFFF;
    box-shadow: 0 8px 22px rgba(36, 49, 58, 0.07);
}

.brand img {
    display: block;
    width: 165px;
    max-width: 62vw;
    max-height: 58px;
    object-fit: contain;
}

.heading {
    margin-bottom: 21px;
    text-align: center;
}

.heading h1 {
    margin: 0;
    color: var(--text);
    font-size: 29px;
    line-height: 1.2;
}

.login-card form {
    display: grid;
    gap: 15px;
}

.field {
    display: grid;
    gap: 7px;
}

.field label,
.label-row {
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
}

.label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.forgot {
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    background: none;
    border: 0;
    padding: 0;
}

.forgot:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.input-control {
    position: relative;
}

.input-control input {
    width: 100%;
    height: 50px;
    padding: 0 44px 0 42px;
    border: 1.5px solid var(--border);
    border-radius: 13px;
    outline: none;
    color: var(--text);
    background: var(--surface-soft);
    caret-color: var(--primary);
    transition:
        border-color .2s ease,
        box-shadow .2s ease,
        background .2s ease;
}

.input-control input::placeholder {
    color: #9A9390;
    opacity: 1;
}

.input-control input:hover {
    border-color: #BFB6B1;
    background: #FFFFFF;
}

.input-control input:focus {
    border-color: var(--primary);
    background: #FFFFFF;
    box-shadow: 0 0 0 4px rgba(148, 29, 62, .12);
}

.input-control.has-error input {
    border-color: var(--danger);
    background: #FFF8FA;
    box-shadow: 0 0 0 4px rgba(197, 43, 80, .09);
}

.input-icon {
    position: absolute;
    top: 50%;
    right: 14px;
    width: 18px;
    height: 18px;
    color: var(--primary);
    transform: translateY(-50%);
    pointer-events: none;
}

.input-icon svg,
.password-toggle svg {
    width: 100%;
    height: 100%;
}

.password-toggle {
    position: absolute;
    top: 50%;
    left: 10px;
    width: 33px;
    height: 33px;
    display: grid;
    place-items: center;
    padding: 7px;
    border: 0;
    border-radius: 9px;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    transform: translateY(-50%);
    transition: color .2s ease, background .2s ease;
}

.password-toggle:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.error {
    display: block;
    min-height: 14px;
    color: var(--danger);
    font-size: 11px;
    font-weight: 700;
}

.remember {
    width: fit-content;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}

.remember input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.check-box {
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    border: 1.5px solid #BFB6B1;
    border-radius: 5px;
    color: white;
    background: white;
    transition: background .2s ease, border-color .2s ease;
}

.check-box svg {
    width: 13px;
    opacity: 0;
    transform: scale(.6);
    transition: opacity .2s ease, transform .2s ease;
}

.remember input:checked + .check-box {
    border-color: var(--primary);
    background: var(--primary);
}

.remember input:checked + .check-box svg {
    opacity: 1;
    transform: scale(1);
}

.login-button {
    position: relative;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    overflow: hidden;
    border: 2px solid var(--primary);
    border-radius: 13px;
    color: #FFFFFF;
    background: var(--primary);
    box-shadow: 0 12px 24px rgba(148, 29, 62, .28);
    cursor: pointer;
    font-weight: 800;
    transition:
        transform .2s ease,
        background .2s ease,
        box-shadow .2s ease;
}

.login-button::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg,
        transparent 25%,
        rgba(255, 255, 255, .24),
        transparent 75%);
    transform: translateX(110%);
    transition: transform .65s ease;
}

.login-button:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(113, 21, 46, .34);
}

.login-button:hover::before {
    transform: translateX(-110%);
}

.login-button:active {
    transform: translateY(0);
}

.login-button:focus-visible {
    outline: 4px solid rgba(185, 154, 88, .36);
    outline-offset: 3px;
}

.login-button:disabled {
    cursor: wait;
    opacity: .86;
}

.button-label,
.button-arrow {
    position: relative;
    z-index: 1;
}

.button-arrow {
    width: 19px;
    height: 19px;
}

.loader {
    position: relative;
    z-index: 1;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, .4);
    border-top-color: #FFFFFF;
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

.security {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: var(--muted);
    font-size: 11px;
}

.security svg {
    width: 16px;
    color: var(--gold-dark);
}

.form-alert {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 13px;
    border: 1px solid rgba(197, 43, 80, .22);
    border-radius: 12px;
    color: var(--danger);
    background: #FFF8FA;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.6;
}

.form-alert svg {
    width: 18px;
    flex: 0 0 auto;
}

.footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin-top: 21px;
    color: #817975;
    font-size: 11px;
}

.footer a {
    color: var(--primary);
    font-weight: 700;
}

.footer a:hover {
    text-decoration: underline;
}

.footer-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #BFB6B1;
}

@keyframes float {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(22px, -18px, 0) scale(1.06); }
}

@keyframes codeFloat {
    0%, 100% { transform: translateY(0) rotate(-10deg); }
    50% { transform: translateY(-18px) rotate(-4deg); }
}

@keyframes codeFloatTwo {
    0%, 100% { transform: translateY(0) rotate(12deg) scale(.82); }
    50% { transform: translateY(18px) rotate(6deg) scale(.87); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 520px) {
    .page { padding: 18px 12px; }

    .login-card {
        width: min(100%, 390px);
        padding: 22px 18px 18px;
        border-width: 2px;
        border-radius: 22px;
    }

    .brand { margin-bottom: 15px; }
    .brand img { width: 150px; }
    .heading { margin-bottom: 18px; }
    .heading h1 { font-size: 26px; }
    .input-control input, .login-button { height: 49px; }

    .floating-code { opacity: .08; transform: scale(.7); }
    .code-one { top: 3%; left: -30px; }
    .code-two { right: -35px; bottom: 3%; }
}

@media (max-height: 690px) and (min-width: 521px) {
    .page { padding-block: 15px; }
    .login-card { padding-top: 20px; padding-bottom: 17px; }
    .brand { margin-bottom: 12px; }
    .brand img { width: 148px; }
    .heading { margin-bottom: 15px; }
    .heading h1 { font-size: 25px; }
    .login-card form { gap: 12px; }
    .input-control input, .login-button { height: 47px; }
    .footer { margin-top: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* ==========================================================================
   Shell — MudBlazor surfaces pulled onto the same palette
   ========================================================================== */
.qm-appbar {
    background: var(--surface) !important;
    color: var(--text) !important;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(36, 49, 58, .05) !important;
}

.qm-appbar-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.25;
}

.qm-appbar-subtitle {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
}

.qm-drawer {
    background: var(--primary) !important;
    border-left: 1px solid rgba(255, 255, 255, .08) !important;
}

.qm-drawer-brand {
    display: grid;
    place-items: center;
    padding: 18px 16px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.qm-drawer-brand img {
    width: 152px;
    max-height: 48px;
    object-fit: contain;
    padding: 8px 11px;
    border-radius: 12px;
    background: #FFFFFF;
}

.qm-nav-section {
    margin: 15px 20px 5px;
    color: rgba(255, 255, 255, .50);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .05em;
}

.qm-drawer .mud-nav-link {
    margin: 3px 10px;
    padding: 10px 14px !important;
    border-radius: 12px;
    color: rgba(255, 255, 255, .84) !important;
    font-size: 14px;
    font-weight: 600;
    transition: background .18s ease, color .18s ease;
}

.qm-drawer .mud-nav-link:hover {
    background: rgba(255, 255, 255, .10) !important;
    color: #FFFFFF !important;
}

.qm-drawer .mud-nav-link.active {
    color: var(--primary) !important;
    background: #FFFFFF !important;
    box-shadow: 0 8px 20px rgba(50, 4, 20, .22);
}

.qm-drawer .mud-nav-link .mud-icon-root {
    color: rgba(255, 255, 255, .78);
}

.qm-drawer .mud-nav-link.active .mud-icon-root {
    color: var(--primary) !important;
}

.qm-drawer .mud-nav-group > .mud-nav-link {
    font-weight: 700;
}

.qm-drawer .mud-nav-group .mud-collapse-container .mud-nav-link {
    font-size: 13px;
    font-weight: 500;
}

.qm-drawer .mud-navgroup-icon {
    color: rgba(255, 255, 255, .7);
}

.qm-drawer-footer {
    padding: 14px 16px;
    border-top: 1px solid rgba(255, 255, 255, .12);
    color: rgba(255, 255, 255, .60);
    font-size: 11px;
    text-align: center;
}

.qm-content {
    background: var(--surface-soft);
}

.qm-page-title {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
}

.qm-page-subtitle {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--muted);
}

.qm-card {
    border: 1px solid var(--border) !important;
    border-radius: 16px !important;
    background: var(--surface);
    box-shadow: 0 6px 18px rgba(36, 49, 58, .05) !important;
}

.qm-stat-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.15;
}

.qm-stat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
}

.qm-stat-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: var(--primary-light);
    color: var(--primary);
}

.qm-user-chip {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 12px 5px 6px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-soft);
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease;
}

.qm-user-chip:hover {
    border-color: #BFB6B1;
    background: #FFFFFF;
}

.qm-user-name {
    font-size: 12px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.25;
}

.qm-user-role {
    font-size: 10px;
    font-weight: 600;
    color: var(--muted);
}

/* ==========================================================================
   Blazor plumbing, restyled and translated
   ========================================================================== */
#blazor-error-ui {
    color-scheme: light only;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    display: none;
    box-sizing: border-box;
    padding: 12px 20px;
    color: #FFFFFF;
    background: var(--danger);
    box-shadow: 0 -4px 18px rgba(43, 5, 20, .24);
    font-size: 13px;
    font-weight: 600;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    left: 0.9rem;
    top: 0.7rem;
}

#blazor-error-ui .reload {
    color: #FFFFFF;
    text-decoration: underline;
}

.blazor-error-boundary {
    padding: 1rem 1.25rem;
    color: white;
    background: var(--danger);
    border-radius: 12px;
}

.blazor-error-boundary::after {
    content: "حدث خطأ غير متوقع.";
}

/* ==========================================================================
   Boot splash — the first thing painted, before the WebAssembly runtime loads.
   Same palette and card treatment as the login screen so the app never shows a
   frame that looks like it belongs to a different product.
   ========================================================================== */
.qm-boot {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background: var(--primary);
}

.qm-boot-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 54px 54px;
    mask-image: radial-gradient(circle at center, #000 35%, transparent 88%);
    opacity: .28;
}

.qm-boot-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 15% 18%, rgba(185, 154, 88, 0.30), transparent 24%),
        radial-gradient(circle at 86% 82%, rgba(255, 255, 255, 0.13), transparent 26%);
}

.qm-boot-card {
    position: relative;
    z-index: 1;
    width: min(100%, 360px);
    padding: 30px 26px 26px;
    text-align: center;
    border: 3px solid var(--surface);
    border-radius: 26px;
    background: var(--surface);
    box-shadow: 0 26px 60px rgba(20, 10, 14, 0.30);
    animation: qm-boot-in .45s ease-out both;
}

.qm-boot-logo {
    width: fit-content;
    margin: 0 auto 20px;
    padding: 7px 12px;
    border: 1px solid #E8E1DE;
    border-radius: 13px;
    background: var(--surface);
    box-shadow: 0 8px 22px rgba(36, 49, 58, 0.07);
}

.qm-boot-logo img {
    display: block;
    width: 155px;
    max-width: 60vw;
    max-height: 54px;
    object-fit: contain;
}

.qm-boot-ring {
    position: relative;
    width: 92px;
    height: 92px;
    margin: 0 auto 16px;
}

.loading-progress {
    display: block;
    width: 100%;
    height: 100%;
}

.loading-progress circle {
    fill: none;
    stroke: var(--primary-light);
    stroke-width: 7;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

/* Blazor feeds the download percentage in as a custom property; the dash array
   turns it into the filled arc. 2πr ≈ 264 for r=42. */
.loading-progress circle:last-child {
    stroke: var(--primary);
    stroke-linecap: round;
    stroke-dasharray: calc(2.64 * var(--blazor-load-percentage, 0%)), 500;
    transition: stroke-dasharray 0.15s ease-in-out;
}

.qm-boot-percent {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--primary);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .3px;
}

.qm-boot-percent::after {
    content: var(--blazor-load-percentage-text, "");
}

.qm-boot-title {
    margin: 0 0 5px;
    color: var(--text);
    font-size: 19px;
    font-weight: 800;
}

.qm-boot-subtitle {
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 13px;
}

/* Indeterminate sweep. It runs the whole time, so the card still reads as alive
   during the stretch after the download finishes and the runtime is starting. */
.qm-boot-bar {
    height: 4px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--primary-light);
}

.qm-boot-bar span {
    display: block;
    width: 40%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), var(--gold));
    animation: qm-boot-sweep 1.4s ease-in-out infinite;
}

.qm-boot-footer {
    position: absolute;
    z-index: 1;
    bottom: 22px;
    color: rgba(255, 255, 255, .72);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
}

@keyframes qm-boot-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

@keyframes qm-boot-sweep {
    0% { transform: translateX(-110%); }
    100% { transform: translateX(260%); }
}

/* ==========================================================================
   Tables, dialogs and detail surfaces
   ========================================================================== */
.qm-table .mud-table-head th {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    background: var(--surface-soft);
    border-bottom: 1px solid var(--border);
}

.qm-table .mud-table-body td {
    border-bottom: 1px solid #F0ECEA;
    font-size: 13px;
}

.qm-table .mud-table-row:hover {
    background: var(--surface-soft) !important;
}

.qm-cell-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.35;
}

.qm-cell-sub {
    font-size: 11px;
    color: var(--muted);
}

.qm-cell-muted {
    font-size: 12px;
    color: #A39B97;
}

.qm-text-danger { color: var(--danger); }
.qm-text-warn { color: var(--gold-dark); }

/* Stacked-card mode below the breakpoint: the label sits opposite its value. */
.qm-table .mud-table-cell.mud-table-cell-custom-group,
.qm-table tbody.mud-table-smalldevice-layout td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.qm-table tbody.mud-table-smalldevice-layout tr {
    border: 1px solid var(--border);
    border-radius: 14px;
    margin-bottom: 10px;
    display: block;
    padding: 4px 2px;
    background: var(--surface);
}

.qm-empty {
    display: grid;
    place-items: center;
    gap: 6px;
    padding: 48px 16px;
    text-align: center;
}

.qm-empty-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text);
}

.qm-empty-sub {
    font-size: 12px;
    color: var(--muted);
}

.qm-dialog-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
}

.qm-form-section {
    margin: 22px 0 12px;
    padding-inline-start: 10px;
    border-inline-start: 3px solid var(--primary);
    color: var(--text);
    font-weight: 800;
}

.qm-form-section:first-child {
    margin-top: 0;
}

.qm-inset {
    border: 1px solid var(--border) !important;
    border-radius: 12px !important;
    background: var(--surface-soft) !important;
}

.qm-detail-name {
    font-size: 17px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.3;
}

.qm-detail-sub {
    font-size: 12px;
    color: var(--muted);
}

.qm-detail-link {
    font-size: 12px;
    color: var(--primary);
    word-break: break-all;
}

.qm-detail-tile {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-soft);
    height: 100%;
}

.qm-detail-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--muted);
}

.qm-detail-value {
    margin-top: 2px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.qm-usage {
    margin-bottom: 12px;
}

.qm-usage-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
}

.qm-usage-count {
    font-size: 11px;
    color: var(--muted);
}

.qm-qr-wrap {
    display: grid;
    place-items: center;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #FFFFFF;
}

.qm-qr {
    width: 240px;
    max-width: 100%;
    height: auto;
    image-rendering: pixelated;
}

/* Codes, IPs and timestamps read better fixed-width and LTR inside an RTL page. */
.qm-mono {
    font-family: "SFMono-Regular", Menlo, Consolas, monospace;
    direction: ltr;
    display: inline-block;
    unicode-bidi: embed;
}

.qm-struck {
    text-decoration: line-through;
    color: var(--muted);
}

/* Revenue report — invoiced as the track, collected filled over it. */
.qm-bucket {
    padding: 10px 0;
    border-bottom: 1px solid #F0ECEA;
}

.qm-bucket:last-child {
    border-bottom: 0;
}

.qm-bar-track {
    position: relative;
    height: 10px;
    border-radius: 999px;
    background: #F1ECEA;
    overflow: hidden;
}

.qm-bar-invoiced,
.qm-bar-collected {
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    height: 100%;
    border-radius: 999px;
}

.qm-bar-invoiced {
    background: rgba(148, 29, 62, .22);
}

.qm-bar-collected {
    background: var(--primary);
}

/* ==========================================================================
   Readability and dialog layout
   ========================================================================== */

/* Tables sit at 14px — the 13px default was too small for day-long use. */
.qm-table .mud-table-head th {
    font-size: 13px;
}

.qm-table .mud-table-body td,
.qm-table .mud-table-body td .mud-typography {
    font-size: 14px;
}

.qm-table .mud-table-body td .mud-chip {
    font-size: 12px;
}

.qm-cell-title {
    font-size: 14px;
}

.qm-cell-sub {
    font-size: 12.5px;
}

.qm-cell-muted {
    font-size: 13px;
}

/* Stacked-card mode: the DataLabel is the row's heading, so it matches the value. */
.qm-table tbody.mud-table-smalldevice-layout td:before {
    font-size: 13px;
    font-weight: 700;
}

/* Every dialog's action buttons sit centred, with room to breathe. */
.mud-dialog-actions {
    justify-content: center !important;
    gap: 10px;
    padding-bottom: 18px !important;
}

.mud-dialog-actions .mud-button-root {
    min-width: 118px;
}

/* ==========================================================================
   Owner surfaces — theme preview and the working-hours week
   ========================================================================== */
.qm-preview {
    padding: 14px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.qm-preview-header {
    margin: -14px -14px 12px;
    padding: 14px;
    text-align: center;
}

.qm-preview-search {
    padding: 9px 12px;
    margin-bottom: 10px;
    border: 1px solid rgba(0, 0, 0, .12);
    font-size: 12px;
    opacity: .6;
}

.qm-preview-chip {
    display: inline-block;
    padding: 5px 12px;
    margin-bottom: 10px;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.qm-preview-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    margin-bottom: 8px;
    border: 1px solid rgba(0, 0, 0, .08);
    font-size: 13px;
}

.qm-preview-thumb {
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    background: rgba(0, 0, 0, .07);
}

.qm-day-row {
    display: grid;
    grid-template-columns: 110px 130px 1fr;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #F0ECEA;
}

.qm-day-row:last-of-type {
    border-bottom: 0;
}

.qm-day-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

@media (max-width: 700px) {
    .qm-day-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}

/* ==========================================================================
   Image upload — the preview box keeps its size whether or not an image has
   loaded, so a form does not jump as thumbnails arrive.
   ========================================================================== */
.qm-upload-body {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.qm-upload-preview {
    flex: 0 0 auto;
    width: 104px;
    height: 104px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px dashed var(--border);
    border-radius: 12px;
    background: var(--surface-soft);
}

.qm-upload-preview-wide {
    width: 190px;
    height: 104px;
}

.qm-upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.qm-upload-empty {
    color: var(--border);
}

.qm-upload-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    min-width: 0;
}

.qm-upload-hint {
    font-size: 11px;
    line-height: 1.6;
    color: var(--muted);
}

/* The thumbnail column in the items and categories tables. */
.qm-row-thumb {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    overflow: hidden;
    border-radius: 10px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    display: grid;
    place-items: center;
}

.qm-row-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.qm-row-thumb .mud-icon-root {
    color: var(--border);
}

@media (max-width: 600px) {
    .qm-upload-body {
        flex-direction: column;
    }
}
