html, body {
    font-family: 'Cairo', 'Tajawal', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    min-height: 100%;
}

body {
    margin: 0;
    background: #faf8fc;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background: radial-gradient(circle at top right, #eee9f6 0, #faf8fc 44%, #eef3f2 100%);
}

.auth-card {
    width: min(100%, 430px);
    border-radius: 20px;
}

.auth-card__brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.app-shell {
    min-height: 100vh;
    background:
        radial-gradient(circle at 100% 0, rgba(114, 86, 165, .06), transparent 32rem),
        #faf8fc;
}

.app-bar {
    box-shadow: inset 0 -1px rgba(255, 255, 255, .12);
    padding-inline: 12px;
}

.app-bar__brand,
.drawer-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-bar__brand > .mud-icon-root {
    font-size: 30px;
}

.app-bar__subtitle {
    color: rgba(255, 255, 255, .72) !important;
}

.app-bar__branch {
    border-color: rgba(255, 255, 255, .45) !important;
    color: #fff !important;
}

.app-bar__avatar {
    margin-inline-start: 8px;
}

.app-drawer {
    border-inline-start: 1px solid #e3dded;
    background: rgba(255, 255, 255, .98) !important;
}

.drawer-profile {
    width: 100%;
    padding-block: 8px;
}

.nav-section-label {
    display: block;
    color: #71677e;
    padding: 18px 20px 4px;
    letter-spacing: .08em;
}

.app-drawer .mud-nav-link {
    margin: 2px 10px;
    border-radius: 10px;
}

.app-drawer .mud-nav-link.active {
    background: #eee9f6;
    color: #5a407d;
    font-weight: 700;
}

