:root{
  --kf-bg:#f4f7fa;
  --kf-surface:#ffffff;
  --kf-surface-2:#f0f5f7;
  --kf-text:#0d3550;
  --kf-muted:#6f8190;
  --kf-border:#dbe5eb;
  --kf-navy:#063d5a;
  --kf-navy-2:#0a526e;
  --kf-teal:#0d7185;
  --kf-accent:#0f6179;
  --kf-danger:#aa3943;
  --kf-success:#17845d;
  --kf-shadow:0 13px 34px rgba(15,61,86,.09);
  --kf-shadow-soft:0 8px 24px rgba(15,61,86,.07);
  --kf-radius:20px;
  --kf-small-radius:14px;
}

html[data-koui-theme="midnight"]{
  --kf-bg:#09131e;
  --kf-surface:#101f2d;
  --kf-surface-2:#172a39;
  --kf-text:#eaf3f7;
  --kf-muted:#a4b4bf;
  --kf-border:#2b4150;
  --kf-navy:#0d7696;
  --kf-navy-2:#1193ae;
  --kf-teal:#21a0b4;
  --kf-accent:#77cde0;
  --kf-shadow:0 16px 40px rgba(0,0,0,.24);
  --kf-shadow-soft:0 8px 25px rgba(0,0,0,.18);
}

html[data-koui-theme="sand"]{
  --kf-bg:#f5f0e6;
  --kf-surface:#fffdf8;
  --kf-surface-2:#f3ead9;
  --kf-text:#423b31;
  --kf-muted:#7c7060;
  --kf-border:#e4d6bf;
  --kf-navy:#5b4934;
  --kf-navy-2:#806642;
  --kf-teal:#9a7744;
  --kf-accent:#ad8143;
  --kf-shadow:0 13px 34px rgba(93,72,45,.10);
  --kf-shadow-soft:0 8px 24px rgba(93,72,45,.08);
}

.koui-icon.koui-icon-brand{--koui-icon:url("/static/kafaat_official_ui_v2/icons/brand.svg?v=2.1.0");}
.koui-icon.koui-icon-home{--koui-icon:url("/static/kafaat_official_ui_v2/icons/home.svg?v=2.1.0");}
.koui-icon.koui-icon-sales{--koui-icon:url("/static/kafaat_official_ui_v2/icons/sales.svg?v=2.1.0");}
.koui-icon.koui-icon-finance{--koui-icon:url("/static/kafaat_official_ui_v2/icons/finance.svg?v=2.1.0");}
.koui-icon.koui-icon-inventory{--koui-icon:url("/static/kafaat_official_ui_v2/icons/inventory.svg?v=2.1.0");}
.koui-icon.koui-icon-work{--koui-icon:url("/static/kafaat_official_ui_v2/icons/work.svg?v=2.1.0");}
.koui-icon.koui-icon-users{--koui-icon:url("/static/kafaat_official_ui_v2/icons/users.svg?v=2.1.0");}
.koui-icon.koui-icon-house{--koui-icon:url("/static/kafaat_official_ui_v2/icons/house.svg?v=2.1.0");}
.koui-icon.koui-icon-plans{--koui-icon:url("/static/kafaat_official_ui_v2/icons/plans.svg?v=2.1.0");}
.koui-icon.koui-icon-receipt{--koui-icon:url("/static/kafaat_official_ui_v2/icons/receipt.svg?v=2.1.0");}
.koui-icon.koui-icon-reports{--koui-icon:url("/static/kafaat_official_ui_v2/icons/reports.svg?v=2.1.0");}
.koui-icon.koui-icon-settings{--koui-icon:url("/static/kafaat_official_ui_v2/icons/settings.svg?v=2.1.0");}
.koui-icon.koui-icon-theme{--koui-icon:url("/static/kafaat_official_ui_v2/icons/theme.svg?v=2.1.0");}
.koui-icon.koui-icon-complaint{--koui-icon:url("/static/kafaat_official_ui_v2/icons/complaint.svg?v=2.1.0");}
.koui-icon.koui-icon-contractor{--koui-icon:url("/static/kafaat_official_ui_v2/icons/contractor.svg?v=2.1.0");}
.koui-icon.koui-icon-stage{--koui-icon:url("/static/kafaat_official_ui_v2/icons/stage.svg?v=2.1.0");}
.koui-icon.koui-icon-approval{--koui-icon:url("/static/kafaat_official_ui_v2/icons/approval.svg?v=2.1.0");}
.koui-icon.koui-icon-camera{--koui-icon:url("/static/kafaat_official_ui_v2/icons/camera.svg?v=2.1.0");}
.koui-icon.koui-icon-mapping{--koui-icon:url("/static/kafaat_official_ui_v2/icons/mapping.svg?v=2.1.0");}
.koui-icon.koui-icon-notification{--koui-icon:url("/static/kafaat_official_ui_v2/icons/notification.svg?v=2.1.0");}
.koui-icon.koui-icon-check{--koui-icon:url("/static/kafaat_official_ui_v2/icons/check.svg?v=2.1.0");}
.koui-icon.koui-icon-calendar{--koui-icon:url("/static/kafaat_official_ui_v2/icons/calendar.svg?v=2.1.0");}
.koui-icon.koui-icon-search{--koui-icon:url("/static/kafaat_official_ui_v2/icons/search.svg?v=2.1.0");}
.koui-icon.koui-icon-add{--koui-icon:url("/static/kafaat_official_ui_v2/icons/add.svg?v=2.1.0");}
.koui-icon.koui-icon-edit{--koui-icon:url("/static/kafaat_official_ui_v2/icons/edit.svg?v=2.1.0");}
.koui-icon.koui-icon-save{--koui-icon:url("/static/kafaat_official_ui_v2/icons/save.svg?v=2.1.0");}
.koui-icon.koui-icon-print{--koui-icon:url("/static/kafaat_official_ui_v2/icons/print.svg?v=2.1.0");}
.koui-icon.koui-icon-open{--koui-icon:url("/static/kafaat_official_ui_v2/icons/open.svg?v=2.1.0");}
.koui-icon.koui-icon-danger{--koui-icon:url("/static/kafaat_official_ui_v2/icons/danger.svg?v=2.1.0");}
.koui-icon.koui-icon-backup{--koui-icon:url("/static/kafaat_official_ui_v2/icons/backup.svg?v=2.1.0");}
.koui-icon.koui-icon-font{--koui-icon:url("/static/kafaat_official_ui_v2/icons/font.svg?v=2.1.0");}
.koui-icon.koui-icon-whatsapp{--koui-icon:url("/static/kafaat_official_ui_v2/icons/whatsapp.svg?v=2.1.0");}
.koui-icon.koui-icon-salary{--koui-icon:url("/static/kafaat_official_ui_v2/icons/salary.svg?v=2.1.0");}
.koui-icon.koui-icon-admin{--koui-icon:url("/static/kafaat_official_ui_v2/icons/admin.svg?v=2.1.0");}
.koui-icon.koui-icon-logout{--koui-icon:url("/static/kafaat_official_ui_v2/icons/logout.svg?v=2.1.0");}
.koui-icon.koui-icon-arrow{--koui-icon:url("/static/kafaat_official_ui_v2/icons/arrow.svg?v=2.1.0");}
.koui-icon.koui-icon-menu{--koui-icon:url("/static/kafaat_official_ui_v2/icons/menu.svg?v=2.1.0");}
.koui-icon.koui-icon-support{--koui-icon:url("/static/kafaat_official_ui_v2/icons/support.svg?v=2.1.0");}
.koui-icon.koui-icon-shield{--koui-icon:url("/static/kafaat_official_ui_v2/icons/shield.svg?v=2.1.0");}

