/* Shared header, saved appearance and bidirectional layouts. */
:root{--kf-header-height:80px;--kf-bg:#f5f8f6;--kf-surface:#fff;--kf-soft:#f1f6f3;--kf-text:#19392c;--kf-muted:#62796e;--kf-line:#c9ddd1;--kf-accent:#008d59;--kf-shadow:0 12px 40px #122e2012;color-scheme:light}
html[data-theme="dark"]{--kf-bg:#0d1915;--kf-surface:#15261f;--kf-soft:#1c3027;--kf-text:#e6f1eb;--kf-muted:#abc2b5;--kf-line:#345044;--kf-accent:#65d7a3;--kf-shadow:0 12px 40px #0003;--ui-text:#e6f1eb;--ui-muted:#abc2b5;--ui-border:#345044;--ui-green:#65d7a3;--ui-focus:#65d7a3;--bg:#0d1915;--text:#e6f1eb;--muted:#abc2b5;--line:#345044;--salvation-black:#e6f1eb;--salvation-white:#15261f;--salvation-gray:#abc2b5;--charcoal:#e6f1eb;--gray-50:#0d1915;--gray-100:#1c3027;--gray-300:#345044;--gray-500:#abc2b5;--green-dark:#65d7a3;--green-deep:#b5eed1;color-scheme:dark}
.kf-header{position:sticky;inset-block-start:0;z-index:9200;width:100%;background:var(--kf-soft);color:var(--kf-text);border-block-end:1px solid var(--kf-line);font-family:var(--font-ui)}
.kf-header-inner{display:flex;align-items:center;justify-content:space-between;gap:22px;min-height:var(--kf-header-height);max-width:1600px;margin:0 auto;padding:10px 24px}
.kf-header a{text-decoration:none;color:inherit}
.kf-brand{display:flex;align-items:center;gap:10px;flex-shrink:0;min-width:0}
.kf-brand img{display:block;width:52px;height:52px;object-fit:contain;flex-shrink:0}
.kf-brand strong{display:block;font-size:19px;font-weight:800;line-height:1.4;color:var(--kf-text)}
.kf-brand small{display:block;font-size:10px;font-weight:600;line-height:1.7;color:var(--kf-muted)}
.kf-desktop-nav{display:flex;align-items:center;justify-content:center;gap:18px;flex:1;min-width:0}
.kf-desktop-nav>a{position:relative;display:inline-flex;align-items:center;gap:6px;white-space:nowrap;font-size:13px;font-weight:600;color:var(--kf-muted);padding:12px 0;line-height:1.6}
.kf-desktop-nav>a:hover,.kf-desktop-nav>a[aria-current]{color:var(--kf-accent)}
.kf-desktop-nav>a[aria-current]::after{content:"";position:absolute;inset-inline:0;inset-block-end:3px;height:2px;background:var(--kf-accent)}
.kf-features{position:relative}
.kf-features summary{display:flex;align-items:center;gap:8px;list-style:none;cursor:pointer;font-size:13px;color:var(--kf-muted);padding-block:12px;white-space:nowrap}
.kf-features summary::-webkit-details-marker{display:none}
.kf-features summary i{font-size:9px}
.kf-features[open] summary{color:var(--kf-accent)}
.kf-feature-links{position:absolute;inset-block-start:100%;inset-inline-start:0;min-width:220px;background:var(--kf-surface);border:1px solid var(--kf-line);border-radius:12px;box-shadow:var(--kf-shadow);padding:8px}
.kf-feature-links a{display:block;padding:10px 12px;font-size:13px;color:var(--kf-text);border-radius:8px;white-space:nowrap}
.kf-feature-links a:hover{background:var(--kf-soft);color:var(--kf-accent)}
.kf-header-actions{display:flex;align-items:center;gap:10px;flex-shrink:0}
.kf-header .kf-login,.kf-mobile-auth .kf-login{font-size:13px;color:var(--kf-muted);font-weight:600;padding:10px 4px}
.kf-header .kf-signup,.kf-mobile-auth .kf-signup{display:inline-flex;align-items:center;justify-content:center;border:1px solid #80c6a5;border-radius:12px;padding:10px 18px;color:var(--kf-accent);font-size:13px;font-weight:800;white-space:nowrap;background:transparent;text-decoration:none}
.kf-header .kf-signup:hover,.kf-mobile-auth .kf-signup:hover{background:var(--kf-surface)}
.kf-icon-button{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:44px;height:44px;min-height:44px;padding:0;border:1px solid var(--kf-line);border-radius:12px;background:var(--kf-surface);color:var(--kf-accent);font:inherit;font-size:19px;cursor:pointer;line-height:1}
.kf-icon-button:hover{background:var(--kf-soft)}
.kf-languages{display:inline-flex;align-items:center;gap:3px;border:1px solid var(--kf-line);border-radius:12px;padding:3px;background:var(--kf-surface);direction:ltr}
.kf-languages button{display:inline-flex;align-items:center;justify-content:center;gap:5px;min-width:38px;min-height:34px;padding:5px 8px;background:transparent;border:0;border-radius:9px;color:var(--kf-muted);font:600 12px var(--font-ui);cursor:pointer;line-height:1.6}
.kf-languages button[aria-pressed="true"]{background:#008d59;color:#fff}
.kf-languages button>span[aria-hidden]{font-family:"Segoe UI Emoji","Apple Color Emoji",sans-serif;font-size:18px;line-height:1}
.kf-lang-code{font-size:10px}
.kf-flag{position:relative;display:inline-block;width:23px;height:16px;border-radius:2px;overflow:hidden;box-shadow:0 0 0 1px #0002;flex-shrink:0}
.kf-flag-ps{background:linear-gradient(#111 0 33.33%,#fff 33.33% 66.66%,#00843d 66.66%)}
.kf-flag-ps::before{content:"";position:absolute;inset:0 auto 0 0;border-top:8px solid transparent;border-bottom:8px solid transparent;border-left:11px solid #e43135}
.kf-flag-us{background:repeating-linear-gradient(#b22234 0 1.23px,#fff 1.23px 2.46px)}
.kf-flag-us::before{content:"✦✦✦";position:absolute;top:0;left:0;width:10px;height:9px;background:#3c3b6e;color:#fff;font:4px/7px Arial;letter-spacing:-.5px;text-align:center}
.kf-menu-toggle{display:none}
.kf-header :focus-visible,.kf-mobile-menu :focus-visible{outline:2px solid var(--kf-accent);outline-offset:4px}
.kf-mobile-menu{position:fixed;inset-block:0;inset-inline-start:auto;inset-inline-end:0;margin:0;width:380px;max-width:calc(100vw - 28px);height:100dvh;max-height:100dvh;padding:22px;border:0;border-inline-start:1px solid var(--kf-line);background:var(--kf-surface);color:var(--kf-text);box-shadow:var(--kf-shadow);overflow:auto;font-family:var(--font-ui);text-align:start}
.kf-mobile-menu::backdrop{background:#07191099;backdrop-filter:blur(3px)}
.kf-menu-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:24px}
.kf-menu-heading strong{font-size:18px}
.kf-menu-preferences{padding-block:0 20px;border-bottom:1px solid var(--kf-line);margin-bottom:12px}
.kf-menu-preferences>span{display:block;font-size:12px;color:var(--kf-muted);margin-bottom:8px}
.kf-menu-preferences .kf-languages{width:100%;display:flex}
.kf-menu-preferences .kf-languages button{flex:1;min-height:42px}
.kf-mobile-nav a{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 8px;border-radius:8px;color:var(--kf-text);text-decoration:none;font-size:14px;line-height:1.7}
.kf-mobile-nav a:hover,.kf-mobile-nav a.is-active{background:var(--kf-soft);color:var(--kf-accent)}
.kf-mobile-nav a>i:last-child{font-size:11px;color:var(--kf-muted)}
.kf-mobile-nav .kashf-sidebar-link-label{flex:1}
.kf-mobile-auth{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-block:20px;border-top:1px solid var(--kf-line);margin-top:16px}
.kf-menu-footer{font-size:11px;color:var(--kf-muted);border-top:1px solid var(--kf-line);padding-top:18px;margin-top:16px}
.kf-menu-open,.kf-menu-open body{overflow:hidden}
.kf-header~.kashf-sidebar{top:var(--kf-header-height)}
.kf-header~.kashf-sidebar-menu-button{display:none!important}
.kf-desktop-nav .kashf-sidebar-link{width:auto;background:none;padding-inline:0;min-height:0}
.kf-desktop-nav .kashf-sidebar-link i{display:none}
:where(html[data-page="login"],html[data-page="register"],html[data-page="forgot-password"],html[data-page="admin-login"]) body:has(>.kf-header){display:block;padding:0;margin:0;background:var(--kf-bg)}
:where(html[data-page="login"],html[data-page="register"],html[data-page="forgot-password"],html[data-page="admin-login"]) body:has(>.kf-header)>:is(.login-container,.register-container,.box){margin:36px auto;max-width:min(600px,calc(100% - 32px))}
html[data-page="login"] body:has(>.kf-header)>.login-container{max-width:min(480px,calc(100% - 32px))}
html[data-area="app"][dir="ltr"] main{margin-right:0;margin-left:260px}
html[dir="ltr"] .kashf-sidebar{right:auto;left:0;direction:ltr}
html[dir="ltr"] :is(th,td,label,.form-group,.pagehead,.page-head){text-align:start}
html[dir="ltr"] .kf-mobile-nav a>i.fa-chevron-left{transform:rotate(180deg)}
html[dir="ltr"] .search-wrap i{right:auto;left:11px}
html[dir="ltr"] .search-wrap input{padding-right:10px;padding-left:31px}
html[dir="ltr"] .customer-result{text-align:start}
html[dir="ltr"] .kashf-sidebar-lock{margin-right:0;margin-inline-start:auto}
html[dir="ltr"] .side a{border-right:0;border-left:3px solid transparent}
html[dir="ltr"] :is(input[type="tel"],input[type="email"],input[inputmode="numeric"]){direction:ltr}
html[data-theme="dark"] body{background:var(--kf-bg)!important;color:var(--kf-text)!important}
html[data-theme="dark"] :is(.card,.panel,.stat,.box,.stat-card,.feature-card,.pricing-card,.price-card,.contact-card,.login-container,.register-container,.ledger-window,.mini-stat,.ledger-row,.section-card,.info-card,.summary-card,.table-wrap,.table-container,.modal-content,.modal-box,.sheet,.art,.sec,article,.side,.mobile,.filters,.notice,.alert,.checkbox-group){background-color:var(--kf-surface)!important;color:var(--kf-text);border-color:var(--kf-line)!important}
html[data-theme="dark"] :is(.hero,.white,.home-section,.stats-grid,.cta-section,.pagehead,.topbar,.head,.page-head,.heroContent,.heroin,.wrap,.layout){background-color:var(--kf-bg);color:var(--kf-text)}
html[data-theme="dark"] :is(.hero,.cta-section){background-image:linear-gradient(135deg,#10291e,#15261f)!important}
html[data-theme="dark"] :is(h1,h2,h3,h4,h5,h6,label,th,td,.logo-area p,.section-header p,.section-heading p,.feature-card p,.price-card p,.pricing-card p,.stat-card p,.footer-links,.footer-links a,.note,.form-group .note,.brandtxt,.brandtxt b){color:var(--kf-text)!important}
html[data-theme="dark"] :is(.muted,.mut,.hint,.small,.sub,.subtitle,.section-subtitle,.section-desc,.hero-content p,.feature-desc,.stat-label,.stat small,.stat .label){color:var(--kf-muted)!important}
html[data-theme="dark"] :is(input:not([type="submit"]),select,textarea){background-color:var(--kf-soft)!important;color:var(--kf-text)!important;border-color:var(--kf-line)!important}
html[data-theme="dark"] input::placeholder,html[data-theme="dark"] textarea::placeholder{color:#9cb4a6!important;opacity:1}
html[data-theme="dark"] :is(table,thead,tbody,tr,td,th){background-color:var(--kf-surface);border-color:var(--kf-line)!important}
html[data-theme="dark"] :is(th,tr:nth-child(even) td,.ledger-head,.ledger-summary,.sync-bar){background-color:var(--kf-soft)!important;color:var(--kf-text)}
html[data-theme="dark"] :is(.btn.light,.btn-secondary,.btn-login,.btn.ghost,.btn.ghost:hover,.auth-home-link,.pagination a,.nav a:not(.active)){background:var(--kf-soft)!important;color:var(--kf-text)!important;border-color:var(--kf-line)!important}
html[data-theme="dark"] :is(.kashf-sidebar,.kashf-sidebar-top,.kashf-sidebar-bottom){background-color:#102019;--kashf-sidebar-border:#345044}
html[data-theme="dark"] :is(.kashf-account-card,.kashf-sidebar .kashf-role){background:#1c3027;border-color:var(--kf-line)}
html[data-theme="dark"] :is(.green,.text-success,.money.pos){color:#69dfa4!important}
html[data-theme="dark"] :is(.red,.text-danger,.money.neg){color:#ff9999!important}
html[data-theme="dark"] .kf-header{background:var(--kf-soft)}
html[data-theme="dark"] .kf-brand :is(strong,small){color:var(--kf-text)}
html[data-theme="dark"] :is(.quick-card,.usage-card,.mini-card,.tool-card,.feature,.app-card,.contact-box,.sms-card,.plan-card,.plan,.service-card,.tpl-card,.option-card,.metric,.kpi,.payment-box,.bank-box,.request-card,.request-item,.filter-box,.empty-state,.tip,.tip-box,.help-box,.field-card,.field-row,.summary,.supplier-card,.debt-card,.customer-card,.product-card,.purchase-card){background:var(--kf-surface)!important;border-color:var(--kf-line)!important;color:var(--kf-text)}
html[data-theme="dark"] :is(.section-title,.number,.label,.usage-head,.usage-head span,.usage-note,.panel-title,.panel-head,.head-title,.total,.value,.info,.lbl,.help,.empty,.desc,.detail,.detail-row,.item-name,.plan-name){color:var(--kf-text)!important}
html[data-theme="dark"] :is(.quick-card .qicon,.progress,.stat-icon,.icon-box){background:var(--kf-soft)!important}
html[data-theme="dark"] :is(.badge,.status,.pill,.status-pill){background:var(--kf-soft)!important;color:var(--kf-text)!important;border-color:var(--kf-line)!important}
html[data-theme="dark"] :is(.badge.ok,.status.paid,.status-active){color:#80e8ad!important}
html[data-theme="dark"] :is(.badge.bad,.status.due,.status-ended){color:#ffa6a6!important}
html[data-theme="dark"] :is(.badge.warn,.status.part,.status-trial){color:#f4d286!important}
html[data-theme="dark"] :is(.topbar,.head,.panel-head){border-color:var(--kf-line)!important}
html[data-theme="dark"] :is(.usage-head strong,.quick-card p,.topbar p,.section-title,.stat-card .number){color:var(--kf-text)!important}
html[data-theme="dark"] :is(.stat .n,.stat b,.stat strong){color:var(--kf-text)!important}
html[data-theme="dark"] :is(p,small,.art p,.side a,.foot,.preview-message,.customer-result small){color:var(--kf-muted)!important}
html[data-theme="dark"] :is(.modal:not(#modal),.dialog,.modal-head,.modal-header,.customer-results,.customer-result,.stock-search-box,.stock-result,.field-item,.preview,.foot,.payment-info,.payment-details){background:var(--kf-surface)!important;color:var(--kf-text);border-color:var(--kf-line)!important}
html[data-theme="dark"] .side a.active{background:var(--kf-soft);color:var(--kf-accent)!important}
html[data-theme="dark"] .kf-header .kf-icon-button{background:var(--kf-surface);color:var(--kf-accent)}
html[data-page="index"] .kf-header .kf-icon-button{background:var(--kf-surface);color:var(--kf-accent)}
body:has(>.kf-header)>header.top{display:none}
.ui-message-page:has(>.kf-header){display:block;padding:0}
.ui-message-page>.ui-message-card{margin:48px auto;max-width:min(580px,calc(100% - 32px))}
html[data-theme="dark"] .ui-message-card{background:var(--kf-surface);color:var(--kf-text)}
html[data-theme="dark"] :is(.kf-header .kf-signup,.kf-mobile-auth .kf-signup){color:var(--kf-accent)}
@media(min-width:1201px) and (max-width:1390px){.kf-header-inner{gap:14px;padding-inline:18px}.kf-desktop-nav{gap:12px}.kf-desktop-nav>a{font-size:12px}.kf-brand strong{font-size:17px}.kf-brand small{font-size:9px}.kf-header-actions{gap:8px}.kf-header .kf-signup{padding-inline:12px}}
@media(max-width:1200px){:root{--kf-header-height:76px}.kf-desktop-nav,.kf-header-actions>.kf-login,.kf-header-actions>.kf-signup,.kf-header-actions>.kf-desktop-language{display:none}.kf-menu-toggle{display:inline-flex}.kf-header-inner{padding:10px 20px;gap:12px}.kf-header-actions{flex-direction:row;gap:12px}}
@media(max-width:992px){html[data-area="app"] main{margin:0!important;width:100%;padding-block-start:24px}.kf-header~.kashf-sidebar{display:none}}
@media(max-width:1200px){html[data-area="admin"] body:has(>.kf-header) main.wrap>.nav{display:none}}
@media(max-width:480px){.kf-header-inner{padding:10px 18px;gap:10px}.kf-brand{gap:8px}.kf-brand img{width:46px;height:46px}.kf-brand strong{font-size:17px}.kf-brand small{font-size:8px;max-width:190px}.kf-header-actions{gap:10px}.kf-icon-button{width:44px;height:44px}.kf-header-actions .kf-menu-toggle{font-size:22px}:where(html[data-page="login"],html[data-page="register"],html[data-page="forgot-password"]) body:has(>.kf-header)>:is(.login-container,.register-container){padding:24px 20px;margin-block:24px}}
@media(max-width:380px){.kf-header-inner{padding-inline:12px;gap:8px}.kf-brand img{width:40px;height:40px}.kf-brand strong{font-size:15px}.kf-brand small{font-size:7px;max-width:150px}.kf-header-actions{gap:8px}}
@media(prefers-reduced-motion:no-preference){.kf-icon-button,.kf-languages button{transition:background-color .15s,color .15s}}
@media print{.kf-header,.kf-mobile-menu,.kf-menu-backdrop{display:none!important}html[data-theme="dark"] body{background:#fff!important;color:#000!important}html[data-theme="dark"] :is(table,thead,tbody,tr,td,th,.card,.panel){background:#fff!important;color:#000!important}}

/* Platform: the original sidebar is the sole menu, with compact corner tools. */
.kf-app-preferences{position:fixed;inset-block-start:14px;inset-inline-end:18px;z-index:9101;display:flex;align-items:center;gap:8px;padding:5px;border:1px solid var(--kf-line);border-radius:16px;background:var(--kf-surface);box-shadow:0 3px 14px #10251c0a;color:var(--kf-text)}
body:has(>.kf-app-preferences)>.kashf-sidebar{top:0}
html[data-area="app"] body:has(>.kf-app-preferences)>main{padding-block-start:86px}
body:has(>.kf-app-preferences)>.kashf-sidebar-menu-button{left:auto;right:auto;inset-inline-start:14px;inset-inline-end:auto;top:19px}
html[data-area="admin"] body:has(>.kf-app-preferences)>.top .topin{padding-inline-end:200px;min-height:82px}
.ui-message-page:has(>.kf-app-preferences){display:block;padding:86px 0 0}
@media(max-width:992px){body:has(>.kf-app-preferences)>.kashf-sidebar{display:flex}html[dir="ltr"] body:has(>.kf-app-preferences)>.kashf-sidebar{transform:translateX(-100%)}html[dir="ltr"] body:has(>.kf-app-preferences)>.kashf-sidebar.is-open{transform:translateX(0)}}
@media(max-width:480px){.kf-app-preferences{inset-inline-end:12px;gap:6px;padding:4px}.kf-app-preferences .kf-languages button{min-width:34px;padding-inline:6px}.kf-app-preferences .kf-icon-button{width:42px;height:42px}html[data-area="admin"] body:has(>.kf-app-preferences)>.top .topin{padding-block-start:80px;padding-inline-end:18px}}
@media print{.kf-app-preferences{display:none!important}html[data-area="app"] body:has(>.kf-app-preferences)>main{padding-block-start:0}}

/* Map the personal palette to controls whose colors are set in older page styles. */
html[data-area="app"][data-dxcel-custom] {
  --kf-accent:var(--dxcel-accent);
  --ui-focus:var(--kf-accent);
  --dxcel-action-secondary:var(--dxcel-secondary,var(--dxcel-accent));
  --dxcel-on-action-secondary:var(--dxcel-on-secondary,var(--dxcel-on-accent));
}

@supports (color: color-mix(in srgb, black, white)) {
  html[data-area="app"][data-dxcel-custom] {
    --kf-accent:color-mix(in srgb,var(--kf-text) 60%,var(--dxcel-accent));
  }
}

html[data-area="app"][data-dxcel-custom] :is(
  .btn.primary,.btn-primary,.btn.green,.btn-green,.action-btn.green,.icon-btn.green,.page-link.active,
  .dxcel-panel [data-device],.dxcel-panel [data-invite-enable],.dxcel-install [data-install-button]
) {
  background:var(--dxcel-accent);
  border-color:var(--dxcel-accent);
  color:var(--dxcel-on-accent);
}

html[data-area="app"][data-dxcel-custom]:is([data-page="settings"],[data-page="subscription"]) .btn:where(:not(.red,.danger,.bad,.warn)),
html[data-area="app"][data-dxcel-custom][data-page="subscription"] :is(.plan.current-plan .btn,.tab.on),
html[data-area="app"][data-dxcel-custom][data-page="sms_external"] :is(.btn,main button:not(.tabs button,.tokens button),.tabs button.active),
html[data-area="app"][data-dxcel-custom]:is([data-page="sms_center"],[data-page="sms_sim"]) .tab.active,
html[data-area="app"][data-dxcel-custom][data-page="inventory"] .go:not(.secondary) {
  background:var(--dxcel-accent);
  border-color:var(--dxcel-accent);
  color:var(--dxcel-on-accent);
}

html[data-area="app"][data-dxcel-custom][data-theme="dark"] :is(.btn,.action-btn,.icon-btn).green {
  color:var(--dxcel-on-accent)!important;
}

html[data-area="app"][data-dxcel-custom][data-page="subscription"] .plan:not(.current-plan) .choosePlan,
html[data-area="app"][data-dxcel-custom][data-page^="inventory"] :is(.go.secondary,.btn.secondary),
html[data-area="app"][data-dxcel-custom][data-page="inventory_stock"] .btn:where(:not(.primary,.red,.danger,.bad,.warn)),
html[data-area="app"][data-dxcel-custom] :is(.btn.soft,.btn.dark,.action-btn.teal,.option-add-btn),
html[data-area="app"][data-dxcel-custom][data-page="sms_external"] .tokens button {
  background:var(--dxcel-action-secondary);
  border-color:var(--dxcel-action-secondary);
  color:var(--dxcel-on-action-secondary);
}

html[data-area="app"][data-dxcel-custom] :is(input[type="checkbox"],input[type="radio"]) {
  accent-color:var(--dxcel-accent);
}

html[data-area="app"][data-dxcel-custom] :is(
  .toggle input:checked+span,.menu-toggle input:checked+span,
  .progress>span,.bar>span
) {
  background:var(--dxcel-accent);
}

html[data-area="app"][data-dxcel-custom] :is(button,a,input,select,textarea):focus-visible {
  outline:2px solid var(--kf-accent);
  outline-offset:2px;
}
