/* ── Readex Pro (self-hosted, variable 300–700, Arabic + Latin in one family) ── */
@font-face {
    font-family: 'Readex Pro';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('../fonts/readex-pro/readex-pro-arabic.woff2') format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

@font-face {
    font-family: 'Readex Pro';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('../fonts/readex-pro/readex-pro-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Readex Pro';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('../fonts/readex-pro/readex-pro-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}


html, body { font-family: 'Readex Pro', sans-serif; }
.ltr { direction: ltr; unicode-bidi: isolate; }

/* ── Design tokens ── */
/* Brand (logo colors): navy #0A1E3C · copper #C58B35 · olive #99872D — mirrors TenantPortalTheme.cs */
:root {
    --aq-navy:          #0A1E3C;
    --aq-copper:        #C58B35;
    --aq-olive:         #99872D;
    --aq-chrome:        #0A1E3C;
    --aq-on-chrome:     #E8ECF2;
    --aq-on-chrome-2:   #A7B3C4;
    --aq-on-chrome-3:   #6F7E93;
    --aq-primary:       #0A1E3C;
    --aq-primary-light: #E8ECF3;
    --aq-secondary:     #56637A;
    --aq-text-primary:  #132238;
    --aq-text-secondary:#56637A;
    --aq-surface:       #FFFFFF;
    --aq-background:    #F5F2EB;
    --aq-divider:       #E6E0D3;
    --aq-success:       #2E7D4F;
    --aq-success-light: #EEF6F0;
    --aq-warning:       #C2570C;
    --aq-warning-light: #FDF4EC;
    --aq-error:         #B42318;
    --aq-error-light:   #FDF1EF;
    --aq-radius:        4px;
    --aq-radius-lg:     6px;
    --aq-shadow-sm:     none;
    --aq-shadow-md:     0 2px 8px rgba(10,30,60,0.08);
}

/* ── Chrome: navy app bar + navy drawer frame a sand canvas ── */
.custom-appbar {
    background: var(--aq-chrome) !important;
    color: var(--aq-on-chrome) !important;
    border-bottom: none;
}
.custom-appbar .mud-icon-button,
.custom-appbar .mud-button-text { color: var(--aq-on-chrome-2) !important; }
.custom-appbar .mud-icon-button:hover,
.custom-appbar .mud-button-text:hover { color: #FFFFFF !important; background-color: rgba(255,255,255,0.06) !important; }

.mud-layout > .mud-drawer { background-color: var(--aq-chrome) !important; border: none; }
.mud-layout > .mud-drawer .mud-nav-link {
    margin: 0 0.5rem 1px;
    border-radius: 4px;
    font-size: 0.8125rem;
    color: var(--aq-on-chrome-2);
    position: relative;
}
.mud-layout > .mud-drawer .mud-nav-link .mud-nav-link-icon { color: var(--aq-on-chrome-3); }
.mud-layout > .mud-drawer .mud-nav-link:hover { background: rgba(255,255,255,0.05); color: #FFFFFF; }
/* :not() matches MudBlazor's own .mud-nav-link.active:not(.mud-nav-link-disabled) specificity, which otherwise paints the text navy on the navy drawer */
.mud-layout > .mud-drawer .mud-nav-link.active:not(.mud-nav-link-disabled) {
    background: rgba(197,139,53,0.13);
    color: #FFFFFF;
    font-weight: 500;
}
.mud-layout > .mud-drawer .mud-nav-link.active .mud-nav-link-icon { color: var(--aq-copper); }
.mud-layout > .mud-drawer .mud-nav-link.active::before {
    content: "";
    position: absolute;
    inset-inline-start: -0.5rem;
    top: 6px;
    bottom: 6px;
    width: 3px;
    border-start-end-radius: 2px;
    border-end-end-radius: 2px;
    background: var(--aq-copper);
}
.mud-layout > .mud-drawer .mud-divider { border-color: rgba(255,255,255,0.08); }

.mud-layout > .mud-main-content { background-color: var(--aq-chrome); }
.portal-canvas {
    background-color: var(--mud-palette-background);
    border-start-start-radius: 14px;
    min-height: calc(100vh - var(--mud-appbar-height));
}
@media (max-width: 959.98px) {
    .portal-canvas { border-start-start-radius: 0; }
}

/* ── Brand ── */
.aq-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}
.aq-brand-img { width: 80%; height: 80%; object-fit: contain; }
.aq-brand-icon {
    width: 32px;
    height: 32px;
    background: #0A1E3C;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.aq-brand-name {
    font-weight: 700;
    font-size: 1.125rem;
    letter-spacing: -0.3px;
    color: var(--aq-text-primary);
    line-height: 1;
}

/* ── User chip ── */
.aq-user-chip {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 4px 10px 4px 5px;
}
/* Copper doorway arch from the logo */
.aq-user-avatar {
    width: 26px;
    height: 30px;
    border-radius: 999px 999px 3px 3px;
    background: var(--aq-copper);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--aq-navy);
    flex-shrink: 0;
    letter-spacing: 0;
}
.aq-user-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--aq-on-chrome);
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
@media (max-width: 599.98px) {
    .aq-user-name { max-width: 140px; }
}

/* ── Drawer header ── */
.portal-drawer-header {
    padding: 16px;
    border-bottom: 1px solid var(--mud-palette-divider);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ── Page header ── */
.portal-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}
.portal-page-header .mud-typography-h5 {
    font-weight: 700;
    letter-spacing: -0.3px;
    margin: 0;
}

/* ── Stat cards ── */
.stat-card {
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: var(--aq-radius-lg);
    padding: 20px;
    cursor: pointer;
    transition: box-shadow 0.18s ease, transform 0.18s ease;
    display: block;
    position: relative;
    overflow: hidden;
    height: 100%;
    box-sizing: border-box;
}
.stat-card:hover {
    box-shadow: var(--aq-shadow-md);
    transform: translateY(-2px);
}
.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--stat-accent, var(--aq-primary));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.22s ease;
}
.stat-card:hover::after {
    transform: scaleX(1);
}
.stat-card.no-action {
    cursor: default;
}
.stat-card.no-action:hover {
    box-shadow: none;
    transform: none;
}
.stat-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    flex-shrink: 0;
}
.stat-icon-primary { background: var(--aq-primary-light); color: var(--aq-primary); }
.stat-icon-warning  { background: var(--aq-warning-light); color: var(--aq-warning); }
.stat-icon-error    { background: var(--aq-error-light);   color: var(--aq-error);   }
.stat-icon-success  { background: var(--aq-success-light); color: var(--aq-success); }

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.15;
    color: var(--mud-palette-text-primary);
    letter-spacing: -0.5px;
}
.stat-value-sm {
    font-size: 1.25rem;
}
.stat-label {
    font-size: 0.8125rem;
    color: var(--mud-palette-text-secondary);
    margin-top: 4px;
    font-weight: 500;
}
.stat-sublabel {
    font-size: 0.75rem;
    color: var(--mud-palette-text-disabled);
    margin-top: 3px;
}