.koui-icon{
  width:1.15rem;
  height:1.15rem;
  display:inline-block;
  flex:0 0 auto;
  vertical-align:-.2em;
  background-color:transparent!important;
  background-image:var(--koui-icon,none);
  background-repeat:no-repeat;
  background-position:center;
  background-size:contain;
  border:0!important;
  box-shadow:none!important;
}

html,body{
  background:var(--kf-bg)!important;
  color:var(--kf-text);
}

body.final-release{
  min-height:100vh;
  background:
    radial-gradient(circle at 12% 0%,rgba(255,255,255,.70),transparent 30%),
    var(--kf-bg)!important;
}

.glass-nav{
  background:color-mix(in srgb,var(--kf-surface) 96%,transparent)!important;
  border-bottom:1px solid var(--kf-border)!important;
  box-shadow:0 6px 20px rgba(13,53,80,.06)!important;
  backdrop-filter:blur(18px);
}

.brand-title{color:var(--kf-text)!important}
.brand-sub{display:none!important}

.v03-nav .nav-link{
  color:var(--kf-text)!important;
  border-radius:11px!important;
  font-weight:850!important;
  display:flex!important;
  align-items:center!important;
  gap:.45rem!important;
  min-height:40px;
}

.v03-nav .nav-link:hover,
.v03-nav .nav-link.active,
.v03-nav .nav-link.show{
  background:var(--kf-surface-2)!important;
  color:var(--kf-accent)!important;
}

.v03-nav .nav-link.koui-work-nav{
  background:linear-gradient(135deg,var(--kf-navy),var(--kf-navy-2))!important;
  color:#fff!important;
}

.v03-nav .dropdown-menu{
  background:var(--kf-surface)!important;
  border:1px solid var(--kf-border)!important;
  border-radius:15px!important;
  box-shadow:var(--kf-shadow)!important;
}

.v03-nav .dropdown-item{
  color:var(--kf-text)!important;
}

.v03-nav .dropdown-item:hover{
  background:var(--kf-surface-2)!important;
}

.user-badge{
  background:var(--kf-surface-2)!important;
  border-color:var(--kf-border)!important;
  color:var(--kf-text)!important;
}

main{color:var(--kf-text)}

.card,
.koui-panel,
.koui-page-head,
.koui-module-card,
.koui-stat,
.koui-setting-link{
  background:var(--kf-surface)!important;
  border-color:var(--kf-border)!important;
  color:var(--kf-text)!important;
  box-shadow:var(--kf-shadow-soft);
}

.form-control,
.form-select,
input,
select,
textarea{
  background-color:var(--kf-surface)!important;
  border-color:var(--kf-border)!important;
  color:var(--kf-text)!important;
}

.form-control:focus,
.form-select:focus,
input:focus,
select:focus,
textarea:focus{
  border-color:var(--kf-accent)!important;
  box-shadow:0 0 0 3px color-mix(in srgb,var(--kf-accent) 14%,transparent)!important;
}

.table,
table{
  --bs-table-bg:var(--kf-surface);
  --bs-table-color:var(--kf-text);
  --bs-table-border-color:var(--kf-border);
  color:var(--kf-text)!important;
}

.table thead th,
.koui-table th{
  background:var(--kf-surface-2)!important;
  color:var(--kf-text)!important;
}

.btn,
.koui-btn{
  border-radius:10px!important;
  font-weight:850!important;
}

.koui-btn-primary,
.btn-primary{
  background:linear-gradient(135deg,var(--kf-navy),var(--kf-navy-2))!important;
  border-color:var(--kf-navy)!important;
  color:#fff!important;
}

.kafaat-home-v2,
.kafaat-work-v2,
.kafaat-appearance-v2{
  min-height:100vh;
  display:flex;
  flex-direction:column;
}

body.kf-immersive-page .glass-nav,
body.kf-immersive-page > footer{
  display:none!important;
}

body.kf-immersive-page main{
  padding:0!important;
  width:100%!important;
  max-width:none!important;
  flex:1;
}

.kf-home-shell,
.kf-work-shell,
.kf-appearance-shell{
  width:min(1580px,calc(100% - 48px));
  margin:24px auto 28px;
  flex:1;
}

.kf-brandbar,
.kf-pagebar{
  background:var(--kf-surface);
  border:1px solid var(--kf-border);
  border-radius:22px;
  box-shadow:var(--kf-shadow);
  min-height:98px;
  padding:20px 26px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
}

.kf-brand,
.kf-page-title{
  display:flex;
  align-items:center;
  gap:16px;
}

.kf-brand strong{
  color:var(--kf-text);
  font-size:clamp(1.45rem,2vw,2rem);
  font-weight:950;
}

.kf-brand-icon,
.kf-page-icon{
  width:58px;
  height:58px;
  display:grid;
  place-items:center;
  color:#fff;
  background:linear-gradient(145deg,var(--kf-navy),var(--kf-navy-2));
  border-radius:15px;
  box-shadow:0 8px 18px color-mix(in srgb,var(--kf-navy) 24%,transparent);
}

.kf-brand-icon .koui-icon,
.kf-page-icon .koui-icon{
  width:32px;
  height:32px;
}

.kf-brand-actions,
.kf-page-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.kf-user-pill,
.kf-theme-button{
  min-height:42px;
  padding:9px 14px;
  border-radius:999px;
  border:1px solid var(--kf-border);
  display:inline-flex;
  align-items:center;
  gap:8px;
  color:var(--kf-text);
  background:var(--kf-surface-2);
  font-weight:850;
}

.kf-theme-button{cursor:pointer}
.kf-theme-button:hover{border-color:var(--kf-accent);color:var(--kf-accent)}

.kf-module-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:18px;
  margin-top:28px;
}

.kf-module-card{
  position:relative;
  min-height:238px;
  padding:28px 28px 25px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  text-decoration:none!important;
  background:var(--kf-surface);
  border:1px solid var(--kf-border);
  border-radius:20px;
  color:var(--kf-text)!important;
  box-shadow:var(--kf-shadow);
  transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease;
  overflow:hidden;
}

.kf-module-card:hover{
  transform:translateY(-4px);
  border-color:color-mix(in srgb,var(--kf-accent) 45%,var(--kf-border));
  box-shadow:0 18px 42px color-mix(in srgb,var(--kf-navy) 14%,transparent);
}

