/* ==========================================================================
   نظام إدارة الفندق — الهوية البصرية العامة
   Design tokens are lifted from samples/login_page_design.html so the login
   screen and the application shell share one visual language.
   ========================================================================== */

:root {
    --hm-primary: #0B3C7B;
    --hm-primary-dark: #082d5c;
    --hm-primary-mid: #12478d;
    --hm-secondary: #E0565C;
    --hm-accent: #F5C423;
    --hm-ink: #172033;
    --hm-muted: #6b7280;
    --hm-line: #dbe4f0;
    --hm-surface: #ffffff;
    --hm-canvas: #f4f7fc;

    --hm-brand-gradient: linear-gradient(135deg, #0B3C7B 0%, #12478d 52%, #E0565C 100%);
    --hm-panel-gradient: radial-gradient(circle at 18% 16%, rgba(255, 255, 255, .18), transparent 24%),
                         radial-gradient(circle at 82% 82%, rgba(245, 196, 35, .22), transparent 24%),
                         linear-gradient(155deg, #0B3C7B 0%, #144b94 56%, #E0565C 100%);

    --hm-radius: 14px;
    --hm-radius-lg: 22px;
    --hm-shadow-sm: 0 2px 10px rgba(15, 23, 42, .05);
    --hm-shadow-md: 0 10px 30px rgba(15, 23, 42, .08);
    --hm-shadow-lg: 0 28px 70px rgba(15, 23, 42, .14);

    --hm-appbar-height: 68px;
    --hm-drawer-width: 276px;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
    background: var(--hm-canvas);
    color: var(--hm-ink);
    -webkit-font-smoothing: antialiased;
}

/* Arabic numerals stay latin so amounts and dates line up in tables. */
body {
    font-variant-numeric: tabular-nums;
}

a {
    text-decoration: none;
}

::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(11, 60, 123, .18);
    border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(11, 60, 123, .3);
}

/* ==========================================================================
   شاشة الإقلاع — shown by index.html until Blazor takes over
   ========================================================================== */

.app-boot {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: linear-gradient(160deg, #f8fbff 0%, #fdfdfd 48%, #f7f9fc 100%);
}

.app-boot__logo {
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    color: #fff;
    background: var(--hm-brand-gradient);
    box-shadow: 0 16px 34px rgba(11, 60, 123, .22);
}

.app-boot__title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--hm-primary);
}

.app-boot__bar {
    width: 190px;
    height: 4px;
    border-radius: 99px;
    background: rgba(11, 60, 123, .12);
    overflow: hidden;
}

.app-boot__bar span {
    display: block;
    width: 40%;
    height: 100%;
    border-radius: 99px;
    background: var(--hm-brand-gradient);
    animation: hm-boot 1.1s ease-in-out infinite;
}

@keyframes hm-boot {
    0%   { transform: translateX(150%); }
    100% { transform: translateX(-250%); }
}

.app-boot__text {
    font-size: .82rem;
    color: var(--hm-muted);
}

/* ==========================================================================
   شريط الخطأ العام
   ========================================================================== */

#blazor-error-ui {
    display: none;
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 2000;
    padding: 12px 20px;
    font-size: .88rem;
    font-weight: 600;
    color: #fff;
    background: var(--hm-secondary);
    box-shadow: 0 -6px 20px rgba(224, 86, 92, .28);
}

#blazor-error-ui .reload {
    color: #fff;
    text-decoration: underline;
    margin-inline-start: 10px;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    float: left;
}

/* ==========================================================================
   صفحة تسجيل الدخول
   ========================================================================== */

.login-page {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow: hidden;
    background: linear-gradient(160deg, #f8fbff 0%, #fdfdfd 48%, #f7f9fc 100%);
}

.login-page::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 10% 18%, rgba(11, 60, 123, .09), transparent 18%),
        radial-gradient(circle at 88% 16%, rgba(224, 86, 92, .11), transparent 18%),
        radial-gradient(circle at 80% 82%, rgba(245, 196, 35, .13), transparent 20%),
        radial-gradient(circle at 18% 84%, rgba(11, 60, 123, .07), transparent 18%);
}

.login-page::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: .75;
    background:
        linear-gradient(135deg, rgba(11, 60, 123, .035) 25%, transparent 25%) -28px 0/56px 56px,
        linear-gradient(225deg, rgba(224, 86, 92, .03) 25%, transparent 25%) -28px 0/56px 56px,
        linear-gradient(315deg, rgba(245, 196, 35, .04) 25%, transparent 25%) 0 0/56px 56px;
}

.login-shape {
    position: absolute;
    z-index: 0;
    opacity: .85;
    pointer-events: none;
}

.login-shape--one {
    width: 180px;
    height: 180px;
    top: 80px;
    left: 8%;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(11, 60, 123, .14), rgba(245, 196, 35, .14));
    box-shadow: 0 20px 50px rgba(11, 60, 123, .08);
}

.login-shape--two {
    width: 160px;
    height: 160px;
    right: 9%;
    bottom: 82px;
    border-radius: 34px;
    transform: rotate(22deg);
    background: linear-gradient(135deg, rgba(224, 86, 92, .15), rgba(245, 196, 35, .14));
    box-shadow: 0 22px 60px rgba(224, 86, 92, .09);
}

.login-shape--three {
    width: 100px;
    height: 100px;
    top: 16%;
    right: 24%;
    border-radius: 28px;
    transform: rotate(18deg);
    background: rgba(255, 255, 255, .95);
    border: 1px solid rgba(11, 60, 123, .08);
    box-shadow: 0 18px 40px rgba(15, 23, 42, .08);
}

.login-card {
    position: relative;
    z-index: 2;
    width: min(880px, 100%);
    min-height: 540px;
    display: grid;
    grid-template-columns: .94fr 1.06fr;
    border-radius: 26px;
    overflow: hidden;
    background: rgba(255, 255, 255, .96);
    border: 1.5px solid rgba(11, 60, 123, .14);
    box-shadow: var(--hm-shadow-lg);
    animation: hm-slide-in .75s ease-out;
}

@keyframes hm-slide-in {
    from { opacity: 0; transform: translateY(24px) scale(.975); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-brand {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 42px 34px;
    text-align: center;
    color: #fff;
    background: var(--hm-panel-gradient);
}

.login-brand::before {
    content: '';
    position: absolute;
    width: 320px;
    height: 320px;
    top: -120px;
    left: -110px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .18);
    box-shadow: 0 0 0 42px rgba(255, 255, 255, .04), 0 0 0 88px rgba(255, 255, 255, .025);
}

.login-brand::after {
    content: '';
    position: absolute;
    width: 210px;
    height: 210px;
    right: -55px;
    bottom: -96px;
    border-radius: 42px;
    transform: rotate(28deg);
    background: linear-gradient(135deg, rgba(245, 196, 35, .28), rgba(255, 255, 255, .08));
}

.login-brand__inner {
    position: relative;
    z-index: 2;
    width: 100%;
}

.login-brand__logo {
    width: 78px;
    height: 78px;
    margin: 0 auto 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 22px;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .28);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18);
    backdrop-filter: blur(12px);
}

.login-brand__title {
    font-size: 1.82rem;
    font-weight: 800;
    letter-spacing: -.4px;
    margin: 0 0 10px;
}

.login-brand__subtitle {
    font-size: .94rem;
    line-height: 1.9;
    opacity: .9;
    max-width: 320px;
    margin: 0 auto 26px;
}

.login-brand__features {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 284px;
    margin: 0 auto;
}

.login-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--hm-radius);
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .12);
    backdrop-filter: blur(8px);
    text-align: right;
    transition: .25s ease;
}

.login-feature:hover {
    transform: translateX(-5px);
    background: rgba(255, 255, 255, .18);
}

.login-feature__icon {
    color: var(--hm-accent);
    display: inline-flex;
}

.login-feature__text {
    font-size: .9rem;
    font-weight: 600;
}

.login-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 42px 36px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .99), rgba(250, 251, 253, .97));
}

.login-form {
    width: 100%;
    max-width: 330px;
}

.login-form__title {
    color: var(--hm-ink);
    font-size: 1.85rem;
    font-weight: 800;
    margin: 0 0 6px;
}

.login-form__subtitle {
    color: var(--hm-muted);
    font-size: .9rem;
    line-height: 1.8;
    margin: 0 0 26px;
}

.login-form__label {
    display: block;
    color: #334155;
    font-size: .88rem;
    font-weight: 700;
    margin-bottom: 7px;
}

.login-form__field {
    margin-bottom: 18px;
}

.login-form__options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 2px 0 22px;
    font-size: .82rem;
}

.login-form__forgot {
    color: var(--hm-secondary);
    font-weight: 700;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    font-size: .82rem;
    cursor: pointer;
    transition: color .25s ease;
}

.login-form__forgot:hover {
    color: var(--hm-primary);
}

.login-form__footer {
    text-align: center;
    margin-top: 24px;
    color: #94a3b8;
    font-size: .75rem;
    line-height: 1.7;
}

/* The gradient submit button, including the sheen sweep from the sample. */
.login-submit.mud-button-root {
    width: 100%;
    height: 48px;
    border-radius: var(--hm-radius);
    color: #fff;
    font-size: .98rem;
    font-weight: 800;
    position: relative;
    overflow: hidden;
    background: var(--hm-brand-gradient);
    box-shadow: 0 14px 28px rgba(11, 60, 123, .18);
    transition: transform .25s ease, box-shadow .25s ease;
}