.app-content {
    width: min(100%, 1600px);
    margin-inline: auto;
    padding: 28px 32px 40px;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.page-header__eyebrow {
    color: #7256a5;
    font-weight: 700;
    margin-bottom: 4px;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.patient-hero {
    padding: 24px;
    border: 1px solid #e3dded;
    border-radius: 20px;
    background: linear-gradient(135deg, #fff 0%, #f5f1f9 100%);
    box-shadow: 0 12px 32px rgba(71, 48, 98, .07);
}

.patient-hero__identity,
.patient-info-card,
.insurance-summary {
    display: flex;
    align-items: center;
    gap: 14px;
}

.patient-hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    color: #71677e;
    font-size: .875rem;
}

.patient-info-card {
    min-height: 92px;
    border: 1px solid #e3dded;
    border-radius: 14px;
}

.patient-info-card .mud-icon-root {
    font-size: 30px;
}

.insurance-summary {
    justify-content: space-between;
    border: 1px solid #e3dded;
    border-radius: 14px;
    background: #f5f1f9;
}

.insured-lookup {
    border: 1px solid #e3dded;
    border-radius: 18px;
    background: linear-gradient(135deg, #f5f1f9, #fff);
}

.integration-note {
    color: #71677e;
}

.patient-details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 28px;
}

.patient-details-grid--single {
    grid-template-columns: 1fr;
}

.patient-details-grid > div {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.patient-details-grid span {
    color: #71677e;
    font-size: .75rem;
}

.patient-details-grid b {
    overflow-wrap: anywhere;
    font-size: .9rem;
}

.patient-details-grid__wide {
    grid-column: 1 / -1;
}

.mobile-bottom-nav {
    display: none;
}

.surface-card {
    border: 1px solid #e3dded;
    box-shadow: 0 8px 24px rgba(71, 48, 98, .06) !important;
}

.stat-card {
    position: relative;
    min-height: 132px;
    overflow: hidden;
    border: 1px solid #e3dded;
    box-shadow: 0 8px 24px rgba(71, 48, 98, .06) !important;
}

.stat-card::after {
    content: '';
    position: absolute;
    inset-inline-end: -28px;
    inset-block-end: -38px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--mud-palette-primary) 8%, transparent);
}

.stat-card__icon {
    width: 46px;
    height: 46px;
    border-radius: 14px !important;
}

.metric-positive { color: #2e7d32; }
.metric-warning { color: #b25e00; }
.metric-danger { color: #c62828; }

.data-table-wrap {
    overflow-x: auto;
}

.visit-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    color: #71677e;
    font-size: .82rem;
}

.visits-hero,
.visit-detail-hero {
    margin-bottom: 24px;
}

.visit-metric {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 92px;
    border: 1px solid #e3dded;
    border-radius: 16px;
    background: #fff;
}

.visit-metric .mud-icon-root {
    padding: 10px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #f5f1f9;
}

.visits-toolbar .mud-input-control {
    max-width: 520px;
}

.visit-timeline {
    position: relative;
    display: grid;
    gap: 0;
    max-width: 920px;
    margin-inline: auto;
}

.visit-timeline__item {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
}

.visit-timeline__rail {
    position: relative;
    display: flex;
    justify-content: center;
}

.visit-timeline__rail::after {
    content: '';
    position: absolute;
    inset-block: 0;
    width: 2px;
    background: #dbe9e5;
}

.visit-timeline__item:first-child .visit-timeline__rail::after {
    inset-block-start: 22px;
}

.visit-timeline__item:last-child .visit-timeline__rail::after {
    inset-block-end: calc(100% - 22px);
}

.visit-timeline__marker {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 5px solid #faf8fc;
    border-radius: 50%;
    color: #5a407d;
    background: #eee9f6;
}

.visit-timeline__marker .mud-icon-root {
    font-size: 18px;
}

.visit-card {
    margin-bottom: 18px;
    border: 1px solid #e3dded;
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(71, 48, 98, .05) !important;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.visit-card:hover {
    transform: translateY(-2px);
    border-color: #b9d5cf;
    box-shadow: 0 12px 30px rgba(71, 48, 98, .09) !important;
}

.visit-card__header,
.visit-card__footer,
.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.visit-card__date {
    color: #71677e;
    letter-spacing: 0;
}

.visit-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
    margin-block: 18px;
    color: #71677e;
    font-size: .86rem;
}

.visit-card__meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.visit-card__meta .mud-icon-root {
    font-size: 18px;
}

.visit-card__footer {
    padding-top: 12px;
    border-top: 1px solid #edf2f0;
}

.visit-card__type {
    color: #71677e;
    font-size: .78rem;
}

.visit-empty {
    display: grid;
    place-items: center;
    gap: 10px;
    min-height: 250px;
    text-align: center;
}

.visit-empty > .mud-icon-root {
    font-size: 52px;
}

.visit-summary-card {
    display: grid;
    grid-template-columns: 36px 1fr;
    align-items: center;
    gap: 2px 12px;
    min-height: 108px;
}

.visit-summary-card .mud-icon-root {
    grid-row: 1 / 3;
}

.visit-summary-card span {
    color: #71677e;
    font-size: .75rem;
}

.visit-summary-card b {
    font-size: 1.05rem;
    font-variant-numeric: tabular-nums;
}

.invoice-hero__title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.invoice-hero__title .mud-chip {
    font-weight: 700;
}

.invoice-hero__vat-note {
    color: #71677e;
    margin-top: 6px;
}

.financial-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 10px;
    margin: 0;
}

.financial-breakdown > div {
    border: 1px solid #e3dded;
    border-radius: 12px;
    padding: 12px 14px;
    background: #faf8fc;
}

.financial-breakdown dt {
    font-size: .75rem;
    color: #71677e;
}

.financial-breakdown dd {
    margin: 4px 0 0;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.billing-dialog .mud-dialog-title {
    padding-bottom: 8px;
}

.billing-dialog .mud-dialog-content {
    padding-top: 8px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.billing-live {
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    gap: 24px;
    align-items: start;
}

.billing-live__preview {
    position: static;
}

.preview-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: #30283c;
    font-size: .8rem;
    font-weight: 700;
}

.preview-label__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2e7d32;
    animation: preview-pulse 1.6s ease-out infinite;
}

@keyframes preview-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .35; transform: scale(.8); }
}

.thermal-invoice--live {
    max-width: 340px;
    border: 1px dashed #9fbdb5;
    border-radius: 14px;
    box-shadow: 0 14px 34px rgba(71, 48, 98, .10);
    font-family: 'Cairo', 'Tajawal', Arial, sans-serif;
}

.thermal-invoice--live .thermal-invoice__totals dd,
.thermal-invoice--live .thermal-invoice__grand dd {
    color: #7256a5;
}

.preview-empty {
    display: grid;
    place-items: center;
    gap: 8px;
    margin: 14px 0;
    padding: 26px 12px;
    border: 1px dashed #cbdcd7;
    border-radius: 10px;
    color: #71677e;
    font-size: .78rem;
    text-align: center;
}