.kf-module-icon{
  width:82px;
  height:82px;
  border-radius:21px;
  display:grid;
  place-items:center;
  background:var(--kf-surface-2);
  color:var(--kf-navy);
  margin-bottom:18px;
}

.kf-module-icon .koui-icon{width:47px;height:47px}

.kf-module-card strong{
  font-size:1.25rem;
  font-weight:950;
  color:inherit;
}

.kf-module-card small{
  color:var(--kf-muted);
  margin-top:8px;
  font-size:.93rem;
  line-height:1.6;
}

.kf-card-arrow{
  position:absolute;
  left:22px;
  bottom:25px;
  color:#6f8495;
  width:22px;
  height:22px;
}

.kf-module-active{
  color:#fff!important;
  background:linear-gradient(145deg,#073b58,#07506e)!important;
  border-color:#073b58!important;
}

.kf-module-active .kf-module-icon{
  background:rgba(255,255,255,.10);
  border:1px solid rgba(255,255,255,.28);
  color:#fff;
}

.kf-module-active small,
.kf-module-active .kf-card-arrow{
  color:rgba(255,255,255,.84);
}

.kf-module-tail{
  max-width:970px;
  margin:22px auto 0;
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:18px;
}

.kf-tail-card{
  min-height:140px;
  flex-direction:row;
  justify-content:flex-start;
  text-align:right;
  padding-inline:28px 58px;
}

.kf-tail-card .kf-module-icon{
  width:68px;
  height:68px;
  margin:0;
}

.kf-tail-card .kf-module-icon .koui-icon{width:38px;height:38px}
.kf-tail-card small{display:block}

.kf-final-footer{
  margin-top:auto;
  min-height:112px;
  padding:22px clamp(28px,5vw,90px);
  background:var(--kf-surface);
  border-top:1px solid var(--kf-border);
  display:grid;
  grid-template-columns:1fr auto 1fr;
  align-items:center;
  gap:22px;
  color:var(--kf-muted);
}

.kf-footer-copy{
  justify-self:start;
  display:flex;
  flex-direction:column;
  gap:4px;
}

.kf-footer-copy strong{color:var(--kf-text)}

.kf-footer-trust{
  display:flex;
  align-items:center;
  gap:20px;
  font-weight:800;
}

.kf-footer-trust span{display:flex;align-items:center;gap:7px}

.kf-footer-sep{
  display:block!important;
  width:1px;
  height:30px;
  background:var(--kf-border);
}

.kf-footer-version{justify-self:end;font-size:.9rem}

.kf-page-title h1{
  margin:0;
  color:var(--kf-text);
  font-size:clamp(1.5rem,2vw,2rem);
  font-weight:950;
}

.kf-breadcrumb{
  margin-top:7px;
  display:flex;
  align-items:center;
  gap:8px;
  color:var(--kf-muted);
  font-size:.88rem;
}

.kf-breadcrumb a{color:var(--kf-muted);text-decoration:none}

.kf-work-stats{
  margin-top:28px;
  background:var(--kf-surface);
  border:1px solid var(--kf-border);
  border-radius:18px;
  box-shadow:var(--kf-shadow-soft);
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  overflow:hidden;
}

.kf-work-stat{
  min-height:120px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:17px;
  padding:20px;
  border-inline-start:1px solid var(--kf-border);
}

.kf-work-stat:first-child{border-inline-start:0}

.kf-stat-icon{
  width:64px;
  height:64px;
  border-radius:15px;
  display:grid;
  place-items:center;
  color:var(--kf-navy);
  background:var(--kf-surface-2);
}

.kf-stat-icon .koui-icon{width:34px;height:34px}

.kf-work-stat div{
  display:grid;
  grid-template-columns:auto auto;
  align-items:end;
  gap:0 7px;
}

.kf-work-stat small{
  grid-column:1/-1;
  color:var(--kf-text);
  font-weight:900;
  font-size:1rem;
}

.kf-work-stat strong{
  color:var(--kf-navy);
  font-size:2rem;
  line-height:1.1;
}

.kf-work-stat em{color:var(--kf-muted);font-style:normal}

.kf-work-grid{
  margin-top:28px;
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:20px;
}

.kf-work-card{
  min-height:255px;
  padding:25px 28px;
  position:relative;
  display:flex;
  flex-direction:column;
  text-decoration:none!important;
  color:var(--kf-text)!important;
  background:var(--kf-surface);
  border:1px solid var(--kf-border);
  border-radius:18px;
  box-shadow:var(--kf-shadow-soft);
  transition:transform .18s ease,border-color .18s ease;
}

.kf-work-card:hover{transform:translateY(-3px);border-color:var(--kf-accent)}

.kf-work-card-icon{
  width:66px;
  height:66px;
  display:grid;
  place-items:center;
  align-self:flex-start;
  color:var(--kf-navy);
  background:var(--kf-surface-2);
  border-radius:15px;
}

.kf-work-card-icon .koui-icon{width:38px;height:38px}

.kf-work-card h2{
  margin:18px 0 8px;
  color:var(--kf-text);
  font-size:1.2rem;
  font-weight:950;
}

.kf-work-card p{
  color:var(--kf-muted);
  margin:0 0 24px;
  line-height:1.85;
  font-size:.93rem;
}

.kf-detail-link{
  margin-top:auto;
  display:flex;
  align-items:center;
  gap:7px;
  color:var(--kf-accent);
  font-weight:900;
}

.kf-detail-link .koui-icon{width:17px;height:17px}


/* KAFAT_FINAL_UI_ICON_RENDER_HOTFIX_V2_0_1 */
.kf-module-icon .koui-icon,
.kf-stat-icon .koui-icon,
.kf-work-card-icon .koui-icon,
.kf-page-icon .koui-icon,
.kf-brand-icon .koui-icon,
.kf-icon-sample .koui-icon,
.kf-mini-links .koui-icon,
.kf-mini-nav .koui-icon,
.kf-theme-button .koui-icon,
.kf-user-pill .koui-icon,
.kf-footer-trust .koui-icon,
.kf-secondary-action .koui-icon,
.kf-primary-action .koui-icon,
.kf-detail-link .koui-icon,
.kf-chip .koui-icon,
.btn .koui-icon,
a .koui-icon{
  background-color:transparent!important;
  border-radius:0!important;
}
html[data-koui-theme="midnight"] .koui-icon{filter:brightness(0) invert(1) opacity(.92);}
html[data-koui-theme="official"] .koui-icon, html[data-koui-theme="sand"] .koui-icon{filter:none;}


/* KAFAT_FINAL_UI_ICON_CASCADE_FIX_V2_0_2 */
.koui-icon[class*="koui-icon-"]{
  background-color:transparent!important;
  background-repeat:no-repeat!important;
  background-position:center!important;
  background-size:contain!important;
  border:0!important;
  box-shadow:none!important;
}

/* White icons on dark brand surfaces. */
.kf-brand-icon .koui-icon,
.kf-page-icon .koui-icon,
.kf-module-active .koui-icon,
.kf-mini-nav .koui-icon{
  filter:brightness(0) invert(1)!important;
}

/* Blue icons on light cards. */
html[data-koui-theme="official"] .kf-module-card:not(.kf-module-active) .koui-icon,
html[data-koui-theme="official"] .kf-icon-sample .koui-icon,
html[data-koui-theme="official"] .kf-work-card .koui-icon,
html[data-koui-theme="official"] .kf-work-stat .koui-icon,
html[data-koui-theme="sand"] .kf-module-card:not(.kf-module-active) .koui-icon,
html[data-koui-theme="sand"] .kf-icon-sample .koui-icon,
html[data-koui-theme="sand"] .kf-work-card .koui-icon,
html[data-koui-theme="sand"] .kf-work-stat .koui-icon{
  filter:none;
}

/* Keep dark-theme icons visible. */
html[data-koui-theme="midnight"] .koui-icon[class*="koui-icon-"]{
  filter:brightness(0) invert(1) opacity(.94);
}

/* Do not draw a colored square for an element that has no real icon class. */
.koui-icon:not([class*="koui-icon-"]){
  background-image:none!important;
  background-color:transparent!important;
}

/* =================================================================
   KAFAT FINAL COMPONENT SYSTEM V2.1
   Unified layout for Sales, Accounts, Inventory, Salaries, Reports,
   Follow-up, Settings, tables, forms, dialogs, and legacy pages.
   ================================================================= */

body.final-release{
  display:flex;
  min-height:100vh;
  flex-direction:column;
}

body.final-release > main{
  flex:1 0 auto;
  width:100%;
}

body.final-release > footer{
  margin-top:auto;
}

main.container{
  width:min(1480px,calc(100% - 32px));
  max-width:1480px;
}

main.p-0{
  width:100%;
  max-width:none;
}

body.final-release main > h1,
body.final-release main > h2,
body.final-release main > h3,
body.final-release main .page-title{
  color:var(--kf-text);
  font-weight:950;
}

/* Core Koui pages used across the final templates. */
.koui-page{
  width:min(1480px,calc(100% - 32px));
  margin:24px auto 38px;
}

.koui-page-head{
  min-height:92px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  flex-wrap:wrap;
  padding:18px 22px;
  border:1px solid var(--kf-border);
  border-radius:20px;
  background:var(--kf-surface)!important;
  box-shadow:var(--kf-shadow);
}

.koui-title-wrap{
  display:flex;
  align-items:center;
  gap:14px;
}

.koui-title-icon{
  width:54px;
  height:54px;
  display:grid;
  place-items:center;
  border-radius:15px;
  color:#fff;
  background:linear-gradient(145deg,var(--kf-navy),var(--kf-navy-2));
}

.koui-title-icon .koui-icon{
  width:29px;
  height:29px;
  filter:brightness(0) invert(1)!important;
}

.koui-page-head h1,
.koui-page-head h2{
  margin:0;
  color:var(--kf-text);
  font-size:clamp(1.35rem,2vw,1.8rem);
  font-weight:950;
}

.koui-head-actions,
.koui-actions{
  display:flex;
  align-items:center;
  gap:9px;
  flex-wrap:wrap;
}

.koui-btn{
  min-height:42px;
  padding:9px 15px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  text-decoration:none!important;
  border:1px solid var(--kf-border);
  border-radius:11px;
  color:var(--kf-text)!important;
  background:var(--kf-surface);
  font-weight:900;
  transition:.18s ease;
}

.koui-btn:hover{
  color:var(--kf-accent)!important;
  border-color:var(--kf-accent);
  transform:translateY(-1px);
}

.koui-btn-primary{
  color:#fff!important;
  border-color:var(--kf-navy)!important;
  background:linear-gradient(135deg,var(--kf-navy),var(--kf-navy-2))!important;
}

.koui-btn-primary:hover{
  color:#fff!important;
}

.koui-btn-danger{
  color:var(--kf-danger)!important;
  border-color:color-mix(in srgb,var(--kf-danger) 40%,var(--kf-border));
}

.koui-section{
  margin-top:22px;
}

.koui-section-title{
  margin:0 0 11px;
  display:flex;
  align-items:center;
  gap:8px;
  color:var(--kf-text);
  font-size:1.05rem;
  font-weight:950;
}

.koui-panel{
  overflow:hidden;
  border:1px solid var(--kf-border)!important;
  border-radius:18px!important;
  background:var(--kf-surface)!important;
  box-shadow:var(--kf-shadow-soft);
}

.koui-panel-head{
  min-height:62px;
  padding:14px 17px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  border-bottom:1px solid var(--kf-border);
  background:color-mix(in srgb,var(--kf-surface-2) 66%,var(--kf-surface));
}

.koui-panel-head h2,
.koui-panel-head h3{
  margin:0;
  color:var(--kf-text);
  font-size:1.02rem;
  font-weight:950;
}

.koui-panel-body{
  padding:17px;
}

.koui-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
}

