/* Molak Marafeq panel theme */
.molak-panel,
.molak-auth {
    --brand: #0F766E;
    --brand-strong: #0B5F59;
    --brand-soft: #E3F4F1;
    --brand-softer: #F2FAF8;
    --orange: #B7791F;
    --orange-soft: #FFF3D8;
}

.molak-sidebar .molak-brand {
    flex-direction: column;
    gap: 8px;
    color: var(--brand-strong);
    font-weight: 700;
}
.molak-brand img {
    width: 74px;
    height: 74px;
    object-fit: contain;
}
.molak-panel .btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.molak-panel .btn-primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
.molak-panel .nav-item.active {
    background: var(--brand);
    color: #fff;
}
.molak-panel .nav-item.active svg { color: #fff; }
.molak-panel .njik-panel-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.molak-panel .njik-panel-link img {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    object-fit: contain;
}
.molak-panel .user-menu-btn .avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    overflow: hidden;
    background: #F1F3F5;
    border: 1px solid #D8DDE3;
    color: #7B838C;
    display: grid;
    place-items: center;
}
.molak-panel .user-menu-btn .avatar svg {
    width: 18px;
    height: 18px;
    max-width: 18px;
    max-height: 18px;
    color: currentColor;
    stroke-width: 1.9;
}
.molak-panel .user-menu .dropdown {
    min-width: 170px;
    padding: 5px;
}
.molak-panel .user-menu .dropdown a,
.molak-panel .user-menu .dropdown button {
    min-height: 36px;
    padding: 8px 10px;
    gap: 8px;
    font-size: 12.5px;
    line-height: 1.35;
}
.molak-panel .user-menu .dropdown svg {
    width: 18px;
    height: 18px;
    max-width: 18px;
    max-height: 18px;
    flex: 0 0 18px;
    stroke-width: 1.9;
}
.molak-view-switch {
    position: relative;
    display: inline-flex;
}
.molak-view-switch-menu {
    left: auto;
    right: 0;
    min-width: 178px;
}
.molak-view-switch-menu svg {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
}
.molak-view-switch-menu a.active {
    background: var(--brand-soft);
    color: var(--brand-strong);
    font-weight: 700;
}

.molak-login {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
    background:
        linear-gradient(135deg, rgba(8, 47, 73, .88), rgba(15, 118, 110, .88)),
        url('../molak/login-bg.png') center/cover no-repeat;
}
.molak-login-card {
    width: min(100%, 410px);
    background: #fff;
    border-radius: 18px;
    padding: 32px 28px;
    box-shadow: 0 22px 70px rgba(0, 0, 0, .28);
}
.molak-login-card img {
    width: 94px;
    height: 94px;
    object-fit: contain;
    display: block;
    margin: 0 auto 8px;
}
.molak-login-card h1 {
    text-align: center;
    color: var(--brand-strong);
    font-size: 22px;
}
.molak-login-card p {
    text-align: center;
    color: var(--muted);
    margin: 3px 0 22px;
}
.molak-login-card label {
    display: block;
    margin: 12px 0 5px;
    font-weight: 600;
}
.molak-login-submit {
    width: 100%;
    justify-content: center;
    margin-top: 18px;
    height: 46px;
}

.grid.two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 18px;
}
.molak-wallet-grid {
    margin-top: 16px;
    grid-template-columns: minmax(0, 1fr);
}
.mini-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}
.mini-table th,
.mini-table td {
    border-bottom: 1px solid var(--line);
    padding: 9px 8px;
    text-align: right;
}
.mini-table th {
    color: var(--muted);
    font-weight: 600;
}