@media (max-width: 960px) {
    .billing-live {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .billing-live__preview {
        position: static;
    }

    .thermal-invoice--live {
        max-width: 100%;
    }
}

.billing-section {
    padding: 14px 0;
    border-bottom: 1px dashed #dbe7e3;
}

.billing-section:last-of-type {
    border-bottom: 0;
    padding-bottom: 4px;
}

.billing-section__title {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #30283c;
    margin-bottom: 10px;
}

.billing-section .patient-status-row .mud-chip {
    height: auto;
    padding: 8px 14px;
    text-align: start;
    white-space: normal;
    line-height: 1.5;
}

.status-note {
    margin: 8px 0 0;
    padding: 8px 14px;
    border-radius: 12px;
    font-size: .8rem;
    line-height: 1.6;
}

.status-note--success {
    background: #e7f4ee;
    color: #1f6b46;
}

.status-note--warning {
    background: #fdf3e3;
    color: #8a5a00;
}

.status-note--info {
    background: #e8f2f6;
    color: #155e75;
}

.charge-card-list {
    display: grid;
    gap: 8px;
    margin-top: 8px;
}

.charge-card {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #e3dded;
    border-radius: 14px;
    padding: 10px 14px;
    background: #fff;
    transition: border-color .15s ease, background .15s ease;
}

.charge-card:hover {
    border-color: #b8d8d0;
}

.charge-card--selected {
    border-color: var(--mud-palette-primary);
    background: color-mix(in srgb, var(--mud-palette-primary) 6%, #fff);
}

.charge-card__info {
    flex: 1;
    min-width: 0;
    display: grid;
    gap: 2px;
}

.charge-card__name {
    font-size: .95rem;
}

.charge-card__detail {
    color: #71677e;
    font-size: .78rem;
    font-variant-numeric: tabular-nums;
}

.charge-card__amount {
    text-align: end;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.charge-card__amount small {
    color: #71677e;
    font-weight: 400;
}

.clinical-document-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #71677e;
    font-size: .78rem;
}

.soap-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.soap-card {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 14px;
    min-height: 150px;
    padding: 18px;
    border: 1px solid #e3dded;
    border-radius: 14px;
    background: #faf8fc;
}

.soap-card > span {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    color: #5a407d;
    background: #eee9f6;
    font-weight: 800;
}

.soap-card p,
.clinical-addendums p {
    margin: 8px 0 0;
    color: #30283c;
    line-height: 1.8;
    white-space: pre-wrap;
}

.clinical-signature {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 12px;
    color: #5a407d;
    background: #f5f1f9;
    font-size: .86rem;
}

.clinical-addendums {
    display: grid;
    gap: 12px;
}

.clinical-addendums article {
    padding: 16px;
    border-inline-start: 3px solid #4f8f83;
    border-radius: 10px;
    background: #faf8fc;
}

.clinical-addendums small {
    display: block;
    margin-top: 10px;
    color: #71677e;
}

.payment-dialog {
    max-width: 680px;
}

.payment-dialog__title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.payment-amount-card {
    border: 1px solid #e3dded;
    border-radius: 16px;
    color: #5a407d;
    background: #f5f1f9;
    text-align: center;
}

.payment-amount-card small {
    font-size: .85rem;
}

.payment-method-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.payment-method-card {
    position: relative;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    gap: 3px 10px;
    min-height: 86px;
    padding: 14px;
    border: 1px solid #e3dded;
    border-radius: 14px;
    color: #30283c;
    background: #fff;
    font: inherit;
    text-align: start;
    cursor: pointer;
    transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.payment-method-card:hover,
.payment-method-card:focus-visible {
    border-color: #7256a5;
    outline: none;
    box-shadow: 0 0 0 3px rgba(114, 86, 165, .12);
}

.payment-method-card.is-selected {
    border-color: #5a407d;
    background: #f5f1f9;
}

.payment-method-card > .mud-icon-root:first-child {
    grid-row: 1 / 3;
    color: #5a407d;
    font-size: 28px;
}

.payment-method-card > span {
    font-weight: 700;
}

.payment-method-card > small {
    color: #71677e;
    line-height: 1.4;
}

.payment-method-card__check {
    position: absolute;
    inset-block-start: 8px;
    inset-inline-end: 8px;
    color: #2e7d32;
    font-size: 18px !important;
}

.mada-terminal-status__content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}

.mada-terminal-status__content p {
    margin: 4px 0 0;
}

@media (max-width: 959.98px) {
    .app-content {
        padding: 22px 20px 32px;
    }

    .app-bar__subtitle,
    .app-bar__branch {
        display: none !important;
    }
}

@media (max-width: 599.98px) {
    .app-content {
        padding: 18px 14px calc(92px + env(safe-area-inset-bottom));
    }

    .page-header {
        display: block;
    }

    .page-actions {
        margin-top: 16px;
    }

    .patient-hero,
    .insurance-summary {
        display: block;
    }

    .patient-details-grid {
        grid-template-columns: 1fr;
    }

    .insurance-summary .mud-button-root {
        width: 100%;
        margin-top: 14px;
    }

    .page-actions .mud-button-root {
        flex: 1 1 auto;
    }

    .visit-timeline__item {
        grid-template-columns: 36px minmax(0, 1fr);
    }

    .visit-timeline__marker {
        width: 32px;
        height: 32px;
        border-width: 4px;
    }

    .visit-card__header,
    .visit-card__footer,
    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .visit-card__footer .mud-button-root {
        width: 100%;
        min-height: 44px;
    }

    .soap-grid {
        grid-template-columns: 1fr;
    }

    .payment-method-grid {
        grid-template-columns: 1fr;
    }

    .mada-terminal-status__content {
        align-items: flex-start;
        flex-direction: column;
    }

    .mud-dialog {
        width: calc(100vw - 24px);
        max-width: calc(100vw - 24px);
        margin: 12px;
        max-height: calc(100vh - 24px);
    }

    .mud-dialog-actions {
        flex-wrap: wrap;
    }

    .mobile-bottom-nav {
        position: fixed;
        z-index: 1200;
        inset-inline: 0;
        inset-block-end: 0;
        display: flex;
        justify-content: space-around;
        min-height: calc(68px + env(safe-area-inset-bottom));
        padding: 7px 8px env(safe-area-inset-bottom);
        border-top: 1px solid #e3dded;
        background: rgba(255, 255, 255, .96);
        box-shadow: 0 -8px 24px rgba(71, 48, 98, .1);
        backdrop-filter: blur(14px);
    }

    .mobile-bottom-nav a,
    .mobile-bottom-nav button {
        display: flex;
        flex: 1 1 0;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        min-width: 0;
        border: 0;
        border-radius: 10px;
        color: #71677e;
        background: transparent;
        font: inherit;
        font-size: .7rem;
        text-decoration: none;
    }

    .mobile-bottom-nav a.active {
        color: #5a407d;
        background: #eee9f6;
        font-weight: 700;
    }

    .mobile-bottom-nav .mud-icon-root {
        font-size: 23px;
    }
}

a, .btn-link {
    color: #7256a5;
}

.btn-primary {
    color: #fff;
    background-color: #7256a5;
    border-color: #5a407d;
}

.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 #7256a5;
}

.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;
}
/* لوحة أجهزة النظام — متاحة للمبرمج فقط */
.developer-devices__header {
    align-items: center;
}