.koui-module-card{
  min-height:104px;
  padding:17px;
  display:flex;
  align-items:center;
  gap:14px;
  text-decoration:none!important;
  color:var(--kf-text)!important;
  border:1px solid var(--kf-border)!important;
  border-radius:16px!important;
  background:var(--kf-surface)!important;
  box-shadow:var(--kf-shadow-soft);
  transition:.18s ease;
}

.koui-module-card:hover{
  transform:translateY(-2px);
  border-color:var(--kf-accent)!important;
}

.koui-module-card.is-primary{
  color:#fff!important;
  border-color:var(--kf-navy)!important;
  background:linear-gradient(145deg,var(--kf-navy),var(--kf-navy-2))!important;
}

.koui-module-card.is-primary .koui-icon{
  filter:brightness(0) invert(1)!important;
}

.koui-module-icon{
  width:48px;
  height:48px;
  display:grid;
  place-items:center;
  flex:0 0 auto;
  border-radius:14px;
  color:var(--kf-navy);
  background:var(--kf-surface-2);
}

.koui-module-icon .koui-icon{
  width:25px;
  height:25px;
}

.koui-module-card strong{
  font-size:1rem;
  font-weight:950;
}

.koui-module-card small{
  display:block;
  margin-top:3px;
  color:var(--kf-muted);
}

.koui-stats{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:13px;
}

.koui-stat{
  min-height:105px;
  padding:16px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  text-decoration:none!important;
  color:var(--kf-text)!important;
  border:1px solid var(--kf-border)!important;
  border-radius:16px!important;
  background:var(--kf-surface)!important;
  box-shadow:var(--kf-shadow-soft);
}

.koui-stat small{
  color:var(--kf-muted);
  font-weight:850;
}

.koui-stat strong{
  display:block;
  margin-top:5px;
  color:var(--kf-navy);
  font-size:1.65rem;
  line-height:1.2;
  font-weight:950;
}

.koui-stat.is-alert strong{
  color:var(--kf-danger);
}