.molak-table-toolbar {
    gap: 8px;
}
.molak-search {
    margin: 0;
    flex: 1 1 280px;
}
.molak-filter-select {
    min-width: 142px;
    max-width: 210px;
}
.row-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.row-actions form { margin: 0; }
.molak-row-actions {
    justify-content: center;
}
.molak-panel .row-action-trigger {
    width: 30px;
    height: 30px;
    border-color: var(--line);
    background: var(--card);
    color: var(--ink);
}
.molak-panel .row-action-trigger:hover,
.molak-panel .row-menu.open > .row-action-trigger {
    background: var(--hover);
    border-color: var(--brand);
    color: var(--brand-strong);
}
.molak-panel .row-menu-list {
    min-width: 168px;
    text-align: right;
}
.molak-panel .row-menu-form {
    margin: 0;
}
.molak-panel .row-menu-list .row-menu-item {
    justify-content: flex-start;
}
.molak-panel .row-menu-list .row-menu-item svg {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
}
.molak-panel .row-menu-list .row-menu-item.danger {
    color: var(--danger);
}
.phone-input {
    display: flex;
    align-items: stretch;
    direction: ltr;
}
.phone-input span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 62px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-right: 0;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    background: var(--bg);
    color: var(--ink);
    font-weight: 700;
}
.phone-input .input {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    direction: ltr;
}
.molak-entity-modal,
.molak-staff-modal {
    max-width: 860px;
}
.molak-entity-modal.entity-approved-providers {
    width: min(960px, calc(100vw - 32px));
    max-width: 960px;
}
.molak-entity-modal.entity-approved-providers .modal-body {
    max-height: min(72vh, 720px);
    overflow: auto;
}
.molak-entity-modal.entity-approved-providers .form-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 14px 16px;
    align-items: start;
}
.molak-entity-modal.entity-approved-providers .entity-field {
    grid-column: span 4;
    min-width: 0;
}
.molak-entity-modal.entity-approved-providers .entity-field-name,
.molak-entity-modal.entity-approved-providers .entity-field-description,
.molak-entity-modal.entity-approved-providers .entity-field-contract_terms,
.molak-entity-modal.entity-approved-providers .entity-field-offer_file_url {
    grid-column: 1 / -1;
}
.molak-entity-modal.entity-approved-providers .entity-field-phone,
.molak-entity-modal.entity-approved-providers .entity-field-whatsapp,
.molak-entity-modal.entity-approved-providers .entity-field-email {
    grid-column: span 4;
}
.molak-entity-modal.entity-approved-providers .entity-field-city,
.molak-entity-modal.entity-approved-providers .entity-field-rating,
.molak-entity-modal.entity-approved-providers .entity-field-starting_price,
.molak-entity-modal.entity-approved-providers .entity-field-status,
.molak-entity-modal.entity-approved-providers .entity-field-created_by_phone {
    grid-column: span 3;
}
.molak-entity-modal.entity-approved-providers .entity-field-is_featured {
    grid-column: span 3;
    align-self: end;
    min-height: 42px;
    display: flex;
    align-items: center;
}
.molak-entity-modal.entity-approved-providers label {
    display: block;
    margin-bottom: 7px;
    font-size: 12px;
    color: var(--muted);
}
.molak-entity-modal.entity-approved-providers .check-line {
    margin-top: 22px;
    color: var(--ink);
}
.molak-entity-modal.entity-approved-providers textarea.input {
    min-height: 94px;
    resize: vertical;
}
.molak-entity-modal.entity-approved-providers input[type="file"].input {
    padding: 10px;
    min-height: 44px;
    background: var(--surface);
}
.molak-thumb {
    display: inline-flex;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    overflow: hidden;
    vertical-align: middle;
}
.molak-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.file-current-box {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}
.file-current-box[hidden] {
    display: none;
}
.file-current-preview {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--surface);
}
.molak-entity-modal.entity-approved-providers .file-current-link {
    display: inline-flex;
    width: fit-content;
    color: var(--brand);
    font-weight: 700;
    font-size: 12px;
    text-decoration: none;
}
.molak-entity-modal.entity-approved-providers .file-current-link[hidden] {
    display: none;
}
.file-delete-line {
    margin: 0 !important;
    font-size: 12px !important;
    color: var(--danger, #b42318) !important;
}
.field-wide { grid-column: 1 / -1; }
.check-line {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 600;
}
.text-danger { color: var(--danger); }
@media (max-width: 760px) {
    .molak-entity-modal.entity-approved-providers .form-grid {
        grid-template-columns: 1fr;
    }
    .molak-entity-modal.entity-approved-providers .entity-field,
    .molak-entity-modal.entity-approved-providers .entity-field-phone,
    .molak-entity-modal.entity-approved-providers .entity-field-whatsapp,
    .molak-entity-modal.entity-approved-providers .entity-field-email,
    .molak-entity-modal.entity-approved-providers .entity-field-city,
    .molak-entity-modal.entity-approved-providers .entity-field-rating,
    .molak-entity-modal.entity-approved-providers .entity-field-starting_price,
    .molak-entity-modal.entity-approved-providers .entity-field-status,
    .molak-entity-modal.entity-approved-providers .entity-field-created_by_phone,
    .molak-entity-modal.entity-approved-providers .entity-field-is_featured {
        grid-column: 1 / -1;
    }
}
.molak-template-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 16px 0;
}
.molak-permissions {
    display: grid;
    gap: 12px;
}
.permission-group {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 12px;
    background: var(--bg);
}
.permission-group h4 {
    margin-bottom: 10px;
    font-size: 13px;
}
.permission-module {
    display: grid;
    grid-template-columns: 170px 1fr;
    gap: 10px;
    padding: 9px 0;
    border-top: 1px solid var(--line);
}
.permission-module:first-of-type { border-top: 0; }
.permission-module div {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.permission-module label {
    display: inline-flex;
    gap: 5px;
    align-items: center;
    color: var(--ink);
}

.molak-dashboard {
    display: grid;
    gap: 18px;
}

.molak-dashboard-head {
    margin-bottom: 0;
}

.molak-dashboard-head .page-actions {
    gap: 8px;
}

.molak-dashboard-overview {
    display: grid;
    grid-template-columns: minmax(280px, .72fr) minmax(0, 1.28fr);
    gap: 16px;
    align-items: stretch;
}

.molak-balance-card {
    min-height: 156px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow);
    padding: 22px 24px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
}