/* ── Lease cards ── */
.lease-card {
    border: 1px solid var(--mud-palette-lines-default) !important;
    border-radius: var(--aq-radius-lg) !important;
    transition: box-shadow 0.18s ease;
    overflow: hidden;
    cursor: pointer;
    background: var(--mud-palette-surface);
}
.lease-card:hover {
    box-shadow: var(--aq-shadow-md) !important;
}
.lease-status-strip {
    height: 4px;
    width: 100%;
    background: var(--mud-palette-lines-default);
}
.lease-card.active-lease .lease-status-strip {
    background: var(--mud-palette-success);
}
.lease-card.expired-lease .lease-status-strip {
    background: var(--mud-palette-lines-default);
}
.lease-amount {
    font-size: 1.1875rem;
    font-weight: 700;
    color: var(--aq-primary);
    letter-spacing: -0.3px;
    margin-top: 4px;
}

/* ── Table wrapper ── */
.portal-table-wrap {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: var(--aq-radius-lg);
    overflow: hidden;
}
.portal-table-wrap .mud-table {
    border: none !important;
    border-radius: 0 !important;
}
.portal-table-wrap .mud-table-head .mud-table-cell {
    background: var(--aq-background);
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--aq-text-secondary);
}

/* ── Empty state ── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3rem 1rem;
    text-align: center;
}
.empty-state .mud-icon-root {
    font-size: 3rem;
    opacity: 0.4;
}

/* ── Skeleton / loading ── */
.stat-skeleton {
    border-radius: var(--aq-radius-lg) !important;
}

/* ── Utilities ── */
.ltr-num  { direction: ltr; unicode-bidi: embed; }
.ltr-content { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] .rtl-mirror { transform: scaleX(-1); }
.action-col { text-align: end !important; }
.fw-600   { font-weight: 600; }
.fs-13    { font-size: 0.8125rem; }

.aq-brand-logo { height: 30px; width: auto; display: block; }

/* ── Pay page ── */
.pay-method { display: flex; align-items: center; gap: 16px; padding: 16px 20px; cursor: pointer; border: 1px solid var(--mud-palette-lines-default); transition: border-color .15s, box-shadow .15s; }
.pay-method:hover, .pay-method-selected { border-color: var(--mud-palette-secondary); box-shadow: 0 2px 8px rgba(10, 30, 60, 0.08); }
.pay-method-disabled { opacity: .5; pointer-events: none; filter: grayscale(1); }
.pay-method-icon { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; }
.pay-method-text { flex: 1; min-width: 0; }
.pay-fee-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-block: 2px; }