.koui-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:28px;
  padding:4px 9px;
  border-radius:999px;
  color:var(--kf-text);
  background:var(--kf-surface-2);
  font-size:.76rem;
  font-weight:900;
}

.koui-badge-success{
  color:var(--kf-success);
  background:color-mix(in srgb,var(--kf-success) 13%,var(--kf-surface));
}

.koui-badge-danger{
  color:var(--kf-danger);
  background:color-mix(in srgb,var(--kf-danger) 12%,var(--kf-surface));
}

.koui-badge-warning{
  color:#896315;
  background:#fbf1d9;
}

.koui-filter{
  display:grid;
  grid-template-columns:minmax(240px,2fr) repeat(3,minmax(150px,1fr)) auto;
  gap:10px;
  align-items:end;
}

.koui-field label{
  display:block;
  margin-bottom:6px;
  color:var(--kf-text);
  font-size:.8rem;
  font-weight:900;
}

.koui-field input,
.koui-field select,
.koui-field textarea{
  width:100%;
  min-height:43px;
  padding:9px 11px;
  border:1px solid var(--kf-border);
  border-radius:11px;
  background:var(--kf-surface);
  color:var(--kf-text);
}

.koui-form-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:13px;
}

.koui-settings-grid{
  display:grid;
  grid-template-columns:minmax(0,2fr) minmax(290px,.8fr);
  gap:16px;
}

.koui-setting-actions{
  display:grid;
  gap:10px;
  align-content:start;
}

.koui-setting-link{
  min-height:58px;
  padding:13px 14px;
  display:flex;
  align-items:center;
  gap:11px;
  text-decoration:none!important;
  color:var(--kf-text)!important;
  border:1px solid var(--kf-border)!important;
  border-radius:14px!important;
  background:var(--kf-surface)!important;
  box-shadow:var(--kf-shadow-soft);
}

.koui-setting-link:hover{
  border-color:var(--kf-accent)!important;
}

.koui-setting-link .koui-icon{
  width:22px;
  height:22px;
}

.koui-setting-link.is-danger{
  color:var(--kf-danger)!important;
}

.koui-table-wrap{
  overflow:auto;
}

.koui-table{
  width:100%;
  min-width:850px;
  border-collapse:collapse;
}

.koui-table th,
.koui-table td{
  padding:12px 11px;
  text-align:right;
  vertical-align:middle;
  white-space:nowrap;
  border-bottom:1px solid var(--kf-border);
}

.koui-table th{
  color:var(--kf-text);
  background:var(--kf-surface-2);
  font-size:.8rem;
  font-weight:950;
}

.koui-table tbody tr:hover{
  background:color-mix(in srgb,var(--kf-surface-2) 55%,transparent);
}

.koui-empty{
  padding:36px 20px;
  text-align:center;
  color:var(--kf-muted);
  font-weight:850;
}

.koui-progress{
  height:8px;
  overflow:hidden;
  border-radius:999px;
  background:var(--kf-surface-2);
}

.koui-progress span{
  display:block;
  height:100%;
  border-radius:inherit;
  background:linear-gradient(90deg,var(--kf-navy),var(--kf-teal));
}

/* Sales & installments redesign. */
.kf-sales-page{
  width:min(1520px,calc(100% - 38px));
  margin:24px auto 38px;
}

.kf-sales-hero{
  min-height:106px;
  padding:20px 24px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  flex-wrap:wrap;
  border:1px solid var(--kf-border);
  border-radius:21px;
  background:var(--kf-surface);
  box-shadow:var(--kf-shadow);
}

.kf-sales-heading{
  display:flex;
  align-items:center;
  gap:15px;
}

.kf-sales-heading-icon{
  width:58px;
  height:58px;
  display:grid;
  place-items:center;
  flex:0 0 auto;
  border-radius:16px;
  background:linear-gradient(145deg,var(--kf-navy),var(--kf-navy-2));
}

.kf-sales-heading-icon .koui-icon{
  width:31px;
  height:31px;
  filter:brightness(0) invert(1)!important;
}

.kf-sales-heading h1{
  margin:0;
  color:var(--kf-text);
  font-size:clamp(1.45rem,2.2vw,2rem);
  font-weight:950;
}

.kf-sales-heading span{
  display:block;
  margin-top:5px;
  color:var(--kf-muted);
}

.kf-sales-actions{
  display:flex;
  align-items:center;
  gap:9px;
  flex-wrap:wrap;
}

.kf-sales-kpis{
  margin-top:18px;
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:13px;
}

.kf-sales-kpi{
  min-height:124px;
  padding:17px;
  display:flex;
  align-items:center;
  gap:13px;
  text-decoration:none!important;
  color:var(--kf-text)!important;
  border:1px solid var(--kf-border);
  border-radius:17px;
  background:var(--kf-surface);
  box-shadow:var(--kf-shadow-soft);
  transition:.18s ease;
}

.kf-sales-kpi:hover{
  transform:translateY(-2px);
  border-color:var(--kf-accent);
}

.kf-kpi-icon{
  width:51px;
  height:51px;
  display:grid;
  place-items:center;
  flex:0 0 auto;
  border-radius:14px;
  color:var(--kf-navy);
  background:var(--kf-surface-2);
}

.kf-kpi-icon .koui-icon{
  width:27px;
  height:27px;
}

.kf-sales-kpi div{
  min-width:0;
}

.kf-sales-kpi small{
  display:block;
  color:var(--kf-muted);
  font-weight:850;
}

.kf-sales-kpi strong{
  display:block;
  margin-top:4px;
  overflow:hidden;
  color:var(--kf-text);
  font-size:clamp(1.25rem,1.7vw,1.65rem);
  line-height:1.25;
  font-weight:950;
  text-overflow:ellipsis;
}

.kf-sales-kpi em{
  color:var(--kf-muted);
  font-size:.8rem;
  font-style:normal;
}

.kf-kpi-highlight{
  color:#fff!important;
  border-color:var(--kf-navy);
  background:linear-gradient(145deg,var(--kf-navy),var(--kf-navy-2));
}

.kf-kpi-highlight small,
.kf-kpi-highlight strong,
.kf-kpi-highlight em{
  color:#fff;
}

.kf-kpi-highlight .kf-kpi-icon{
  color:#fff;
  background:rgba(255,255,255,.12);
}

.kf-kpi-highlight .koui-icon{
  filter:brightness(0) invert(1)!important;
}

.kf-sales-section{
  margin-top:22px;
  padding:19px;
  border:1px solid var(--kf-border);
  border-radius:19px;
  background:var(--kf-surface);
  box-shadow:var(--kf-shadow-soft);
}

.kf-section-bar{
  min-height:45px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:14px;
}

.kf-section-bar h2{
  margin:0;
  color:var(--kf-text);
  font-size:1.08rem;
  font-weight:950;
}

.kf-section-bar a{
  display:inline-flex;
  align-items:center;
  gap:7px;
  text-decoration:none;
  color:var(--kf-accent);
  font-weight:900;
}