.login-submit.mud-button-root::before {
    content: '';
    position: absolute;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .28), transparent);
    transition: right .6s ease;
}

.login-submit.mud-button-root:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px rgba(11, 60, 123, .22);
}

.login-submit.mud-button-root:hover:not(:disabled)::before {
    right: 100%;
}

.login-submit.mud-button-root:disabled {
    opacity: .75;
    color: #fff;
}

@media (max-width: 860px) {
    .login-page {
        padding: 18px;
        overflow: auto;
    }

    .login-card {
        grid-template-columns: 1fr;
        width: min(430px, 100%);
        min-height: auto;
        border-radius: 22px;
    }

    .login-form-panel {
        order: 1;
        padding: 34px 24px;
    }

    .login-brand {
        order: 2;
        padding: 30px 24px;
    }

    .login-brand__features {
        display: none;
    }

    .login-brand__title {
        font-size: 1.55rem;
    }

    .login-brand__subtitle {
        margin-bottom: 0;
    }

    .login-shape {
        display: none;
    }
}

@media (max-width: 430px) {
    .login-page { padding: 10px; }
    .login-card { border-radius: 20px; }
    .login-form-panel { padding: 28px 18px; }
    .login-brand { padding: 24px 18px; }
}

/* ==========================================================================
   حقول MudBlazor — rounded outlined inputs matching the login sample
   ========================================================================== */

.hm-field .mud-input-control-input-container > .mud-input.mud-input-outlined {
    background: #fff;
    border-radius: var(--hm-radius);
}

.hm-field .mud-input-outlined .mud-input-outlined-border {
    border-width: 1.5px;
    border-color: var(--hm-line);
    border-radius: var(--hm-radius);
    transition: border-color .2s ease, box-shadow .2s ease;
}

.hm-field .mud-input-outlined:hover .mud-input-outlined-border {
    border-color: #b9c9e0;
}

.hm-field .mud-input-outlined:focus-within .mud-input-outlined-border {
    border-width: 1.5px;
    border-color: var(--hm-primary);
    box-shadow: 0 0 0 4px rgba(11, 60, 123, .08);
}

.hm-field .mud-input-outlined.mud-input-error .mud-input-outlined-border {
    border-color: var(--hm-secondary);
}

.hm-field .mud-input.mud-input-outlined > input.mud-input-root {
    padding-top: 12px;
    padding-bottom: 12px;
    font-size: .92rem;
}

.hm-field .mud-input-adornment-start .mud-icon-root {
    color: #94a3b8;
    font-size: 1.15rem;
}

/* ==========================================================================
   هيكل التطبيق — app bar, drawer and navigation
   ========================================================================== */

.hm-appbar.mud-appbar {
    background: var(--hm-brand-gradient);
    box-shadow: 0 4px 22px rgba(11, 60, 123, .18);
    color: #fff;
}

.hm-appbar .mud-toolbar {
    height: var(--hm-appbar-height);
    gap: 6px;
}

.hm-appbar .mud-icon-button {
    color: rgba(255, 255, 255, .92);
}

.hm-appbar .mud-icon-button:hover {
    background: rgba(255, 255, 255, .14);
}

.hm-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
}

.hm-brand__mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: var(--hm-radius);
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .26);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2);
    flex: 0 0 auto;
}

.hm-brand__name {
    font-size: 1.06rem;
    font-weight: 800;
    line-height: 1.25;
    white-space: nowrap;
}

.hm-brand__tag {
    font-size: .72rem;
    font-weight: 600;
    opacity: .78;
    white-space: nowrap;
}

.hm-appbar__user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 12px 5px 6px;
    border-radius: 99px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .18);
    transition: background .2s ease;
}

.hm-appbar__user:hover {
    background: rgba(255, 255, 255, .2);
}

.hm-appbar__user-name {
    font-size: .85rem;
    font-weight: 700;
    line-height: 1.2;
    color: #fff;
}

.hm-appbar__user-role {
    font-size: .7rem;
    font-weight: 600;
    opacity: .8;
    color: #fff;
}

.hm-avatar {
    background: rgba(255, 255, 255, .22) !important;
    color: #fff !important;
    font-weight: 800;
    border: 1px solid rgba(255, 255, 255, .3);
}

/* الدرج الجانبي */
.hm-drawer.mud-drawer {
    background: #fff;
    border-inline-start: 1px solid var(--hm-line);
    box-shadow: -6px 0 26px rgba(15, 23, 42, .05);
}

.hm-drawer .mud-drawer-header {
    padding: 18px 18px 12px;
}

.hm-drawer__profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--hm-radius);
    background: linear-gradient(135deg, rgba(11, 60, 123, .06), rgba(224, 86, 92, .05));
    border: 1px solid rgba(11, 60, 123, .1);
}

.hm-drawer__profile-name {
    font-size: .9rem;
    font-weight: 800;
    color: var(--hm-ink);
    line-height: 1.3;
}

.hm-drawer__profile-role {
    font-size: .74rem;
    font-weight: 600;
    color: var(--hm-secondary);
}

.hm-drawer__avatar {
    background: var(--hm-brand-gradient) !important;
    color: #fff !important;
    font-weight: 800;
}

.hm-drawer__section {
    padding: 16px 22px 6px;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .6px;
    color: #9aa4b3;
}

.hm-nav.mud-navmenu {
    padding: 0 12px 24px;
}

.hm-nav .mud-nav-link {
    border-radius: var(--hm-radius);
    margin-bottom: 3px;
    padding-block: 10px;
    font-size: .9rem;
    font-weight: 600;
    color: #48566b;
    transition: background .18s ease, color .18s ease;
}

.hm-nav .mud-nav-link .mud-nav-link-icon {
    color: #8ea0b8;
    transition: color .18s ease;
}

.hm-nav .mud-nav-link:hover {
    background: rgba(11, 60, 123, .06);
    color: var(--hm-primary);
}

.hm-nav .mud-nav-link:hover .mud-nav-link-icon {
    color: var(--hm-primary);
}

/* البند النشط — نرفع الأولوية لتجاوز لون MudBlazor الافتراضي للنص */
.hm-nav .mud-nav-link.active,
.hm-nav .mud-nav-link.active:hover,
.hm-nav a.mud-nav-link.active:not(.mud-nav-link-disabled) {
    position: relative;
    color: #fff !important;
    font-weight: 700;
    background: var(--hm-brand-gradient);
    box-shadow: 0 8px 20px rgba(11, 60, 123, .22);
}

.hm-nav .mud-nav-link.active .mud-nav-link-text,
.hm-nav .mud-nav-link.active .mud-nav-link-icon,
.hm-nav .mud-nav-link.active .mud-icon-root,
.hm-nav a.mud-nav-link.active:not(.mud-nav-link-disabled) .mud-nav-link-text,
.hm-nav a.mud-nav-link.active:not(.mud-nav-link-disabled) .mud-nav-link-icon {
    color: #fff !important;
}

.hm-nav .mud-nav-link.active::before {
    content: '';
    position: absolute;
    inset-inline-end: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 22px;
    border-radius: 99px 0 0 99px;
    background: var(--hm-accent);
}

.hm-nav .mud-nav-group > .mud-nav-link {
    font-weight: 700;
    color: var(--hm-ink);
}

.hm-nav .mud-nav-group .mud-collapse-container .mud-nav-link {
    font-size: .86rem;
    padding-inline-start: 30px;
}

/* زر تسجيل الخروج في نهاية القائمة الجانبية */
.hm-nav-logout {
    padding: 0 12px 24px;
}

.hm-nav-logout__btn.mud-button-root {
    height: 44px;
    border-radius: 12px;
    font-weight: 700;
    justify-content: flex-start;
    gap: 6px;
    text-transform: none;
    box-shadow: 0 6px 16px rgba(214, 69, 80, .25);
    transition: transform .15s ease, box-shadow .15s ease;
}

.hm-nav-logout__btn.mud-button-root:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(214, 69, 80, .35);
}

.hm-drawer__footer {
    margin-top: auto;
    padding: 14px 18px 18px;
    border-top: 1px solid var(--hm-line);
    font-size: .72rem;
    color: #9aa4b3;
    text-align: center;
    line-height: 1.7;
}

/* المحتوى */
.hm-content {
    padding: 24px;
    min-height: calc(100vh - var(--hm-appbar-height));
    background: var(--hm-canvas);
}

.hm-page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 20px;
}

.hm-page-head__title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--hm-ink);
    margin: 0;
}

.hm-page-head__subtitle {
    font-size: .85rem;
    color: var(--hm-muted);
    margin: 4px 0 0;
}

.hm-card.mud-paper {
    border-radius: var(--hm-radius-lg);
    border: 1px solid var(--hm-line);
    box-shadow: var(--hm-shadow-sm);
    background: var(--hm-surface);
}

/* بطاقات المؤشرات */
.hm-stat {
    position: relative;
    overflow: hidden;
    padding: 18px 20px;
    border-radius: var(--hm-radius-lg);
    border: 1px solid var(--hm-line);
    background: var(--hm-surface);
    box-shadow: var(--hm-shadow-sm);
    transition: transform .22s ease, box-shadow .22s ease;
    height: 100%;
}

