
/* BuildTrack Kuwait — Final professional refinements
   Loaded after professional-ui.css. */

:root {
    --final-nav: #18202a;
    --final-nav-soft: #222e3a;
    --final-gold: #a47a49;
    --final-gold-light: #d7b17b;
    --final-green: #16835d;
    --final-red: #c2414b;
    --final-orange: #b7791f;
    --final-blue: #3568a8;
    --final-gray: #667085;
}

/* ---------- Semantic badges ---------- */
.status-badge {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 24px;
    padding: 4px 9px !important;
    border: 1px solid transparent;
    border-radius: 999px !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    white-space: nowrap;
}
.status-success { color:#0d6848 !important; background:#e7f7f0 !important; border-color:#b9ead7 !important; }
.status-info { color:#285d97 !important; background:#eaf2fb !important; border-color:#c8dbf1 !important; }
.status-warning { color:#8b5b10 !important; background:#fff5dd !important; border-color:#f2d89d !important; }
.status-danger { color:#a02f39 !important; background:#fff0f1 !important; border-color:#f1c2c6 !important; }
.status-muted { color:#596273 !important; background:#f1f3f5 !important; border-color:#dfe3e8 !important; }
.status-gold { color:#74512d !important; background:#f4eadb !important; border-color:#e3cba9 !important; }
.status-neutral { color:#475467 !important; background:#f8fafc !important; border-color:#e4e7ec !important; }

/* ---------- Date/filter state ---------- */
.filter-active-note {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 10px;
    padding: 7px 11px;
    border-radius: 12px;
    color: #6f4e2c;
    background: #f8efe3;
    border: 1px solid #ead7bd;
    font-size: 11.5px;
    font-weight: 800;
}
.payment-filter-card,
.changeorders-filter-card,
.dailynotes-filter-card,
.auditlogs-filter-card {
    overflow: visible;
}

/* ---------- Compact desktop action icons ---------- */
@media (min-width: 768px) {
    .table-actions {
        display: inline-flex !important;
        align-items: center;
        justify-content: flex-start;
        gap: 5px !important;
        flex-wrap: nowrap !important;
        white-space: nowrap;
    }
    .table-actions form { margin:0 !important; }
    .table-actions .icon-only-action,
    .table-actions .btn.icon-only-action {
        width: 34px !important;
        min-width: 34px !important;
        height: 34px !important;
        min-height: 34px !important;
        padding: 0 !important;
        display: inline-grid !important;
        place-items: center;
        border-radius: 10px !important;
        font-size: 15px !important;
        line-height: 1 !important;
    }
    .table-actions .icon-only-action i { margin:0 !important; }
}

/* ---------- Modal action bars ---------- */
.modal-footer.modal-action-bar {
    position: sticky;
    bottom: 0;
    z-index: 6;
    display: grid !important;
    grid-auto-flow: column;
    grid-auto-columns: minmax(44px, 1fr);
    align-items: center;
    gap: 7px !important;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom)) !important;
    margin: 0 !important;
    border-top: 1px solid #e7eaee !important;
    background: rgba(255,255,255,.96) !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
.modal-footer.modal-action-bar > form { margin:0 !important; display:contents; }
.modal-footer.modal-action-bar .btn {
    width: 100% !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    margin: 0 !important;
    padding: 0 !important;
    display: grid !important;
    place-items: center;
    border-radius: 13px !important;
    font-size: 0 !important;
}
.modal-footer.modal-action-bar .btn i {
    margin:0 !important;
    font-size:17px !important;
    line-height:1 !important;
}
.modal-dialog-scrollable .modal-content { overflow:hidden; }
.modal-dialog-scrollable .modal-body { overscroll-behavior:contain; }

/* ---------- Navigation: phone only ---------- */
@media (min-width: 768px) {
    .bottom-tab-bar,
    .mobile-header { display:none !important; }
}
@media (max-width: 767.98px) {
    .sidebar { display:none !important; }
    .bottom-tab-bar {
        display:grid !important;
        background:
            radial-gradient(circle at 50% -40%, rgba(164,122,73,.22), transparent 45%),
            linear-gradient(180deg, #202b37, #18202a) !important;
        border-top: 1px solid rgba(215,177,123,.28) !important;
    }
    .bottom-tab-item.active,
    .bottom-tab-item[aria-current="page"] {
        background: rgba(215,177,123,.16) !important;
        box-shadow: inset 0 0 0 1px rgba(215,177,123,.18) !important;
    }
    .bottom-tab-item.active .bottom-tab-icon,
    .bottom-tab-item[aria-current="page"] .bottom-tab-icon,
    .bottom-tab-item.active .bottom-tab-label,
    .bottom-tab-item[aria-current="page"] .bottom-tab-label {
        color: #f2d5aa !important;
    }
    .bottom-tab-item.active.app-tab-pulse {
        animation: final-tab-pulse .28s ease-out;
    }
    @keyframes final-tab-pulse {
        50% { background:rgba(215,177,123,.29); }
    }
    .bottom-tab-fab { transition:transform .22s ease, filter .18s ease, box-shadow .18s ease !important; }
    body.quick-add-active .bottom-tab-fab { transform:rotate(45deg) !important; filter:brightness(1.08); }
}

/* ---------- Animated quick-add sheet ---------- */
.quick-add-overlay {
    background: rgba(8,13,19,.10) !important;
    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);
    transition: background-color .22s ease, backdrop-filter .22s ease !important;
}
.quick-add-overlay.is-active {
    background: rgba(8,13,19,.52) !important;
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
}
.quick-add-sheet {
    transform: translateY(calc(100% + 28px)) scale(.985) !important;
    opacity: .85;
    transition: transform .32s cubic-bezier(.22,.9,.28,1), opacity .22s ease !important;
}
.quick-add-overlay.is-active .quick-add-sheet {
    transform: translateY(0) scale(1) !important;
    opacity:1;
}
.quick-add-row {
    opacity:0;
    transform:translateY(13px);
    transition:transform .24s ease, opacity .22s ease, background-color .16s ease !important;
}
.quick-add-overlay.is-active .quick-add-row { opacity:1; transform:translateY(0); }
.quick-add-overlay.is-active .quick-add-row:nth-of-type(1) { transition-delay:.05s !important; }
.quick-add-overlay.is-active .quick-add-row:nth-of-type(2) { transition-delay:.09s !important; }
.quick-add-overlay.is-active .quick-add-row:nth-of-type(3) { transition-delay:.13s !important; }
.quick-add-row:active { transform:scale(.985) !important; background:#f4eadb !important; }
.quick-add-spark {
    position:absolute;
    inset-inline-end:24px;
    top:17px;
    width:30px;
    height:30px;
    pointer-events:none;
}
.quick-add-spark span {
    position:absolute;
    width:5px;height:5px;border-radius:50%;
    background:#c89a61;
    opacity:0;
}
.quick-add-spark span:nth-child(1){inset-inline-start:2px;top:12px}
.quick-add-spark span:nth-child(2){inset-inline-start:14px;top:2px}
.quick-add-spark span:nth-child(3){inset-inline-end:1px;top:15px}
.quick-add-overlay.is-active .quick-add-spark span { animation:quick-spark .45s ease-out both; }
.quick-add-overlay.is-active .quick-add-spark span:nth-child(2){animation-delay:.05s}
.quick-add-overlay.is-active .quick-add-spark span:nth-child(3){animation-delay:.1s}
@keyframes quick-spark {
    0%{opacity:0;transform:scale(.2)}
    40%{opacity:1}
    100%{opacity:0;transform:translateY(-9px) scale(1)}
}

/* ---------- Search ---------- */
.search-box-card #searchPageForm {
    display:grid !important;
    grid-template-columns:minmax(0,1fr) 54px;
    gap:8px !important;
}
.search-box-card .input-group-text {
    border-inline-end:0 !important;
    color:#8e99a8;
    background:#fff;
}
.search-box-card .input-group .form-control { border-inline-start:0 !important; }
.search-box-card button[type="submit"] {
    width:54px; min-width:54px; padding:0 !important; border-radius:15px !important;
}
.search-box-card button[type="submit"] i { font-size:20px; }

/* ---------- Budget catalogue ---------- */
.budget-catalogue {
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:14px;
}
.budget-catalog-card {
    position:relative;
    min-width:0;
    padding:16px;
    border:1px solid #e4e7ec;
    border-radius:20px;
    background:#fff;
    box-shadow:0 7px 22px rgba(16,24,40,.055);
    color:inherit;
    text-decoration:none;
    overflow:hidden;
    transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.budget-catalog-card:hover {
    color:inherit;
    transform:translateY(-2px);
    border-color:#d9c09d;
    box-shadow:0 15px 34px rgba(16,24,40,.09);
}
.budget-catalog-icon {
    width:52px;height:52px;border-radius:17px;
    display:grid;place-items:center;
    color:#825d36;
    background:linear-gradient(145deg,#f5ecdf,#ead8bf);
    font-size:24px;
    margin-bottom:12px;
}
.budget-catalog-title {
    min-height:44px;
    margin:0 0 10px;
    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
    overflow:hidden;
    font-size:15px;
    font-weight:900;
    line-height:1.45;
}
.budget-catalog-money {
    display:flex;align-items:end;justify-content:space-between;gap:8px;
    margin-bottom:10px;
}
.budget-catalog-money span {font-size:10.5px;color:#7a8493;font-weight:700}
.budget-catalog-money strong {font-size:14px;color:#76532e}
.budget-catalog-progress {height:6px!important;border-radius:99px!important;overflow:hidden;background:#edf0f3!important}
.budget-catalog-progress .progress-bar {background:linear-gradient(90deg,#8b6842,#c59a64)!important}
.budget-catalog-meta {display:flex;justify-content:space-between;gap:6px;align-items:center;margin-top:10px}
.budget-catalog-meta small{font-size:10.5px;color:#7a8493}
@media (max-width:1199.98px){.budget-catalogue{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media (max-width:767.98px){
    .budget-catalogue{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
    .budget-catalog-card{padding:12px;border-radius:17px}
    .budget-catalog-icon{width:46px;height:46px;border-radius:14px;font-size:21px;margin-bottom:9px}
    .budget-catalog-title{font-size:13px;min-height:39px}
    .budget-catalog-money{display:block}
    .budget-catalog-money strong{display:block;margin-top:2px}
}
@media (max-width:350px){.budget-catalogue{grid-template-columns:1fr}}

/* ---------- Budget details ---------- */
.budget-detail-hero {
    position:relative;
    padding:16px !important;
    overflow:hidden;
}
.budget-detail-heading {
    display:grid;
    grid-template-columns:auto minmax(0,1fr) auto;
    align-items:start;
    gap:12px;
}
.budget-detail-icon {
    width:50px;height:50px;border-radius:16px;display:grid;place-items:center;
    color:#825d36;background:#f1e5d4;font-size:23px;
}
.budget-detail-copy {min-width:0}
.budget-detail-copy h2 {margin:0;overflow-wrap:anywhere;font-size:20px}
.budget-detail-description {
    margin-top:6px;
    color:#697586;
    font-size:12.5px;
    line-height:1.75;
    overflow-wrap:anywhere;
    word-break:break-word;
}
.budget-detail-actions {display:flex;gap:6px;flex-wrap:nowrap}
.budget-detail-tags {display:flex;gap:6px;flex-wrap:wrap;margin-top:10px}
.budget-detail-progress {margin-top:14px}
.budget-detail-progress-head {display:flex;justify-content:space-between;font-size:11px;font-weight:800;color:#786044;margin-bottom:6px}
.budget-mini-kpis {
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:8px;
    margin-bottom:14px;
}
.budget-mini-kpi {
    min-width:0;
    min-height:58px;
    padding:9px 10px;
    border-radius:14px;
    border:1px solid #e6e8ec;
    background:#fff;
}
.budget-mini-kpi span{display:block;color:#7b8492;font-size:9.5px;font-weight:800}
.budget-mini-kpi strong{display:block;margin-top:3px;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media(max-width:767.98px){
    .budget-detail-heading{grid-template-columns:44px minmax(0,1fr) auto;gap:8px}
    .budget-detail-icon{width:44px;height:44px;border-radius:14px;font-size:20px}
    .budget-detail-copy h2{font-size:16px}
    .budget-detail-actions .btn{width:38px;height:38px;padding:0;display:grid;place-items:center;font-size:0}
    .budget-detail-actions .btn i{font-size:14px}
    .budget-mini-kpis{grid-template-columns:repeat(4,minmax(96px,1fr));overflow-x:auto;scrollbar-width:none;padding-bottom:2px}
    .budget-mini-kpis::-webkit-scrollbar{display:none}
}

/* ---------- Contractor details ---------- */
@media(max-width:767.98px){
    .contractor-actions-bar {
        display:grid !important;
        grid-template-columns:repeat(5,1fr);
        gap:7px !important;
        margin-bottom:10px;
    }
    .contractor-actions-bar > form {display:contents}
    .contractor-actions-bar .btn {
        width:100%!important;height:43px!important;min-height:43px!important;
        padding:0!important;display:grid!important;place-items:center!important;
        border-radius:12px!important;font-size:0!important;
    }
    .contractor-actions-bar .btn i{font-size:16px!important;margin:0!important}
    .contractor-contact-grid,
    .contractor-stat-grid {
        grid-template-columns:repeat(2,minmax(0,1fr)) !important;
        gap:8px!important;
    }
    .contractor-contact-grid > div,
    .contractor-stat-card {min-height:74px!important;padding:10px!important}
}

/* ---------- User create/edit ---------- */
.user-form-grid {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:14px;
}
.user-form-grid .field-span-2 {grid-column:1/-1}
.user-active-toggle {
    min-height:48px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:10px 13px;
    border:1px solid #dfe3e8;
    border-radius:14px;
    background:#f9fafb;
}
.user-form-actions {display:flex;gap:8px;justify-content:flex-end;margin-top:16px}


/* ---------- Project settings ---------- */
.settings-shell{max-width:1060px;margin-inline:auto}
.project-settings-form{display:grid;gap:16px}
.settings-section{padding:20px}
.settings-section-head{display:flex;align-items:center;gap:12px;margin-bottom:18px}
.settings-section-head h2{margin:0;font-size:17px}
.settings-section-head p{margin:3px 0 0;color:#7a8493;font-size:11.5px}
.settings-section-icon{width:43px;height:43px;border-radius:14px;display:grid;place-items:center;background:#f1e5d4;color:#805b36;font-size:19px}
.settings-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px}
.settings-grid .field-span-2{grid-column:1/-1}
.project-cover-editor{display:grid;grid-template-columns:220px minmax(0,1fr);gap:16px;align-items:center;margin-top:16px}
.project-cover-preview{position:relative;height:150px;border-radius:18px;overflow:hidden;background:#eef1f4}
.project-cover-preview img{width:100%;height:100%;object-fit:cover;display:block}
.project-cover-fallback-label{position:absolute;inset:0;display:grid;place-items:center;color:#fff;background:linear-gradient(transparent,rgba(0,0,0,.32));pointer-events:none}
.location-picker{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(300px,.75fr);gap:15px;margin-top:16px}
.location-map-shell{position:relative;min-height:330px;border:1px solid #e1e5e9;border-radius:18px;overflow:hidden;background:#eef1f4}
.project-location-map{width:100%;height:100%;min-height:330px;border:0;display:block}
.location-map-tip{position:absolute;inset-inline:12px;bottom:12px;z-index:500;display:inline-flex;align-items:center;gap:6px;width:max-content;max-width:calc(100% - 24px);padding:7px 10px;border-radius:12px;background:rgba(24,32,42,.88);color:#fff;font-size:10.5px;font-weight:700;pointer-events:none;backdrop-filter:blur(8px)}
.location-coordinate-panel{padding:14px;border:1px solid #e4e7ec;border-radius:18px;background:#fafbfc}
.location-picker-actions{display:flex;gap:7px;flex-wrap:wrap;margin-top:12px}
.settings-form-actions{display:flex;justify-content:flex-end;gap:8px}
@media(max-width:767.98px){
    .settings-section{padding:14px}
    .project-cover-editor,.location-picker{grid-template-columns:1fr}
    .project-cover-preview{height:185px}
    .location-map-shell,.project-location-map{min-height:250px}
}

/* ---------- Fixed-height login ---------- */
.final-login-body { min-height:100svh; }
.final-login-shell { min-height:100svh; }
.final-login-visual { background-color:#18202a; }
.login-default-art {
    position:absolute;inset:0;pointer-events:none;
    background:
      radial-gradient(circle at 15% 18%,rgba(215,177,123,.32),transparent 22%),
      radial-gradient(circle at 84% 30%,rgba(91,126,166,.30),transparent 24%),
      linear-gradient(145deg,#273647,#111820);
}
@media(max-width:767.98px){
    html:has(body.final-login-body), body.final-login-body {
        height:100svh!important;
        min-height:100svh!important;
        overflow:hidden!important;
        overscroll-behavior:none;
    }
    .final-login-shell {
        height:100svh!important;
        min-height:100svh!important;
        display:grid!important;
        grid-template-rows:minmax(180px,35svh) minmax(0,65svh)!important;
        overflow:hidden!important;
    }
    .final-login-visual{min-height:0!important;height:auto!important}
    .final-login-visual-top{padding:calc(12px + env(safe-area-inset-top)) 14px 0!important}
    .final-login-visual-bottom{padding:16px 18px 24px!important}
    .final-login-visual-bottom h2{font-size:21px!important;max-width:290px}
    .final-login-panel {
        min-height:0!important;
        margin-top:-22px;
        border-radius:27px 27px 0 0!important;
        position:relative;z-index:2;
        overflow:hidden!important;
    }
    .final-login-panel-inner {
        height:100%;
        padding:18px 20px calc(14px + env(safe-area-inset-bottom))!important;
        overflow:hidden!important;
        display:flex!important;
        flex-direction:column;
        justify-content:center;
    }
    .final-login-panel-inner h1{font-size:22px!important;margin-bottom:3px!important}
    .login-intro{margin-bottom:12px!important}
    .final-login-form .mb-3{margin-bottom:10px!important}
    .final-login-form .form-control,.final-login-form .input-group-text,.final-login-form .password-toggle{min-height:48px!important}
    .login-brand-row{margin-bottom:10px!important}
    .login-footer-note{margin-top:8px!important}
    .login-install-button{min-height:42px!important}
    body.final-login-body.login-keyboard-open .final-login-shell {
        grid-template-rows:0 minmax(0,100svh)!important;
    }
    body.final-login-body.login-keyboard-open .final-login-visual{display:none!important}
    body.final-login-body.login-keyboard-open .final-login-panel{margin-top:0;border-radius:0!important}
    body.final-login-body.login-keyboard-open .final-login-panel-inner{overflow:auto!important;justify-content:flex-start;padding-top:calc(18px + env(safe-area-inset-top))!important}
}

/* ---------- Short mobile pages ---------- */
@media(max-width:767.98px){
    body.app-short-page:not(.quick-search-open):not(.app-sheet-open) {
        height:100svh!important;
        overflow:hidden!important;
        overscroll-behavior:none;
    }
    body.app-short-page .app-shell,
    body.app-short-page .main-content {height:100svh!important;min-height:0!important;overflow:hidden!important}
    body.app-short-page .content-wrap {
        height:calc(100svh - var(--app-mobile-header-h) - var(--app-bottom-nav-h) - env(safe-area-inset-bottom))!important;
        min-height:0!important;
        overflow:hidden!important;
    }
    html.keyboard-open body.app-short-page,
    body.app-short-page.has-modal-open {overflow:auto!important}
}

/* ---------- General mobile compactness ---------- */
@media(max-width:767.98px){
    .content-wrap{padding-inline:10px!important}
    .clean-card{max-width:100%;overflow-wrap:anywhere}
    .page-actions{gap:8px}
}

/* ---------- Motion accessibility ---------- */
@media(prefers-reduced-motion:reduce){
    .quick-add-sheet,.quick-add-row,.budget-catalog-card,.bottom-tab-fab{transition-duration:.01ms!important;animation:none!important}
}


/* Login media layers and compact form details */
.final-login-visual { position:relative; overflow:hidden; }
.final-login-hero-image {
    position:absolute; inset:0; width:100%; height:100%;
    object-fit:cover; display:block; z-index:0;
}
.final-login-visual-shade {
    position:absolute; inset:0; z-index:1;
    background:
      linear-gradient(180deg,rgba(12,18,25,.18),rgba(12,18,25,.22) 34%,rgba(12,18,25,.82) 100%),
      linear-gradient(90deg,rgba(12,18,25,.18),transparent 55%);
}
.final-login-visual-top,.final-login-visual-bottom { position:relative; z-index:2; }
.login-kicker {
    display:inline-flex;align-items:center;
    margin-bottom:7px;padding:5px 9px;border-radius:999px;
    color:#f0d4ad;background:rgba(215,177,123,.14);
    border:1px solid rgba(215,177,123,.2);
    font-size:10px;font-weight:800;
}
.login-title-block{margin-bottom:14px}
.login-field{margin-bottom:12px}
.login-options{display:flex;align-items:center;justify-content:space-between;margin:2px 0 13px}
.app-check{display:flex;align-items:center;gap:9px}
.app-check .form-check-input{margin:0!important;flex:0 0 auto}
.app-check strong,.app-check small{display:block}
.app-check small{font-size:10px;color:#7a8493;margin-top:1px}
.password-field-toggle{min-width:46px!important}
.quick-add-sheet{position:relative}

/* Make the user form keep two fields per row as requested, including narrow phones. */
@media(max-width:420px){
    .user-form-grid{gap:10px}
    .user-form-card{padding-inline:12px!important}
    .user-form-grid .form-label{font-size:10.5px}
    .user-form-grid .form-control,.user-form-grid .form-select{padding-inline:8px;font-size:12px}
    .user-form-actions .btn{flex:1}
}

/* Interactive map shell keeps a polished placeholder before tiles load. */
.location-map-shell{background:
  linear-gradient(135deg,rgba(164,122,73,.10),transparent 45%),
  repeating-linear-gradient(0deg,#eef1f4 0 1px,transparent 1px 34px),
  repeating-linear-gradient(90deg,#eef1f4 0 1px,transparent 1px 34px),
  #f8fafc}

/* Header search should feel like a first-class desktop action. */
.top-actions .js-open-search{border-color:#d7dce2!important}

/* Keep modal action icons evenly spaced even when only three actions exist. */
@media(min-width:768px){
    .modal-footer.modal-action-bar{
        grid-auto-columns:44px;
        justify-content:end!important;
    }
}

/* Dashboard location link */
.dashboard-map-badge { text-decoration:none!important; cursor:pointer; }
.dashboard-map-badge:hover { color:#74512d!important; border-color:#d5b686!important; background:#f4eadb!important; }

/* Four compact budget KPIs must remain visible in one row on phones. */
@media(max-width:767.98px){
    .budget-mini-kpis{
        grid-template-columns:repeat(4,minmax(0,1fr))!important;
        overflow:visible!important;
        gap:6px!important;
    }
    .budget-mini-kpi{
        min-width:0!important;
        min-height:54px!important;
        padding:8px 5px!important;
        text-align:center;
    }
    .budget-mini-kpi span{font-size:8.5px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
    .budget-mini-kpi strong{font-size:11px!important;letter-spacing:-.02em}
}

.empty-state-card{
    grid-column:1/-1;min-height:220px;display:flex;flex-direction:column;
    align-items:center;justify-content:center;gap:8px;text-align:center;
    color:#7b8492;border:1px dashed #d8dde3;border-radius:20px;background:#fafbfc;
}
.empty-state-card>i{font-size:31px;color:#a47a49}
.empty-state-card>strong{color:#344054}
.empty-state-card>span{font-size:12px}

/* ========================================================================
   Final correction pass — mobile viewport, login, search and desktop tables
   ======================================================================== */

/* One search control only: submit on the right, input in the middle, clear on the left. */
.global-search-card{overflow:visible!important}
.global-search-form{width:100%;margin:0}
.global-search-control{
    min-height:58px;
    display:grid;
    grid-template-columns:54px minmax(0,1fr) 44px;
    align-items:stretch;
    direction:rtl;
    overflow:hidden;
    border:1px solid #dfe3e8;
    border-radius:18px;
    background:#fff;
    box-shadow:0 5px 18px rgba(16,24,40,.04);
    transition:border-color .16s ease,box-shadow .16s ease;
}
.global-search-control:focus-within{
    border-color:#b9915f;
    box-shadow:0 0 0 3px rgba(164,122,73,.12),0 8px 22px rgba(16,24,40,.06);
}
.global-search-input{
    min-width:0;
    width:100%;
    border:0;
    outline:0;
    background:transparent;
    color:#18202a;
    padding:0 14px;
    font:700 15px/1.4 Tajawal,system-ui,sans-serif;
    -webkit-appearance:none;
    appearance:none;
}
.global-search-input::-webkit-search-cancel-button{-webkit-appearance:none;appearance:none}
.global-search-input::placeholder{color:#a2aab5;font-weight:500}
.global-search-submit,.global-search-clear{
    border:0;
    display:grid;
    place-items:center;
    cursor:pointer;
    -webkit-tap-highlight-color:transparent;
}
.global-search-submit{
    color:#fff;
    background:linear-gradient(145deg,#aa8253,#8b6842);
    font-size:20px;
    border-radius:0;
}
.global-search-submit:disabled{cursor:wait;opacity:.9}
.global-search-clear{
    color:#7e8895;
    background:transparent;
    font-size:16px;
    transition:opacity .12s ease,visibility .12s ease,background .12s ease;
}
.global-search-clear:hover{background:#f2f4f7;color:#344054}
.global-search-clear.is-hidden{opacity:0;visibility:hidden;pointer-events:none}
.global-search-spinner{display:none;width:18px;height:18px;border-width:2px}
.global-search-form.is-searching .global-search-submit>i{display:none}
.global-search-form.is-searching .global-search-spinner{display:inline-block}
@media(max-width:767.98px){
    .global-search-card{padding:10px!important}
    .global-search-control{min-height:52px;grid-template-columns:50px minmax(0,1fr) 40px;border-radius:16px}
    .global-search-input{font-size:16px;padding-inline:10px}
}

/* Desktop tables own their pagination. Mobile reveal buttons must never leak to desktop. */
@media(min-width:992px){
    button.js-reveal-more.d-lg-none,
    a.js-reveal-more.d-lg-none,
    .js-reveal-more-link.d-lg-none,
    .quotes-mobile-list + .js-reveal-more,
    .payments-mobile-list + .js-reveal-more{
        display:none!important;
    }
}

/* Correct short-page sizing using the actually visible viewport and measured bars. */
@media(max-width:767.98px){
    html.app-short-page,
    html.app-short-page body,
    body.app-short-page:not(.quick-search-open):not(.app-sheet-open){
        width:100%!important;
        height:var(--app-visible-height,100dvh)!important;
        min-height:var(--app-visible-height,100dvh)!important;
        max-height:var(--app-visible-height,100dvh)!important;
        overflow:hidden!important;
        overscroll-behavior:none!important;
    }
    html.app-short-page body .mobile-header{
        position:relative!important;
        top:auto!important;
        flex:0 0 var(--app-mobile-header-actual,var(--app-mobile-header-h))!important;
    }
    html.app-short-page body .app-shell{
        height:calc(var(--app-visible-height,100dvh) - var(--app-mobile-header-actual,var(--app-mobile-header-h)))!important;
        min-height:0!important;
        max-height:none!important;
        overflow:hidden!important;
    }
    html.app-short-page body .main-content{
        height:100%!important;
        min-height:0!important;
        max-height:100%!important;
        overflow:hidden!important;
    }
    html.app-short-page body .content-wrap{
        box-sizing:border-box!important;
        height:calc(100% - var(--app-bottom-nav-actual,var(--app-bottom-nav-h)))!important;
        min-height:0!important;
        max-height:none!important;
        padding-top:10px!important;
        padding-bottom:8px!important;
        overflow:hidden!important;
        overscroll-behavior:none!important;
    }
    html.keyboard-open.app-short-page,
    html.keyboard-open.app-short-page body,
    html.app-short-page body.has-modal-open{
        height:auto!important;
        max-height:none!important;
        overflow:auto!important;
    }
}

/* Robust mobile login: the white panel always fills the remaining screen. */
@media(max-width:767.98px){
    html:has(body.final-login-body),
    body.final-login-body{
        width:100%!important;
        height:var(--login-visible-height,100dvh)!important;
        min-height:var(--login-visible-height,100dvh)!important;
        max-height:var(--login-visible-height,100dvh)!important;
        overflow:hidden!important;
        overscroll-behavior:none!important;
        background:#18202a!important;
    }
    body.final-login-body .final-login-shell{
        width:100%!important;
        height:var(--login-visible-height,100dvh)!important;
        min-height:0!important;
        max-height:var(--login-visible-height,100dvh)!important;
        display:flex!important;
        flex-direction:column!important;
        grid-template-columns:none!important;
        grid-template-rows:none!important;
        overflow:hidden!important;
        background:#18202a!important;
    }
    body.final-login-body .final-login-visual{
        display:block!important;
        flex:0 0 clamp(158px,29dvh,225px)!important;
        width:100%!important;
        height:auto!important;
        min-height:0!important;
        overflow:hidden!important;
        opacity:1;
        visibility:visible;
        transition:flex-basis .16s ease,opacity .12s ease;
    }
    body.final-login-body .final-login-visual-top{
        padding:calc(10px + env(safe-area-inset-top)) 14px 0!important;
    }
    body.final-login-body .final-login-visual-bottom{
        padding:12px 18px 31px!important;
    }
    body.final-login-body .final-login-visual-bottom h2{
        margin:0!important;
        max-width:310px!important;
        font-size:20px!important;
        line-height:1.35!important;
    }
    body.final-login-body .final-login-summary{margin-top:8px!important}
    body.final-login-body .final-login-panel{
        flex:1 1 auto!important;
        width:100%!important;
        min-height:0!important;
        height:auto!important;
        margin-top:-22px!important;
        padding:0!important;
        display:flex!important;
        align-items:stretch!important;
        justify-content:stretch!important;
        border-radius:27px 27px 0 0!important;
        overflow:hidden!important;
        background:#f4f6f8!important;
        box-shadow:0 -15px 34px rgba(0,0,0,.14)!important;
        position:relative!important;
        z-index:3!important;
    }
    body.final-login-body .final-login-panel-inner{
        flex:1 1 auto!important;
        width:100%!important;
        max-width:none!important;
        height:100%!important;
        min-height:0!important;
        box-sizing:border-box!important;
        padding:16px 20px calc(13px + env(safe-area-inset-bottom))!important;
        display:flex!important;
        flex-direction:column!important;
        justify-content:flex-start!important;
        overflow-y:auto!important;
        overflow-x:hidden!important;
        overscroll-behavior:contain!important;
        scrollbar-width:none;
        background:#f4f6f8!important;
    }
    body.final-login-body .final-login-panel-inner::-webkit-scrollbar{display:none}
    body.final-login-body .login-brand-row{margin-bottom:8px!important;flex:0 0 auto}
    body.final-login-body .login-title-block{margin-bottom:10px!important;flex:0 0 auto}
    body.final-login-body .login-title-block h1{font-size:21px!important;margin-bottom:2px!important}
    body.final-login-body .login-intro{margin-bottom:0!important;font-size:12px!important}
    body.final-login-body .final-login-form{flex:0 0 auto}
    body.final-login-body .login-field{margin-bottom:9px!important}
    body.final-login-body .final-login-form .form-control,
    body.final-login-body .final-login-form .input-group-text,
    body.final-login-body .final-login-form .password-toggle{
        min-height:47px!important;
    }
    body.final-login-body .login-options{margin:0 0 10px!important}
    body.final-login-body .final-login-submit{min-height:48px!important}
    body.final-login-body .login-install-button{min-height:40px!important;margin-top:7px!important}
    body.final-login-body .login-footer-note{margin-top:auto!important;padding-top:8px!important;flex:0 0 auto}

    body.final-login-body.login-keyboard-open .final-login-visual{
        display:block!important;
        flex-basis:0!important;
        opacity:0!important;
        visibility:hidden!important;
        pointer-events:none!important;
    }
    body.final-login-body.login-keyboard-open .final-login-panel{
        margin-top:0!important;
        border-radius:0!important;
    }
    body.final-login-body.login-keyboard-open .final-login-panel-inner{
        padding-top:calc(12px + env(safe-area-inset-top))!important;
        overflow-y:auto!important;
    }
    body.final-login-body.login-keyboard-open .login-brand-row,
    body.final-login-body.login-keyboard-open .login-title-block,
    body.final-login-body.login-keyboard-open .login-footer-note{
        display:none!important;
    }
}
@media(max-width:767.98px) and (max-height:720px){
    body.final-login-body .final-login-visual{flex-basis:132px!important}
    body.final-login-body .final-login-visual-bottom{padding-bottom:25px!important}
    body.final-login-body .final-login-visual-bottom h2{font-size:17px!important}
    body.final-login-body .final-login-summary{display:none!important}
    body.final-login-body .login-brand-row{display:none!important}
    body.final-login-body .final-login-panel-inner{padding-top:14px!important}
}

.platform-project-access-banner{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 18px;margin:0 0 16px;border-radius:16px;border:1px solid #d5b27d;background:#fff8ec;color:#3b2b18;box-shadow:0 8px 26px rgba(77,52,23,.08)}
.platform-project-access-banner>div{display:flex;align-items:center;gap:12px}.platform-project-access-banner>div>i{font-size:1.5rem;color:#9b6a2f}.platform-project-access-banner span{display:flex;flex-direction:column}.platform-project-access-banner small{color:#715b42;margin-top:3px}.platform-project-access-banner form{margin:0}.platform-project-access-banner button{border:0;border-radius:11px;background:#18202a;color:#fff;padding:9px 13px;font-weight:700}.platform-project-access-banner.is-readonly{border-color:#9fc3df;background:#eef8ff}.platform-project-access-banner.is-readonly>div>i{color:#27709f}
.platform-customer-announcement{display:flex;gap:12px;align-items:flex-start;padding:14px 17px;margin-bottom:16px;border-radius:15px;background:#18202a;color:#fff}.platform-customer-announcement>i{color:#dfbd85;font-size:1.25rem}.platform-customer-announcement div{display:flex;flex-direction:column}.platform-customer-announcement span{color:#d7dee5;font-size:.9rem;margin-top:3px;white-space:pre-line}
@media(max-width:720px){.platform-project-access-banner{align-items:stretch;flex-direction:column}.platform-project-access-banner button{width:100%}}
