﻿:root{--fm-navy:#172433;--fm-navy2:#21364b;--fm-gold:#c8a45c;--fm-bg:#f3f6f9;--fm-card:#fff;--fm-text:#1d2a36;--fm-muted:#6b7785;--fm-border:#dfe6ec;--fm-good:#19764a;--fm-bad:#b64242;--fm-warn:#a66a14;--fm-blue:#2f6f9f;--fm-shadow:0 8px 24px rgba(23,36,51,.08)}
*{box-sizing:border-box}html,body{margin:0;padding:0;background:var(--fm-bg);color:var(--fm-text);font-family:"Segoe UI",Tahoma,Arial,sans-serif}html[dir="rtl"] body{font-family:"Tajawal",Tahoma,"Segoe UI",Arial,sans-serif}body{min-height:100vh}.fm-shell{display:flex;min-height:100vh}.fm-sidebar{width:265px;background:linear-gradient(180deg,var(--fm-navy),#101a24);color:#fff;position:fixed;top:0;bottom:0;inset-inline-start:0;overflow-y:auto;z-index:1000}.fm-brand{padding:20px 18px 17px;border-bottom:1px solid rgba(255,255,255,.08);display:flex;gap:12px;align-items:center}.fm-brand-mark{width:42px;height:42px;border-radius:12px;background:linear-gradient(135deg,var(--fm-gold),#f0d99a);display:grid;place-items:center;color:#172433;font-weight:900;letter-spacing:-1px}.fm-brand-main{font-size:19px;font-weight:800;letter-spacing:.2px}.fm-brand-sub{color:#c9d2dc;font-size:11px;margin-top:3px}.fm-nav{padding:12px}.fm-nav-title{font-size:10px;color:#8ea0b2;text-transform:uppercase;letter-spacing:1.1px;padding:16px 12px 7px}.fm-nav a{display:flex;align-items:center;gap:10px;color:#dfe7ee;text-decoration:none;padding:10px 12px;border-radius:9px;font-size:14px;margin:2px 0;transition:.15s}.fm-nav a:hover,.fm-nav a.active{background:rgba(255,255,255,.10);color:#fff}.fm-nav .ico{width:21px;height:21px;display:grid;place-items:center;border-radius:6px;background:rgba(255,255,255,.06);font-weight:800}.fm-main{margin-inline-start:265px;width:calc(100% - 265px);min-height:100vh}.fm-topbar{height:66px;background:#fff;border-bottom:1px solid var(--fm-border);display:flex;align-items:center;justify-content:space-between;padding:0 24px;position:sticky;top:0;z-index:900;gap:12px}.fm-topbar-start,.fm-topbar-actions{display:flex;align-items:center;gap:12px}.fm-menu-toggle{display:none;background:none;border:0;font-size:24px;cursor:pointer}.fm-user{font-size:13px;color:var(--fm-muted)}.fm-user strong{color:var(--fm-text)}.fm-top-link{color:#5f6d79;text-decoration:none;font-size:12.5px;font-weight:600}.fm-top-link:hover{color:var(--fm-navy2)}.fm-lang-button{width:122px;height:44px;border-radius:12px;border:1px solid #c8d2dc;background:#fff;padding:0;cursor:pointer;box-shadow:0 3px 10px rgba(0,0,0,.09);transition:transform .15s ease,box-shadow .15s ease}.fm-lang-button:hover{transform:translateY(-1px);box-shadow:0 5px 14px rgba(0,0,0,.14)}.fm-lang-button:focus{outline:3px solid rgba(47,111,159,.20);outline-offset:2px}.fm-content{padding:24px;max-width:1500px;margin:0 auto}.fm-page-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:20px}.fm-page-head h1{font-size:25px;margin:0 0 5px;line-height:1.25}.fm-page-head p{margin:0;color:var(--fm-muted);font-size:13px;max-width:900px;line-height:1.65}.fm-kpis{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-bottom:20px}.fm-kpi,.fm-card{background:#fff;border:1px solid var(--fm-border);border-radius:14px;box-shadow:var(--fm-shadow)}.fm-kpi{padding:18px;position:relative;overflow:hidden}.fm-kpi:after{content:"";position:absolute;width:60px;height:60px;border-radius:50%;background:rgba(200,164,92,.10);inset-inline-end:-18px;top:-18px}.fm-kpi-label{font-size:12px;color:var(--fm-muted);margin-bottom:8px}.fm-kpi-value{font-size:24px;font-weight:800;direction:ltr;text-align:start}.fm-kpi-note{font-size:11px;color:var(--fm-muted);margin-top:5px}.fm-card{padding:18px;margin-bottom:18px}.fm-card-title{font-size:16px;font-weight:800;margin-bottom:14px}.fm-grid-2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.fm-form-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.fm-form-grid.fm-3{grid-template-columns:repeat(3,minmax(0,1fr))}.fm-form-grid.fm-2{grid-template-columns:repeat(2,minmax(0,1fr))}.fm-span-2{grid-column:span 2}.fm-field label{display:block;font-size:12px;font-weight:700;margin-bottom:6px;color:#465665}.fm-input,.fm-select,select.fm-input,input.fm-input,textarea.fm-input{width:100%;min-height:41px;border:1px solid #cfd8e1;border-radius:9px;padding:8px 10px;background:#fff;color:var(--fm-text);font:inherit}.fm-money{direction:ltr;text-align:start}.fm-input:focus,.fm-select:focus{outline:none;border-color:#829db8;box-shadow:0 0 0 3px rgba(33,54,75,.08)}textarea.fm-input{min-height:82px;resize:vertical}.fm-actions{display:flex;gap:8px;align-items:end;flex-wrap:wrap}.fm-btn{display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:9px;padding:10px 15px;font-weight:800;font-size:13px;cursor:pointer;text-decoration:none;min-height:40px}.fm-btn-primary{background:var(--fm-navy2);color:#fff}.fm-btn-gold{background:var(--fm-gold);color:#172433}.fm-btn-light{background:#eef2f5;color:#243444}.fm-btn-danger{background:#fdecec;color:#933}.fm-message{display:block;padding:10px 12px;border-radius:8px;margin-bottom:14px;font-size:13px}.fm-success{background:#e9f7ef;color:#17613e}.fm-error{background:#fdeeee;color:#913434}.fm-warning{background:#fff4dd;color:#83520c}.fm-info{background:#eaf3fb;color:#275d87}.fm-table-wrap{overflow:auto;border:1px solid var(--fm-border);border-radius:10px}.fm-table{width:100%;border-collapse:collapse;background:#fff;font-size:13px}.fm-table th{background:#f4f7f9;text-align:start;padding:11px 10px;white-space:nowrap;border-bottom:1px solid var(--fm-border);color:#465665}.fm-table td{padding:10px;border-bottom:1px solid #edf1f4;vertical-align:middle}.fm-table tr:last-child td{border-bottom:0}.fm-table .num{direction:ltr;text-align:end;white-space:nowrap}.fm-pill{display:inline-block;padding:4px 9px;border-radius:99px;background:#eef3f7;font-size:11px;font-weight:700}.fm-pill-good{background:#e9f7ef;color:#17613e}.fm-pill-warn{background:#fff4dd;color:#83520c}.fm-positive{color:var(--fm-good)}.fm-negative{color:var(--fm-bad)}.fm-links{display:flex;gap:10px;flex-wrap:wrap}.fm-links a{background:#fff;border:1px solid var(--fm-border);border-radius:10px;padding:10px 13px;text-decoration:none;color:var(--fm-text);font-weight:700;font-size:13px}.fm-links a:hover{border-color:#aab9c6}.fm-mobile-overlay{display:none}.fm-rate-chip{display:inline-flex;align-items:center;gap:6px;padding:7px 10px;background:#fff8e7;border:1px solid #edd9a7;border-radius:99px;font-size:12px;font-weight:800;color:#6a531e;direction:ltr}.fm-account-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.fm-account-card{background:#fff;border:1px solid var(--fm-border);border-radius:13px;padding:16px;box-shadow:0 5px 16px rgba(23,36,51,.05);display:flex;flex-direction:column;gap:10px}.fm-account-top{display:flex;justify-content:space-between;gap:10px;align-items:flex-start}.fm-account-name{font-size:15px;font-weight:800}.fm-account-balance{font-size:24px;font-weight:900;direction:ltr}.fm-account-usd{font-size:12px;color:var(--fm-muted);direction:ltr}.fm-account-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:auto}.fm-account-actions a{font-size:12px;text-decoration:none;font-weight:800;color:var(--fm-blue)}.fm-help{color:var(--fm-muted);font-size:12px;line-height:1.6}.fm-summary-row{display:flex;gap:12px;align-items:center;flex-wrap:wrap}.fm-spacer{height:8px}.fm-empty{padding:18px;text-align:center;color:var(--fm-muted)}
html[dir="rtl"] .fm-topbar-actions{margin-inline-start:auto}html[dir="rtl"] input[type="date"]{direction:ltr;text-align:right}html[dir="rtl"] .fm-table .num{text-align:left}
@media(max-width:1100px){.fm-kpis{grid-template-columns:repeat(2,1fr)}.fm-form-grid,.fm-form-grid.fm-3{grid-template-columns:repeat(2,1fr)}.fm-account-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:780px){.fm-sidebar{transform:translateX(-100%);transition:.2s}.fm-sidebar.open{transform:translateX(0)}html[dir="rtl"] .fm-sidebar{transform:translateX(100%)}html[dir="rtl"] .fm-sidebar.open{transform:translateX(0)}.fm-main{margin-inline-start:0;width:100%}.fm-menu-toggle{display:block}.fm-topbar{padding:0 12px;height:62px}.fm-user{display:none}.fm-top-link{display:none}.fm-content{padding:14px}.fm-page-head{display:block}.fm-page-head h1{font-size:21px}.fm-page-head .fm-links{margin-top:12px}.fm-kpis,.fm-grid-2,.fm-form-grid,.fm-form-grid.fm-2,.fm-form-grid.fm-3,.fm-account-grid{grid-template-columns:1fr}.fm-span-2{grid-column:auto}.fm-kpi{padding:15px}.fm-kpi-value{font-size:22px}.fm-card{padding:14px;border-radius:11px}.fm-mobile-overlay.show{display:block;position:fixed;inset:0;background:rgba(0,0,0,.35);z-index:950}.fm-actions .fm-btn,.fm-actions input.fm-btn{flex:1 1 auto}.fm-table-wrap{border:0;overflow:visible}.fm-table.fm-responsive thead{display:none}.fm-table.fm-responsive,.fm-table.fm-responsive tbody,.fm-table.fm-responsive tr,.fm-table.fm-responsive td{display:block;width:100%}.fm-table.fm-responsive tr{border:1px solid var(--fm-border);border-radius:11px;margin-bottom:10px;background:#fff;overflow:hidden}.fm-table.fm-responsive td{display:grid;grid-template-columns:minmax(115px,40%) 1fr;gap:10px;padding:9px 11px;white-space:normal;text-align:start!important;border-bottom:1px solid #edf1f4}.fm-table.fm-responsive td:last-child{border-bottom:0}.fm-table.fm-responsive td:before{content:attr(data-label);font-weight:800;color:#5d6c78}.fm-table.fm-responsive td.num{direction:inherit}.fm-account-balance{font-size:22px}}
@media(max-width:420px){.fm-brand{padding:16px}.fm-topbar-actions{gap:7px}.fm-lang-button{width:108px;height:40px}.fm-content{padding:11px}.fm-card{padding:12px}.fm-btn{width:100%}}

/* ========================================================================== */
/* V5 visual refinements                                                       */
/* ========================================================================== */
:root{
    --fm-sand:#f0dfad;
    --fm-sand-soft:#f5e8c1;
    --fm-sand-border:#d3b86e;
    --fm-sand-deep:#e5c970;
}

/* Section cards now use a stronger champagne/yellow background so white
   inputs and table surfaces have clearer contrast. */
.fm-card{
    background:var(--fm-sand-soft);
    border-color:var(--fm-sand-border);
    box-shadow:0 8px 24px rgba(86,68,25,.10);
}
.fm-card-title{color:#3a3324}
.fm-table-wrap{background:#fff;border-color:#d7c690}
.fm-rate-chip{background:var(--fm-sand);border-color:var(--fm-sand-border);color:#5d4815}
.fm-warning,.fm-pill-warn{background:#ecd695;color:#654910}
.fm-links a{border-color:#d7c690}

/* Account cards: individual, centered, smooth and clearly separated. */
.fm-account-grid-centered{margin-bottom:20px}
.fm-account-card{
    background:var(--fm-sand);
    border:1px solid var(--fm-sand-border);
    border-radius:18px;
    padding:20px 18px;
    min-height:190px;
    align-items:center;
    justify-content:center;
    text-align:center;
    box-shadow:0 9px 22px rgba(84,65,18,.13);
    transition:transform .15s ease,box-shadow .15s ease,border-color .15s ease;
}
.fm-account-card:hover{transform:translateY(-2px);box-shadow:0 12px 28px rgba(84,65,18,.18);border-color:#c7a94f}
.fm-account-card .fm-account-top{width:100%;justify-content:center;align-items:center}
.fm-account-name{font-size:17px;line-height:1.4;text-align:center}
.fm-account-currency{background:#fff;border:1px solid rgba(120,94,24,.18);margin-top:2px}
.fm-account-balance{font-size:27px;text-align:center}
.fm-account-usd{text-align:center;color:#61573e}
.fm-account-actions{justify-content:center;width:100%}
.fm-account-actions a{background:#fff;border:1px solid #d0b96f;border-radius:9px;padding:7px 12px;color:#354a5f}
.fm-account-tools{margin-top:4px}
.fm-page-head-simple{margin-bottom:16px}

/* Collapsed add/create sections save vertical space until explicitly opened. */
.fm-collapsible{transition:opacity .15s ease}
.fm-collapsible.fm-collapsed{display:none}

/* Dashboard / target presentation. */
.fm-kpis-dashboard{grid-template-columns:repeat(4,minmax(0,1fr))}
.fm-kpis-report{grid-template-columns:repeat(4,minmax(0,1fr))}
.fm-kpi-target{border-color:#c9a94e;background:#fff9e8}
.fm-target-card{position:relative;overflow:hidden}
.fm-target-card:after{content:"";position:absolute;width:160px;height:160px;border-radius:50%;background:rgba(200,164,92,.12);inset-inline-end:-75px;top:-85px;pointer-events:none}
.fm-target-total{display:flex;align-items:center;justify-content:space-between;gap:16px;background:#fff;border:1px solid #d6c384;border-radius:12px;padding:13px 15px;margin-bottom:12px;position:relative;z-index:1}
.fm-target-total span{font-size:12px;color:#6a6048;font-weight:700}
.fm-target-total strong{font-size:23px;direction:ltr;color:#172433}
.fm-target-help{margin:12px 0 0}
.fm-kpi-period{font-size:16px!important;line-height:1.45}

/* Sidebar footer keeps password / sign-out at the end of the menu. */
.fm-nav-footer{margin-top:18px;padding-top:12px;border-top:1px solid rgba(255,255,255,.10)}
.fm-nav-footer a{color:#f1e5c1}

/* Mobile-only centered Ferrari Management identity. */
.fm-mobile-brand{display:none}
.fm-mobile-brand-mark{width:31px;height:31px;border-radius:9px;background:linear-gradient(135deg,var(--fm-gold),#f0d99a);display:grid;place-items:center;color:#172433;font-size:12px;font-weight:900}
.fm-mobile-brand-text{font-size:12px;font-weight:800;color:#fff;white-space:nowrap}

@media(max-width:1100px){
    .fm-kpis-dashboard,.fm-kpis-report{grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media(max-width:780px){
    .fm-topbar{
        background:linear-gradient(90deg,var(--fm-navy),#101a24);
        border-bottom-color:#0d1720;
        position:sticky;
        padding:0 10px;
    }
    .fm-menu-toggle{color:#fff;position:relative;z-index:3;width:38px;height:38px;border-radius:9px;background:rgba(255,255,255,.08)}
    .fm-mobile-brand{display:flex;align-items:center;justify-content:center;gap:7px;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);z-index:1;max-width:145px}
    html[dir="rtl"] .fm-mobile-brand{left:50%;right:auto;transform:translate(-50%,-50%)}
    .fm-topbar-actions{position:relative;z-index:3;margin-inline-start:auto}
    .fm-lang-button{width:98px;height:38px;border-color:#d7c690;box-shadow:none}
    .fm-kpis-dashboard,.fm-kpis-report{grid-template-columns:1fr}
    .fm-account-card{min-height:165px;padding:18px 14px}
    .fm-account-grid-centered{gap:12px}
    .fm-target-total{align-items:flex-start;flex-direction:column;gap:5px}
}

@media(max-width:390px){
    .fm-mobile-brand-text{font-size:10.5px}
    .fm-mobile-brand-mark{width:28px;height:28px;font-size:11px}
    .fm-mobile-brand{max-width:122px;gap:5px}
    .fm-lang-button{width:88px;height:36px}
}

/* ========================================================================== */
/* V6 usability / accounting refinements                                      */
/* ========================================================================== */
:root{
    --fm-sand:#f8edcf;
    --fm-sand-soft:#fcf6e5;
    --fm-sand-border:#dfcf9f;
    --fm-sand-deep:#ead18b;
}
.fm-card{background:var(--fm-sand-soft);border-color:var(--fm-sand-border);box-shadow:0 7px 20px rgba(86,68,25,.075)}
.fm-account-card{background:var(--fm-sand);border-color:var(--fm-sand-border);box-shadow:0 7px 18px rgba(84,65,18,.10)}
.fm-account-card:hover{box-shadow:0 10px 24px rgba(84,65,18,.14);border-color:#d2bb76}
.fm-table-wrap{border-color:#e2d7b6}.fm-rate-chip{background:#fbf1d6;border-color:#e1cf9c}.fm-links a{border-color:#dfd2ab}
.fm-balance-negative{color:#c62828!important;font-weight:900!important}
.fm-account-card .fm-balance-negative{color:#ba2525!important}
.fm-account-subline{font-size:12px;color:#665f50;line-height:1.5;text-align:center}
.fm-account-actions{justify-content:center}
.fm-account-actions .fm-btn{padding:8px 11px;min-height:36px}
.fm-action-inline{display:flex;gap:7px;flex-wrap:wrap;justify-content:center}
.fm-edit-banner{background:#fff7d8;border:1px solid #e5d397;color:#68521d;border-radius:9px;padding:9px 12px;margin-bottom:12px;font-weight:700}
.fm-admin-only{border-inline-start:4px solid #b9872e}
.fm-signout-link{margin-top:8px;background:rgba(255,255,255,.045)}
.fm-planning-note{background:#fffaf0;border:1px solid #ead8a8;border-radius:10px;padding:10px 12px;color:#695b38;line-height:1.55}

@media(max-width:780px){
    /* User request: raise responsive typography by approximately 1pt. */
    body{font-size:calc(1em + 1pt)}
    .fm-nav a{font-size:15.33px}
    .fm-nav-title{font-size:11.33px}
    .fm-page-head h1{font-size:22.33px}
    .fm-page-head p{font-size:14.33px}
    .fm-card-title{font-size:17.33px}
    .fm-field label{font-size:13.33px}
    .fm-input,.fm-select,select.fm-input,input.fm-input,textarea.fm-input{font-size:14.33px}
    .fm-btn{font-size:14.33px}
    .fm-message{font-size:14.33px}
    .fm-table{font-size:14.33px}
    .fm-pill{font-size:12.33px}
    .fm-help,.fm-account-subline{font-size:13.33px}
    .fm-kpi-label{font-size:13.33px}
    .fm-kpi-value{font-size:23.33px}
    .fm-kpi-note{font-size:12.33px}
    .fm-links a{font-size:14.33px}
    .fm-account-name{font-size:18.33px}
    .fm-account-balance{font-size:23.33px}
    .fm-account-usd{font-size:13.33px}
    .fm-mobile-brand-text{font-size:13.33px}
}

/* V6 mobile typography completion: +1pt for remaining visible labels/components. */
@media(max-width:780px){
    .fm-brand-main{font-size:20.33px}
    .fm-brand-sub{font-size:12.33px}
    .fm-rate-chip{font-size:13.33px}
    .fm-account-actions a{font-size:13.33px}
    .fm-target-total span{font-size:13.33px}
    .fm-target-total strong{font-size:24.33px}
    .fm-edit-banner,.fm-planning-note,.fm-admin-only{font-size:14.33px}
}

/* V7 */
.fm-btn-danger{background:#fff0f0!important;border:1px solid #e2a8a8!important;color:#a91f1f!important}.fm-small-input{max-width:85px}.fm-mobile-brand{text-decoration:none!important;cursor:pointer}.fm-mobile-brand:hover .fm-mobile-brand-text{color:#f3dc9d}.fm-account-access-note{font-size:12px;color:#6b6253}
@media(max-width:780px){.fm-mobile-brand-text{font-size:17px!important;font-weight:900;letter-spacing:.1px}.fm-mobile-brand-mark{width:34px;height:34px;font-size:13px}.fm-mobile-brand{max-width:205px;gap:8px}}
@media(max-width:390px){.fm-mobile-brand-text{font-size:15px!important}.fm-mobile-brand{max-width:175px}.fm-mobile-brand-mark{width:31px;height:31px}}

.fm-kpis-3{grid-template-columns:repeat(3,minmax(0,1fr))}.fm-dashboard-account-grid{margin-top:12px}.fm-dashboard-account-card{text-decoration:none!important;color:inherit;min-height:145px}.fm-dashboard-account-card:hover{color:inherit}
@media(max-width:780px){.fm-kpis-3{grid-template-columns:1fr}.fm-dashboard-account-grid{grid-template-columns:1fr}}

/* ========================================================================== */
/* V8 language, mobile navigation and dashboard summary refinements           */
/* ========================================================================== */
.fm-lang-button{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:0;
    color:#23384d;
    font-size:13px;
    font-weight:900;
    text-decoration:none!important;
    line-height:1;
    padding:0 13px;
}
.fm-lang-button:hover{color:#172433}
.fm-lang-mobile{display:none}
.fm-lang-desktop{display:inline}
.fm-hamburger{display:flex;flex-direction:column;justify-content:center;gap:4px;width:22px;height:20px;margin:auto}
.fm-hamburger span{display:block;width:22px;height:2px;border-radius:4px;background:currentColor}
.fm-pill-ok{background:#e9f7ef;color:#17613e}
.fm-pill-danger{background:#fdecec;color:#a12a2a}

.fm-metric-strip{
    display:grid;
    grid-template-columns:repeat(5,minmax(150px,1fr));
    gap:10px;
    width:100%;
}
.fm-target-strip{grid-template-columns:repeat(6,minmax(145px,1fr))}
.fm-metric-item{
    min-width:0;
    background:#fff;
    border:1px solid #e0d3ae;
    border-radius:12px;
    padding:13px 12px;
    display:flex;
    flex-direction:column;
    justify-content:center;
    gap:6px;
    text-align:center;
}
.fm-metric-item span{font-size:12px;font-weight:800;color:#6a6048;line-height:1.35}
.fm-metric-item strong{font-size:20px;font-weight:900;color:#172433;direction:ltr;white-space:nowrap}
.fm-metric-highlight{background:#fff8df;border-color:#cfb66d}
.fm-metric-highlight strong{color:#7b5b12}

@media(max-width:1100px){
    .fm-metric-strip,.fm-target-strip{grid-template-columns:repeat(3,minmax(145px,1fr))}
}

@media(max-width:780px){
    .fm-lang-button{width:46px!important;height:38px!important;padding:0 4px;font-size:16px;border-color:#d7c690;background:rgba(255,255,255,.96)}
    .fm-lang-desktop{display:none}
    .fm-lang-mobile{display:inline;font-weight:900}
    .fm-menu-toggle{display:flex!important;align-items:center;justify-content:center;font-size:0!important;padding:0}
    .fm-hamburger{display:flex}
    .fm-mobile-brand-text{font-size:18px!important}
    .fm-mobile-brand-mark{width:35px;height:35px;font-size:13px}

    /* Keep both Current Month Summary and Breakeven Breakdown horizontal on
       phones; the row scrolls naturally instead of turning into stacked cards. */
    .fm-metric-strip,.fm-target-strip{
        display:flex;
        overflow-x:auto;
        gap:9px;
        padding-bottom:5px;
        scroll-snap-type:x proximity;
        -webkit-overflow-scrolling:touch;
    }
    .fm-metric-item{flex:0 0 158px;scroll-snap-align:start;padding:12px 10px}
    .fm-metric-item span{font-size:13.33px}
    .fm-metric-item strong{font-size:20.33px}
}

@media(max-width:390px){
    .fm-mobile-brand-text{font-size:16.5px!important}
    .fm-lang-button{width:43px!important;height:36px!important;font-size:15px}
}


/* V8.1 dashboard / desktop header / recurring navigation refinements */
.fm-dashboard-quick-links .fm-action-line-break{
    flex-basis:100%;
    width:0;
    height:0;
}
.fm-target-rate-note{
    margin-top:10px;
    color:#746a54;
    font-size:12px;
    line-height:1.55;
    display:flex;
    align-items:center;
    gap:6px;
    flex-wrap:wrap;
}
.fm-target-rate-note strong{
    color:#5f4a18;
    font-weight:900;
    direction:ltr;
}
.fm-nav-group{
    margin:7px 0 5px;
    padding:4px 0 3px;
}
.fm-nav-group-title{
    color:var(--fm-gold);
    font-size:12.5px;
    font-weight:900;
    line-height:1.35;
    padding:8px 12px 5px;
    letter-spacing:.2px;
}
.fm-nav-sub{
    margin-inline-start:11px;
    padding-inline-start:8px;
    border-inline-start:2px solid rgba(200,164,92,.34);
}
.fm-nav-sub a{
    padding-block:8px;
    font-size:13.5px;
}
.fm-nav-sub .ico{
    width:19px;
    height:19px;
    color:#f0d99a;
    background:rgba(200,164,92,.10);
    font-size:10px;
}
@media(min-width:781px){
    .fm-topbar{
        background:linear-gradient(90deg,var(--fm-navy),#101a24);
        border-bottom-color:#0d1720;
        box-shadow:0 4px 14px rgba(10,20,30,.10);
    }
    .fm-user{color:#c7d0d9}
    .fm-user strong{color:#fff}
    .fm-top-link{color:#f1e5c1}
    .fm-top-link:hover{color:#fff}
    .fm-lang-button{
        background:#fff;
        border-color:#d7c690;
        color:#172433;
    }
}
@media(max-width:780px){
    .fm-nav-group-title{font-size:13.5px}
    .fm-nav-sub a{font-size:14.8px}
    .fm-target-rate-note{font-size:13px}
}


/* ========================================================================== */
/* V8.1 unified gold buttons, menu group headings and RTL dashboard KPIs      */
/* ========================================================================== */

/*
   Use the same gold treatment as the Add Vendor button throughout the system.
   Delete/action buttons are intentionally included because the requested
   visual standard is one button color. Disabled controls remain muted.
*/
.fm-btn,
input.fm-btn,
button.fm-btn,
a.fm-btn,
.fm-btn-primary,
.fm-btn-light,
.fm-btn-danger,
.fm-btn-gold,
.fm-links a,
.fm-sort-arrow {
    background: var(--fm-gold) !important;
    color: #172433 !important;
    border: 1px solid #b99348 !important;
    box-shadow: 0 3px 8px rgba(112, 83, 27, .13);
}

.fm-btn:hover,
input.fm-btn:hover,
button.fm-btn:hover,
a.fm-btn:hover,
.fm-btn-primary:hover,
.fm-btn-light:hover,
.fm-btn-danger:hover,
.fm-btn-gold:hover,
.fm-links a:hover,
.fm-sort-arrow:hover {
    background: #d7b66e !important;
    color: #172433 !important;
    border-color: #aa8238 !important;
    transform: translateY(-1px);
}

.fm-btn:focus,
input.fm-btn:focus,
button.fm-btn:focus,
a.fm-btn:focus,
.fm-links a:focus,
.fm-sort-arrow:focus {
    outline: 3px solid rgba(200, 164, 92, .23);
    outline-offset: 2px;
}

.fm-btn:disabled,
input.fm-btn:disabled,
button.fm-btn:disabled,
.fm-btn.aspNetDisabled,
.fm-sort-arrow.aspNetDisabled {
    opacity: .42 !important;
    cursor: default !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Keep the language selector consistent with the gold control family. */
.fm-lang-button {
    background: var(--fm-gold) !important;
    color: #172433 !important;
    border-color: #b99348 !important;
}
.fm-lang-button:hover {
    background: #d7b66e !important;
    border-color: #aa8238 !important;
}

/*
   Every main sidebar group heading now uses the same treatment as the
   Recurring Expenses group heading.
*/
.fm-nav-title,
.fm-nav-group-title {
    color: var(--fm-gold) !important;
    font-size: 12.5px !important;
    font-weight: 900 !important;
    line-height: 1.35 !important;
    padding: 10px 12px 6px !important;
    letter-spacing: .2px !important;
    text-transform: none !important;
}

/* Give the major group headings the same spacing rhythm. */
.fm-nav-title {
    margin-top: 7px;
}

/*
   Arabic Dashboard KPI:
   keep the numeric amount directly below the Arabic title.
   Numeric direction remains LTR so $ / decimals render correctly.
*/
html[dir="rtl"] .fm-kpis-dashboard .fm-kpi {
    text-align: right;
}

html[dir="rtl"] .fm-kpis-dashboard .fm-kpi-label {
    text-align: right;
    margin-bottom: 5px;
}

html[dir="rtl"] .fm-kpis-dashboard .fm-kpi-value {
    direction: ltr;
    text-align: right;
    margin-top: 0;
}

@media(max-width:780px) {
    .fm-nav-title,
    .fm-nav-group-title {
        font-size: 13.5px !important;
    }
}


/* ========================================================================== */
/* V9 branch layer / dashboard financial model                                */
/* ========================================================================== */
.fm-dashboard-title-block{display:flex;flex-direction:column;align-items:flex-start;min-width:0}
.fm-dashboard-branch-picker{display:flex;align-items:center;gap:9px;margin:5px 0 2px;padding:7px 9px;border:1px solid #dcc783;border-radius:12px;background:#fff8df;box-shadow:0 3px 10px rgba(93,70,22,.07)}
.fm-dashboard-branch-picker label{font-size:12px;font-weight:900;color:#725817;white-space:nowrap;margin:0}
.fm-branch-select{min-width:205px;max-width:270px;height:39px!important;background:#fff!important;border-color:#d4bd72!important;font-weight:800;color:#172433}
.fm-branch-filter-row{display:flex;align-items:end;gap:12px;flex-wrap:wrap;margin:0 0 16px}
.fm-branch-filter-row .fm-field{min-width:210px;margin:0}
.fm-branch-badge{display:inline-flex;align-items:center;justify-content:center;border:1px solid #d6c383;background:#fff8df;color:#6e551b;border-radius:999px;padding:4px 9px;font-size:11px;font-weight:900;line-height:1.25}
.fm-dashboard-finance-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-top:16px;align-items:stretch}
.fm-dashboard-summary-card{margin:0!important;display:flex;flex-direction:column;min-width:0}
.fm-dashboard-summary-card .fm-table-wrap{flex:1}
.fm-summary-table td:first-child{font-weight:700;color:#5f5a4f}
.fm-summary-value-link{color:#17324d;text-decoration:none!important;font-weight:900;display:inline-block;direction:ltr;border-bottom:1px dashed rgba(23,50,77,.35)}
.fm-summary-value-link:hover{color:#8b681b;border-bottom-color:#8b681b}
.fm-summary-total{margin-top:28px!important;margin-bottom:0!important}
.fm-summary-total strong{white-space:nowrap}
.fm-target-rate-note{margin-top:10px}
.fm-cash-details-total{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:16px;padding:15px 18px;border:1px solid #d8c480;background:#fff8df;border-radius:14px}
.fm-cash-details-total span{font-weight:800;color:#6d5b2f}.fm-cash-details-total strong{font-size:24px;direction:ltr;color:#172433}
.fm-payment-item-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-bottom:16px}
.fm-payment-item-summary>div{background:#fff;border:1px solid #e0d3ae;border-radius:11px;padding:11px 13px}.fm-payment-item-summary span{display:block;font-size:11px;color:#746b5a;font-weight:800;margin-bottom:4px}.fm-payment-item-summary strong{font-size:15px;color:#172433}
.fm-record-payment-link{white-space:nowrap}

/* Dashboard quick buttons remain identical regardless of label length. */
.fm-dashboard-quick-links a{width:190px!important;min-width:190px!important;height:54px!important;min-height:54px!important;padding:0 16px!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;text-align:center!important;white-space:nowrap;box-sizing:border-box}
.fm-dashboard-quick-links .fm-action-line-break{flex-basis:100%!important;width:100%!important;height:0!important}

@media(max-width:1180px){.fm-dashboard-finance-grid{grid-template-columns:1fr 1fr}.fm-dashboard-finance-grid>.fm-card:last-child{grid-column:1/-1}}
@media(max-width:780px){
  .fm-dashboard-head{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:12px!important;align-items:start!important}
  .fm-dashboard-title-block{display:contents}
  .fm-dashboard-title-block h1{grid-column:1;margin:0}
  .fm-dashboard-branch-picker{grid-column:2;grid-row:1;justify-self:end;margin:0;padding:5px 7px;max-width:48vw}
  .fm-dashboard-branch-picker label{display:none}
  .fm-branch-select{min-width:0;width:42vw;max-width:195px;height:38px!important;font-size:13.33px!important}
  .fm-dashboard-title-block p{grid-column:1/-1;grid-row:2;margin-top:0!important}
  .fm-dashboard-quick-links{grid-column:1/-1;grid-row:3;display:flex!important;width:100%;gap:10px!important}
  .fm-dashboard-quick-links a{width:calc(50% - 5px)!important;min-width:0!important;flex:0 0 calc(50% - 5px)!important;height:52px!important;min-height:52px!important;padding:0 8px!important;white-space:normal}
  .fm-dashboard-finance-grid{grid-template-columns:1fr;gap:12px}
  .fm-dashboard-finance-grid>.fm-card:last-child{grid-column:auto}
  .fm-branch-filter-row{align-items:stretch}.fm-branch-filter-row .fm-field{width:100%;min-width:0}
  .fm-payment-item-summary{grid-template-columns:1fr}
  .fm-cash-details-total{align-items:flex-start;flex-direction:column;gap:5px}
}


/* V10 USD / Whole-business account refinements */
.fm-static-value{min-height:46px;display:flex;align-items:center;padding:0 14px;border:1px solid var(--fm-border);border-radius:12px;background:#fff;color:var(--fm-navy);font-weight:700;box-sizing:border-box}
.fm-account-card-link{display:block;color:inherit;text-decoration:none}
.fm-account-card-link:hover{color:inherit;text-decoration:none;transform:translateY(-2px)}
.fm-account-card-link:focus{outline:3px solid rgba(200,164,92,.24);outline-offset:2px}
.fm-profit-rate-inline{font-weight:900;white-space:nowrap}

/* ========================================================================== */
/* V11 Daily Sheet + language-button reliability                              */
/* ========================================================================== */

/* The language button captions are static markup chosen only by page dir.
   This prevents transaction postbacks from ever rendering an empty button. */
.fm-lang-desktop.fm-lang-on-ltr{display:inline!important;color:#172433!important}
.fm-lang-desktop.fm-lang-on-rtl{display:none!important;color:#172433!important}
.fm-lang-mobile.fm-lang-on-ltr,.fm-lang-mobile.fm-lang-on-rtl{display:none!important;color:#172433!important}
html[dir="rtl"] .fm-lang-desktop.fm-lang-on-ltr{display:none!important}
html[dir="rtl"] .fm-lang-desktop.fm-lang-on-rtl{display:inline!important}
.fm-lang-button,.fm-lang-button span{color:#172433!important;opacity:1!important;font-weight:900!important}

.fm-daily-sheet-head{align-items:center}
.fm-sheet-status-line{font-size:12px;color:#6c6658;display:flex;gap:7px;align-items:center;margin-top:5px}
.fm-daily-sheet-selector{padding:14px 18px;margin-bottom:16px}
.fm-daily-sheet-ledger{display:flex;flex-direction:column;gap:15px}
.fm-sheet-section{margin:0!important;padding:0!important;overflow:hidden}
.fm-sheet-section-head{display:flex;align-items:center;gap:12px;padding:15px 18px;background:rgba(200,164,92,.13);border-bottom:1px solid var(--fm-sand-border)}
.fm-sheet-section-head-actions{justify-content:space-between}
.fm-sheet-heading-left{display:flex;align-items:center;gap:12px}
.fm-sheet-section-number{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:10px;background:var(--fm-gold);color:#172433;font-weight:900;flex:0 0 32px}
.fm-sheet-section-title{font-size:17px;font-weight:900;color:#172433}
.fm-sheet-sales-row{display:grid;grid-template-columns:minmax(180px,1fr) minmax(180px,310px);align-items:center;gap:18px;padding:20px 22px;background:#fff}
.fm-sheet-sales-row label{font-weight:800;color:#544e42}
.fm-sheet-sales-input{font-size:20px!important;font-weight:900!important;text-align:end!important;direction:ltr}
.fm-sheet-add-link{display:inline-flex;align-items:center;justify-content:center;min-height:38px;padding:7px 13px;border-radius:9px;background:var(--fm-gold);border:1px solid #b99348;color:#172433!important;text-decoration:none!important;font-weight:900;white-space:nowrap}
.fm-sheet-add-link:hover{background:#d7b66e}
.fm-sheet-grid-wrap{margin:16px;border-radius:11px}
.fm-sheet-expense-grid th:first-child,.fm-sheet-expense-grid td:first-child{width:52px;text-align:center}
.fm-sheet-expense-grid th:nth-child(2){min-width:180px}
.fm-sheet-expense-grid th:nth-child(3){min-width:180px}
.fm-sheet-expense-grid th:nth-child(4){min-width:130px}
.fm-sheet-expense-grid th:nth-child(5){min-width:220px}
.fm-sheet-expense-grid th:last-child{min-width:145px}
.fm-sheet-line-no{display:inline-flex;min-width:30px;height:30px;align-items:center;justify-content:center;border-radius:9px;border:1px solid #d7c47f;background:#fff9e7;font-weight:900;color:#17324d}
.fm-sheet-line-amount{direction:ltr;text-align:end;font-weight:800}
.fm-sheet-line-actions{display:flex;gap:6px;white-space:nowrap}
.fm-sheet-small-btn{min-height:34px!important;padding:6px 10px!important;font-size:12px!important}
.fm-sheet-expense-total{display:flex;justify-content:flex-end;align-items:center;gap:25px;padding:0 22px 18px;font-weight:800;color:#5c5545}
.fm-sheet-expense-total strong{font-size:19px;color:#172433;direction:ltr}
.fm-sheet-remaining-section{border-color:#d1b65f!important}
.fm-sheet-remaining-row{display:flex;justify-content:space-between;align-items:center;gap:20px;padding:24px 25px;background:#fff}
.fm-sheet-remaining-row span{font-size:17px;font-weight:900;color:#544b37}
.fm-sheet-remaining-row strong{font-size:28px;font-weight:900;color:#172433;direction:ltr}
.fm-sheet-final-actions{margin-top:18px;justify-content:flex-end}

/* Dashboard has no explanatory paragraph under the Branch selector in V11. */
.fm-dashboard-title-block{gap:4px}

@media(max-width:780px){
    .fm-lang-desktop.fm-lang-on-ltr,.fm-lang-desktop.fm-lang-on-rtl{display:none!important}
    .fm-lang-mobile.fm-lang-on-ltr{display:inline!important}
    .fm-lang-mobile.fm-lang-on-rtl{display:none!important}
    html[dir="rtl"] .fm-lang-mobile.fm-lang-on-ltr{display:none!important}
    html[dir="rtl"] .fm-lang-mobile.fm-lang-on-rtl{display:inline!important}

    .fm-dashboard-quick-links{grid-row:2!important}
    .fm-sheet-section-head{padding:13px 14px}
    .fm-sheet-section-title{font-size:16px}
    .fm-sheet-sales-row{grid-template-columns:1fr;gap:8px;padding:16px 14px}
    .fm-sheet-grid-wrap{margin:10px 0;border:0;overflow-x:auto}
    .fm-sheet-expense-grid{min-width:860px}
    .fm-sheet-expense-total{padding:5px 14px 16px;justify-content:space-between}
    .fm-sheet-remaining-row{padding:20px 15px}
    .fm-sheet-remaining-row strong{font-size:24px}
    .fm-sheet-final-actions .fm-btn{width:100%}
}


/* ========================================================================== */
/* V12 Daily Sheet simplification + stable compact expense editing            */
/* ========================================================================== */

.fm-sheet-unified{
    margin:0!important;
    padding:0!important;
    overflow:hidden;
    border:1px solid var(--fm-border);
}

.fm-sheet-sales-highlight{
    background:#eef5fb!important;
    border-bottom:1px solid #d7e4ef;
    padding:20px 22px;
}

.fm-sheet-expenses-block{
    background:#fff;
}

.fm-sheet-expenses-head{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:14px;
    padding:14px 18px;
    background:rgba(200,164,92,.12);
    border-bottom:1px solid var(--fm-sand-border);
}

.fm-sheet-expense-grid th:first-child,
.fm-sheet-expense-grid td:first-child{
    width:52px;
    text-align:center;
}

.fm-sheet-expense-grid th:nth-child(2){min-width:210px}
.fm-sheet-expense-grid th:nth-child(3){min-width:200px}
.fm-sheet-expense-grid th:nth-child(4){min-width:145px}
.fm-sheet-expense-grid th:nth-child(5),
.fm-sheet-expense-grid td:nth-child(5){
    width:70px;
    min-width:70px;
    text-align:center;
}

.fm-sheet-line-actions{
    display:flex;
    justify-content:center;
    align-items:center;
    min-height:42px;
}

.fm-sheet-delete-image{
    width:26px!important;
    height:26px!important;
    padding:0!important;
    margin:0!important;
    border:0!important;
    background:transparent!important;
    cursor:pointer;
    vertical-align:middle;
    transition:transform .12s ease,opacity .12s ease;
}

.fm-sheet-delete-image:hover{
    transform:scale(1.09);
    opacity:.82;
}

.fm-sheet-delete-image:focus{
    outline:2px solid rgba(214,39,40,.24);
    outline-offset:2px;
    border-radius:50%;
}

.fm-sheet-remaining-highlight{
    background:#eef8f1!important;
    border-top:1px solid #cfe2d3;
    padding:23px 25px;
}

.fm-sheet-sales-highlight label,
.fm-sheet-remaining-highlight span{
    color:#26394a;
}

.fm-sheet-remaining-highlight strong{
    color:#174b2b;
}

.fm-sheet-remaining-highlight strong .fm-balance-negative,
.fm-sheet-remaining-highlight .fm-balance-negative{
    color:#b91c1c!important;
}

@media(max-width:780px){
    .fm-sheet-expenses-head{padding:12px 14px}
    .fm-sheet-sales-highlight{padding:16px 14px}
    .fm-sheet-expense-grid{min-width:700px}
    .fm-sheet-remaining-highlight{padding:19px 15px}
}


/* V13 - Month Sheet / monthly financial view */
.fm-nav-daily-sub{
    margin-top:-4px;
    margin-bottom:5px;
}
.fm-month-sheet-filter{
    display:flex;
    align-items:end;
    justify-content:space-between;
    gap:18px;
    margin-bottom:18px;
}
.fm-month-sheet-year-field{
    width:min(220px,100%);
    margin:0;
}
.fm-month-sheet-year{
    min-width:150px;
}
.fm-month-sheet-profit-note{
    color:#667684;
    font-size:13px;
    line-height:1.5;
    text-align:end;
}
.fm-month-sheet-card{
    overflow:hidden;
}
.fm-month-sheet-table{
    min-width:1180px;
}
.fm-month-sheet-table th{
    white-space:normal;
    vertical-align:bottom;
}
.fm-month-sheet-table td{
    vertical-align:middle;
}
.fm-month-sheet-table .fm-month-name{
    background:#fbf7ec;
}
.fm-month-sheet-table .fm-month-cash{
    background:#eef8f1;
}
.fm-month-sheet-table .fm-month-profit{
    background:#f7f4ec;
}
@media(max-width:780px){
    .fm-month-sheet-filter{
        align-items:stretch;
        flex-direction:column;
        gap:10px;
    }
    .fm-month-sheet-year-field{
        width:100%;
    }
    .fm-month-sheet-year{
        width:100%;
        min-width:0;
    }
    .fm-month-sheet-profit-note{
        text-align:start;
    }
    .fm-month-sheet-table{
        min-width:0;
    }
    .fm-month-sheet-table.fm-responsive tr{
        box-shadow:0 3px 13px rgba(23,36,51,.06);
    }
    .fm-month-sheet-table.fm-responsive td.fm-month-name{
        display:block;
        background:#f5ead0;
        font-size:17px;
        font-weight:900;
    }
    .fm-month-sheet-table.fm-responsive td.fm-month-name:before{
        display:none;
    }
    .fm-month-sheet-table.fm-responsive td.fm-month-cash{
        background:#eaf6ed;
    }
    .fm-month-sheet-table.fm-responsive td.fm-month-profit{
        background:#faf6e9;
    }
}

/* ========================================================================== */
/* V14 - Arabic dual scrolling + compact mobile Daily Sheet                    */
/* ========================================================================== */

/* Arabic desktop: the right-side scrollbar belongs to the menu, while the
   content page owns a separate scrollbar at the menu/content boundary. */
@media(min-width:781px){
    html[dir="rtl"],html[dir="rtl"] body{
        height:100%;
        overflow:hidden;
    }
    html[dir="rtl"] .fm-shell{
        height:100vh;
        min-height:0;
        overflow:hidden;
    }
    html[dir="rtl"] .fm-sidebar{
        direction:ltr;
        overflow-y:auto;
        overscroll-behavior:contain;
        scrollbar-gutter:stable;
    }
    html[dir="rtl"] .fm-sidebar .fm-brand,
    html[dir="rtl"] .fm-sidebar .fm-nav{
        direction:rtl;
    }
    html[dir="rtl"] .fm-main{
        height:100vh;
        min-height:0;
        overflow-y:auto;
        overflow-x:hidden;
        direction:ltr;
        scrollbar-gutter:stable;
    }
    html[dir="rtl"] .fm-main .fm-topbar,
    html[dir="rtl"] .fm-main .fm-content{
        direction:rtl;
    }
}

/* Month Sheet is intentionally a normal menu item directly below Daily Sheet. */
.fm-nav-daily-sub{margin:0!important;padding:0!important}

/* Daily Sheet selector and sales entry stay compact and close together. */
.fm-daily-sheet-selector-grid{
    align-items:end;
}
.fm-sheet-sales-row{
    display:flex!important;
    align-items:center;
    justify-content:flex-start;
    gap:14px;
}
.fm-sheet-sales-row label{
    margin:0;
    white-space:nowrap;
}
.fm-sheet-sales-input{
    width:155px!important;
    max-width:155px!important;
    min-width:120px!important;
    flex:0 0 155px;
}

/* V14 uses one combined Category dropdown. Salary rows appear as
   "Salary - Employee Name", so the separate employee column is gone. */
.fm-sheet-grid-wrap{
    overflow:visible;
}
.fm-sheet-expense-grid{
    width:100%;
    min-width:0!important;
    table-layout:fixed;
}
.fm-sheet-expense-grid th:first-child,
.fm-sheet-expense-grid td:first-child{
    width:54px!important;
    min-width:54px!important;
}
.fm-sheet-expense-grid th:nth-child(2),
.fm-sheet-expense-grid td:nth-child(2){
    width:auto!important;
    min-width:0!important;
}
.fm-sheet-expense-grid th:nth-child(3),
.fm-sheet-expense-grid td:nth-child(3){
    width:150px!important;
    min-width:120px!important;
}
.fm-sheet-expense-grid th:nth-child(4),
.fm-sheet-expense-grid td:nth-child(4){
    width:58px!important;
    min-width:58px!important;
    text-align:center;
}
.fm-sheet-category{
    width:100%!important;
    min-width:0!important;
}
.fm-sheet-line-amount{
    width:100%!important;
    max-width:120px;
    min-width:0!important;
    margin-inline:auto;
}

/* The + button lives under the serial-number column rather than in the header. */
.fm-sheet-add-row{
    width:54px;
    margin-inline-start:16px;
    display:flex;
    justify-content:center;
    align-items:center;
    padding:1px 0 9px;
}
.fm-sheet-add-plus{
    width:32px;
    height:32px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border:1px solid #b99348;
    border-radius:8px;
    background:var(--fm-gold);
    color:#172433!important;
    text-decoration:none!important;
    font-size:23px;
    font-weight:900;
    line-height:1;
    box-shadow:0 2px 6px rgba(23,36,51,.10);
}
.fm-sheet-add-plus:hover{
    background:#d7b66e;
}

/* Administration: add controls sit opposite the section title. In RTL the
   inherited direction naturally mirrors the locations. */
.fm-section-toolbar.fm-admin-section-toolbar{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:12px;
    margin-bottom:14px;
}
.fm-admin-section-toolbar .fm-card-title{
    margin-bottom:0;
}
.fm-admin-section-toolbar .fm-btn,
.fm-admin-section-toolbar button.fm-btn,
.fm-admin-section-toolbar input.fm-btn{
    flex:0 0 auto;
    width:auto!important;
}

/* Current month is easy to spot after Month Sheet auto-scroll. */
.fm-current-month-row td{
    border-top:2px solid #c8a45c!important;
    border-bottom:2px solid #c8a45c!important;
}
.fm-current-month-row td:first-child{
    box-shadow:inset 4px 0 0 #c8a45c;
}
html[dir="rtl"] .fm-current-month-row td:first-child{
    box-shadow:inset -4px 0 0 #c8a45c;
}

@media(max-width:780px){
    /* Date + Branch share one row to reduce vertical space. */
    .fm-daily-sheet-selector{
        padding:10px!important;
        margin-bottom:11px;
    }
    .fm-daily-sheet-selector-grid,
    .fm-form-grid.fm-2.fm-daily-sheet-selector-grid{
        grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
        gap:8px!important;
    }
    .fm-daily-sheet-selector .fm-field label{
        font-size:11px;
        margin-bottom:4px;
    }
    .fm-daily-sheet-selector .fm-input{
        min-height:38px;
        padding:6px 7px;
        font-size:12px;
    }

    /* Sales label and value stay on the same horizontal line. */
    .fm-sheet-sales-row,
    .fm-sheet-sales-highlight{
        display:flex!important;
        flex-direction:row!important;
        align-items:center!important;
        justify-content:flex-start!important;
        gap:8px!important;
        padding:12px 10px!important;
    }
    .fm-sheet-sales-row label{
        font-size:13px;
        white-space:nowrap;
        flex:0 1 auto;
    }
    .fm-sheet-sales-input{
        width:100px!important;
        max-width:100px!important;
        min-width:86px!important;
        flex:0 0 100px!important;
        min-height:38px!important;
        padding:5px 7px!important;
        font-size:16px!important;
    }

    /* Four compact columns: serial, category(+employee for salary), amount, X. */
    .fm-sheet-grid-wrap{
        margin:8px 0 0!important;
        border:0!important;
        overflow:visible!important;
    }
    .fm-sheet-expense-grid{
        width:100%!important;
        min-width:0!important;
        table-layout:fixed!important;
        font-size:12px!important;
    }
    .fm-sheet-expense-grid th,
    .fm-sheet-expense-grid td{
        padding:6px 3px!important;
        white-space:normal!important;
    }
    .fm-sheet-expense-grid th:first-child,
    .fm-sheet-expense-grid td:first-child{
        width:38px!important;
        min-width:38px!important;
    }
    .fm-sheet-expense-grid th:nth-child(2),
    .fm-sheet-expense-grid td:nth-child(2){
        width:auto!important;
        min-width:0!important;
    }
    .fm-sheet-expense-grid th:nth-child(3),
    .fm-sheet-expense-grid td:nth-child(3){
        width:88px!important;
        min-width:88px!important;
    }
    .fm-sheet-expense-grid th:nth-child(4),
    .fm-sheet-expense-grid td:nth-child(4){
        width:34px!important;
        min-width:34px!important;
    }
    .fm-sheet-line-no{
        min-width:26px;
        width:26px;
        height:28px;
        font-size:12px;
        border-radius:7px;
    }
    .fm-sheet-category{
        min-height:36px!important;
        padding:4px 5px!important;
        font-size:11.5px!important;
    }
    .fm-sheet-line-amount{
        width:78px!important;
        max-width:78px!important;
        min-width:0!important;
        min-height:36px!important;
        padding:4px 5px!important;
        font-size:13px!important;
    }
    .fm-sheet-line-actions{
        min-height:34px!important;
    }
    .fm-sheet-delete-image{
        width:22px!important;
        height:22px!important;
    }
    .fm-sheet-add-row{
        width:38px;
        margin-inline-start:0!important;
        padding-top:3px;
    }
    .fm-sheet-add-plus{
        width:28px;
        height:28px;
        border-radius:7px;
        font-size:20px;
    }
    .fm-sheet-expense-total{
        padding:5px 10px 12px!important;
        gap:10px;
        font-size:12px;
    }
    .fm-sheet-expense-total strong{
        font-size:16px;
    }
    .fm-sheet-remaining-highlight{
        padding:14px 10px!important;
    }
    .fm-sheet-remaining-row span{
        font-size:14px;
    }
    .fm-sheet-remaining-row strong{
        font-size:21px;
    }

    .fm-admin-section-toolbar{
        flex-direction:row!important;
        align-items:center!important;
    }
    .fm-admin-section-toolbar .fm-btn,
    .fm-admin-section-toolbar button.fm-btn,
    .fm-admin-section-toolbar input.fm-btn{
        width:auto!important;
        min-width:0!important;
        padding:8px 10px!important;
        white-space:nowrap;
    }

    .fm-current-month-row{
        border:2px solid #c8a45c!important;
    }
    .fm-current-month-row td{
        border-top:0!important;
        border-bottom:1px solid #edf1f4!important;
    }
}

@media(max-width:390px){
    .fm-sheet-sales-row label{font-size:12px}
    .fm-sheet-sales-input{
        width:90px!important;
        max-width:90px!important;
        min-width:80px!important;
        flex-basis:90px!important;
    }
    .fm-sheet-expense-grid th:nth-child(3),
    .fm-sheet-expense-grid td:nth-child(3){
        width:80px!important;
        min-width:80px!important;
    }
    .fm-sheet-line-amount{
        width:70px!important;
        max-width:70px!important;
    }
}


/* ========================================================================== */
/* V14.1 - Daily Sheet header/closed state + explicit Arabic scroll placement */
/* ========================================================================== */

/* Keep the top Back action directly beside the Daily Sheet title. */
.fm-daily-sheet-head{
    display:flex!important;
    align-items:flex-start!important;
    justify-content:flex-start!important;
    margin-bottom:14px!important;
}
.fm-daily-sheet-title-block{min-width:0}
.fm-daily-sheet-title-row{
    display:flex;
    align-items:center;
    gap:10px;
    min-width:0;
    flex-wrap:nowrap;
}
.fm-daily-sheet-title-row h1{
    margin:0!important;
    min-width:0;
}
.fm-title-back{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    flex:0 0 auto;
    min-height:34px;
    padding:6px 11px;
    border:1px solid var(--fm-border);
    border-radius:9px;
    background:#fff;
    color:var(--fm-text)!important;
    text-decoration:none!important;
    font-size:12px;
    font-weight:800;
    white-space:nowrap;
}
.fm-title-back:hover{border-color:#aab9c6}

/* Closed Daily Sheet: one strong border around Sales + Expenses + Remaining. */
.fm-sheet-unified.fm-sheet-closed{
    border:3px solid #b99348!important;
    box-shadow:0 7px 20px rgba(126,91,25,.16)!important;
}

/* Arabic desktop:
   1) far-right scrollbar = menu,
   2) next scrollbar to its left = opened page. */
@media(min-width:781px){
    html[dir="rtl"] .fm-sidebar{
        right:0!important;
        left:auto!important;
        inset-inline-start:auto!important;
        inset-inline-end:0!important;
        width:265px!important;
        direction:ltr!important; /* scrollbar stays on the far-right edge */
    }
    html[dir="rtl"] .fm-main{
        margin-right:265px!important;
        margin-left:0!important;
        width:calc(100% - 265px)!important;
        direction:ltr!important; /* page scrollbar stays at the menu boundary */
    }
    html[dir="rtl"] .fm-sidebar .fm-brand,
    html[dir="rtl"] .fm-sidebar .fm-nav,
    html[dir="rtl"] .fm-main .fm-topbar,
    html[dir="rtl"] .fm-main .fm-content{
        direction:rtl!important;
    }
}

@media(max-width:780px){
    /* Do not let the global mobile page-head rule push Back under the title. */
    .fm-page-head.fm-daily-sheet-head{
        display:flex!important;
        margin-bottom:10px!important;
    }
    .fm-daily-sheet-title-row{
        gap:7px;
    }
    .fm-daily-sheet-title-row h1{
        font-size:19px!important;
        line-height:1.2!important;
    }
    .fm-title-back{
        min-height:31px;
        padding:5px 8px;
        font-size:11px;
    }
    .fm-sheet-status-line{
        margin-top:3px!important;
    }

    /* Arabic mobile drawer enters from the right. */
    html[dir="rtl"] .fm-sidebar{
        right:0!important;
        left:auto!important;
        inset-inline-start:auto!important;
        inset-inline-end:0!important;
    }
}

/* ========================================================================== */
/* V14.2 - responsive Arabic drawer + language caption fix                    */
/* ========================================================================== */

/*
   Desktop keeps the V14.1 dual-scroll layout.
   At responsive widths we deliberately switch the navigation to a drawer.
   This prevents the desktop fixed RTL sidebar from clipping/corrupting the
   mobile page.
*/
@media(max-width:900px){
    html[dir="rtl"],
    html[dir="rtl"] body{
        height:auto!important;
        min-height:100%!important;
        overflow-x:hidden!important;
        overflow-y:auto!important;
    }

    html[dir="rtl"] .fm-shell{
        height:auto!important;
        min-height:100vh!important;
        overflow:visible!important;
    }

    .fm-sidebar{
        position:fixed!important;
        top:0!important;
        bottom:auto!important;
        height:100dvh!important;
        max-height:100dvh!important;
        width:min(300px,86vw)!important;
        overflow-y:auto!important;
        overflow-x:hidden!important;
        overscroll-behavior:contain;
        z-index:1200!important;
        transition:transform .2s ease!important;
    }

    /* LTR drawer enters from the left. */
    html[dir="ltr"] .fm-sidebar{
        left:0!important;
        right:auto!important;
        inset-inline-start:0!important;
        inset-inline-end:auto!important;
        transform:translateX(-105%)!important;
    }
    html[dir="ltr"] .fm-sidebar.open{
        transform:translateX(0)!important;
    }

    /*
       RTL drawer enters from the right. `direction:ltr` is intentional:
       it forces the menu's own scrollbar onto the FAR-RIGHT edge.
       The actual menu content is switched back to RTL below.
    */
    html[dir="rtl"] .fm-sidebar{
        right:0!important;
        left:auto!important;
        inset-inline-start:auto!important;
        inset-inline-end:0!important;
        transform:translateX(105%)!important;
        direction:ltr!important;
    }
    html[dir="rtl"] .fm-sidebar.open{
        transform:translateX(0)!important;
    }
    html[dir="rtl"] .fm-sidebar .fm-brand,
    html[dir="rtl"] .fm-sidebar .fm-nav{
        direction:rtl!important;
    }

    .fm-main,
    html[dir="rtl"] .fm-main{
        margin:0!important;
        width:100%!important;
        min-height:100vh!important;
        height:auto!important;
        overflow:visible!important;
        direction:inherit!important;
    }

    html[dir="rtl"] .fm-main .fm-topbar,
    html[dir="rtl"] .fm-main .fm-content{
        direction:rtl!important;
    }

    .fm-menu-toggle{
        display:flex!important;
        align-items:center!important;
        justify-content:center!important;
        color:#fff!important;
        position:relative!important;
        z-index:3!important;
        width:38px!important;
        height:38px!important;
        border-radius:9px!important;
        background:rgba(255,255,255,.08)!important;
        font-size:0!important;
        padding:0!important;
    }

    .fm-topbar{
        background:linear-gradient(90deg,var(--fm-navy),#101a24)!important;
        border-bottom-color:#0d1720!important;
        position:sticky!important;
        top:0!important;
        padding:0 10px!important;
        height:62px!important;
    }
    .fm-user,.fm-top-link{display:none!important}
    .fm-mobile-brand{
        display:flex!important;
        align-items:center!important;
        justify-content:center!important;
        gap:7px!important;
        position:absolute!important;
        left:50%!important;
        right:auto!important;
        top:50%!important;
        transform:translate(-50%,-50%)!important;
        z-index:1!important;
        max-width:145px!important;
    }
    .fm-topbar-actions{
        position:relative!important;
        z-index:3!important;
        margin-inline-start:auto!important;
    }

    /*
       Mobile/tablet language button:
       force desktop caption OFF with equal/higher specificity than the
       persistent RTL caption rule. This fixes the previous "ENEN" rendering.
    */
    html[dir] .fm-lang-desktop.fm-lang-on-ltr,
    html[dir] .fm-lang-desktop.fm-lang-on-rtl{
        display:none!important;
    }
    html[dir="ltr"] .fm-lang-mobile.fm-lang-on-ltr{
        display:inline!important;
    }
    html[dir="ltr"] .fm-lang-mobile.fm-lang-on-rtl{
        display:none!important;
    }
    html[dir="rtl"] .fm-lang-mobile.fm-lang-on-ltr{
        display:none!important;
    }
    html[dir="rtl"] .fm-lang-mobile.fm-lang-on-rtl{
        display:inline!important;
    }
    .fm-lang-button{
        width:46px!important;
        height:38px!important;
        padding:0 4px!important;
        font-size:16px!important;
        border-color:#d7c690!important;
        background:rgba(255,255,255,.96)!important;
    }

    .fm-mobile-overlay{
        display:none!important;
    }
    .fm-mobile-overlay.show{
        display:block!important;
        position:fixed!important;
        inset:0!important;
        background:rgba(10,18,27,.42)!important;
        z-index:1150!important;
    }
}

/*
   Wider responsive/tablet Arabic view:
   while the menu is open, use a true two-pane layout instead of allowing the
   menu to cover the page. The far-right scrollbar belongs to the menu and the
   next scrollbar to its left belongs to the page.
*/
@media(min-width:521px) and (max-width:900px){
    html[dir="rtl"] body.fm-menu-open{
        overflow:hidden!important;
    }
    html[dir="rtl"] body.fm-menu-open .fm-sidebar{
        width:280px!important;
        right:0!important;
        left:auto!important;
        transform:translateX(0)!important;
        direction:ltr!important;
    }
    html[dir="rtl"] body.fm-menu-open .fm-sidebar .fm-brand,
    html[dir="rtl"] body.fm-menu-open .fm-sidebar .fm-nav{
        direction:rtl!important;
    }
    html[dir="rtl"] body.fm-menu-open .fm-main{
        position:fixed!important;
        top:0!important;
        bottom:0!important;
        left:0!important;
        right:auto!important;
        width:calc(100% - 280px)!important;
        height:100dvh!important;
        min-height:0!important;
        overflow-y:auto!important;
        overflow-x:hidden!important;
        direction:ltr!important;
        margin:0!important;
    }
    html[dir="rtl"] body.fm-menu-open .fm-main .fm-topbar,
    html[dir="rtl"] body.fm-menu-open .fm-main .fm-content{
        direction:rtl!important;
    }
    html[dir="rtl"] body.fm-menu-open .fm-mobile-overlay{
        display:none!important;
    }
}

/* Narrow phones use a conventional overlay drawer; two side-by-side panes
   would leave too little usable width. */
@media(max-width:520px){
    html[dir="rtl"] .fm-sidebar{
        width:min(300px,88vw)!important;
        direction:ltr!important;
    }
    html[dir="rtl"] .fm-sidebar .fm-brand,
    html[dir="rtl"] .fm-sidebar .fm-nav{
        direction:rtl!important;
    }
}

/* Desktop Arabic: show the full word English; mobile/tablet shows EN. */
@media(min-width:901px){
    html[dir="rtl"] .fm-lang-desktop.fm-lang-on-rtl{
        display:inline!important;
    }
    html[dir="rtl"] .fm-lang-mobile.fm-lang-on-rtl{
        display:none!important;
    }
}


/* ========================================================================== */
/* V14.3 - compact mobile financial cards + Today Cash                       */
/* ========================================================================== */

/* Dashboard uses four equal KPI cards on desktop. */
.fm-kpis-dashboard.fm-kpis-4{
    grid-template-columns:repeat(4,minmax(0,1fr));
}

/* Today Cash is intentionally visually distinct from the other three KPIs. */
.fm-kpi-today-cash{
    background:linear-gradient(135deg,#e8f7f1,#d8efe5)!important;
    border-color:#8bc4a8!important;
    box-shadow:0 8px 22px rgba(28,104,72,.11)!important;
}
.fm-kpi-today-cash:after{background:rgba(45,139,98,.11)!important}
.fm-kpi-today-cash .fm-kpi-label{color:#356c56!important;font-weight:800}
.fm-kpi-today-cash .fm-kpi-value{color:#155f42}
.fm-kpi-today-cash .fm-balance-negative{color:#c62828!important}

@media(max-width:780px){
    /* Dashboard: exactly two KPI cards per row, with less unused space. */
    .fm-kpis-dashboard.fm-kpis-4{
        grid-template-columns:repeat(2,minmax(0,1fr))!important;
        gap:8px!important;
        margin-bottom:12px!important;
    }
    .fm-kpis-dashboard .fm-kpi{
        min-width:0!important;
        min-height:86px!important;
        padding:10px 9px!important;
        border-radius:12px!important;
    }
    .fm-kpis-dashboard .fm-kpi:after{
        width:46px!important;
        height:46px!important;
        inset-inline-end:-14px!important;
        top:-14px!important;
    }
    .fm-kpis-dashboard .fm-kpi-label{
        font-size:11.7px!important;
        line-height:1.25!important;
        margin-bottom:5px!important;
        min-height:29px;
    }
    .fm-kpis-dashboard .fm-kpi-value{
        font-size:19px!important;
        line-height:1.1!important;
        white-space:nowrap;
    }

    /* Dashboard account balances: two compact cards per row. */
    .fm-dashboard-account-section{
        padding:10px!important;
        margin-top:14px!important;
    }
    .fm-dashboard-account-section .fm-card-title{
        margin-bottom:8px!important;
    }
    .fm-dashboard-account-grid{
        grid-template-columns:repeat(2,minmax(0,1fr))!important;
        gap:8px!important;
        margin-top:8px!important;
    }
    .fm-dashboard-account-card{
        min-width:0!important;
        min-height:108px!important;
        padding:10px 7px!important;
        gap:5px!important;
        border-radius:12px!important;
        overflow:hidden;
    }

    /* Accounts and Vendor Accounts: two cards per row without horizontal overflow. */
    .fm-mobile-two-account-grid{
        grid-template-columns:repeat(2,minmax(0,1fr))!important;
        gap:8px!important;
        margin-bottom:12px!important;
    }
    .fm-mobile-two-account-grid .fm-account-card{
        display:flex!important;
        flex-direction:column!important;
        align-items:center!important;
        justify-content:center!important;
        min-width:0!important;
        min-height:122px!important;
        padding:10px 7px!important;
        gap:5px!important;
        border-radius:12px!important;
        overflow:hidden;
    }
    .fm-dashboard-account-card .fm-account-name,
    .fm-mobile-two-account-grid .fm-account-name{
        width:100%;
        font-size:13px!important;
        line-height:1.25!important;
        overflow-wrap:anywhere;
    }
    .fm-dashboard-account-card .fm-account-balance,
    .fm-mobile-two-account-grid .fm-account-balance{
        width:100%;
        font-size:18px!important;
        line-height:1.15!important;
        white-space:nowrap;
    }
    .fm-mobile-two-account-grid .fm-branch-badge{
        max-width:100%;
        padding:3px 6px!important;
        font-size:9.8px!important;
        white-space:normal;
        text-align:center;
    }
    .fm-mobile-two-account-grid .fm-account-actions{
        gap:4px!important;
        width:100%;
    }
    .fm-mobile-two-account-grid .fm-account-actions a,
    .fm-mobile-two-account-grid .fm-account-actions .fm-btn{
        font-size:10.5px!important;
        line-height:1.15!important;
        padding:5px 5px!important;
        min-height:29px!important;
        white-space:normal;
    }

    /* Vendor cards have three actions; stack them compactly inside each half-width card. */
    .fm-vendor-account-grid .fm-account-card{
        min-height:174px!important;
    }
    .fm-vendor-account-grid .fm-account-subline{
        width:100%;
        font-size:10.5px!important;
        line-height:1.2!important;
        overflow-wrap:anywhere;
    }
    .fm-vendor-account-grid .fm-action-inline{
        display:grid!important;
        grid-template-columns:1fr!important;
        width:100%!important;
        gap:4px!important;
    }
    .fm-vendor-account-grid .fm-action-inline .fm-btn{
        width:100%!important;
        margin:0!important;
    }

    /* Prevent the centered FM identity from being squeezed by the menu/language controls. */
    .fm-mobile-brand{
        max-width:220px!important;
        gap:8px!important;
        min-width:0;
    }
    .fm-mobile-brand-mark{
        width:38px!important;
        height:38px!important;
        min-width:38px!important;
        flex:0 0 38px!important;
        font-size:14px!important;
    }
    .fm-mobile-brand-text{
        font-size:18px!important;
        line-height:1.1!important;
        white-space:nowrap!important;
        overflow:hidden;
        text-overflow:ellipsis;
    }
}

@media(max-width:360px){
    /* Keep the FM mark full-size even on narrow phones; only trim the text width. */
    .fm-mobile-brand{max-width:180px!important}
    .fm-mobile-brand-text{font-size:16px!important}
    .fm-kpis-dashboard .fm-kpi-value{font-size:17px!important}
    .fm-dashboard-account-card .fm-account-name,
    .fm-mobile-two-account-grid .fm-account-name{font-size:12px!important}
    .fm-dashboard-account-card .fm-account-balance,
    .fm-mobile-two-account-grid .fm-account-balance{font-size:16.5px!important}
}


/* ========================================================================== */
/* V15 - dashboard targets, compact Daily Sheet, reporting and mobile tables  */
/* ========================================================================== */
.fm-kpi-label-strong{font-weight:900!important;color:#4d5964!important}

/* Primary cash/profit row, followed by a distinct two-card target row. */
.fm-dashboard-finance-primary,.fm-dashboard-finance-targets{grid-template-columns:repeat(2,minmax(0,1fr))!important}
.fm-dashboard-finance-targets{margin-top:16px!important}
.fm-dashboard-finance-grid>.fm-card:last-child{grid-column:auto!important}
.fm-target-revenue-card{border-color:#b8c8d7!important;background:#f8fbfd!important}

/* Final total stays on one line on every screen and is only ~1pt larger than rows. */
.fm-summary-total{display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:space-between!important;gap:10px!important;margin-top:10px!important;padding:10px 12px!important}
.fm-summary-total span,.fm-summary-total strong{font-size:14.5px!important;font-weight:900!important;line-height:1.25!important;margin:0!important}

/* Daily Sheet: a bounded, unified physical sheet rather than a stretched page. */
.fm-daily-sheet-selector,.fm-daily-sheet-ledger{width:min(980px,100%);margin-inline:auto}
.fm-daily-sheet-ledger{gap:0!important}
.fm-sheet-unified{background:#f3f5f6!important;border:2px solid #bcc5cc!important;border-radius:14px!important;overflow:hidden!important;padding:0!important;box-shadow:0 8px 24px rgba(23,36,51,.08)!important}
.fm-sheet-sales-highlight,.fm-sheet-expenses-block,.fm-sheet-remaining-highlight{margin:0!important;border:0!important;border-radius:0!important}
.fm-sheet-sales-highlight{background:#eef3f7!important;border-bottom:1px solid #ccd5dc!important;padding:13px 18px!important}
.fm-sheet-expenses-block{background:#f3f5f6!important;padding:0 12px 4px!important}
.fm-sheet-expenses-head{padding:10px 4px 6px!important;background:transparent!important;border:0!important}
.fm-sheet-grid-wrap{margin:3px 0 2px!important;background:#fff!important}
.fm-sheet-expense-total{padding:7px 6px 9px!important}
.fm-sheet-remaining-highlight{background:#e8eef2!important;border-top:1px solid #c5cfd7!important;padding:12px 18px!important}
.fm-sheet-final-actions{margin:0!important;padding:11px 14px!important;background:#e2e7ea!important;border-top:1px solid #c5cdd3!important;justify-content:flex-end!important}
.fm-sheet-unified.fm-sheet-closed{border-width:3px!important}
.fm-daily-sheet-head{display:flex!important;justify-content:space-between!important;align-items:flex-start!important;width:min(980px,100%);margin-inline:auto!important}
.fm-daily-sheet-head .fm-title-back{order:2;margin-inline-start:auto!important}
html[dir="rtl"] .fm-daily-sheet-head .fm-title-back{order:-1;margin-inline-start:0!important;margin-inline-end:auto!important}
.fm-daily-sheet-title-block{order:1}
html[dir="rtl"] .fm-daily-sheet-title-block{order:2}

/* Salaries */
.fm-salary-grid-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
.fm-salary-grid-toolbar .fm-card-title{margin:0!important}
.fm-employee-select-cell{width:42px;text-align:center!important}
.fm-employee-statement-check{width:18px;height:18px;accent-color:#c8a45c}

/* Vendor title/add button remains a compact single row. */
.fm-vendors-head{display:flex!important;align-items:center!important;justify-content:space-between!important}
.fm-vendors-head .fm-links{margin:0!important}

/* Account details */
.fm-account-details-head{display:flex!important;align-items:center!important;justify-content:space-between!important}
.fm-account-details-back{margin-inline-start:auto}
html[dir="rtl"] .fm-account-details-back{margin-inline-start:0;margin-inline-end:auto}
.fm-account-details-summary{display:grid;grid-template-columns:minmax(220px,1fr) minmax(240px,1fr);gap:12px;margin-bottom:18px;align-items:stretch}
.fm-account-balance-summary{margin:0!important}
.fm-account-detail-action-group{display:flex;align-items:center;justify-content:center;gap:10px;padding:14px;background:#fff;border:1px solid var(--fm-border);border-radius:14px;box-shadow:var(--fm-shadow)}
.fm-account-detail-action-group .fm-btn{min-width:115px}
.fm-mobile-only,.fm-desc-mobile{display:none}

/* Month Sheet: seven focused columns fit a desktop width without horizontal scrolling. */
.fm-month-sheet-v15{table-layout:fixed;font-size:12px!important}
.fm-month-sheet-v15 th,.fm-month-sheet-v15 td{padding:9px 6px!important;white-space:normal!important}
.fm-month-sheet-v15 th:first-child,.fm-month-sheet-v15 td:first-child{width:13%}
.fm-month-sheet-v15 th:not(:first-child),.fm-month-sheet-v15 td:not(:first-child){width:14.5%}
.fm-month-sheet-v15 .fm-positive,.fm-month-sheet-v15 .fm-balance-positive{color:#18864b!important}
.fm-month-sheet-v15 .fm-negative,.fm-month-sheet-v15 .fm-balance-negative{color:#c62828!important}

@media(max-width:780px){
  .fm-dashboard-finance-primary,.fm-dashboard-finance-targets{grid-template-columns:1fr!important;gap:10px!important}
  .fm-summary-total{flex-direction:row!important;align-items:center!important}
  .fm-summary-total span,.fm-summary-total strong{font-size:14px!important}

  .fm-daily-sheet-head,.fm-daily-sheet-selector,.fm-daily-sheet-ledger{width:100%!important}
  .fm-daily-sheet-head{display:flex!important;gap:8px!important}
  .fm-daily-sheet-head .fm-title-back{flex:0 0 auto!important;margin-top:0!important}
  .fm-sheet-sales-highlight{padding:10px!important}
  .fm-sheet-expenses-block{padding:0 7px 2px!important}
  .fm-sheet-remaining-highlight{padding:10px!important}
  .fm-sheet-final-actions{padding:9px!important;gap:7px!important}

  .fm-vendors-head{display:flex!important;gap:8px!important;margin-bottom:12px!important}
  .fm-vendors-head h1{margin:0!important}
  .fm-vendors-head .fm-btn{padding:7px 9px!important;min-height:34px!important;font-size:11px!important}

  .fm-account-details-head{display:flex!important;gap:8px!important}
  .fm-account-details-head h1{margin:0!important}
  .fm-account-details-summary{grid-template-columns:1fr!important;gap:8px!important}
  .fm-account-detail-action-group{padding:9px!important;gap:7px!important}
  .fm-account-detail-action-group .fm-btn{flex:1 1 0;min-width:0!important;padding:8px 6px!important}

  /* Account statement remains a real four-column grid on phones. */
  .fm-account-statement-table.fm-responsive{display:table!important;width:100%!important;table-layout:fixed!important;font-size:10.5px!important}
  .fm-account-statement-table.fm-responsive thead{display:table-header-group!important}
  .fm-account-statement-table.fm-responsive tbody{display:table-row-group!important}
  .fm-account-statement-table.fm-responsive tr{display:table-row!important;border:0!important;margin:0!important}
  .fm-account-statement-table.fm-responsive th,.fm-account-statement-table.fm-responsive td{display:table-cell!important;width:auto!important;grid-template-columns:none!important;padding:7px 4px!important;border-bottom:1px solid #e6eaed!important;vertical-align:top!important;white-space:normal!important;overflow-wrap:anywhere}
  .fm-account-statement-table.fm-responsive td:before{display:none!important}
  .fm-account-statement-table .fm-desktop-detail{display:none!important}
  .fm-account-statement-table .fm-mobile-only{display:table-cell!important}
  .fm-account-statement-table .fm-desc-desktop{display:none!important}
  .fm-account-statement-table .fm-desc-mobile{display:inline!important}
  .fm-account-statement-table th:nth-child(1){width:21%!important}
  .fm-account-statement-table th:nth-child(3){width:22%!important}
  .fm-account-statement-table th:nth-child(4){width:24%!important}
  .fm-account-statement-table th:nth-child(5){width:33%!important}

  /* Invoice actions: no Actions pseudo-label; buttons share one horizontal row. */
  .fm-invoice-table .fm-invoice-actions{display:block!important;padding:7px!important}
  .fm-invoice-table .fm-invoice-actions:before{display:none!important}
  .fm-invoice-table .fm-invoice-actions .fm-action-inline{display:flex!important;flex-direction:row!important;flex-wrap:wrap!important;gap:5px!important}
  .fm-invoice-table .fm-invoice-actions .fm-btn{flex:1 1 auto!important;min-width:0!important;padding:6px 7px!important;font-size:10.5px!important;min-height:31px!important}
  .fm-invoice-table .fm-invoice-actions .fm-action-inline>span,.fm-invoice-table .fm-invoice-actions .fm-action-inline>div{display:flex!important;gap:5px!important;flex:1 1 auto!important}

  .fm-salary-grid-toolbar{margin-bottom:8px!important}
  .fm-salary-grid-toolbar .fm-btn{padding:7px 8px!important;font-size:11px!important}
}