.hm-stat:hover {
    transform: translateY(-3px);
    box-shadow: var(--hm-shadow-md);
}

.hm-stat::after {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--hm-stat-accent, var(--hm-primary));
}

.hm-stat__icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: var(--hm-radius);
    color: var(--hm-stat-accent, var(--hm-primary));
    background: color-mix(in srgb, var(--hm-stat-accent, var(--hm-primary)) 12%, transparent);
}

.hm-stat__label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--hm-muted);
}

.hm-stat__value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--hm-ink);
    line-height: 1.2;
}

.hm-stat__hint {
    font-size: .74rem;
    color: #94a3b8;
}

/* بطاقة اختصار */
.hm-shortcut {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--hm-radius);
    border: 1px solid var(--hm-line);
    background: #fff;
    color: var(--hm-ink);
    font-weight: 700;
    font-size: .88rem;
    transition: .2s ease;
    height: 100%;
}

.hm-shortcut:hover {
    border-color: rgba(11, 60, 123, .32);
    background: rgba(11, 60, 123, .04);
    transform: translateY(-2px);
    box-shadow: var(--hm-shadow-sm);
}

.hm-shortcut__icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    color: #fff;
    background: var(--hm-shortcut-accent, var(--hm-primary));
    flex: 0 0 auto;
}

/* حالة قيد الإنشاء */
.hm-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    text-align: center;
    padding: 64px 24px;
    border-radius: var(--hm-radius-lg);
    border: 1.5px dashed var(--hm-line);
    background: rgba(255, 255, 255, .7);
}

.hm-placeholder__icon {
    width: 74px;
    height: 74px;
    display: grid;
    place-items: center;
    border-radius: 24px;
    color: var(--hm-primary);
    background: rgba(11, 60, 123, .08);
}

.hm-placeholder__title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--hm-ink);
    margin: 0;
}

.hm-placeholder__text {
    font-size: .88rem;
    color: var(--hm-muted);
    margin: 0;
    max-width: 420px;
    line-height: 1.9;
}

@media (max-width: 600px) {
    .hm-content {
        padding: 16px;
    }

    .hm-brand__tag {
        display: none;
    }
}

/* ==========================================================================
   بطاقة الجدول وشريط الأدوات
   ========================================================================== */

.hm-stat--compact {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
}

.hm-stat--compact .hm-stat__value {
    font-size: 1.35rem;
}

.hm-table-card {
    overflow: hidden;
}

.hm-table-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--hm-line);
    background: linear-gradient(180deg, #fff, #fbfcfe);
}

.hm-table-toolbar__search {
    width: min(360px, 100%);
}

.hm-table-scroll {
    width: 100%;
    overflow-x: auto;
}

/* ==========================================================================
   جدول البيانات
   ========================================================================== */

.hm-grid.mud-table {
    background: transparent;
}

.hm-grid .mud-table-root {
    min-width: 720px;
}

.hm-grid .mud-table-head .hm-grid__head {
    background: var(--hm-brand-gradient);
    color: #fff;
    font-size: .8rem;
    font-weight: 800;
    letter-spacing: .2px;
    white-space: nowrap;
    border-bottom: none;
    padding-block: 15px;
}

/* عناوين الأعمدة داخل MudBlazor مغلَّفة بعنصر داخلي له لونه الخاص */
.hm-grid .mud-table-head .hm-grid__head .mud-table-cell-header-sortable,
.hm-grid .mud-table-head .hm-grid__head .mud-icon-root,
.hm-grid .mud-table-head .hm-grid__head span {
    color: #fff;
}

.hm-grid .hm-grid__head--actions,
.hm-grid .hm-grid__cell--actions {
    text-align: center;
    width: 1%;
    white-space: nowrap;
}

.hm-grid .hm-grid__cell {
    padding-block: 12px;
    border-bottom: 1px solid #eef2f8;
    font-size: .88rem;
    color: var(--hm-ink);
}

.hm-grid .mud-table-body .mud-table-row:hover {
    background: rgba(11, 60, 123, .035);
}

.hm-grid .mud-table-body .mud-table-row:last-child .hm-grid__cell {
    border-bottom: none;
}

.hm-floor-number {
    /* الأرقام تبقى بترتيب LTR حتى تظهر إشارة السالب في مكانها الصحيح */
    direction: ltr;
    display: inline-grid;
    place-items: center;
    min-width: 42px;
    height: 34px;
    padding: 0 10px;
    border-radius: 11px;
    font-weight: 800;
    font-size: .95rem;
    color: var(--hm-primary);
    background: rgba(11, 60, 123, .08);
    border: 1px solid rgba(11, 60, 123, .14);
}

.hm-cell-primary {
    font-weight: 700;
}

.hm-cell-date {
    font-size: .82rem;
    color: var(--hm-muted);
    white-space: nowrap;
}

.hm-row-actions {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

/* شارات الحالة */
.hm-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 99px;
    font-size: .78rem;
    font-weight: 700;
    white-space: nowrap;
}

.hm-pill__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.hm-pill--success {
    color: #12805a;
    background: rgba(30, 158, 106, .12);
}

.hm-pill--danger {
    color: #b23b43;
    background: rgba(224, 86, 92, .12);
}

.hm-pill--info {
    color: var(--hm-primary);
    background: rgba(11, 60, 123, .09);
}

.hm-pill--muted {
    color: #94a3b8;
    background: #f1f5f9;
}

.hm-pill .mud-icon-root {
    font-size: 1rem;
}

/* الترقيم */
.hm-grid__pager {
    border-top: 1px solid var(--hm-line);
    background: #fbfcfe;
}

.hm-grid__pager .mud-table-pagination-caption,
.hm-grid__pager .mud-select-input {
    font-size: .82rem;
}

/* حالة الفراغ */
.hm-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 54px 24px;
}

.hm-empty__icon {
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    border-radius: 22px;
    color: var(--hm-primary);
    background: rgba(11, 60, 123, .07);
    margin-bottom: 14px;
}

.hm-empty__title {
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--hm-ink);
    margin: 0 0 6px;
}

.hm-empty__text {
    font-size: .85rem;
    color: var(--hm-muted);
    margin: 0;
    max-width: 380px;
    line-height: 1.8;
}

/* عرض الجوال — MudDataGrid يبدّل إلى تخطيط مكدّس تحت نقطة الانكسار */
@media (max-width: 600px) {
    .hm-grid .mud-table-root {
        min-width: 0;
    }

    .hm-grid .mud-table-body .mud-table-row {
        display: block;
        margin: 12px;
        border: 1px solid var(--hm-line);
        border-radius: var(--hm-radius);
        box-shadow: var(--hm-shadow-sm);
        overflow: hidden;
    }

    .hm-grid .mud-table-body .hm-grid__cell {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        border-bottom: 1px solid #f1f5f9;
    }

    .hm-grid .mud-table-body .hm-grid__cell::before {
        content: attr(data-label);
        font-size: .78rem;
        font-weight: 700;
        color: #94a3b8;
    }

    .hm-grid .hm-grid__cell--actions {
        width: auto;
        justify-content: center;
        background: #fbfcfe;
    }

    .hm-grid .hm-grid__cell--actions::before {
        content: none;
    }

    .hm-table-toolbar__search {
        width: 100%;
    }
}

/* ==========================================================================
   الحوارات
   ========================================================================== */

.hm-dialog.mud-dialog {
    border-radius: var(--hm-radius-lg);
    overflow: hidden;
    box-shadow: var(--hm-shadow-lg);
}

.hm-dialog .mud-dialog-title {
    padding: 0;
    margin: 0;
}

.hm-dialog__header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 22px;
    color: #fff;
}

.hm-dialog__header--primary {
    background: var(--hm-brand-gradient);
}

.hm-dialog__header--danger {
    background: linear-gradient(135deg, #b23b43 0%, #E0565C 100%);
}

.hm-dialog__header--warning {
    background: linear-gradient(135deg, #C77E12 0%, #E8A317 100%);
}

.hm-dialog__header-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: var(--hm-radius);
    background: rgba(255, 255, 255, .17);
    border: 1px solid rgba(255, 255, 255, .26);
    flex: 0 0 auto;
}

.hm-dialog__title {
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.3;
}

.hm-dialog__subtitle {
    font-size: .78rem;
    font-weight: 600;
    opacity: .85;
    margin-top: 2px;
}

.hm-dialog__content.mud-dialog-content {
    padding: 22px;
}

.hm-dialog__actions.mud-dialog-actions {
    padding: 16px 22px 20px;
    border-top: 1px solid var(--hm-line);
    background: #fbfcfe;
    /* أزرار الإجراءات في المنتصف أفقيًا، ومرتّبة من اليمين إلى اليسار */
    justify-content: center;
    gap: 12px;
    /* اللف ضروري: الحوار يقصّ ما يفيض (overflow:hidden) فتختفي الأزرار الزائدة */
    flex-wrap: wrap;
}

.hm-dialog__actions.mud-dialog-actions > .mud-button-root {
    min-width: 132px;
}

/* شريط إجراءات بأربعة أزرار أو أكثر: نترك الزر بعرض نصّه حتى يتّسع السطر للجميع */
.hm-dialog__actions--multi.mud-dialog-actions > .mud-button-root {
    min-width: 0;
}

.hm-confirm__message {
    font-size: .92rem;
    line-height: 1.9;
    color: var(--hm-ink);
    margin: 0;
}

/* حقول النماذج داخل الحوارات */
.hm-form-field {
    margin-bottom: 18px;
}

.hm-form-label {
    display: block;
    color: #334155;
    font-size: .86rem;
    font-weight: 700;
    margin-bottom: 7px;
}

.hm-form-required {
    color: var(--hm-secondary);
}

.hm-form-hint {
    font-size: .74rem;
    color: #94a3b8;
    margin-top: 6px;
    line-height: 1.7;
}

.hm-status-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--hm-radius);
    border: 1.5px solid var(--hm-line);
    transition: border-color .2s ease, background .2s ease;
}