.kf-sales-shortcuts{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:13px;
}

.kf-sales-shortcut{
  min-height:102px;
  padding:15px;
  display:grid;
  grid-template-columns:47px 1fr 19px;
  align-items:center;
  gap:12px;
  text-decoration:none!important;
  color:var(--kf-text)!important;
  border:1px solid var(--kf-border);
  border-radius:15px;
  background:var(--kf-surface);
  transition:.18s ease;
}

.kf-sales-shortcut:hover{
  transform:translateY(-2px);
  border-color:var(--kf-accent);
  background:color-mix(in srgb,var(--kf-surface-2) 55%,var(--kf-surface));
}

.kf-sales-shortcut > span{
  width:47px;
  height:47px;
  display:grid;
  place-items:center;
  border-radius:13px;
  color:var(--kf-navy);
  background:var(--kf-surface-2);
}

.kf-sales-shortcut > span .koui-icon{
  width:25px;
  height:25px;
}

.kf-sales-shortcut strong{
  display:block;
  font-weight:950;
}

.kf-sales-shortcut small{
  display:block;
  margin-top:3px;
  color:var(--kf-muted);
}

.kf-sales-shortcut > .koui-icon{
  color:var(--kf-muted);
}

.kf-sales-shortcut-primary{
  color:#fff!important;
  border-color:var(--kf-navy);
  background:linear-gradient(145deg,var(--kf-navy),var(--kf-navy-2));
}

.kf-sales-shortcut-primary strong,
.kf-sales-shortcut-primary small,
.kf-sales-shortcut-primary > .koui-icon{
  color:#fff;
}

.kf-sales-shortcut-primary > span{
  color:#fff;
  background:rgba(255,255,255,.12);
}

.kf-sales-shortcut-primary .koui-icon{
  filter:brightness(0) invert(1)!important;
}

.kf-operation-grid{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:12px;
}

.kf-operation-card{
  min-height:104px;
  padding:15px;
  display:grid;
  grid-template-columns:42px 1fr;
  align-items:center;
  gap:0 11px;
  border:1px solid var(--kf-border);
  border-radius:15px;
  background:var(--kf-surface);
}

.kf-operation-card > span{
  grid-row:1/3;
  width:42px;
  height:42px;
  display:grid;
  place-items:center;
  border-radius:12px;
  color:var(--kf-navy);
  background:var(--kf-surface-2);
}

.kf-operation-card small{
  color:var(--kf-muted);
  font-weight:850;
}

.kf-operation-card strong{
  color:var(--kf-text);
  font-size:1.55rem;
  font-weight:950;
}

.kf-operation-card.is-warning strong{
  color:#ae7216;
}

/* Global Bootstrap normalization for older pages. */
body.final-release .card{
  border:1px solid var(--kf-border)!important;
  border-radius:17px!important;
  background:var(--kf-surface)!important;
  color:var(--kf-text)!important;
  box-shadow:var(--kf-shadow-soft)!important;
}

body.final-release .card-header{
  min-height:58px;
  display:flex;
  align-items:center;
  color:var(--kf-text)!important;
  border-bottom:1px solid var(--kf-border)!important;
  background:var(--kf-surface-2)!important;
  font-weight:950;
}

body.final-release .card-body{
  padding:18px;
}

body.final-release .table-responsive{
  overflow:auto;
  border:1px solid var(--kf-border);
  border-radius:14px;
}

body.final-release .table{
  width:100%;
  margin:0;
  color:var(--kf-text)!important;
  background:var(--kf-surface)!important;
}

body.final-release .table > :not(caption) > * > *{
  padding:.78rem .72rem;
  color:var(--kf-text)!important;
  border-bottom-color:var(--kf-border)!important;
  background:var(--kf-surface)!important;
  vertical-align:middle;
}

body.final-release .table thead th{
  color:var(--kf-text)!important;
  background:var(--kf-surface-2)!important;
  font-size:.82rem;
  font-weight:950;
}

body.final-release .table tbody tr:hover > *{
  background:color-mix(in srgb,var(--kf-surface-2) 55%,var(--kf-surface))!important;
}

body.final-release .nav-tabs{
  gap:5px;
  border-bottom-color:var(--kf-border);
}

body.final-release .nav-tabs .nav-link{
  color:var(--kf-muted);
  border-radius:10px 10px 0 0;
  font-weight:850;
}

body.final-release .nav-tabs .nav-link.active{
  color:var(--kf-accent);
  border-color:var(--kf-border) var(--kf-border) var(--kf-surface);
  background:var(--kf-surface);
}

body.final-release .modal-content{
  color:var(--kf-text);
  border:1px solid var(--kf-border);
  border-radius:18px;
  background:var(--kf-surface);
  box-shadow:var(--kf-shadow);
}

body.final-release .modal-header,
body.final-release .modal-footer{
  border-color:var(--kf-border);
}

body.final-release .list-group-item{
  color:var(--kf-text);
  border-color:var(--kf-border);
  background:var(--kf-surface);
}

body.final-release .pagination .page-link{
  color:var(--kf-text);
  border-color:var(--kf-border);
  background:var(--kf-surface);
}

body.final-release .pagination .active .page-link{
  color:#fff;
  border-color:var(--kf-navy);
  background:var(--kf-navy);
}

body.final-release .alert{
  border-radius:13px;
}

body.final-release .badge{
  font-weight:850;
}

body.final-release .accordion-item{
  color:var(--kf-text);
  border-color:var(--kf-border);
  background:var(--kf-surface);
}

body.final-release .accordion-button{
  color:var(--kf-text);
  background:var(--kf-surface);
  font-weight:900;
}

body.final-release .accordion-button:not(.collapsed){
  color:var(--kf-accent);
  background:var(--kf-surface-2);
}

body.final-release .dropdown-menu{
  color:var(--kf-text);
  border-color:var(--kf-border);
  background:var(--kf-surface);
}

body.final-release .dropdown-item{
  color:var(--kf-text);
}

body.final-release .dropdown-item:hover{
  color:var(--kf-accent);
  background:var(--kf-surface-2);
}

body.final-release .form-label{
  color:var(--kf-text);
  font-weight:850;
}

body.final-release .text-secondary,
body.final-release .text-muted{
  color:var(--kf-muted)!important;
}

body.final-release hr{
  border-color:var(--kf-border);
  opacity:1;
}