.molak-balance-copy {
    display: grid;
    gap: 8px;
}

.molak-balance-copy span {
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 600;
}

.molak-balance-copy strong {
    color: var(--ink-strong);
    font-size: 32px;
    line-height: 1;
    font-weight: 750;
    direction: ltr;
    text-align: right;
}

.molak-balance-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--brand);
    display: grid;
    place-items: center;
}

.molak-balance-icon svg {
    width: 20px;
    height: 20px;
}

.molak-metrics {
    min-width: 0;
    border-block: 1px solid var(--line);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.molak-metric {
    position: relative;
    min-height: 78px;
    padding: 15px 18px;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 12px;
}

.molak-metric:not(:nth-child(3n))::after {
    content: '';
    position: absolute;
    inset-inline-end: 0;
    inset-block: 16px;
    width: 1px;
    background: var(--line);
}

.molak-metric:nth-child(n + 4) {
    border-top: 1px solid var(--line);
}

.molak-metric-icon {
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: transparent !important;
    color: var(--brand);
    display: grid;
    place-items: center;
}

.molak-metric-icon svg {
    width: 17px;
    height: 17px;
}

.molak-metric-label {
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.35;
}

.molak-metric-value {
    margin-top: 3px;
    color: var(--ink-strong);
    font-size: 23px;
    font-weight: 750;
    line-height: 1;
    direction: ltr;
    text-align: right;
}

.molak-dashboard-tables {
    margin-top: 0;
    align-items: stretch;
}

.molak-dashboard-card {
    min-height: 300px;
    display: flex;
    flex-direction: column;
}

.molak-dashboard-card .card-head {
    min-height: 56px;
}

.molak-dashboard-card .card-head .link-detail {
    margin-inline-start: auto;
}

.molak-dashboard-card .card-pad {
    flex: 1;
    padding-top: 10px;
}

.molak-dashboard-table th,
.molak-dashboard-table td {
    height: 42px;
    vertical-align: middle;
}

.molak-dashboard-table .mono {
    direction: ltr;
    text-align: right;
}

html[data-theme="dark"] .molak-balance-card {
    background: var(--card);
    border-color: var(--line);
}

html[data-theme="dark"] .molak-balance-icon,
html[data-theme="dark"] .molak-metric-icon {
    border-color: var(--line-strong);
}

.app-users-head {
    margin-bottom: 14px;
}

.app-users-card {
    overflow: hidden;
}

.app-users-stats {
    display: grid;
    /* عدد المربعات يتغيّر بتغيّر التصنيفات، فتتوزّع تلقائياً على صف واحد. */
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    border-bottom: 1px solid var(--line);
}

.app-users-stat {
    min-height: 72px;
    padding: 15px 18px;
    color: var(--ink);
    text-decoration: none;
    border-inline-start: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.app-users-stat:first-child {
    border-inline-start: 0;
}

.app-users-stat span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
    line-height: 1.4;
}

.app-users-stat strong {
    color: var(--ink-strong);
    font-size: 24px;
    line-height: 1;
    text-align: right;
}

.app-users-stat:hover,
.app-users-stat.active {
    background: var(--hover);
}

.app-users-toolbar {
    border-bottom: 1px solid var(--line);
}

.app-users-property-select {
    min-width: 220px;
}

.app-users-table th,
.app-users-table td {
    height: 58px;
    vertical-align: middle;
}

.app-user-main {
    color: var(--ink-strong);
    font-weight: 700;
    line-height: 1.45;
}

.app-user-sub {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.4;
}

.app-user-ltr,
.app-user-number {
    direction: ltr;
    unicode-bidi: plaintext;
    text-align: right;
}

.app-user-role,
.app-user-status {
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding-inline-start: 9px;
    color: var(--ink);
    background: transparent !important;
    border: 0;
    border-inline-start: 2px solid currentColor;
    border-radius: 0;
    font-size: 12px;
    font-weight: 750;
    white-space: nowrap;
}

.app-user-role.role-registration { color: #B7791F; }
.app-user-role.role-delegate { color: var(--brand); }
.app-user-role.role-employee { color: #4B5563; }
.app-user-role.role-owner { color: #2563EB; }

.app-user-status.status-success { color: #15945F; }
.app-user-status.status-warning { color: #B7791F; }
.app-user-status.status-danger { color: #C2413A; }
.app-user-status.status-neutral { color: var(--muted); }

html[data-theme="dark"] .app-users-stat:hover,
html[data-theme="dark"] .app-users-stat.active {
    background: rgba(255, 255, 255, .035);
}

@media (max-width: 900px) {
    .molak-dashboard-overview { grid-template-columns: 1fr; }
    .molak-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .molak-metric:not(:nth-child(3n))::after { display: none; }
    .molak-metric:nth-child(odd)::after {
        content: '';
        display: block;
        position: absolute;
        inset-inline-end: 0;
        inset-block: 16px;
        width: 1px;
        background: var(--line);
    }
    .molak-metric:nth-child(n + 3) { border-top: 1px solid var(--line); }
    .grid.two { grid-template-columns: 1fr; }
    .permission-module { grid-template-columns: 1fr; }
    .app-users-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .app-users-stat:nth-child(odd) { border-inline-start: 0; }
}

@media (max-width: 560px) {
    .molak-balance-card {
        min-height: 132px;
        padding: 18px;
        align-items: center;
    }

    .molak-balance-copy strong {
        font-size: 27px;
    }

    .molak-metrics { grid-template-columns: 1fr; }
    .molak-metric::after { display: none !important; }
    .molak-metric:nth-child(n + 2) { border-top: 1px solid var(--line); }
    .app-users-stats { grid-template-columns: 1fr; }
    .app-users-stat {
        border-inline-start: 0;
        border-top: 1px solid var(--line);
    }
    .app-users-stat:first-child { border-top: 0; }
    .app-users-property-select { min-width: 100%; }
}


/* ===== شريط ملخّص الكيان ===== */
.entity-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 14px;
}

.entity-summary-box {
    min-height: 72px;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    border-inline-start: 1px solid var(--line);
}

.entity-summary-box:first-child { border-inline-start: 0; }

.entity-summary-value {
    color: var(--ink-strong);
    font-size: 23px;
    font-weight: 700;
    line-height: 1.15;
    direction: ltr;
    unicode-bidi: isolate;
    text-align: start;
    font-variant-numeric: tabular-nums;
}

.entity-summary-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
    line-height: 1.4;
}

.entity-summary-box.tone-success .entity-summary-value { color: var(--success, #1d806f); }
.entity-summary-box.tone-warning .entity-summary-value { color: var(--warning, #b06d12); }
.entity-summary-box.tone-danger  .entity-summary-value { color: var(--danger,  #b3261e); }

/* ===== رؤوس أعمدة قابلة للترتيب ===== */
.dt-sortable { padding: 0; }

.dt-sortable > a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 11px 14px;
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
}

.dt-sortable > a:hover { color: var(--brand-strong); }
.dt-sortable.is-sorted > a { color: var(--brand-strong); }

.dt-sort-arrow {
    font-size: 10px;
    opacity: .45;
    line-height: 1;
}

.dt-sortable.is-sorted .dt-sort-arrow { opacity: 1; }

/* ===== خلية الجوال ===== */
.molak-phone {
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.molak-phone:hover {
    color: var(--brand-strong);
    text-decoration: underline;
}

@media (max-width: 640px) {
    .entity-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .entity-summary-box { border-inline-start: 0; border-top: 1px solid var(--line); }
    .entity-summary-box:first-child,
    .entity-summary-box:nth-child(2) { border-top: 0; }
}

/* ===== خلية التحصيل ===== */
.collect-nums {
    display: flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

.collect-pct {
    font-size: 11px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 20px;
}

.collect-pct.is-full { color: #0f6f5c; background: rgba(29, 128, 111, .12); }
.collect-pct.is-part { color: #8a5410; background: rgba(176, 109, 18, .12); }
.collect-pct.is-none { color: #8d2b24; background: rgba(179, 38, 30, .10); }

.collect-warn { color: #b06d12; font-size: 13px; cursor: help; }

/* ===== صف متأخر ===== */
tr.row-overdue > td { background: rgba(179, 38, 30, .045); }
tr.row-overdue:hover > td { background: rgba(179, 38, 30, .08); }

.row-overdue-dot {
    color: #b3261e;
    font-size: 9px;
    margin-inline-start: 4px;
    vertical-align: middle;
    cursor: help;
}

/* ===== توزيع حسب فئة ===== */
.entity-breakdown { padding: 16px 18px; margin-bottom: 14px; }

.entity-breakdown-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.entity-breakdown-head h2 { font-size: 14px; line-height: 1.4; }

.entity-breakdown-head .mono {
    font-size: 15px;
    font-weight: 700;
    color: var(--ink-strong);
    direction: ltr;
    unicode-bidi: isolate;
    font-variant-numeric: tabular-nums;
}

.entity-breakdown-list { display: grid; gap: 7px; }

.breakdown-row {
    display: grid;
    grid-template-columns: minmax(110px, 150px) 1fr minmax(78px, auto) 46px;
    align-items: center;
    gap: 10px;
}

.breakdown-label {
    font-size: 12.5px;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.breakdown-track {
    height: 7px;
    border-radius: 4px;
    background: var(--bg);
    border: 1px solid var(--line);
    overflow: hidden;
}

.breakdown-track > span {
    display: block;
    height: 100%;
    background: var(--brand-strong);
}

.breakdown-value {
    font-size: 12.5px;
    font-weight: 650;
    color: var(--ink-strong);
    text-align: start;
    direction: ltr;
    unicode-bidi: isolate;
    font-variant-numeric: tabular-nums;
}

.breakdown-pct {
    font-size: 11px;
    color: var(--muted);
    text-align: start;
    direction: ltr;
    unicode-bidi: isolate;
}

@media (max-width: 640px) {
    .breakdown-row { grid-template-columns: 1fr auto; gap: 4px 8px; }
    .breakdown-track { grid-column: 1 / -1; order: 3; }
    .breakdown-pct { order: 2; }
}

/* ===== مبلغ موقّع (وارد / صادر) ===== */
.amount-signed {
    font-weight: 650;
    direction: ltr;
    unicode-bidi: isolate;
    text-align: start;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.amount-signed.is-in  { color: #0f6f5c; }
.amount-signed.is-out { color: #b3261e; }


/* ===== أزرار القرار داخل الجدول ===== */
.row-decisions {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: nowrap;
}

.row-decisions form { display: inline-flex; margin: 0; }
.row-decisions .btn { white-space: nowrap; }

/* ===== صف عاجل ===== */
tr.row-urgent > td { background: rgba(179, 38, 30, .045); }
tr.row-urgent:hover > td { background: rgba(179, 38, 30, .08); }
tr.row-urgent > td:first-child { box-shadow: inset 3px 0 0 #b3261e; }

/* ===== عمودا التسلسل ورقم السجل ===== */
.dt-seq {
    width: 1%;
    white-space: nowrap;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

td.dt-ref {
    white-space: nowrap;
    color: var(--muted);
    font-size: 12px;
}

/* ===== تصنيفات مستخدمي التطبيق ===== */
.app-users-stat {
    position: relative;
    transition: background .15s, color .15s;
}

/* شريط علوي بلون التصنيف يظهر عند التحويم أو عند تفعيله. */
.app-users-stat::before {
    content: '';
    position: absolute;
    inset-block-start: 0;
    inset-inline-start: 0;
    inline-size: 100%;
    block-size: 3px;
    background: var(--stat-tone);
    opacity: 0;
    transition: opacity .15s;
}

.app-users-stat:hover::before,
.app-users-stat.active::before { opacity: 1; }

.app-users-stat:hover strong,
.app-users-stat.active strong { color: var(--stat-tone); }

.app-users-stat:hover { background: var(--stat-wash); }
.app-users-stat.active { background: var(--stat-wash); }

.app-users-stat.tone-all          { --stat-tone: #1d806f; --stat-wash: rgba(29, 128, 111, .07); }
.app-users-stat.tone-pending      { --stat-tone: #b06d12; --stat-wash: rgba(176, 109, 18, .08); }
.app-users-stat.tone-registration { --stat-tone: #2563a8; --stat-wash: rgba(37, 99, 168, .07); }
.app-users-stat.tone-delegate     { --stat-tone: #7a3ea8; --stat-wash: rgba(122, 62, 168, .07); }
.app-users-stat.tone-employee     { --stat-tone: #0f7a86; --stat-wash: rgba(15, 122, 134, .07); }
.app-users-stat.tone-owner        { --stat-tone: #a8582c; --stat-wash: rgba(168, 88, 44, .07); }


/* ===== شريط تنقّل الأقسام ===== */
.section-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    padding: 6px;
    margin-bottom: 14px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
}

.section-nav-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 7px;
    color: var(--muted);
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    transition: background .15s, color .15s;
}

.section-nav-item > svg { width: 15px; height: 15px; stroke-width: 1.9; }
.section-nav-item:hover { background: var(--bg); color: var(--ink-strong); }

.section-nav-item.active {
    background: var(--brand-strong);
    color: #fff;
}

@media (max-width: 760px) {
    .section-nav { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .section-nav-item { flex: 0 0 auto; }
}

/* ============ رسوم لوحة المعلومات ============ */

/* صفوف الرسوم تتبع إيقاع .molak-dashboard نفسه، فيُلغى الهامش العلوي
   الذي تضيفه .grid.two حتى لا تتضاعف المسافة. */
.molak-charts { margin-top: 0; }

.molak-chart-card,
.molak-rank-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.molak-rank-card { margin-bottom: 0; }

.molak-chart-card .card-pad { flex: 1; }

.molak-chart-body {
    display: grid;
    gap: 16px;
    align-content: start;
}

.molak-chart-hero {
    display: grid;
    gap: 4px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.molak-chart-hero strong {
    font-size: 34px;
    line-height: 1;
    font-weight: 750;
    color: var(--ink-strong);
    direction: ltr;
    unicode-bidi: isolate;
    text-align: start;
    font-variant-numeric: tabular-nums;
}

.molak-chart-hero > span {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--muted);
}

/* السطر عربي والأرقام بداخله لاتينية، فيبقى الوعاء بالاتجاه الطبيعي
   وكل رقم يعزل نفسه بـ dir=ltr. */
.molak-chart-hero-sub {
    font-size: 12px;
    color: var(--faint);
}

.molak-chart-hero-sub .mono {
    unicode-bidi: isolate;
    font-variant-numeric: tabular-nums;
}

.molak-chart-plot { min-width: 0; }

/* تلميح عند المرور على عمود أو شريحة، وبقية العناصر تخفت قليلاً. */
.molak-chart-plot [data-mark] { transition: opacity .12s ease; cursor: default; }
.molak-chart-plot svg:hover [data-mark] { opacity: .45; }
.molak-chart-plot svg [data-mark]:hover { opacity: 1; }

.molak-chart-note {
    padding: 10px 20px;
    border-top: 1px solid var(--line);
    font-size: 11.5px;
    color: var(--muted);
}

.molak-chart-note .mono {
    direction: ltr;
    unicode-bidi: isolate;
    font-variant-numeric: tabular-nums;
}

/* أسماء العمارات أطول من أسماء فئات المصروفات، فتأخذ عموداً أوسع. */
.molak-rank-card .breakdown-row {
    grid-template-columns: minmax(96px, 136px) 1fr minmax(74px, auto) 40px;
}

@media (max-width: 560px) {
    .molak-chart-hero strong { font-size: 28px; }
    .molak-rank-card .breakdown-row {
        grid-template-columns: 1fr minmax(70px, auto) 38px;
    }
    .molak-rank-card .breakdown-track { display: none; }
}

/* تنبيه أسفل قائمة مرتّبة: ما لا يظهر في الأشرطة يُقال بالنص. */
.molak-rank-note {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 12px;
    padding-top: 11px;
    border-top: 1px solid var(--line);
    font-size: 11.5px;
    color: var(--muted);
}

.molak-rank-note svg {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    color: var(--warn, #A87514);
}