.hm-status-toggle.is-on {
    border-color: rgba(30, 158, 106, .35);
    background: rgba(30, 158, 106, .05);
}

.hm-status-toggle.is-off {
    border-color: rgba(224, 86, 92, .3);
    background: rgba(224, 86, 92, .04);
}

.hm-status-toggle__label {
    font-size: .88rem;
    font-weight: 800;
    color: var(--hm-ink);
}

.hm-status-toggle__hint {
    font-size: .74rem;
    color: var(--hm-muted);
    line-height: 1.6;
}

/* زر متدرّج مشترك */
.hm-btn-gradient.mud-button-root {
    color: #fff;
    font-weight: 800;
    border-radius: var(--hm-radius);
    background: var(--hm-brand-gradient);
    box-shadow: 0 8px 20px rgba(11, 60, 123, .18);
    transition: transform .2s ease, box-shadow .2s ease;
}

.hm-btn-gradient.mud-button-root:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(11, 60, 123, .24);
}

.hm-btn-gradient.mud-button-root:disabled {
    opacity: .7;
    color: #fff;
}

/* ==========================================================================
   عناصر إضافية للجداول والنماذج (أنواع الغرف والغرف)
   ========================================================================== */

.hm-cell-sub {
    font-size: .76rem;
    color: var(--hm-muted);
    margin-top: 2px;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hm-cell-price {
    direction: ltr;
    text-align: start;
    font-weight: 800;
    font-size: .95rem;
    color: var(--hm-primary);
    white-space: nowrap;
}

/* صفّان جنبًا إلى جنب داخل النماذج */
.hm-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 560px) {
    .hm-form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

/* شارات الحالة التشغيلية للغرف */
.hm-state--available {
    color: #12805a;
    background: rgba(30, 158, 106, .12);
}

.hm-state--occupied {
    color: #1d4ed8;
    background: rgba(47, 128, 237, .13);
}

.hm-state--cleaning {
    color: #a16207;
    background: rgba(245, 196, 35, .2);
}

.hm-state--maintenance {
    color: #c2410c;
    background: rgba(232, 163, 23, .16);
}

.hm-state--out {
    color: #64748b;
    background: #eef2f7;
}

/* اختيار الحالة داخل حوار تغيير حالة الغرفة */
.hm-state-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hm-state-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--hm-radius);
    border: 1.5px solid var(--hm-line);
    background: #fff;
    font-family: inherit;
    text-align: start;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.hm-state-option:hover {
    border-color: rgba(11, 60, 123, .3);
    background: rgba(11, 60, 123, .03);
}

.hm-state-option.is-selected {
    border-color: var(--hm-primary);
    background: rgba(11, 60, 123, .06);
    box-shadow: 0 0 0 3px rgba(11, 60, 123, .08);
}

.hm-state-option__icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    flex: 0 0 auto;
    color: #64748b;
    background: #f1f5f9;
}