.developer-devices__notice {
    border-radius: 14px;
}

.developer-stat {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 104px;
}

.developer-stat > .mud-icon-root {
    width: 44px;
    height: 44px;
    padding: 10px;
    border-radius: 12px;
    background: color-mix(in srgb, currentColor 10%, transparent);
}

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

.developer-device-card {
    padding: 1.25rem;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 18px;
    overflow: hidden;
}

.developer-device-card__top,
.developer-device-card__identity,
.developer-devices__loading,
.developer-devices__empty {
    display: flex;
    align-items: center;
}

.developer-device-card__top {
    justify-content: space-between;
    gap: 1rem;
}

.developer-device-card__identity {
    gap: .75rem;
    min-width: 0;
}

.developer-device-card__icon {
    display: grid;
    place-items: center;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    color: var(--mud-palette-primary);
    background: var(--mud-palette-primary-hover);
    border-radius: 14px;
}

.developer-device-card__session {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .5rem;
    margin: 1.25rem 0;
    padding: .75rem;
    background: var(--mud-palette-background-grey);
    border-radius: 12px;
}

.developer-device-card__session > div {
    display: flex;
    flex-direction: column;
    gap: .2rem;
}

.developer-device-card__session span,
.developer-device-details dt {
    color: var(--mud-palette-text-secondary);
    font-size: .72rem;
}

.developer-device-card__session strong {
    font-size: .88rem;
}

.developer-device-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .85rem 1rem;
    margin: 0;
}

.developer-device-details > div {
    min-width: 0;
}

.developer-device-details dt,
.developer-device-details dd {
    margin: 0;
}

.developer-device-details dd {
    margin-top: .15rem;
    overflow-wrap: anywhere;
    font-size: .88rem;
    font-weight: 600;
}

.developer-device-details__wide {
    grid-column: 1 / -1;
}

.developer-device-card__technical {
    margin: 1rem -1.25rem -1.25rem;
    border-top: 1px solid var(--mud-palette-lines-default);
}