@media(max-width:1200px){
  .koui-grid{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }

  .koui-stats,
  .kf-sales-kpis,
  .kf-operation-grid{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}

@media(max-width:900px){
  .koui-page,
  .kf-sales-page{
    width:min(100% - 22px,1480px);
    margin-top:12px;
  }

  .koui-grid,
  .kf-sales-shortcuts{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .koui-stats,
  .kf-sales-kpis,
  .kf-operation-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .koui-filter{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .koui-settings-grid{
    grid-template-columns:1fr;
  }
}

@media(max-width:620px){
  main.container{
    width:min(100% - 16px,1480px);
    padding-inline:0!important;
  }

  .koui-page-head,
  .kf-sales-hero{
    padding:14px;
  }

  .koui-grid,
  .koui-stats,
  .koui-filter,
  .koui-form-grid,
  .kf-sales-kpis,
  .kf-sales-shortcuts,
  .kf-operation-grid{
    grid-template-columns:1fr;
  }

  .kf-sales-actions{
    width:100%;
  }

  .kf-sales-actions > *{
    flex:1;
  }
}

/* Kafaat V2.2 interaction reliability layer
   Keeps every real control above decorative glass/animation layers and restores
   reliable mouse/touch interaction across forms, accordions and dialogs. */
body.final-release :is(
  form,
  .card-body,
  .card-footer,
  .form-check,
  .input-group,
  .btn-group,
  .accordion,
  .accordion-item,
  .accordion-header,
  .accordion-body,
  .modal-content,
  .modal-body,
  .modal-footer
){
  position:relative;
}

body.final-release :is(
  input:not([type="hidden"]):not(.btn-check),
  select,
  textarea,
  button,
  a.btn,
  label,
  .form-check-input,
  .form-check-label,
  .accordion-button,
  [role="button"],
  [data-bs-toggle]
){
  position:relative;
  z-index:12;
  pointer-events:auto!important;
  touch-action:manipulation;
}

body.final-release :is(
  .card,
  .card-body,
  .card-footer,
  .form-check,
  .input-group,
  .btn-group,
  .accordion-item,
  .accordion-button,
  .modal-content
)::before,
body.final-release :is(
  .card,
  .card-body,
  .card-footer,
  .form-check,
  .input-group,
  .btn-group,
  .accordion-item,
  .accordion-button,
  .modal-content
)::after{
  pointer-events:none!important;
}

body.final-release .form-check{
  z-index:10;
  pointer-events:auto!important;
  min-height:1.65rem;
}

body.final-release .form-check-input:not(.btn-check){
  width:1.25rem;
  height:1.25rem;
  margin-top:.12rem;
  cursor:pointer;
  background-color:var(--kf-surface)!important;
  border:2px solid color-mix(in srgb,var(--kf-accent) 62%,#64748b)!important;
  box-shadow:none!important;
}

body.final-release .form-check-input:not(.btn-check):checked{
  background-color:#0d6efd!important;
  border-color:#0d6efd!important;
}

body.final-release .form-check-input:not(.btn-check):focus{
  box-shadow:0 0 0 .22rem rgba(13,110,253,.22)!important;
}

body.final-release .form-check-label,
body.final-release label[for]{
  cursor:pointer;
  user-select:none;
}

body.final-release .accordion-button{
  cursor:pointer;
}

body.final-release :is(button,.btn,.accordion-button,[role="button"]):disabled,
body.final-release :is(button,.btn,.accordion-button,[role="button"])[aria-disabled="true"]{
  cursor:not-allowed;
}

/* Keep Bootstrap's hidden radio/checkbox buttons hidden while their labels stay clickable. */
body.final-release input.btn-check{
  position:absolute!important;
  clip:rect(0,0,0,0)!important;
  pointer-events:none!important;
}

/* Existing plan-rebalance control receives the same global repair plus a larger target. */
.plan-rebalance-confirm-card,
.plan-rebalance-confirm-card .card-body,
.plan-rebalance-confirm-row{
  position:relative;
  z-index:10;
  pointer-events:auto!important;
}

.plan-rebalance-confirm-row{
  display:flex;
  align-items:flex-start;
  gap:.7rem;
  padding:.65rem .75rem;
  border-radius:12px;
  cursor:pointer;
  user-select:none;
}

.plan-rebalance-confirm-row:hover{
  background:color-mix(in srgb,var(--kf-accent) 7%,transparent);
}

#confirmFullRebalance.form-check-input{
  flex:0 0 auto;
  width:1.35rem;
  height:1.35rem;
  margin:.1rem 0 0 0!important;
  z-index:14;
}

#fullRebalanceSubmit{
  position:relative;
  z-index:14;
}

#fullRebalanceSubmit:disabled{
  opacity:.55;
  cursor:not-allowed;
  pointer-events:none!important;
}

/* Emergency fallback classes used only when Bootstrap JS is unavailable. */
.kf-fallback-modal-open{
  overflow:hidden!important;
}

.modal.kf-fallback-show{
  display:block!important;
  opacity:1!important;
}

.kf-fallback-backdrop{
  position:fixed;
  inset:0;
  z-index:1040;
  background:rgba(15,23,42,.5);
}

.modal.kf-fallback-show{
  z-index:1055;
}

.dropdown-menu.kf-fallback-show{
  display:block!important;
}


/* ========================================================================== */
/* KAFAAT MOBILE RESPONSIVE HOTFIX V2.3.0                                    */
/* الصفحة الرئيسية والصفحات الإدارية على الهاتف                             */
/* ========================================================================== */
@media screen {
  html,
  body{
    max-width:100%;
    overflow-x:hidden;
  }

  body.final-release,
  body.final-release main,
  body.final-release main > *{
    min-width:0;
  }

  body.final-release img,
  body.final-release svg,
  body.final-release video,
  body.final-release canvas{
    max-width:100%;
  }

  body.final-release .container,
  body.final-release .container-fluid{
    min-width:0;
  }

  body.final-release .table-responsive,
  body.final-release .table-wrap,
  body.final-release .table-shell{
    width:100%;
    max-width:100%;
    overflow-x:auto;
    overflow-y:visible;
    -webkit-overflow-scrolling:touch;
  }

  body.final-release .table-responsive > table,
  body.final-release .table-wrap > table,
  body.final-release .table-shell > table{
    margin-bottom:0;
  }
}

@media screen and (max-width: 992px){
  body.final-release .glass-nav .container{
    width:100%;
    max-width:none;
    padding-inline:12px;
  }

  body.final-release .glass-nav .navbar-brand{
    min-width:0;
    max-width:calc(100% - 62px);
  }

  body.final-release .glass-nav .brand-title,
  body.final-release .glass-nav .brand-sub{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }

  body.final-release .glass-nav .navbar-collapse{
    width:100%;
    max-height:calc(100dvh - 78px);
    overflow-y:auto;
    overflow-x:hidden;
    padding:10px 2px 14px;
  }

  body.final-release .glass-nav .nav-scroll.v03-nav{
    width:100%;
    overflow:visible!important;
    white-space:normal;
    flex-direction:column;
    align-items:stretch;
  }

  body.final-release .glass-nav .v03-nav .nav-link{
    width:100%;
    min-height:44px;
    display:flex;
    align-items:center;
    gap:9px;
    border-radius:12px;
    padding:.65rem .8rem;
  }

  body.final-release .glass-nav .v03-nav .dropdown-menu{
    width:100%;
    min-width:0;
    position:static!important;
    transform:none!important;
    margin:.3rem 0 .6rem;
  }

  body.final-release .glass-nav .navbar-collapse > .d-flex{
    width:100%;
    flex-wrap:wrap;
    align-items:stretch!important;
  }

  body.final-release .glass-nav .navbar-collapse > .d-flex > *{
    min-height:42px;
  }

  body.final-release .glass-nav .user-badge{
    width:100%;
    max-width:none;
    display:flex;
    align-items:center;
    justify-content:center;
  }

  /* الصفحة الرئيسية */
  .kf-home-shell,
  .kf-work-shell,
  .kf-appearance-shell{
    width:calc(100% - 22px);
    max-width:none;
    margin:11px auto 18px;
  }

  .kf-brandbar,
  .kf-pagebar{
    min-height:0;
    padding:16px;
    border-radius:18px;
    align-items:stretch;
    flex-direction:column;
  }

  .kf-brand,
  .kf-page-title{
    width:100%;
    min-width:0;
  }

  .kf-brand strong,
  .kf-page-title h1{
    min-width:0;
    overflow-wrap:anywhere;
  }

  .kf-brand-actions,
  .kf-page-actions{
    width:100%;
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:9px;
  }

  .kf-user-pill,
  .kf-theme-button,
  .kf-page-actions > *{
    width:100%;
    min-width:0;
    justify-content:center;
    text-align:center;
    white-space:normal;
  }

  .kf-module-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px;
    margin-top:14px;
  }

  .kf-module-card{
    min-width:0;
    min-height:198px;
    padding:18px 12px 17px;
    border-radius:17px;
  }

  .kf-module-icon{
    width:66px;
    height:66px;
    margin-bottom:13px;
    border-radius:17px;
  }

  .kf-module-icon .koui-icon{
    width:38px;
    height:38px;
  }

  .kf-module-card strong{
    width:100%;
    font-size:1.02rem;
    line-height:1.55;
    overflow-wrap:anywhere;
    word-break:normal;
  }

  .kf-module-card small{
    width:100%;
    margin-top:5px;
    font-size:.8rem;
    line-height:1.55;
    overflow-wrap:anywhere;
  }

  .kf-card-arrow{
    width:18px;
    height:18px;
    left:12px;
    bottom:12px;
  }

  .kf-module-tail{
    max-width:none;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px;
    margin-top:12px;
  }

  .kf-tail-card{
    min-height:116px;
    padding:15px;
    flex-direction:column;
    justify-content:center;
    text-align:center;
  }

  .kf-tail-card .kf-module-icon{
    width:56px;
    height:56px;
    margin-bottom:10px;
  }

  .kf-tail-card .kf-module-icon .koui-icon{
    width:31px;
    height:31px;
  }

  .kf-final-footer{
    min-height:0;
    padding:18px 14px;
    grid-template-columns:1fr;
    justify-items:center;
    text-align:center;
    gap:13px;
  }

  .kf-footer-copy,
  .kf-footer-version{
    justify-self:center;
  }

  .kf-footer-trust{
    flex-wrap:wrap;
    justify-content:center;
    gap:10px 16px;
  }

  .kf-footer-sep{display:none!important;}

  /* متابعة العمل والمظهر */
  .kf-work-stats{
    grid-template-columns:repeat(2,minmax(0,1fr));
    margin-top:14px;
  }

  .kf-work-stat{
    min-width:0;
    min-height:100px;
    padding:14px 10px;
    gap:10px;
  }

  .kf-work-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px;
    margin-top:14px;
  }

  .kf-work-card{
    min-width:0;
    min-height:220px;
    padding:18px 15px;
  }

  /* الصفحات الداخلية العامة */
  body.final-release main.container,
  body.final-release main.container-fluid{
    width:100%;
    max-width:100%;
    padding-inline:10px!important;
  }

  body.final-release :is(.row,.form-row){
    min-width:0;
  }

  body.final-release :is(.card,.card-body,.card-header,.card-footer,.modal-content,.offcanvas,.accordion-item){
    min-width:0;
    max-width:100%;
  }

  body.final-release :is(input,select,textarea,.form-control,.form-select,.input-group){
    max-width:100%;
  }

  body.final-release .modal-dialog{
    width:auto;
    max-width:calc(100% - 18px);
    margin:9px auto;
  }

  body.final-release .btn-toolbar,
  body.final-release .page-actions,
  body.final-release .toolbar,
  body.final-release .filter-actions,
  body.final-release .actions-bar{
    flex-wrap:wrap;
  }
}