.hm-state-option--available .hm-state-option__icon { color: #12805a; background: rgba(30, 158, 106, .12); }
.hm-state-option--occupied .hm-state-option__icon { color: #1d4ed8; background: rgba(47, 128, 237, .13); }
.hm-state-option--cleaning .hm-state-option__icon { color: #a16207; background: rgba(245, 196, 35, .2); }
.hm-state-option--maintenance .hm-state-option__icon { color: #c2410c; background: rgba(232, 163, 23, .16); }
.hm-state-option--out .hm-state-option__icon { color: #64748b; background: #eef2f7; }

.hm-state-option__body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
}

.hm-state-option__label {
    font-size: .89rem;
    font-weight: 800;
    color: var(--hm-ink);
}

.hm-state-option__hint {
    font-size: .74rem;
    color: var(--hm-muted);
    line-height: 1.6;
}

.hm-state-option__current {
    font-size: .68rem;
    font-weight: 800;
    color: var(--hm-primary);
    background: rgba(11, 60, 123, .1);
    padding: 3px 9px;
    border-radius: 99px;
    flex: 0 0 auto;
}

/* العنصر الافتراضي داخل قوائم الاختيار */
.hm-select-placeholder {
    color: #9aa4b3;
    font-style: italic;
}

/* ==========================================================================
   وحدة الحجوزات
   ========================================================================== */

.hm-table-toolbar__filter {
    width: min(210px, 100%);
}

.hm-booking-number {
    direction: ltr;
    display: inline-block;
    padding: 6px 12px;
    border-radius: 10px;
    font-weight: 800;
    font-size: .84rem;
    color: var(--hm-primary);
    background: rgba(11, 60, 123, .08);
    border: 1px solid rgba(11, 60, 123, .14);
    white-space: nowrap;
}

.hm-stay {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.hm-stay__date {
    font-weight: 700;
    font-size: .85rem;
}

.hm-stay__arrow {
    color: #b6c2d4;
    font-size: 1rem !important;
}

.hm-cell-sub--due {
    color: var(--hm-secondary);
    font-weight: 700;
}

.hm-cell-sub--paid {
    color: #12805a;
    font-weight: 700;
}

/* شارات حالة الحجز */
.hm-state--pending {
    color: #a16207;
    background: rgba(245, 196, 35, .2);
}

.hm-state--confirmed {
    color: #1d4ed8;
    background: rgba(47, 128, 237, .13);
}

.hm-state--checkedin {
    color: #12805a;
    background: rgba(30, 158, 106, .12);
}

.hm-state--checkedout {
    color: #64748b;
    background: #eef2f7;
}

.hm-state--cancelled {
    color: #b23b43;
    background: rgba(224, 86, 92, .12);
}

.hm-state-option--pending .hm-state-option__icon { color: #a16207; background: rgba(245, 196, 35, .2); }
.hm-state-option--confirmed .hm-state-option__icon { color: #1d4ed8; background: rgba(47, 128, 237, .13); }
.hm-state-option--checkedin .hm-state-option__icon { color: #12805a; background: rgba(30, 158, 106, .12); }
.hm-state-option--checkedout .hm-state-option__icon { color: #64748b; background: #eef2f7; }
.hm-state-option--cancelled .hm-state-option__icon { color: #b23b43; background: rgba(224, 86, 92, .12); }

/* عنوان قسم داخل النماذج */
.hm-section-title {
    font-size: .8rem;
    font-weight: 800;
    color: var(--hm-primary);
    letter-spacing: .2px;
    margin: 6px 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--hm-line);
}

.hm-section-title:not(:first-child) {
    margin-top: 22px;
}

/* خيار النزيل داخل قائمة البحث */
.hm-guest-option__name {
    font-size: .88rem;
    font-weight: 700;
    color: var(--hm-ink);
}

.hm-guest-option__meta {
    font-size: .75rem;
    color: var(--hm-muted);
}

/* شارة عدد الليالي */
.hm-nights-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    margin-bottom: 18px;
    border-radius: var(--hm-radius);
    font-size: .84rem;
    color: var(--hm-primary);
    background: rgba(11, 60, 123, .06);
    border: 1px solid rgba(11, 60, 123, .12);
}

/* اختيار الغرف */
.hm-room-picker {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
}

.hm-rooms-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 22px;
    border-radius: var(--hm-radius);
    border: 1.5px dashed var(--hm-line);
    color: var(--hm-muted);
    font-size: .84rem;
    background: #fbfcfe;
}

.hm-room-lines {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hm-room-line {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--hm-radius);
    border: 1.5px solid var(--hm-line);
    background: #fff;
}

.hm-room-line--readonly {
    background: #fbfcfe;
}

.hm-room-line__info {
    flex: 1 1 auto;
    min-width: 0;
}

.hm-room-line__title {
    font-size: .88rem;
    font-weight: 800;
    color: var(--hm-ink);
}

.hm-room-line__meta {
    font-size: .74rem;
    color: var(--hm-muted);
}

.hm-room-line__price {
    width: 130px;
    flex: 0 0 auto;
}

.hm-room-line__total {
    width: 110px;
    flex: 0 0 auto;
    text-align: start;
}

.hm-room-line__label {
    display: block;
    font-size: .7rem;
    font-weight: 700;
    color: #94a3b8;
    margin-bottom: 4px;
}

.hm-room-line__amount {
    direction: ltr;
    text-align: start;
    font-size: .95rem;
    font-weight: 800;
    color: var(--hm-primary);
}

/* ملخّص المبالغ */
.hm-totals {
    margin-top: 6px;
    padding: 14px 16px;
    border-radius: var(--hm-radius);
    border: 1.5px solid var(--hm-line);
    background: linear-gradient(135deg, rgba(11, 60, 123, .04), rgba(224, 86, 92, .03));
}

.hm-totals__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 0;
    font-size: .85rem;
    color: #475569;
}

.hm-totals__row strong {
    direction: ltr;
    font-weight: 800;
    color: var(--hm-ink);
}

.hm-totals__discount {
    color: var(--hm-secondary) !important;
}

.hm-totals__row--net {
    border-top: 1px dashed var(--hm-line);
    margin-top: 4px;
    padding-top: 9px;
}

.hm-totals__row--net strong {
    font-size: 1.05rem;
    color: var(--hm-primary);
}

.hm-totals__row--due {
    border-top: 1px dashed var(--hm-line);
    margin-top: 4px;
    padding-top: 9px;
}

.hm-totals__row--due strong {
    font-size: 1rem;
    color: var(--hm-secondary);
}

/* تفاصيل الحجز */
.hm-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 18px;
    margin-bottom: 18px;
}

.hm-detail {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hm-detail__label {
    font-size: .72rem;
    font-weight: 700;
    color: #94a3b8;
}

.hm-detail__value {
    font-size: .88rem;
    font-weight: 700;
    color: var(--hm-ink);
}

.hm-detail-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--hm-radius);
    background: rgba(245, 196, 35, .1);
    border: 1px solid rgba(245, 196, 35, .3);
    font-size: .84rem;
    color: #7a5b06;
    line-height: 1.8;
}

@media (max-width: 620px) {
    .hm-details-grid {
        grid-template-columns: 1fr;
    }

    .hm-room-line {
        flex-wrap: wrap;
    }

    .hm-room-line__info {
        flex: 1 1 100%;
    }

    .hm-room-picker {
        flex-direction: column;
        align-items: stretch;
    }

    .hm-table-toolbar__filter {
        width: 100%;
    }
}

/* ==========================================================================
   لوحة الغرف — صفحة الحجز الجديد
   ========================================================================== */

.hm-status-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.hm-status-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: var(--hm-radius);
    border: 1.5px solid var(--hm-line);
    background: #fff;
    font-family: inherit;
    cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.hm-status-chip:hover {
    transform: translateY(-2px);
    box-shadow: var(--hm-shadow-sm);
}

.hm-status-chip.is-active {
    border-color: var(--hm-primary);
    box-shadow: 0 0 0 3px rgba(11, 60, 123, .1);
}

.hm-status-chip__count {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--hm-ink);
    line-height: 1;
}

.hm-status-chip__label {
    font-size: .78rem;
    font-weight: 700;
    color: var(--hm-muted);
}

.hm-status-chip--available .hm-status-chip__count { color: #12805a; }
.hm-status-chip--occupied .hm-status-chip__count { color: #1d4ed8; }
.hm-status-chip--cleaning .hm-status-chip__count { color: #a16207; }
.hm-status-chip--maintenance .hm-status-chip__count { color: #c2410c; }
.hm-status-chip--out .hm-status-chip__count { color: #64748b; }

/* شريط عوامل التصفية */
.hm-board-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 18px;
    margin-bottom: 18px;
}

.hm-board-filters__search {
    width: min(280px, 100%);
}

.hm-board-filters__select {
    width: min(190px, 100%);
}

.hm-board-filters__switch {
    margin-inline-start: auto;
}

/* شبكة البطاقات */
.hm-room-board {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
    gap: 16px;
    /* مساحة تكفي لشريط الاختيار الثابت أسفل الشاشة */
    padding-bottom: 132px;
}

.hm-room-card {
    position: relative;
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    padding: 14px;
    border-radius: var(--hm-radius-lg);
    border: 1.5px solid var(--hm-line);
    background: #fff;
    box-shadow: var(--hm-shadow-sm);
    cursor: pointer;
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

/* الشريط العلوي الملوّن حسب الحالة */
.hm-room-card::before {
    content: '';
    position: absolute;
    inset-inline: 0;
    top: 0;
    height: 5px;
    background: var(--hm-card-accent, #94a3b8);
}

.hm-room-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--hm-shadow-md);
    border-color: rgba(11, 60, 123, .28);
}

.hm-room-card:focus-visible {
    outline: 2px solid var(--hm-primary);
    outline-offset: 2px;
}

.hm-room-card.is-selected {
    border-color: var(--hm-primary);
    box-shadow: 0 0 0 3px rgba(11, 60, 123, .14), var(--hm-shadow-md);
    background: linear-gradient(160deg, rgba(11, 60, 123, .05), rgba(255, 255, 255, .9));
}

.hm-room-card.is-locked {
    cursor: not-allowed;
    opacity: .62;
    background: repeating-linear-gradient(135deg, #fbfcfe, #fbfcfe 8px, #f1f5f9 8px, #f1f5f9 16px);
}

.hm-room-card.is-locked:hover {
    transform: none;
    box-shadow: var(--hm-shadow-sm);
    border-color: var(--hm-line);
}

.hm-room-card--available { --hm-card-accent: #1E9E6A; }
.hm-room-card--occupied { --hm-card-accent: #2F80ED; }
.hm-room-card--cleaning { --hm-card-accent: #F5C423; }
.hm-room-card--maintenance { --hm-card-accent: #E8A317; }
.hm-room-card--out { --hm-card-accent: #94a3b8; }

.hm-room-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-top: 4px;
}

.hm-room-card__status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 9px;
    border-radius: 99px;
    font-size: .68rem;
    font-weight: 800;
    white-space: nowrap;
    color: var(--hm-card-accent);
    background: color-mix(in srgb, var(--hm-card-accent) 14%, transparent);
}

.hm-room-card__status .mud-icon-root {
    font-size: .9rem !important;
}

/* زر المعلومات: كان رماديًا فاتحًا على خلفية بيضاء فلا يكاد يُرى.
   صار شارة دائرية بلون الهوية ليظهر كعنصر قابل للنقر على كل حالات البطاقة. */
.hm-room-card__info.mud-icon-button {
    color: var(--hm-primary);
    background: rgba(11, 60, 123, .09);
    border: 1px solid rgba(11, 60, 123, .18);
    padding: 4px;
    transition: color .18s ease, background-color .18s ease, border-color .18s ease;
}

.hm-room-card__info.mud-icon-button .mud-icon-root {
    font-size: 1.05rem !important;
}

.hm-room-card__info.mud-icon-button:hover,
.hm-room-card__info.mud-icon-button:focus-visible {
    color: #fff;
    background: var(--hm-primary);
    border-color: var(--hm-primary);
}

.hm-room-card__number {
    direction: ltr;
    text-align: center;
    font-size: 2rem;
    font-weight: 800;
    color: var(--hm-ink);
    line-height: 1.1;
    margin-top: auto;
}

.hm-room-card__type {
    text-align: center;
    font-size: .78rem;
    font-weight: 700;
    color: var(--hm-muted);
    margin-bottom: auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hm-room-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding-top: 10px;
    border-top: 1px solid #eef2f8;
    font-size: .72rem;
}

.hm-room-card__floor {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--hm-muted);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hm-room-card__floor .mud-icon-root {
    font-size: .85rem !important;
}

.hm-room-card__price {
    direction: ltr;
    font-weight: 800;
    color: var(--hm-primary);
    white-space: nowrap;
}

.hm-room-card__check {
    position: absolute;
    inset-inline-start: 10px;
    top: 12px;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--hm-brand-gradient);
    box-shadow: 0 4px 10px rgba(11, 60, 123, .3);
}

/* شريط الاختيار السفلي */
.hm-selection-bar {
    position: fixed;
    inset-inline-start: 24px;
    inset-inline-end: calc(var(--hm-drawer-width) + 24px);
    bottom: 20px;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    padding: 14px 20px;
    border-radius: var(--hm-radius-lg);
    background: #fff;
    border: 1.5px solid rgba(11, 60, 123, .18);
    box-shadow: 0 16px 40px rgba(15, 23, 42, .18);
    animation: hm-bar-in .25s ease-out;
}

@keyframes hm-bar-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.hm-selection-bar__info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    color: var(--hm-primary);
}

.hm-selection-bar__count {
    font-size: .92rem;
    font-weight: 800;
    color: var(--hm-ink);
}

.hm-selection-bar__rooms {
    font-size: .76rem;
    color: var(--hm-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 46vw;
}

@media (max-width: 1279px) {
    .hm-selection-bar {
        inset-inline-end: 24px;
    }
}

@media (max-width: 600px) {
    .hm-room-board {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }

    .hm-room-card__number {
        font-size: 1.6rem;
    }

    .hm-board-filters__search,
    .hm-board-filters__select {
        width: 100%;
    }

    .hm-board-filters__switch {
        margin-inline-start: 0;
    }

    .hm-selection-bar {
        inset-inline: 12px;
        bottom: 12px;
        padding: 12px 14px;
    }

    .hm-selection-bar__rooms {
        max-width: 60vw;
    }
}

/* ==========================================================================
   وحدة النزلاء
   ========================================================================== */

.hm-guest-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hm-guest-cell__avatar.mud-avatar {
    background: var(--hm-brand-gradient) !important;
    color: #fff !important;
    font-weight: 800;
    font-size: .72rem;
    flex: 0 0 auto;
}

/* أرقام الهاتف والبريد تبقى بترتيب LTR */
.hm-contact {
    direction: ltr;
    text-align: start;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 220px;
}

.hm-identity {
    direction: ltr;
    display: inline-block;
    padding: 5px 11px;
    border-radius: 9px;
    font-size: .8rem;
    font-weight: 700;
    color: #475569;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    white-space: nowrap;
}

/* المبالغ المستحقة داخل الجداول */
.hm-cell-price--due {
    color: var(--hm-secondary);
}

/* ==========================================================================
   وحدة التدبير الفندقي
   ========================================================================== */

.hm-state--hk-pending {
    color: #a16207;
    background: rgba(245, 196, 35, .2);
}

.hm-state--hk-inprogress {
    color: #1d4ed8;
    background: rgba(47, 128, 237, .13);
}

.hm-state--hk-done {
    color: #12805a;
    background: rgba(30, 158, 106, .12);
}

.hm-state--hk-cancelled {
    color: #b23b43;
    background: rgba(224, 86, 92, .12);
}

.hm-state-option--hk-pending .hm-state-option__icon { color: #a16207; background: rgba(245, 196, 35, .2); }
.hm-state-option--hk-inprogress .hm-state-option__icon { color: #1d4ed8; background: rgba(47, 128, 237, .13); }
.hm-state-option--hk-done .hm-state-option__icon { color: #12805a; background: rgba(30, 158, 106, .12); }
.hm-state-option--hk-cancelled .hm-state-option__icon { color: #b23b43; background: rgba(224, 86, 92, .12); }

.hm-status-chip--hk-pending .hm-status-chip__count { color: #a16207; }
.hm-status-chip--hk-inprogress .hm-status-chip__count { color: #1d4ed8; }
.hm-status-chip--hk-done .hm-status-chip__count { color: #12805a; }
.hm-status-chip--hk-cancelled .hm-status-chip__count { color: #b23b43; }

/* عناوين المهام الجاهزة */
.hm-quick-titles {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.hm-quick-title {
    padding: 5px 11px;
    border-radius: 99px;
    border: 1px solid var(--hm-line);
    background: #fff;
    font-family: inherit;
    font-size: .74rem;
    font-weight: 600;
    color: var(--hm-muted);
    cursor: pointer;
    transition: .18s ease;
}

.hm-quick-title:hover:not(:disabled) {
    border-color: var(--hm-primary);
    color: var(--hm-primary);
    background: rgba(11, 60, 123, .05);
}

.hm-quick-title:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* ==========================================================================
   لوحة غرف التدبير الفندقي
   ========================================================================== */

.hm-hk-card--idle { --hm-card-accent: #cbd5e1; }
.hm-hk-card--pending { --hm-card-accent: #F5C423; }
.hm-hk-card--inprogress { --hm-card-accent: #2F80ED; }
.hm-hk-card--done { --hm-card-accent: #1E9E6A; }
.hm-hk-card--cancelled { --hm-card-accent: #E0565C; }

/* الغرف التي لا تحتاج عملًا تبقى هادئة بصريًا */
.hm-hk-card--idle .hm-room-card__status {
    color: #94a3b8;
    background: #f1f5f9;
}

/* بطاقة المهمة القائمة داخل الكرت */
.hm-hk-card__task {
    margin: 6px 0 4px;
    padding: 7px 9px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--hm-card-accent) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--hm-card-accent) 26%, transparent);
}

.hm-hk-card__task-title {
    font-size: .74rem;
    font-weight: 800;
    color: var(--hm-ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hm-hk-card__task-user {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: .68rem;
    color: var(--hm-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hm-hk-card__task-user .mud-icon-root {
    font-size: .8rem !important;
}

.hm-hk-card__count {
    min-width: 20px;
    height: 20px;
    display: inline-grid;
    place-items: center;
    padding: 0 6px;
    border-radius: 99px;
    font-size: .68rem;
    font-weight: 800;
    color: #64748b;
    background: #eef2f7;
}

/* ------------------------------ العلم المتحرّك ------------------------------ */

.hm-hk-flag {
    position: absolute;
    inset-inline-start: 12px;
    top: 10px;
    width: 26px;
    height: 30px;
    z-index: 3;
    pointer-events: none;
}

.hm-hk-flag__pole {
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    width: 2.5px;
    height: 100%;
    border-radius: 2px;
    background: #94a3b8;
}

/* قطعة القماش ترفرف عبر تحريك نقاط المضلّع */
.hm-hk-flag__cloth {
    position: absolute;
    inset-inline-start: 2px;
    top: 2px;
    width: 22px;
    height: 15px;
    background: var(--hm-flag-color, #F5C423);
    box-shadow: 0 2px 5px rgba(15, 23, 42, .22);
    transform-origin: 0 50%;
    animation: hm-flag-wave 1.5s ease-in-out infinite;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

@keyframes hm-flag-wave {
    0%, 100% {
        clip-path: polygon(0 0, 100% 8%, 100% 92%, 0 100%);
        transform: skewY(0deg);
    }
    50% {
        clip-path: polygon(0 0, 100% -8%, 100% 78%, 0 100%);
        transform: skewY(-3deg);
    }
}

.hm-hk-flag--pending { --hm-flag-color: #F5C423; }

.hm-hk-flag--inprogress { --hm-flag-color: #2F80ED; }

/* المهمة قيد التنفيذ ترفرف أسرع مع نبضة حول البطاقة */
.hm-hk-flag--inprogress .hm-hk-flag__cloth {
    animation-duration: .85s;
}

.hm-hk-card--inprogress {
    animation: hm-hk-pulse 2.2s ease-in-out infinite;
}

@keyframes hm-hk-pulse {
    0%, 100% { box-shadow: var(--hm-shadow-sm); }
    50% { box-shadow: 0 0 0 4px rgba(47, 128, 237, .16), var(--hm-shadow-md); }
}

/* من يفضّل تقليل الحركة لا يرى الرفرفة ولا النبض */
@media (prefers-reduced-motion: reduce) {
    .hm-hk-flag__cloth,
    .hm-hk-card--inprogress {
        animation: none;
    }

    .hm-hk-flag__cloth {
        clip-path: polygon(0 0, 100% 8%, 100% 92%, 0 100%);
    }
}

.hm-status-chip--unassigned .hm-status-chip__count {
    color: var(--hm-secondary);
}

/* ------------------------------ قائمة مهام الغرفة ------------------------------ */

.hm-task-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hm-task-item {
    padding: 12px 14px;
    border-radius: var(--hm-radius);
    border: 1.5px solid var(--hm-line);
    border-inline-start: 4px solid var(--hm-task-accent, #cbd5e1);
    background: #fff;
}

.hm-task-item--pending { --hm-task-accent: #F5C423; }
.hm-task-item--inprogress { --hm-task-accent: #2F80ED; }
.hm-task-item--done { --hm-task-accent: #1E9E6A; }
.hm-task-item--cancelled { --hm-task-accent: #E0565C; }

.hm-task-item__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.hm-task-item__actions {
    display: inline-flex;
    gap: 2px;
}

.hm-task-item__title {
    font-size: .9rem;
    font-weight: 800;
    color: var(--hm-ink);
}

.hm-task-item__desc {
    font-size: .78rem;
    color: var(--hm-muted);
    line-height: 1.7;
    margin-top: 2px;
}

.hm-task-item__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 8px;
    font-size: .74rem;
    color: var(--hm-muted);
}

.hm-task-item__meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.hm-task-item__meta .mud-icon-root {
    font-size: .9rem !important;
}

/* الغرف المستهدفة في الإنشاء الجماعي */
.hm-bulk-rooms {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 12px;
    border-radius: var(--hm-radius);
    border: 1.5px solid var(--hm-line);
    background: #fbfcfe;
}

.hm-bulk-room {
    padding: 4px 10px;
    border-radius: 99px;
    font-size: .74rem;
    font-weight: 700;
    color: var(--hm-primary);
    background: rgba(11, 60, 123, .08);
    border: 1px solid rgba(11, 60, 123, .14);
}

/* تنبيه الخطأ الملتصق بأسفل الحوار — يظل مرئيًا عند التمرير لأن زر الحفظ بالأسفل */
.hm-dialog__error-sticky {
    position: sticky;
    bottom: 0;
    z-index: 4;
    /* الهوامش السالبة تمدّه بعرض الحوار كاملًا فوق شريط الأزرار */
    margin: 14px -22px -22px;
}

.hm-dialog__error-sticky .mud-alert {
    border-radius: 0;
    box-shadow: 0 -6px 18px rgba(15, 23, 42, .16);
}

/* ==========================================================================
   أرقام الغرف داخل جدول الحجوزات
   ========================================================================== */

.hm-room-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.hm-room-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 800;
    color: var(--hm-primary);
    background: rgba(11, 60, 123, .08);
    border: 1px solid rgba(11, 60, 123, .14);
    white-space: nowrap;
}

.hm-room-tag .mud-icon-root {
    font-size: .95rem !important;
}

.hm-room-tag--more {
    color: var(--hm-muted);
    background: #eef2f7;
    border-color: var(--hm-line);
    cursor: default;
}

/* ==========================================================================
   مواعيد حجوزات الغرفة
   ========================================================================== */

.hm-schedule-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.hm-schedule-count {
    font-size: .78rem;
    font-weight: 800;
    color: var(--hm-primary);
}

.hm-schedule-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hm-schedule-item {
    --hm-schedule-accent: #cbd5e1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border-radius: var(--hm-radius);
    border: 1.5px solid var(--hm-line);
    border-inline-start: 4px solid var(--hm-schedule-accent);
    background: #fff;
}

.hm-schedule-item--pending { --hm-schedule-accent: #F5C423; }
.hm-schedule-item--confirmed { --hm-schedule-accent: #2F80ED; }
.hm-schedule-item--checkedin { --hm-schedule-accent: #1E9E6A; }
.hm-schedule-item--checkedout { --hm-schedule-accent: #94a3b8; }
.hm-schedule-item--cancelled { --hm-schedule-accent: #E0565C; }

.hm-schedule-item.is-current {
    background: rgba(30, 158, 106, .05);
    box-shadow: 0 2px 10px rgba(15, 23, 42, .06);
}

.hm-schedule-item__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.hm-schedule-item__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: .76rem;
    color: var(--hm-muted);
}

.hm-schedule-item__meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.hm-schedule-item__meta .mud-icon-root {
    font-size: 1rem !important;
    color: #94a3b8;
}

.hm-schedule-item__flag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 800;
    color: #12805a;
    background: rgba(30, 158, 106, .12);
}

.hm-schedule-item__flag .mud-icon-root {
    font-size: .95rem !important;
}

/* ==========================================================================
   البحث عن الغرف الشاغرة
   ========================================================================== */

.hm-avail-verdict {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 14px;
    border-radius: var(--hm-radius);
    border: 1.5px solid var(--hm-line);
    background: #fbfcfe;
}

.hm-avail-verdict.is-ok {
    color: #12805a;
    background: rgba(30, 158, 106, .08);
    border-color: rgba(30, 158, 106, .28);
}

.hm-avail-verdict.is-no {
    color: #b23b43;
    background: rgba(224, 86, 92, .08);
    border-color: rgba(224, 86, 92, .28);
}

.hm-avail-verdict .mud-icon-root {
    flex: 0 0 auto;
    margin-top: 1px;
}

.hm-avail-verdict__title {
    font-size: .9rem;
    font-weight: 800;
}

.hm-avail-verdict__text {
    font-size: .78rem;
    font-weight: 600;
    opacity: .85;
    margin-top: 3px;
    line-height: 1.7;
}

.hm-avail-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.hm-avail-toolbar__hint {
    font-size: .76rem;
    color: var(--hm-muted);
}

.hm-avail-toolbar__count {
    font-size: .8rem;
    font-weight: 800;
    color: var(--hm-primary);
}

.hm-avail-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 320px;
    overflow-y: auto;
}

.hm-avail-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--hm-radius);
    border: 1.5px solid var(--hm-line);
    background: #fff;
    cursor: pointer;
    transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}

.hm-avail-item:hover {
    border-color: rgba(11, 60, 123, .32);
    background: #fbfcfe;
}

.hm-avail-item:focus-visible {
    outline: 2px solid var(--hm-primary);
    outline-offset: 2px;
}

.hm-avail-item.is-picked {
    border-color: var(--hm-primary);
    background: rgba(11, 60, 123, .05);
    box-shadow: 0 0 0 2px rgba(11, 60, 123, .1);
}

.hm-avail-item__check {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    color: #b6c2d4;
}

.hm-avail-item.is-picked .hm-avail-item__check {
    color: var(--hm-primary);
}

.hm-avail-item__main {
    flex: 1 1 auto;
    min-width: 0;
}

.hm-avail-item__title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: .88rem;
    font-weight: 800;
    color: var(--hm-ink);
}

.hm-avail-item__fit {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 800;
    color: #12805a;
    background: rgba(30, 158, 106, .12);
}

.hm-avail-item__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    margin-top: 3px;
    font-size: .74rem;
    color: var(--hm-muted);
}

.hm-avail-item__price {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: start;
}

.hm-avail-item__total {
    direction: ltr;
    font-size: .88rem;
    font-weight: 800;
    color: var(--hm-primary);
}

.hm-avail-item__unit {
    direction: ltr;
    font-size: .7rem;
    color: var(--hm-muted);
}

/* ==========================================================================
   الحجوزات الجماعية
   ========================================================================== */

/* ملخّص توزيع النزلاء على غرف المجموعة */
.hm-occupancy {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.hm-occupancy__room {
    padding: 12px 14px;
    border-radius: var(--hm-radius);
    border: 1.5px solid var(--hm-line);
    background: #fff;
}

.hm-occupancy__room--unassigned {
    background: #fbfcfe;
    border-style: dashed;
}

.hm-occupancy__number {
    font-size: .86rem;
    font-weight: 800;
    color: var(--hm-ink);
}

.hm-occupancy__meta {
    font-size: .72rem;
    color: var(--hm-muted);
    margin-top: 2px;
}

.hm-occupancy__count {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    font-size: .82rem;
    font-weight: 800;
    color: var(--hm-primary);
}

.hm-occupancy__count .mud-icon-root {
    font-size: 1rem !important;
}

.hm-occupancy__room--unassigned .hm-occupancy__count {
    color: var(--hm-muted);
}

/* صفوف نزلاء المجموعة */
.hm-guest-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hm-guest-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--hm-radius);
    border: 1.5px solid var(--hm-line);
    background: #fff;
}

.hm-guest-row--readonly {
    background: #fbfcfe;
}

.hm-guest-row__info {
    flex: 1 1 auto;
    min-width: 0;
}

.hm-guest-row__name {
    font-size: .88rem;
    font-weight: 800;
    color: var(--hm-ink);
}

.hm-guest-row__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    margin-top: 3px;
    font-size: .74rem;
    color: var(--hm-muted);
}

.hm-guest-row__room {
    width: 170px;
    flex: 0 0 auto;
}

.hm-guest-row__actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 2px;
}

/* دفعات المجموعة */
.hm-payment-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hm-payment-item {
    --hm-pay-accent: #cbd5e1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px;
    border-radius: var(--hm-radius);
    border: 1.5px solid var(--hm-line);
    border-inline-start: 4px solid var(--hm-pay-accent);
    background: #fff;
}

.hm-payment-item--pending { --hm-pay-accent: #F5C423; }
.hm-payment-item--paid { --hm-pay-accent: #1E9E6A; }
.hm-payment-item--partial { --hm-pay-accent: #2F80ED; }
.hm-payment-item--refunded { --hm-pay-accent: #94a3b8; }
.hm-payment-item--cancelled { --hm-pay-accent: #E0565C; }

.hm-payment-item__head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.hm-payment-item__amount {
    direction: ltr;
    font-size: 1rem;
    font-weight: 800;
    color: var(--hm-primary);
}

.hm-payment-item__actions {
    margin-inline-start: auto;
    display: flex;
    align-items: center;
    gap: 2px;
}

.hm-payment-item__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    font-size: .76rem;
    color: var(--hm-muted);
}

.hm-payment-item__meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.hm-payment-item__meta .mud-icon-root {
    font-size: 1rem !important;
    color: #94a3b8;
}

.hm-payment-item__notes {
    font-size: .76rem;
    color: var(--hm-ink);
    opacity: .8;
    line-height: 1.7;
}

/* شارات حالة الدفعة */
.hm-pay--pending {
    color: #a16207;
    background: rgba(245, 196, 35, .2);
}

.hm-pay--paid {
    color: #12805a;
    background: rgba(30, 158, 106, .12);
}

.hm-pay--partial {
    color: #1d4ed8;
    background: rgba(47, 128, 237, .13);
}

.hm-pay--refunded {
    color: #64748b;
    background: #eef2f7;
}

.hm-pay--cancelled {
    color: #b23b43;
    background: rgba(224, 86, 92, .12);
}

/* ==========================================================================
   الغرف المنتظر إخلاؤها اليوم
   ========================================================================== */

/* شريحة مفصولة بصريًا عن شرائح الحالة: هي تصفية زمنية لا حالة تشغيلية */
.hm-status-chip--due {
    border-color: rgba(232, 163, 23, .45);
    background: rgba(232, 163, 23, .07);
}

.hm-status-chip--due .hm-status-chip__count {
    color: #c2410c;
}

.hm-status-chip--due.is-active {
    border-color: #C77E12;
    box-shadow: 0 0 0 3px rgba(232, 163, 23, .18);
}

/* شارة داخل بطاقة الغرفة */
.hm-room-card__due {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    align-self: center;
    margin-top: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 800;
    color: #9a3412;
    background: rgba(232, 163, 23, .18);
    border: 1px solid rgba(232, 163, 23, .32);
    white-space: nowrap;
}

.hm-room-card__due .mud-icon-root {
    font-size: .9rem !important;
}

/* ==========================================================================
   خيار طباعة الفاتورة داخل حوار الحجز
   ========================================================================== */

.hm-print-option {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-top: 18px;
    padding: 10px 12px;
    border-radius: var(--hm-radius);
    border: 1.5px dashed var(--hm-line);
    background: #fbfcfe;
}

.hm-print-option__body {
    padding-top: 6px;
}

.hm-print-option__title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .84rem;
    font-weight: 800;
    color: var(--hm-primary);
}

.hm-print-option__title .mud-icon-root {
    font-size: 1.05rem !important;
}

.hm-print-option__hint {
    margin-top: 2px;
    font-size: .74rem;
    color: var(--hm-muted);
    line-height: 1.7;
}

/* ======================================================================
   السندات المالية
   ====================================================================== */

/* خيارات نوع السند في صف واحد داخل الحوار العريض */
.hm-state-options--row {
    flex-direction: row;
}

.hm-state-options--row .hm-state-option {
    flex: 1 1 0;
}

.hm-state-option:disabled {
    cursor: default;
    opacity: .75;
}

.hm-state-option--receipt .hm-state-option__icon { color: #12805a; background: rgba(30, 158, 106, .12); }
.hm-state-option--payment .hm-state-option__icon { color: #b23b43; background: rgba(224, 86, 92, .12); }

.hm-state-option--payment.is-selected {
    border-color: #b23b43;
    background: rgba(224, 86, 92, .06);
    box-shadow: 0 0 0 3px rgba(224, 86, 92, .1);
}

.hm-state-option--receipt.is-selected {
    border-color: #12805a;
    background: rgba(30, 158, 106, .06);
    box-shadow: 0 0 0 3px rgba(30, 158, 106, .1);
}

.hm-pill--receipt {
    color: #12805a;
    background: rgba(30, 158, 106, .12);
}

.hm-pill--payment {
    color: #b23b43;
    background: rgba(224, 86, 92, .12);
}

.hm-voucher-avatar.mud-avatar.hm-voucher-avatar--receipt { color: #12805a; background: rgba(30, 158, 106, .12); }
.hm-voucher-avatar.mud-avatar.hm-voucher-avatar--payment { color: #b23b43; background: rgba(224, 86, 92, .12); }

/* التفقيط تحت حقل المبلغ */
.hm-voucher-words {
    margin: -6px 0 14px;
    padding: 8px 12px;
    border-radius: var(--hm-radius);
    background: rgba(11, 60, 123, .05);
    border: 1px dashed rgba(11, 60, 123, .25);
    font-size: .8rem;
    font-weight: 700;
    color: var(--hm-primary);
}

.hm-voucher-noaccount {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 12px;
    border-radius: var(--hm-radius);
    border: 1px dashed var(--hm-line);
    background: #f8fafc;
    font-size: .8rem;
    color: var(--hm-muted);
}

/* خلية الحساب القابلة للنقر لفتح كشف الحساب */
.hm-link-cell {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    border: 0;
    background: transparent;
    font-family: inherit;
    text-align: start;
    color: var(--hm-primary);
    cursor: pointer;
}

.hm-link-cell:hover .hm-cell-primary {
    text-decoration: underline;
}

.hm-cell-clamp {
    max-width: 240px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* صف من ثلاثة حقول (من / إلى / زر) */
.hm-form-row--3 {
    grid-template-columns: 1fr 1fr auto;
}

.hm-form-field--action {
    min-width: 160px;
}

@media (max-width: 700px) {
    .hm-form-row--3 {
        grid-template-columns: 1fr;
    }

    .hm-state-options--row {
        flex-direction: column;
    }
}

/* كشف الحساب — الملخّص */
.hm-statement-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 8px;
}

@media (max-width: 800px) {
    .hm-statement-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.hm-statement-tile {
    padding: 12px 14px;
    border-radius: var(--hm-radius);
    border: 1px solid var(--hm-line);
    background: #f8fafc;
}

.hm-statement-tile__label {
    font-size: .72rem;
    font-weight: 700;
    color: var(--hm-muted);
}

.hm-statement-tile__value {
    direction: ltr;
    text-align: end;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--hm-ink);
}

.hm-statement-tile__hint {
    font-size: .7rem;
    color: #94a3b8;
}

.hm-statement-tile--debit .hm-statement-tile__value { color: #b23b43; }
.hm-statement-tile--credit .hm-statement-tile__value { color: #12805a; }
.hm-statement-tile--due { border-color: rgba(224, 86, 92, .4); background: rgba(224, 86, 92, .06); }
.hm-statement-tile--due .hm-statement-tile__value { color: #b23b43; }

/* كشف الحساب — الجدول */
.hm-statement-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .8rem;
}

.hm-statement-table th {
    padding: 9px 10px;
    text-align: start;
    font-size: .72rem;
    font-weight: 800;
    color: var(--hm-primary);
    background: #f1f5f9;
    border-bottom: 1px solid var(--hm-line);
    white-space: nowrap;
}

.hm-statement-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #eef2f7;
    vertical-align: top;
}

.hm-statement-table tbody tr:hover td {
    background: #fafbfd;
}

.hm-statement-table .num {
    direction: ltr;
    text-align: end;
    white-space: nowrap;
}

.hm-statement-table .ltr {
    direction: ltr;
    text-align: end;
    white-space: nowrap;
}

.hm-statement-table .desc {
    min-width: 200px;
    color: var(--hm-ink);
}

.hm-statement-table .strong {
    font-weight: 800;
}

.hm-empty--compact {
    padding: 22px 12px;
}

/* ======================================================================
   التقارير
   ====================================================================== */

.hm-report-filters {
    padding: 18px 20px 14px;
}

.hm-report-filters__row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    gap: 14px;
    align-items: end;
}

@media (max-width: 900px) {
    .hm-report-filters__row {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 560px) {
    .hm-report-filters__row {
        grid-template-columns: 1fr;
    }
}

.hm-report-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.hm-report-quick__btn {
    padding: 4px 12px;
    border-radius: 99px;
    border: 1px solid var(--hm-line);
    background: #f8fafc;
    font-family: inherit;
    font-size: .74rem;
    font-weight: 700;
    color: var(--hm-muted);
    cursor: pointer;
    transition: border-color .15s ease, color .15s ease, background .15s ease;
}

.hm-report-quick__btn:hover {
    border-color: var(--hm-primary);
    color: var(--hm-primary);
    background: rgba(11, 60, 123, .05);
}

.hm-statement-summary--wide {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

@media (max-width: 1100px) {
    .hm-statement-summary--wide {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .hm-statement-summary--wide {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.hm-report-status-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hm-statement-table tfoot td {
    background: #f1f5f9;
    border-top: 1px solid var(--hm-line);
}

.hm-text-due { color: #b23b43; }
.hm-text-ok { color: #12805a; }

/* ======================================================================
   المستخدمون والصلاحيات
   ====================================================================== */

.hm-role--admin { color: #b23b43; background: rgba(224, 86, 92, .12); }
.hm-role--manager { color: #1d4ed8; background: rgba(47, 128, 237, .13); }
.hm-role--reception { color: #12805a; background: rgba(30, 158, 106, .12); }
.hm-role--housekeeping { color: #6d28d9; background: rgba(124, 58, 237, .12); }
.hm-role--accountant { color: #a16207; background: rgba(245, 196, 35, .2); }

.hm-state-options--grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

@media (max-width: 560px) {
    .hm-state-options--grid {
        grid-template-columns: 1fr;
    }
}

.hm-state-option--role .hm-state-option__icon { color: var(--hm-primary); background: rgba(11, 60, 123, .08); }

.hm-placeholder__icon--danger {
    color: #b23b43;
    background: rgba(224, 86, 92, .12);
}

/* حوار الصلاحيات */
.hm-perm-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 8px 12px;
    margin-bottom: 14px;
    border-radius: var(--hm-radius);
    background: #f8fafc;
    border: 1px solid var(--hm-line);
    font-size: .82rem;
    color: var(--hm-muted);
}

.hm-perm-toolbar__count strong {
    color: var(--hm-primary);
    font-weight: 800;
}

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

@media (max-width: 760px) {
    .hm-perm-grid {
        grid-template-columns: 1fr;
    }
}

.hm-perm-module {
    border: 1.5px solid var(--hm-line);
    border-radius: var(--hm-radius);
    background: #fff;
    overflow: hidden;
    transition: border-color .18s ease;
}

.hm-perm-module.is-full { border-color: rgba(30, 158, 106, .5); }
.hm-perm-module.is-partial { border-color: rgba(11, 60, 123, .35); }

.hm-perm-module__head {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px 6px 12px;
    background: #f8fafc;
    border-bottom: 1px solid var(--hm-line);
}

.hm-perm-module.is-full .hm-perm-module__head { background: rgba(30, 158, 106, .07); }

.hm-perm-module__title {
    flex: 1 1 auto;
    font-size: .86rem;
    font-weight: 800;
    color: var(--hm-ink);
}

.hm-perm-module__count {
    font-size: .72rem;
    font-weight: 800;
    color: var(--hm-muted);
    direction: ltr;
}

.hm-perm-module__items {
    display: flex;
    flex-direction: column;
    padding: 6px 12px 8px;
}

.hm-perm-item.mud-checkbox .mud-typography,
.hm-perm-item .mud-checkbox-label {
    font-size: .8rem;
}

/* مؤشرات لوحة التحكم */
.hm-stat__value .mud-skeleton {
    display: inline-block;
    vertical-align: middle;
}

.hm-report-status-strip .ms-auto {
    margin-inline-start: auto;
    align-self: center;
}