.developer-device-card__agent {
    display: block;
    direction: ltr;
    text-align: left;
    overflow-wrap: anywhere;
}

.developer-devices__loading,
.developer-devices__empty {
    justify-content: center;
    flex-direction: column;
    gap: .75rem;
    min-height: 220px;
    text-align: center;
}

@media (max-width: 959.98px) {
    .developer-device-grid { grid-template-columns: 1fr; }
}

@media (max-width: 599.98px) {
    .developer-devices__header { align-items: stretch; }
    .developer-device-card { padding: 1rem; border-radius: 14px; }
    .developer-device-card__top { align-items: flex-start; }
    .developer-device-card__session { grid-template-columns: 1fr; }
    .developer-device-details { grid-template-columns: 1fr; }
    .developer-device-details__wide { grid-column: auto; }
    .developer-device-card__technical { margin: 1rem -1rem -1rem; }
}
/* قالب حراري للطباعة والمعاينة */
.thermal-invoice { width:var(--receipt-width,58mm); max-width:100%; margin:16px auto; padding:12px; color:#111; background:#fff; border:1px solid #ddd; font:12px/1.55 Tahoma,Arial,sans-serif; box-sizing:border-box; }
.thermal-invoice__brand { text-align:center; }
.thermal-invoice__brand h2 { font-size:16px; margin:4px 0; font-weight:700; }
.thermal-invoice__brand p { margin:2px 0; font-size:10px; overflow-wrap:anywhere; }
.thermal-invoice__mark { font-size:28px; line-height:1; }
.thermal-invoice__logo { max-width: 100%; max-height: 64px; margin: 0 auto 4px; display: block; object-fit: contain; }
.thermal-invoice__title { font-size:13px; text-align:center; border-top:1px dashed #111; border-bottom:1px dashed #111; padding:8px 0; margin:10px 0; font-weight:700; }
.thermal-invoice dl { margin:8px 0; }
.thermal-invoice dl > div { display:flex; justify-content:space-between; gap:8px; margin:4px 0; }
.thermal-invoice dt { font-weight:400; }
.thermal-invoice dd { margin:0; text-align:end; overflow-wrap:anywhere; }
.thermal-invoice__meta { font-size:10px; }
.thermal-invoice__items { width:100%; border-collapse:collapse; font-size:11px; }
.thermal-invoice__items th { text-align:right; border-bottom:1px solid #111; padding:6px 2px; }
.thermal-invoice__items td { vertical-align:top; padding:7px 2px; border-bottom:1px dotted #aaa; }
.thermal-invoice__items small { display:block; font-size:9px; }
.thermal-invoice__items td:last-child { text-align:left; white-space:nowrap; }
.thermal-invoice__totals { font-size:11px; }
.thermal-invoice__grand { font-weight:700; border-top:1px solid #111; border-bottom:1px solid #111; padding:7px 0; }
.thermal-invoice__grand dt { font-weight:700; }
.thermal-invoice__qr { text-align:center; margin:12px 0; }
.thermal-invoice__qr img { width:38mm; height:38mm; max-width:100%; image-rendering:pixelated; }
.thermal-invoice__qr figcaption { font-size:9px; }
.thermal-invoice__footer { border-top:1px dashed #111; padding-top:8px; text-align:center; font-size:10px; }
.thermal-invoice__warning { font-weight:700; font-size:10px; text-align:center; }
@media print { .thermal-invoice { border:0; margin:0; break-inside:avoid; } }
.financial-statements h2 { font-size:1.3rem; font-weight:700; margin-bottom:.5rem; }
.financial-statements h3 { font-size:1rem; font-weight:700; margin-bottom:1rem; }
.erp-report-table { width:100%; border-collapse:collapse; font-size:.85rem; }
.erp-report-table th, .erp-report-table td { padding:.7rem .5rem; border-bottom:1px solid #dce3e4; text-align:right; }
.erp-report-table th { font-weight:700; background:#f6f8f8; }
.erp-report-table td:not(:first-child) { font-variant-numeric:tabular-nums; }
@media print { .financial-statements .surface-card { border:0; box-shadow:none; } .erp-report-table { font-size:10pt; } }

.brand-symbol { width: 44px; height: 44px; object-fit: contain; background: #fff; border-radius: 12px; padding: 4px; flex-shrink: 0; }
.auth-card__brand .brand-symbol { width: 72px; height: 72px; }
.mud-table-head .mud-table-cell, .erp-report-table th { background: #f5f1f9; color: #5a407d; }
.form-control:focus { border-color: #7256a5; box-shadow: 0 0 0 .2rem rgba(114,86,165,.15); }
