/* ================= Waasac — naqshad buluug ah ================= */
:root {
    --w-primary: #1d5fd1;
    --w-primary-dark: #123f94;
    --w-navy: #0a2257;
    --w-navy-2: #0f2f73;
    --w-sky: #e8f0fe;
    --w-bg: #f3f6fb;
    --w-border: #dfe6f1;
    --w-text: #15233f;
    --w-muted: #6b7a99;
    --w-success: #14a06b;
    --w-danger: #dc3545;
    --w-radius: 14px;
    --bs-primary: #1d5fd1;
    --bs-primary-rgb: 29, 95, 209;
    --bs-link-color: #1d5fd1;
    --bs-link-color-rgb: 29, 95, 209;
    --bs-link-hover-color: #123f94;
    --bs-body-font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    --bs-body-color: #15233f;
    --bs-body-bg: #f3f6fb;
}

body { background: var(--w-bg); color: var(--w-text); font-size: .95rem; }

.btn-primary {
    --bs-btn-bg: var(--w-primary); --bs-btn-border-color: var(--w-primary);
    --bs-btn-hover-bg: var(--w-primary-dark); --bs-btn-hover-border-color: var(--w-primary-dark);
    --bs-btn-active-bg: var(--w-primary-dark); --bs-btn-active-border-color: var(--w-primary-dark);
    --bs-btn-disabled-bg: var(--w-primary); --bs-btn-disabled-border-color: var(--w-primary);
}
.btn-outline-primary {
    --bs-btn-color: var(--w-primary); --bs-btn-border-color: var(--w-primary);
    --bs-btn-hover-bg: var(--w-primary); --bs-btn-hover-border-color: var(--w-primary);
    --bs-btn-active-bg: var(--w-primary-dark); --bs-btn-active-border-color: var(--w-primary-dark);
}
.text-primary { color: var(--w-primary) !important; }
.bg-primary, .text-bg-primary { background-color: var(--w-primary) !important; }
.form-control:focus, .form-select:focus { border-color: #8db0ee; box-shadow: 0 0 0 .2rem rgba(29, 95, 209, .15); }
.form-label { font-weight: 600; font-size: .85rem; color: #334366; margin-bottom: .3rem; }
.form-control, .form-select { border-color: var(--w-border); border-radius: 10px; }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
    background: linear-gradient(180deg, var(--w-navy) 0%, var(--w-navy-2) 60%, #133a8c 100%);
    color: #c9d6f3; width: 262px; flex-shrink: 0;
}
@media (min-width: 992px) {
    .sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow-y: auto; }
}
.sidebar.offcanvas-lg { --bs-offcanvas-width: 270px; --bs-offcanvas-bg: var(--w-navy); }
/* v42: menu-ga (sidebar) mobile-ka kor iyo hoos ayuu u jiidmaa (offcanvas) */
.sidebar-brand, .sidebar-contact { flex-shrink: 0; }
.sidebar-nav { flex: 1 0 auto; }
@media (max-width: 991.98px) {
    .sidebar.offcanvas-lg { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
}
.sidebar { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.25) transparent; }
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.25); border-radius: 3px; }
.sidebar-brand { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.2rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; font-weight: 800; font-size: 1.3rem; letter-spacing: .3px; }
.brand:hover { color: #fff; }
.sidebar-nav { padding: .6rem .7rem 1rem; flex: 1; }
.sidebar-nav .nav-label { font-size: .68rem; text-transform: uppercase; letter-spacing: 1.2px; color: #7f95c9; padding: .9rem .7rem .35rem; font-weight: 700; }
.sidebar-nav a {
    display: flex; align-items: center; gap: .7rem; color: #c9d6f3; text-decoration: none;
    padding: .58rem .8rem; border-radius: 10px; margin-bottom: 2px; font-weight: 500; transition: .15s;
}
.sidebar-nav a i { font-size: 1.05rem; width: 1.2rem; text-align: center; opacity: .9; }
.sidebar-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar-nav a.active { background: linear-gradient(90deg, #2b6cf0, #1d5fd1); color: #fff; box-shadow: 0 6px 16px rgba(17, 72, 190, .45); }
.sidebar-contact { padding: 1rem 1.2rem; border-top: 1px solid rgba(255,255,255,.08); font-size: .82rem; }
.sidebar-contact a { display: block; color: #9fb4e3; text-decoration: none; padding: .15rem 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-contact a:hover { color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    display: flex; align-items: center; gap: .8rem; padding: .85rem 1.6rem; background: rgba(255,255,255,.92);
    backdrop-filter: blur(6px); border-bottom: 1px solid var(--w-border); position: sticky; top: 0; z-index: 1020;
}
.topbar-title h1 { font-size: 1.25rem; font-weight: 700; margin: 0; color: var(--w-navy); }
.user-btn { display: flex; align-items: center; gap: .5rem; border: 1px solid var(--w-border); border-radius: 999px; padding: .2rem .7rem .2rem .2rem; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--w-primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; }
.content { padding: 1.5rem 1.6rem 2rem; flex: 1; }
.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; padding: 1rem 1.6rem; color: var(--w-muted); font-size: .82rem; border-top: 1px solid var(--w-border); background: #fff; }
.footer a { color: var(--w-muted); text-decoration: none; }
.footer a:hover { color: var(--w-primary); }
@media (max-width: 575.98px) { .content { padding: 1rem .8rem 1.5rem; } .topbar { padding: .7rem .8rem; } }

/* ---------- cards ---------- */
.card { border: 1px solid var(--w-border); border-radius: var(--w-radius); box-shadow: 0 1px 2px rgba(16, 38, 89, .04); }
.card-header { background: #fff; border-bottom: 1px solid var(--w-border); font-weight: 700; color: var(--w-navy); padding: .85rem 1.1rem; border-radius: var(--w-radius) var(--w-radius) 0 0 !important; }
.card-header .bi { color: var(--w-primary); }

.stat-card { position: relative; overflow: hidden; padding: 1.1rem 1.2rem; border-radius: var(--w-radius); background: #fff; border: 1px solid var(--w-border); height: 100%; }
.stat-card .label { color: var(--w-muted); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; padding-right: 50px; }
.stat-card .value { font-size: 1.55rem; font-weight: 800; color: var(--w-navy); margin-top: .2rem; line-height: 1.2; }
.stat-card .hint { font-size: .8rem; color: var(--w-muted); margin-top: .25rem; }
.stat-card .icon { position: absolute; right: 1rem; top: 1rem; width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; }
.stat-card.hero { background: linear-gradient(135deg, #1d5fd1 0%, #0f3a9a 100%); border: 0; color: #fff; }
.stat-card.hero .label, .stat-card.hero .hint { color: #c7d8ff; }
.stat-card.hero .value { color: #fff; }
.stat-card.hero .icon { background: rgba(255,255,255,.15); color: #fff; }
.ic-blue { background: var(--w-sky); color: var(--w-primary); }
.ic-green { background: #e3f6ee; color: var(--w-success); }
.ic-red { background: #fde8ea; color: var(--w-danger); }
.ic-amber { background: #fff4dd; color: #c98a00; }
.ic-cyan { background: #e0f5fb; color: #0b8cb3; }

.text-income { color: var(--w-success) !important; }
.text-expense { color: var(--w-danger) !important; }

/* ---------- tables ---------- */
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .6px; color: var(--w-muted); font-weight: 700; background: #f7f9fd; border-bottom: 1px solid var(--w-border); white-space: nowrap; }
.table > tbody td { vertical-align: middle; border-color: #edf1f8; }
.table > tfoot td, .table > tfoot th { font-weight: 800; background: #f1f5fd; border-top: 2px solid var(--w-border); }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #f4f8ff; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }

/* ---------- houses ---------- */
.house-card { overflow: hidden; transition: transform .15s, box-shadow .15s; height: 100%; }
.house-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(16, 38, 89, .12); }
.house-card .photo, .apt-card .photo { height: 170px; background: linear-gradient(135deg, #dbe7fd, #b9cff8); display: flex; align-items: center; justify-content: center; color: #6d8fd8; font-size: 3rem; position: relative; }
.house-card .photo img, .apt-card .photo img { width: 100%; height: 100%; object-fit: cover; }
.house-card .photo .badge, .apt-card .photo .badge { position: absolute; top: .7rem; left: .7rem; }
.apt-card { overflow: hidden; height: 100%; }
.apt-card .photo { height: 130px; font-size: 2.2rem; }
.mini-stats { display: flex; gap: 1rem; font-size: .82rem; color: var(--w-muted); }
.mini-stats b { color: var(--w-navy); font-size: .95rem; }
.photo-lg { width: 100%; max-height: 340px; object-fit: cover; border-radius: var(--w-radius); }
.photo-placeholder { height: 240px; border-radius: var(--w-radius); background: linear-gradient(135deg, #dbe7fd, #b9cff8); display: flex; align-items: center; justify-content: center; font-size: 4rem; color: #6d8fd8; }
.photo-preview { max-height: 160px; border-radius: 10px; border: 1px solid var(--w-border); }

.map-box { height: 300px; border-radius: var(--w-radius); border: 1px solid var(--w-border); z-index: 1; }
.map-big { height: calc(100vh - 210px); min-height: 420px; }

.info-list { list-style: none; padding: 0; margin: 0; }
.info-list li { display: flex; gap: .7rem; padding: .55rem 0; border-bottom: 1px dashed #e6ecf6; }
.info-list li:last-child { border-bottom: 0; }
.info-list li i { color: var(--w-primary); font-size: 1.05rem; }
.info-list .k { color: var(--w-muted); min-width: 110px; font-size: .85rem; }

.btn-whatsapp { background: #25d366; color: #fff; border-color: #25d366; }
.btn-whatsapp:hover { background: #1eb457; color: #fff; border-color: #1eb457; }

.filter-bar { background: #fff; border: 1px solid var(--w-border); border-radius: var(--w-radius); padding: .9rem 1rem; margin-bottom: 1rem; }
.quick-range .btn { font-size: .78rem; }

.section-title { font-weight: 700; color: var(--w-navy); font-size: 1rem; }
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--w-muted); }
.empty-state i { font-size: 2.6rem; color: #a9bde6; display: block; margin-bottom: .5rem; }

/* bars chart */
.bars { display: flex; align-items: flex-end; gap: 14px; height: 190px; padding: 0 .3rem; }
.bars .grp { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.bars .cols { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 4px; }
.bars .bar { width: 42%; max-width: 26px; border-radius: 6px 6px 2px 2px; min-height: 2px; }
.bars .bar.inc { background: linear-gradient(180deg, #3a7cf2, #1d5fd1); }
.bars .bar.exp { background: #a8c2f2; }
.bars .grp { min-width: 0; }
.bars .lbl { font-size: .74rem; color: var(--w-muted); margin-top: .35rem; text-align: center; line-height: 1.2; }
@media (min-width: 576px) { .bars .lbl { white-space: nowrap; } }
@media (max-width: 575.98px) { .bars { gap: 6px; } .bars .lbl { font-size: .68rem; } .bars .lbl .yr { display: block; } }
/* Bilo badan (>6): sanadka sadar kale */
.bars.many { gap: 6px; }
.bars.many .lbl { white-space: normal; font-size: .7rem; }
.bars.many .lbl .yr { display: block; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; }

.progress { height: 8px; border-radius: 99px; background: #e7eefb; }
.progress-bar { background: var(--w-primary); }

/* login */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem;
    background: radial-gradient(circle at 20% 20%, #2e6ff0 0, transparent 40%), radial-gradient(circle at 80% 90%, #1a4fc0 0, transparent 45%), linear-gradient(135deg, #0a2257, #0f3a9a); }
.login-card { width: 100%; max-width: 420px; border-radius: 20px; border: 0; box-shadow: 0 30px 60px rgba(3, 15, 46, .45); }
.login-card .brand-big { display: flex; flex-direction: column; align-items: center; gap: .4rem; margin-bottom: 1.2rem; }
.login-card .brand-big h1 { font-weight: 800; color: var(--w-navy); font-size: 1.7rem; margin: 0; }

/* report print */
.report-head { display: none; }
@media print {
    .sidebar, .topbar, .footer, .no-print, .filter-bar, .btn { display: none !important; }
    .content { padding: 0 !important; }
    body { background: #fff; font-size: 11px; }
    .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
    .report-head { display: block; margin-bottom: 12px; }
    .stat-card.hero { background: #fff !important; color: #000 !important; border: 1px solid #ccc; }
    .stat-card.hero .value, .stat-card.hero .label, .stat-card.hero .hint { color: #000 !important; }
    a { text-decoration: none; color: inherit; }
}
.validation-summary-valid { display: none !important; }
.validation-summary-errors ul { margin: 0; padding-left: 1.1rem; }
.photo .badge { font-size: .72rem; font-weight: 600; }
.card-header .btn .bi, .card-header .badge .bi { color: inherit; }

/* Logo-ga website-ka (la soo gelin karo — Dejinta) */
.site-logo { width: auto; max-width: 170px; object-fit: contain; border-radius: 8px; flex-shrink: 0; }
.logo-preview { height: 84px; max-width: 260px; object-fit: contain; border-radius: 12px; background: repeating-conic-gradient(#eef2f8 0% 25%, #fff 0% 50%) 50% / 16px 16px; padding: 8px; border: 1px solid var(--w-border); }

/* Warbixinta kireystayaasha */
.tenant-report .group-row td { background: #eef3fd; color: var(--w-navy, #0f3a9a); font-weight: 700; }
.tenant-report .subtotal-row td { background: #f7f9fc; font-weight: 600; font-size: .92em; }
@media print {
    @page { size: A4 landscape; margin: 12mm; }
    .tenant-report .group-row td, .tenant-report .subtotal-row td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .tenant-report .badge { border: 1px solid #999; color: #000 !important; background: transparent !important; }
    .tenant-stats { --bs-gutter-y: .5rem; --bs-gutter-x: .5rem; margin-bottom: .6rem !important; }
    .tenant-stats > div { flex: 0 0 25%; max-width: 25%; }
    .tenant-stats .stat-card { padding: .5rem .7rem; }
    .tenant-stats .stat-card .icon { display: none; }
    .tenant-stats .stat-card .value { font-size: 1.15rem; }
    .card.tenant-card { break-inside: auto; }
    .tenant-report thead { display: table-header-group; }
    .tenant-report tr { break-inside: avoid; }
}

/* Contract dhammaaday (read-only) */
.readonly-banner { border-left: 4px solid #dc3545; }
.renewal-modal { border: 0; border-radius: 16px; box-shadow: 0 25px 50px rgba(3, 15, 46, .35); }
.renewal-modal .renewal-question { background: #f3f7ff; border: 1px solid #dbe6fb; border-radius: 12px; padding: .8rem 1rem; }
.sidebar-nav a .badge { font-size: .7rem; }

/* Password-ka ma ilowday? */
.reset-code { letter-spacing: .6em; font-size: 1.6rem; }

/* Isha password-ka (muuji / qari) */
.pw-toggle { border-color: var(--bs-border-color); color: #6b7a99; background: #fff; }
.pw-toggle:hover, .pw-toggle:focus { background: #f3f7ff; color: #1d5fd1; border-color: var(--bs-border-color); }
.input-group > .form-control:not(:last-child) + .pw-toggle { border-left: 0; }

/* Sawirka isticmaalaha */
.avatar { flex-shrink: 0; }
.avatar-img { object-fit: cover; padding: 0; background: #e9eef8; border: 1px solid rgba(0,0,0,.06); }
.user-photo-preview, .user-photo-letter { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; font-size: 2rem; box-shadow: 0 4px 14px rgba(15, 47, 115, .18); }

/* Xaqiijin laba jeer ah (tirtirid / cusbooneysiin) */
.confirm-modal { border: 0; border-radius: 16px; box-shadow: 0 25px 50px rgba(3, 15, 46, .3); }
.confirm-steps { display: flex; align-items: center; gap: .4rem; margin-bottom: .85rem; }
.confirm-steps .cs { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    font-size: .8rem; font-weight: 700; background: #e9eef7; color: #6b7a99; transition: background .2s, color .2s; }
.confirm-steps .cs-line { width: 44px; height: 3px; border-radius: 2px; background: #e9eef7; transition: background .2s; }
.confirm-modal .confirm-steps .cs:first-child,
.confirm-modal.step-2 .confirm-steps .cs-2 { background: #dc3545; color: #fff; }
.confirm-modal.step-2 .confirm-steps .cs-line { background: #dc3545; }
.confirm-modal.is-update .confirm-steps .cs:first-child,
.confirm-modal.is-update.step-2 .confirm-steps .cs-2 { background: #0d6efd; color: #fff; }
.confirm-modal.is-update.step-2 .confirm-steps .cs-line { background: #0d6efd; }
.confirm-modal #confirmModalText { font-size: 1.02rem; }

/* Admin: badhanka kamarada ee logo-ga (sidebar) — wuxuu fadhiyaa geeska hoose ee logo-ga */
.sidebar-brand { position: relative; }
.sidebar-brand .logo-upload { position: absolute; left: calc(1.2rem - 8px); top: calc(1.1rem + 18px); margin: 0; z-index: 2; }
.logo-upload-btn { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .78rem;
    background: #fff; color: #1d5fd1; border: 2px solid #0f3a9a; box-shadow: 0 2px 6px rgba(0,0,0,.35); cursor: pointer;
    transition: transform .15s, background .15s; position: relative; overflow: hidden; }
.logo-upload-btn:hover { transform: scale(1.12); background: #eaf1ff; }
.logo-upload-btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.logo-upload-btn.is-loading { pointer-events: none; opacity: .7; }
.logo-upload-btn.is-loading i { animation: spin-logo 1s linear infinite; }
@keyframes spin-logo { to { transform: rotate(360deg); } }

/* Analytics: liisaska leh bar-ka (horizontal) */
.hlist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.hlist li { position: relative; display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .42rem .6rem; border-radius: 8px; font-size: .88rem; overflow: hidden; }
.hlist li .fill { position: absolute; left: 0; top: 0; bottom: 0; background: #e6efff; border-radius: 8px; z-index: 0; transition: width .4s; }
.hlist li > .lbl, .hlist li > .cnt { position: relative; z-index: 1; }
.hlist li > .lbl { min-width: 0; overflow-wrap: anywhere; }
.hlist li > .lbl a { text-decoration: none; font-weight: 600; }
.hlist li > .cnt { white-space: nowrap; color: var(--w-navy); }
.hlist.tone-pink li .fill { background: #fde7f1; }
.hlist.tone-green li .fill { background: #e3f6ec; }
.an-bars { height: 170px; }
.an-bars.dense { gap: 3px; }
.an-bars.dense .lbl { font-size: .62rem; white-space: nowrap; }
.an-bars .bar { width: 70%; max-width: 22px; }

/* Apartments kiro ah (admin) */
.kiro-specs { display: flex; flex-wrap: wrap; gap: .35rem .8rem; font-size: .84rem; color: var(--w-muted); }
.kiro-specs span { display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; }
.kiro-admin-card .photo { position: relative; display: flex; }
.kiro-admin-card .kiro-media-badges { position: absolute; right: .6rem; bottom: .6rem; display: flex; gap: .3rem; }
.kiro-admin-card.is-off .photo img { filter: grayscale(.7) opacity(.75); }
.kiro-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: .5rem; }
.kiro-photo { position: relative; display: block; border-radius: 10px; overflow: hidden; aspect-ratio: 4 / 3; background: #e9eef7; margin: 0; cursor: pointer; }
.kiro-photo img { width: 100%; height: 100%; object-fit: cover; }
.kiro-photo input { position: absolute; top: .35rem; left: .35rem; z-index: 2; }
.kiro-photo .rm { position: absolute; inset: auto 0 0 0; background: rgba(220, 53, 69, .9); color: #fff; font-size: .7rem; text-align: center; padding: .15rem 0; display: none; }
.kiro-photo:has(input:checked) img { filter: grayscale(1) opacity(.5); }
.kiro-photo:has(input:checked) .rm { display: block; }
.kiro-video { width: 100%; max-height: 320px; border-radius: 12px; background: #000; display: block; }

/* v29 analytics: icons-ka halka laga yimid + IP */
.src-ic { color: var(--w-primary, #1f5fd1); }
.src-ic.bi-whatsapp { color: #25d366; } .src-ic.bi-facebook { color: #1877f2; } .src-ic.bi-instagram { color: #d6249f; }
.src-ic.bi-google { color: #ea4335; } .src-ic.bi-telegram { color: #229ed9; } .src-ic.bi-twitter-x, .src-ic.bi-tiktok { color: #111; }
.src-ic.bi-youtube { color: #ff0000; } .src-ic.bi-link-45deg { color: #6b7a99; }
code.ip { font-size: .78rem; color: #44557a; background: #f1f5ff; padding: 0 .3rem; border-radius: 4px; }

/* Qoraallada bandhigga */
.qoraal-item.is-custom .form-control { border-color: #f0b44c; background: #fffaf0; }
.qoraal-save { position: sticky; bottom: 0; z-index: 5; box-shadow: 0 -6px 18px rgba(16, 38, 89, .08); }

/* Xadka guryaha / apartments-ka */
.limit-modal { border: 0; border-radius: 20px; }
.limit-icon { width: 72px; height: 72px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; font-size: 2rem; color: #b45309; background: #fff1dc; box-shadow: 0 0 0 8px #fff8ec; }
.usage-pill { font-size: .8rem; font-weight: 600; padding: .3rem .65rem; border-radius: 999px; background: #eef3ff; color: #2a4a8a; white-space: nowrap; }
.usage-pill.full { background: #fdecec; color: #b42318; }
.limit-detail { display: inline-block; font-weight: 700; font-size: .9rem; padding: .3rem .8rem; border-radius: 999px; background: #fdecec; color: #b42318; }
.limit-req-box { background: #f5f8ff; border: 1px solid #e2e9fb; border-radius: 14px; padding: 1rem; text-align: left; }
.limit-now { background: #eef3ff; border-radius: 10px; padding: .55rem .7rem; color: #2a4a8a; }
.limit-requests-card .form-control { width: 6rem; }

/* Doorashada bilaha (lacag-bixinta) */
.month-picker { border: 1px solid #e3e9f5; border-radius: 16px; padding: 1rem; background: #fbfcff; }
.mp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .55rem; }
@media (min-width: 992px) { .mp-grid { grid-template-columns: repeat(4, 1fr); } }
.mp-month { border: 1px solid #dfe5f1; background: #fff; border-radius: 10px; padding: .55rem .4rem; font-weight: 700; color: #1d2b4f; display: flex; flex-direction: column; align-items: center; line-height: 1.15; transition: all .12s; }
.mp-month small { font-weight: 500; font-size: .72rem; color: #8090ad; margin-top: 2px; }
.mp-month:hover:not(:disabled) { border-color: #9db8ee; background: #f3f7ff; }
.mp-month.on { background: #dbe8ff; border-color: #3b74d8; color: #1f56b8; }
.mp-month.on small { color: #3b74d8; }
.mp-month.now:not(.on) { box-shadow: inset 0 0 0 1px #9db8ee; }
.mp-month.paid { background: #eef8f2; border-color: #cfe9d9; color: #3f8a5c; cursor: not-allowed; opacity: .85; }
.mp-month.paid small { color: #3f8a5c; }
.mp-legend-paid { color: #3f8a5c; font-weight: 600; }
.mp-total { font-size: 1.15rem; }
.mp-total b { color: #0f9f6e; }

/* Qaababka lacag-bixinta (split) */
.pay-parts { border: 1px solid #e3e9f5; border-radius: 16px; padding: 1rem; background: #fbfcff; }
.pp-head, .pp-row { display: grid; grid-template-columns: 1.1fr 1fr 1.2fr auto; gap: .5rem; align-items: center; }
.pp-head { margin-bottom: .3rem; padding: 0 .1rem; }
.pp-row + .pp-row { margin-top: .5rem; }
@media (max-width: 767.98px) { .pp-row { grid-template-columns: 1fr 1fr; } .pp-row > input[name=pr] { grid-column: 1; } }
.pp-status { font-size: .92rem; }
.pp-status.ok { color: #0f9f6e; font-weight: 600; }
.pp-status.bad { color: #c2410c; }

/* v40: heshiiska oo dhammaanaya (≤ 20 maalmood) */
.expiry-banner { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; background: linear-gradient(90deg, #fff7e6, #fffdf6); border: 1px solid #f6d58b; border-left: 6px solid #f0a500; border-radius: 14px; padding: .85rem 1rem; margin-bottom: 1rem; }
.expiry-banner.urgent { background: linear-gradient(90deg, #fdecec, #fffafa); border-color: #f3b7b7; border-left-color: #dc2626; }
.eb-days { flex: none; width: 74px; height: 74px; border-radius: 16px; background: #f0a500; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; box-shadow: 0 6px 16px rgba(240, 165, 0, .3); }
.expiry-banner.urgent .eb-days { background: #dc2626; box-shadow: 0 6px 16px rgba(220, 38, 38, .3); }
.eb-days b { font-size: 1.9rem; font-weight: 800; }
.eb-days span { font-size: .72rem; font-weight: 600; margin-top: 2px; }
.eb-body { flex: 1 1 18rem; min-width: 0; }
.eb-title { font-weight: 800; font-size: 1.05rem; color: #7a4b00; }
.expiry-banner.urgent .eb-title { color: #9b1c1c; }
.eb-sub { font-size: .86rem; color: #5b4a2a; margin-top: .15rem; }
.eb-progress { height: 6px; background: #f3e3bf; border-radius: 99px; margin-top: .5rem; overflow: hidden; max-width: 28rem; }
.eb-progress span { display: block; height: 100%; background: #f0a500; border-radius: 99px; }
.expiry-banner.urgent .eb-progress { background: #f6d1d1; }
.expiry-banner.urgent .eb-progress span { background: #dc2626; }
.eb-btn { flex: none; font-weight: 600; }

/* ---------- v43: Chat (sida WhatsApp) ---------- */
.chat-app { display: flex; height: 70vh; min-height: 380px; background: #fff; border: 1px solid var(--w-border); border-radius: 16px; overflow: hidden; box-shadow: 0 6px 22px rgba(15, 40, 100, .06); }
.chat-list { width: 340px; flex-shrink: 0; border-right: 1px solid var(--w-border); display: flex; flex-direction: column; background: #fff; }
.chat-list-head { padding: .75rem; border-bottom: 1px solid var(--w-border); background: #f8fafc; }
.chat-threads { flex: 1; overflow-y: auto; }
.chat-thread { display: flex; gap: .7rem; padding: .65rem .8rem; text-decoration: none; color: inherit; border-bottom: 1px solid #f1f4f8; align-items: center; }
.chat-thread:hover { background: #f5f7fb; }
.chat-thread.active { background: #e8f1ff; }
.chat-thread-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.chat-thread-top { display: flex; align-items: center; gap: .3rem; min-width: 0; }
.chat-thread-top b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.chat-thread-at { margin-left: auto; font-size: .72rem; color: var(--w-muted); white-space: nowrap; }
.chat-thread.unread .chat-thread-at { color: #1a9e55; font-weight: 700; }
.chat-thread-last { display: flex; align-items: center; gap: .4rem; font-size: .84rem; color: #54657e; min-width: 0; }
.chat-thread-last .text-truncate { flex: 1; min-width: 0; }
.chat-thread.unread .chat-thread-last { color: #1f2a3c; font-weight: 600; }
.chat-thread-seen { font-size: .7rem; color: #94a3b8; }
.chat-thread-seen.online, .chat-head-status.online { color: #1a9e55; font-weight: 600; }
.chat-unread { background: #25d366; color: #fff; font-size: .7rem; }
.chat-head-avatar { position: relative; display: inline-flex; flex-shrink: 0; }
.chat-dot { position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; border-radius: 50%; background: #b8c2d0; border: 2px solid #fff; }
.chat-dot.on { background: #25d366; }

.chat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; background: #efeae2; }
.chat-head { display: flex; align-items: center; gap: .7rem; padding: .6rem .9rem; background: #f0f2f5; border-bottom: 1px solid #e2e6ea; }
.chat-head-info { min-width: 0; }
.chat-head-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head-status { font-size: .78rem; color: #667781; }
.chat-back { display: none; }
.chat-body { flex: 1; overflow-y: auto; padding: 1rem 6%; display: flex; flex-direction: column; gap: .2rem;
    background-color: #efeae2;
    background-image: radial-gradient(rgba(0,0,0,.035) 1px, transparent 1px); background-size: 18px 18px; }
.chat-day { text-align: center; margin: .7rem 0 .4rem; }
.chat-day span { background: #fff; color: #54657e; font-size: .74rem; padding: .25rem .7rem; border-radius: 8px; box-shadow: 0 1px 1px rgba(0,0,0,.08); }
.chat-none { margin: auto; max-width: 420px; text-align: center; background: #fff8d6; color: #54606b; font-size: .82rem; padding: .6rem .9rem; border-radius: 10px; }
.chat-row { display: flex; }
.chat-row.mine { justify-content: flex-end; }
.chat-bubble { max-width: min(75%, 560px); padding: .4rem .55rem .25rem .65rem; border-radius: 10px; background: #fff; box-shadow: 0 1px 1px rgba(0,0,0,.1); position: relative; word-wrap: break-word; overflow-wrap: anywhere; }
.chat-row.mine .chat-bubble { background: #d9fdd3; }
.chat-row.theirs .chat-bubble { border-top-left-radius: 2px; }
.chat-row.mine .chat-bubble { border-top-right-radius: 2px; }
.chat-row.pending .chat-bubble { opacity: .8; }
.chat-row.failed .chat-bubble { background: #ffe1e1; }
.chat-text { white-space: pre-wrap; font-size: .93rem; line-height: 1.35; color: #111b21; }
.chat-text a { color: #027eb5; }
.chat-meta { display: flex; justify-content: flex-end; align-items: center; gap: .2rem; font-size: .68rem; color: #667781; margin-top: .1rem; line-height: 1; }
.chat-ticks { font-size: 1rem; line-height: 1; color: #8696a0; }
.chat-ticks .tick-read { color: #34b7f1; }
.chat-img { display: block; max-width: 100%; width: 280px; max-height: 320px; object-fit: cover; border-radius: 8px; margin-bottom: .25rem; cursor: zoom-in; background: #e6e6e6; }
.chat-bubble.only-img { padding: .25rem; }
.chat-bubble.only-img .chat-meta { position: absolute; right: .55rem; bottom: .45rem; background: rgba(0,0,0,.45); color: #fff; padding: .15rem .35rem; border-radius: 8px; }
.chat-bubble.only-img .chat-ticks, .chat-bubble.only-img .chat-ticks .tick-read { color: #fff; }
.chat-bubble.only-img .chat-img { margin-bottom: 0; }
.chat-down { position: absolute; right: 1rem; bottom: 5.2rem; width: 40px; height: 40px; border-radius: 50%; border: 0; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.2); color: #54657e; z-index: 3; }
.chat-down .badge { position: absolute; top: -6px; right: -6px; font-size: .65rem; }
.chat-input { background: #f0f2f5; padding: .5rem .6rem; border-top: 1px solid #e2e6ea; }
.chat-input-row { display: flex; align-items: flex-end; gap: .4rem; }
.chat-input textarea { resize: none; border-radius: 20px; padding: .5rem .9rem; max-height: 140px; border: 0; box-shadow: none !important; }
.chat-attach, .chat-send { width: 42px; height: 42px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 1.15rem; }
.chat-attach { color: #54657e; }
.chat-attach:hover { background: #e2e6ea; }
.chat-send { background: #00a884; color: #fff; }
.chat-send:hover { background: #018f71; color: #fff; }
.chat-preview { display: flex; align-items: center; gap: .6rem; background: #fff; border-radius: 10px; padding: .4rem; margin-bottom: .4rem; }
.chat-preview img { width: 54px; height: 54px; object-fit: cover; border-radius: 6px; }
.chat-error { padding: .3rem .4rem 0; }
.chat-empty { margin: auto; text-align: center; padding: 2rem; color: #54657e; }
.chat-empty > i { font-size: 3.2rem; color: #00a884; }

.chat-toast { position: fixed; right: 1rem; bottom: 1rem; z-index: 1090; display: flex; gap: .7rem; align-items: center; background: #fff; color: #1f2a3c; text-decoration: none;
    border-left: 4px solid #25d366; border-radius: 12px; padding: .7rem 1rem; box-shadow: 0 10px 30px rgba(0,0,0,.18); transform: translateY(140%); transition: transform .3s ease; max-width: 320px; }
.chat-toast.show { transform: translateY(0); }
.chat-toast > i { font-size: 1.6rem; color: #25d366; }
.topbar-chat .badge { font-size: .65rem; }

@media (max-width: 991.98px) {
    .chat-list { width: 100%; border-right: 0; }
    .chat-app.is-admin.has-thread .chat-list { display: none; }
    .chat-app.is-admin:not(.has-thread) .chat-main { display: none; }
    .chat-back { display: inline-flex; }
    .chat-body { padding: .8rem 3%; }
    .chat-bubble { max-width: 85%; }
}
@media (max-width: 575.98px) {
    .chat-app { border-radius: 12px; }
    .chat-img { width: 220px; }
}
@media print { .chat-toast, .topbar-chat { display: none !important; } }

/* ---------- v44: Dhaqdhaqaaqa isticmaalayaasha ---------- */
.act-lastlogin { min-width: 14rem; border-left: 3px solid #e2e8f0; padding-left: .9rem; }
.act-users td { vertical-align: middle; }
.act-feed { max-height: none; }
.act-day { position: sticky; top: 0; z-index: 1; background: #f4f7fc; font-weight: 700; font-size: .8rem; color: #54657e; padding: .4rem 1rem; border-top: 1px solid var(--w-border); border-bottom: 1px solid var(--w-border); }
.act-item { display: flex; gap: .75rem; padding: .6rem 1rem; border-bottom: 1px solid #f1f4f8; align-items: flex-start; }
.act-item:hover { background: #fafcff; }
.act-item.failed { background: #fff6f6; }
.act-time { font-variant-numeric: tabular-nums; font-size: .78rem; color: #64748b; width: 4.2rem; flex-shrink: 0; padding-top: .3rem; }
.act-icon { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: .9rem; }
.act-body { min-width: 0; flex: 1; }
.act-title { font-size: .92rem; }
.act-detail { font-size: .78rem; color: #475569; background: #f8fafc; border-radius: 6px; padding: .25rem .5rem; margin-top: .25rem; overflow-wrap: anywhere; }
.act-meta { display: flex; flex-wrap: wrap; gap: .25rem .9rem; font-size: .74rem; color: #94a3b8; margin-top: .2rem; }
.act-meta a { color: #64748b; overflow-wrap: anywhere; }
@media (max-width: 575.98px) {
    .act-item { padding: .55rem .6rem; gap: .5rem; }
    .act-time { width: 3.4rem; font-size: .72rem; }
    .act-lastlogin { border-left: 0; padding-left: 0; }
}
.ic-orange { background: #fff3e0; color: #d9730d; }
.ic-purple { background: #f1eafe; color: #7c3aed; }

/* ---------- v45: taariikhda dd/mm/yyyy (date-dmy.js) ---------- */
.dmy-wrap { position: relative; display: block; min-width: 8.5rem; }
.dmy-wrap > .dmy-text { padding-right: 2.2rem; font-variant-numeric: tabular-nums; }
.dmy-wrap > .dmy-ico { position: absolute; right: .7rem; top: 50%; transform: translateY(-50%); pointer-events: none; color: #64748b; font-size: .95em; }
.dmy-wrap > .dmy-native { position: absolute !important; top: 0; right: 0; width: 2.4rem !important; min-width: 0 !important; height: 100%; padding: 0 !important;
    opacity: 0; cursor: pointer; border: 0; background: transparent; }
.dmy-wrap > .dmy-native::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.dmy-wrap > .dmy-text.is-invalid ~ .dmy-ico { right: 2.1rem; }
.pp-hint { color: #1350c4; background: #eaf2ff; border-radius: 8px; padding: .35rem .6rem; }