@media screen and (max-width: 620px){
  .kf-home-shell,
  .kf-work-shell,
  .kf-appearance-shell{
    width:calc(100% - 14px);
    margin-top:7px;
  }

  .kf-brandbar,
  .kf-pagebar{
    padding:13px;
    gap:12px;
  }

  .kf-brand{
    justify-content:center;
    text-align:center;
  }

  .kf-brand-icon,
  .kf-page-icon{
    width:52px;
    height:52px;
    flex:0 0 52px;
    border-radius:14px;
  }

  .kf-brand-icon .koui-icon,
  .kf-page-icon .koui-icon{
    width:29px;
    height:29px;
  }

  .kf-brand strong{
    font-size:clamp(1.15rem,5.4vw,1.45rem);
    line-height:1.55;
  }

  .kf-user-pill,
  .kf-theme-button{
    min-height:44px;
    padding:8px 9px;
    font-size:.9rem;
  }

  .kf-module-grid{
    gap:9px;
  }

  .kf-module-card{
    min-height:184px;
    padding:15px 8px 14px;
  }

  .kf-module-card strong{
    font-size:.94rem;
  }

  .kf-module-card small{
    font-size:.74rem;
  }

  .kf-module-icon{
    width:60px;
    height:60px;
    margin-bottom:10px;
  }

  .kf-module-icon .koui-icon{
    width:34px;
    height:34px;
  }

  .kf-work-stat{
    flex-direction:column;
    text-align:center;
  }

  .kf-work-stat div{
    justify-content:center;
  }

  .kf-work-card h2{
    font-size:1.02rem;
  }

  .kf-work-card p{
    font-size:.82rem;
    line-height:1.65;
  }

  body.final-release .table-responsive,
  body.final-release .table-wrap,
  body.final-release .table-shell{
    border-radius:12px;
  }

  body.final-release table.table{
    font-size:.82rem;
  }

  body.final-release .form-label{
    font-size:.9rem;
  }

  body.final-release :is(.btn,.form-control,.form-select){
    min-height:42px;
  }
}

@media screen and (max-width: 420px){
  .kf-brand-actions,
  .kf-page-actions,
  .kf-module-grid,
  .kf-module-tail,
  .kf-work-stats,
  .kf-work-grid{
    grid-template-columns:1fr;
  }

  .kf-module-card{
    min-height:165px;
  }

  .kf-tail-card{
    min-height:105px;
  }

  .kf-footer-trust{
    flex-direction:column;
  }
}

@media print{
  /* لا تؤثر قواعد الهاتف في قوالب الطباعة */
  html,body{overflow:visible!important;max-width:none!important;}
}
