:root{
  --navy:#071d35;
  --blue:#0d3b66;
  --cyan:#08a9d6;
  --green:#08a763;
  --orange:#f5a623;
  --red:#d9363e;
  --bg:#f3f7fb;
  --line:#d7e0e9;
  --text:#172b3d;
  --muted:#66788a;
  --sidebar:245px;
}
*{box-sizing:border-box}
body{margin:0;font:14px/1.45 Manrope,Segoe UI,Arial,sans-serif;background:var(--bg);color:var(--text)}
a{color:inherit;text-decoration:none}
button,input,select,textarea{font:inherit}
.app{min-height:100vh}
.sidebar{
  position:fixed;inset:0 auto 0 0;width:var(--sidebar);overflow:auto;
  background:linear-gradient(180deg,#061a2f,#07365a 68%,#075376);
  color:#e8f6fb;padding:18px 12px;display:flex;flex-direction:column;gap:12px;
  box-shadow:5px 0 22px #0b294025;z-index:40;
  transition:transform .28s ease;
}
.sidebar-backdrop{
  position:fixed;inset:0;background:#04182ccc;z-index:35;
  opacity:0;pointer-events:none;transition:opacity .28s ease;
}
.brand-block{display:flex;gap:12px;align-items:center;padding:8px 10px 14px;position:relative}
.brand-block strong{display:block;font-size:14px}
.brand-block small{color:#9ec9d8}
.sidebar-close{
  display:none;margin-left:auto;border:0;background:#ffffff18;color:#fff;
  width:36px;height:36px;border-radius:10px;font-size:22px;line-height:1;cursor:pointer;
}
.topbar-left{display:flex;align-items:center;gap:12px;min-width:0}
.topbar-left h2{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.nav-burger{
  display:none;flex-direction:column;justify-content:center;gap:5px;
  width:40px;height:40px;padding:8px;border:0;border-radius:10px;
  background:#eef5f9;cursor:pointer;flex:0 0 auto;
}
.nav-burger span{
  display:block;height:2px;width:100%;background:var(--blue);border-radius:2px;
  transition:transform .2s ease,opacity .2s ease;
}
.drop{
  width:42px;height:50px;flex:0 0 auto;
  background:linear-gradient(160deg,#20c6eb,#0277bd);
  border-radius:55% 45% 60% 40%;transform:rotate(45deg);
  box-shadow:inset 6px 6px 14px #fff5;
}
.nav{display:flex;flex-direction:column;gap:4px;flex:1}
.nav-header{margin:12px 10px 4px;font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:#8fb9c8}
.nav-btn,.nav-link{
  display:flex;align-items:center;justify-content:space-between;gap:8px;
  width:100%;border:0;background:transparent;color:#e8f6fb;text-align:left;
  padding:10px 12px;border-radius:10px;cursor:pointer;
}
.nav-btn:hover,.nav-link:hover,.nav-btn.active,.nav-link.active{
  background:linear-gradient(90deg,#08a9d644,#ffffff13);border-left:3px solid #3de0f2;
}
.nav-group .nav-sub{display:none;padding:4px 0 6px 12px}
.nav-group.open .nav-sub{display:flex;flex-direction:column;gap:2px}
.nav-group .caret{opacity:.7;font-size:11px}
.userbox{padding:12px;border-top:1px solid #ffffff22;margin-top:auto}
.userbox small{color:#9ec9d8}
.main{margin-left:var(--sidebar);min-height:100vh}
.topbar{
  position:sticky;top:0;z-index:10;display:flex;align-items:center;justify-content:space-between;
  gap:16px;padding:14px 22px;background:#fffffff2;border-bottom:1px solid var(--line);backdrop-filter:blur(8px)
}
.topbar h2{margin:0;font-size:18px}
.topbar-actions{display:flex;align-items:center;gap:10px;flex-shrink:0}
.user-chip{background:#e8f6fb;color:var(--blue);padding:6px 10px;border-radius:999px;font-weight:650}
.content{padding:20px 22px 40px}
.panel,.card{
  background:linear-gradient(145deg,#fff,#f4fbfd);border:1px solid var(--line);
  border-radius:14px;box-shadow:0 6px 22px #17324d0d;padding:16px
}
.card{border-top:4px solid var(--cyan)}
.grid{display:grid;gap:14px}
.grid-4{grid-template-columns:repeat(4,minmax(0,1fr))}
@media(max-width:1100px){.grid-4{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:991px){
  .nav-burger{display:flex}
  .sidebar-close{display:inline-flex;align-items:center;justify-content:center}
  .sidebar{
    transform:translateX(-105%);
    width:min(var(--sidebar),86vw);
  }
  .sidebar-open .sidebar{transform:translateX(0)}
  .sidebar-open .sidebar-backdrop{
    opacity:1;pointer-events:auto;
  }
  .sidebar-open{overflow:hidden}
  .main{margin-left:0}
  .topbar{padding:12px 14px}
  .content{padding:16px 14px 32px}
  .user-chip{display:none}
}
@media(max-width:720px){
  .grid-4{grid-template-columns:1fr}
  .toolbar{flex-direction:column;align-items:stretch}
}
.kpi-label{color:var(--muted);font-size:12px}
.kpi-value{font-size:24px;font-weight:700;margin-top:4px}
.table-wrap{
  overflow-x:auto;
  overflow-y:hidden;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior-x:contain;
  max-width:100%;
}
table{width:100%;border-collapse:collapse}

@media(max-width:991px){
  .content .table-wrap,
  .content .panel.table-wrap,
  .content *:has(> table){
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
    max-width:100%;
  }
  .content table{
    width:max-content;
    min-width:100%;
  }
  .content th,
  .content td{white-space:nowrap}
  .content .wrap-cell,
  .content .invoice-items{white-space:normal}
}

@media print{
  .table-wrap,
  .content *:has(> table){overflow:visible!important}
  .content table{width:100%!important;min-width:0!important}
  .content th,
  .content td{white-space:normal!important}
}
th,td{padding:10px 12px;border-bottom:1px solid var(--line);text-align:left}
th{background:linear-gradient(135deg,var(--blue),#0e5f8b);color:#fff;font-weight:650}
tbody tr:nth-child(even){background:#f7fbfd}
tbody tr:hover{background:#eaf7fb}
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:6px;
  border:0;border-radius:9px;padding:9px 14px;cursor:pointer;font-weight:650;
  box-shadow:0 3px 8px #17324d18
}
.btn-primary{background:linear-gradient(135deg,#08a9d6,#0d6f9a);color:#fff}
.btn-ghost{background:#eef5f9;color:var(--blue);box-shadow:none}
.btn-make-order{
  background:#fff!important;color:#0f172a!important;
  border:1px solid #e2e8f0;border-radius:999px;font-weight:750;
  box-shadow:0 1px 2px #0f172a14
}
.btn-danger{background:var(--red);color:#fff}
.btn-block{width:100%}
.field{margin:12px 0}
.field label{display:block;font-weight:650;margin-bottom:6px}
.field input,.field select,.field textarea{
  width:100%;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:#fff
}
.field input:focus,.field select:focus,.field textarea:focus{
  outline:2px solid #08a9d655;border-color:var(--cyan)
}
.remember{display:flex;align-items:center;gap:8px;margin:10px 0 16px;color:var(--muted)}
.alert{padding:10px 12px;border-radius:10px;margin-bottom:14px}
.alert-success{background:#e8f8ef;color:#0b6b3a;border:1px solid #b7e4c7}
.alert-error{background:#fdecec;color:#8f1d22;border:1px solid #f5c2c5}
.alert ul{margin:0;padding-left:18px}
.hint{color:var(--muted);font-size:12px;text-align:center;margin-top:14px}
.toolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:14px}
.badge{display:inline-block;padding:3px 8px;border-radius:999px;background:#e8f6fb;color:var(--blue);font-size:12px;font-weight:650}
.badge.on{background:#dff7ea;color:#0d7a4d}
.badge.off{background:#ffe3e3;color:#b42318}
.btn-sm,.btn.sm{padding:5px 10px;font-size:12px;border-radius:8px}
.users-admin-table input{max-width:100%}
.login-body{min-height:100vh}
.login{
  min-height:100vh;display:grid;grid-template-columns:1.1fr .9fr;
  background:radial-gradient(circle at 80% 10%,#0d82a8 0,#0b4e78 28%,#04182c 76%)
}
.login-hero{background-size:cover;background-position:center;min-height:100vh}
.login-card{
  margin:auto;width:min(420px,92vw);background:#fffffff2;border-radius:22px;
  padding:34px;box-shadow:0 28px 80px #0007
}
.login .brand{text-align:center;margin-bottom:8px}
.login .brand h1{font-size:18px;line-height:1.35;margin:14px 0 6px;color:var(--navy)}
.login .brand p{color:var(--muted);margin:0 0 18px}
.login .drop{margin:auto}
.login-brand-logo{
  width:88px;height:88px;object-fit:contain;margin:0 auto;
  display:block;border-radius:18px;background:#fff;
  box-shadow:0 8px 24px #0d3b6622;border:1px solid var(--line);
}
@media(max-width:900px){
  .login{grid-template-columns:1fr}
  .login-hero{display:none}
}
.perm-module{margin-bottom:16px}
.perm-module h4{margin:0 0 8px;color:var(--blue)}
.perm-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:8px}
.perm-item{display:flex;gap:8px;align-items:flex-start;padding:8px;border:1px solid var(--line);border-radius:10px;background:#fff}

/* Accordion permission matrix (Roles / User Permissions) */
.perm-matrix{
  --perm-accent:#6d5efc;
  --perm-accent-soft:#efeaff;
  border:1px solid #e6e8f0;
  border-radius:14px;
  background:#fff;
  padding:14px 16px 10px;
}
.perm-matrix-head{
  display:flex;align-items:flex-start;justify-content:space-between;gap:12px;flex-wrap:wrap;
  margin-bottom:12px;
}
.perm-matrix-title{display:flex;align-items:center;gap:8px}
.perm-matrix-title h3{margin:0;font-size:18px;color:#1f2430}
.perm-matrix-key{color:var(--perm-accent);display:inline-flex}
.perm-matrix-actions{display:flex;flex-direction:column;align-items:flex-end;gap:8px}
.btn-perm-save{
  display:inline-flex;align-items:center;gap:8px;
  background:var(--perm-accent);color:#fff;border:0;border-radius:10px;
  padding:10px 16px;font-weight:700;cursor:pointer;box-shadow:0 8px 18px rgba(109,94,252,.28);
}
.btn-perm-save:hover{filter:brightness(1.05)}
.perm-select-all{
  display:inline-flex;align-items:center;gap:8px;color:var(--perm-accent);font-weight:700;font-size:13px;cursor:pointer;
}
.perm-select-all input{accent-color:var(--perm-accent);width:18px;height:18px}
.perm-matrix-search{
  display:flex;align-items:center;gap:10px;
  border:1px solid #e1e4ee;border-radius:12px;padding:10px 12px;margin-bottom:12px;background:#fff;color:#8b93a7;
}
.perm-matrix-search input{
  border:0;outline:0;width:100%;background:transparent;font:inherit;color:#1f2430;
}
.perm-matrix-list{display:flex;flex-direction:column;gap:8px}
.perm-acc{
  border:1px solid #e6e8f0;border-radius:12px;background:#fff;overflow:hidden;
}
.perm-acc-head{display:flex;align-items:center;gap:4px;padding:4px 6px 4px 10px}
.perm-acc-check{display:inline-flex;padding:8px 4px}
.perm-acc-check input{accent-color:var(--perm-accent);width:16px;height:16px}
.perm-acc-toggle{
  flex:1;display:flex;align-items:center;gap:10px;border:0;background:transparent;
  padding:10px 8px;cursor:pointer;text-align:left;font:inherit;color:#1f2430;
}
.perm-acc-icon{
  width:28px;height:28px;border-radius:8px;background:var(--perm-accent-soft);color:var(--perm-accent);
  display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;
}
.perm-acc-icon:before{font-size:14px;line-height:1}
.perm-icon-home:before{content:"⌂"}
.perm-icon-users:before{content:"☷"}
.perm-icon-folder:before{content:"▤"}
.perm-icon-report:before{content:"▥"}
.perm-icon-settings:before{content:"⚙"}
.perm-icon-cash:before{content:"₹"}
.perm-acc-name{font-weight:750;flex:1}
.perm-acc-count{
  font-size:12px;color:#8b93a7;background:#f3f4f8;border-radius:999px;padding:3px 8px;font-weight:650;
}
.perm-acc-chevron{
  width:8px;height:8px;border-right:2px solid #9aa3b5;border-bottom:2px solid #9aa3b5;
  transform:rotate(-45deg);transition:transform .15s ease;margin:0 6px;
}
.perm-acc.is-open .perm-acc-chevron{transform:rotate(45deg)}
.perm-acc-body{border-top:1px solid #eef0f5;padding:12px 14px 14px;background:#fafbfe}
.perm-acc-grid{
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px 14px;
}
.perm-chip{
  display:flex;align-items:center;gap:8px;flex-wrap:wrap;
  padding:8px 10px;border:1px solid #e6e8f0;border-radius:10px;background:#fff;cursor:pointer;
}
.perm-chip.is-checked{border-color:#cfc8ff;background:#faf8ff}
.perm-chip.is-locked{opacity:.78;cursor:not-allowed}
.perm-chip input{accent-color:var(--perm-accent);width:15px;height:15px}
.perm-chip-label{font-weight:650;font-size:13px;color:#243044}
.perm-badge{
  display:inline-block;padding:2px 8px;border-radius:999px;font-size:11px;font-weight:700;text-transform:lowercase;
}
.perm-badge-view{background:#d9f7fb;color:#0b8fa3}
.perm-badge-create{background:#ddf8e8;color:#1a8f55}
.perm-badge-edit{background:#ebe4ff;color:#6a4fd8}
.perm-badge-delete{background:#ffe0ea;color:#d12b63}
.perm-badge-approval{background:#ffe8d4;color:#c45d12}
.perm-badge-print,
.perm-badge-export,
.perm-badge-action{background:#eef0f4;color:#667085}
.perm-locked-tag{font-size:10px;color:#8b93a7;font-weight:650}
@media (max-width:900px){
  .perm-acc-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:640px){
  .perm-acc-grid{grid-template-columns:1fr}
  .perm-matrix-actions{align-items:stretch;width:100%}
  .btn-perm-save{justify-content:center}
}

.muted{color:var(--muted)}

/* —— Salesman: side menu on desktop, bottom nav on mobile —— */
.app-salesman .topbar{
  background:#fff;
  box-shadow:0 5px 22px #15334d0b;
}
.app-salesman .content{
  background:
    radial-gradient(circle at 96% 3%,#dff7ff 0,transparent 25%),
    radial-gradient(circle at 8% 92%,#eee7ff 0,transparent 28%),
    #eef3f9;
}
.topbar-title-wrap{display:flex;flex-direction:column;gap:6px;min-width:0}
.version-pill{
  display:inline-flex;align-items:center;width:fit-content;
  background:#d9f7e5;color:#0b6b3a;font-size:12px;font-weight:800;
  padding:4px 12px;border-radius:999px;
}
.btn-notify{
  display:inline-flex;align-items:center;gap:8px;position:relative;
  border:0;border-radius:14px;padding:10px 14px;cursor:pointer;
  background:linear-gradient(135deg,#0b3a5c,#155e8a);color:#fff;font-weight:700;
  box-shadow:0 8px 20px #0b3a5c33;
}
.btn-notify .bell{font-size:14px}
.btn-notify-badge{
  display:none;min-width:18px;height:18px;padding:0 5px;
  border-radius:999px;background:#e11d48;color:#fff;
  font-size:11px;font-weight:800;line-height:18px;text-align:center;
}
.btn-notify-badge.is-on{display:inline-flex;align-items:center;justify-content:center}
.notify-modal{
  position:fixed;inset:0;z-index:220;display:grid;place-items:center;
  padding:14px;background:#001722d9
}
.notify-modal[hidden]{display:none!important}
.notify-card{
  position:relative;width:min(650px,96vw);max-height:80vh;overflow:auto;
  padding:22px 22px 16px;border-radius:20px;background:#fff
}
.notify-card h3{margin:0 36px 14px 0;color:#071d35}
.notify-list{display:flex;flex-direction:column;gap:4px}
.notify-item{padding:12px 0;border-bottom:1px solid #e5eef5}
.notify-item:last-child{border-bottom:0}
.notify-item.is-unread{background:#f0fbf7;margin:0 -10px;padding:12px 10px;border-radius:12px;border-bottom:0}
.notify-item strong,.notify-item a{display:block;color:#071d35;font-weight:800;text-decoration:none}
.notify-item a:hover{color:#08a9d6}
.notify-item div{margin:4px 0;color:#172b3d}
.notify-item small{color:#66788a}
.notify-empty{margin:8px 0 0;color:#66788a}

.executive-hero{
  position:relative;overflow:hidden;
  display:flex;align-items:flex-end;justify-content:space-between;gap:16px;flex-wrap:wrap;
  border-radius:22px;padding:22px 20px;
  color:#fff;
  background:linear-gradient(125deg,#5b21b6 0%,#6d28d9 42%,#1d4ed8 100%);
  box-shadow:0 18px 40px #4c1d9533;
  margin-bottom:14px;
}
.executive-hero:before,.executive-hero:after{
  content:"";position:absolute;border-radius:50%;border:2px solid #ffffff22;pointer-events:none;
}
.executive-hero:before{width:180px;height:180px;right:-40px;top:-50px}
.executive-hero:after{width:120px;height:120px;right:30px;bottom:-40px;border-color:#ffffff18}
.executive-hero-copy{position:relative;z-index:1;max-width:520px}
.executive-hero .eyebrow{
  display:block;font-size:11px;letter-spacing:.14em;font-weight:800;opacity:.85;margin-bottom:8px;
}
.executive-hero h1{margin:0 0 8px;font-size:clamp(22px,5vw,30px);line-height:1.15;font-weight:800}
.executive-hero p{margin:0;opacity:.9;font-size:14px}
.hero-date{
  position:relative;z-index:1;
  background:#ffffff24;backdrop-filter:blur(10px);
  border:1px solid #ffffff33;border-radius:16px;padding:12px 14px;min-width:min(220px,100%);
}
.hero-date label{display:block;font-size:12px;font-weight:700;margin-bottom:6px;opacity:.9}
.hero-date input{
  width:100%;border:0;border-radius:10px;padding:10px 12px;background:#fff;color:#10263a;font-weight:650;
}

.executive-kpis{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;
}
.executive-kpis article{
  position:relative;overflow:hidden;border-radius:20px;padding:16px;color:#fff;
  min-height:128px;display:flex;flex-direction:column;justify-content:space-between;
  box-shadow:0 14px 30px #17324d22;
}
.executive-kpis article:before{
  content:"";position:absolute;inset:auto -20px -30px auto;width:110px;height:110px;
  border-radius:50%;border:2px solid #ffffff25;
}
.executive-kpis i{font-style:normal;font-size:18px;opacity:.9}
.executive-kpis span{font-size:13px;font-weight:750;opacity:.95}
.executive-kpis b{font-size:clamp(20px,5vw,26px);font-weight:800;font-variant-numeric:tabular-nums}
.executive-kpis b small{font-size:12px;font-weight:700;opacity:.85}
.executive-kpis em{font-style:normal;font-size:12px;opacity:.85}
.grad-violet{background:linear-gradient(145deg,#7c3aed,#5b21b6)}
.grad-blue{background:linear-gradient(145deg,#2563eb,#1d4ed8)}
.grad-green{background:linear-gradient(145deg,#059669,#047857)}
.grad-orange{background:linear-gradient(145deg,#f59e0b,#d97706)}

.bottom-nav{display:none}

@media(min-width:992px){
  .app-salesman .content{padding:22px}
  .executive-kpis{grid-template-columns:repeat(4,minmax(0,1fr))}
  .app-salesman .bottom-nav{display:none!important}
}

@media(max-width:991px){
  /* Salesman mobile: hide side menu, show bottom nav */
  .app-salesman .sidebar,
  .app-salesman .sidebar-backdrop,
  .app-salesman .nav-burger,
  .app-salesman .logout-form,
  .app-salesman .user-chip{
    display:none!important;
  }
  .app-salesman .main{margin-left:0}
  .app-salesman .content{padding:16px 14px 110px}
  .app-salesman .bottom-nav{
    display:flex;align-items:stretch;justify-content:space-around;gap:4px;
    position:fixed;left:0;right:0;bottom:0;z-index:50;
    height:82px;padding:8px 6px calc(8px + env(safe-area-inset-bottom));
    background:linear-gradient(180deg,#0b1f33,#071525);
    box-shadow:0 -10px 30px #0006;
  }
  .app-salesman .bottom-nav.is-scrollable{
    justify-content:flex-start;
    gap:6px;
    overflow-x:auto;
    overflow-y:hidden;
    -webkit-overflow-scrolling:touch;
    scroll-snap-type:x proximity;
    scrollbar-width:none;
  }
  .app-salesman .bottom-nav.is-scrollable::-webkit-scrollbar{display:none}
  .bottom-nav-item{
    flex:1 1 0;min-width:0;max-width:96px;
    display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;
    border-radius:16px;padding:8px 4px;color:#d7e6f2;text-decoration:none;
  }
  .bottom-nav.is-scrollable .bottom-nav-item{
    flex:0 0 auto;
    width:76px;
    min-width:76px;
    max-width:none;
    scroll-snap-align:start;
  }
  .bottom-nav-item.active{
    background:#ffffff18;color:#fff;font-weight:800;
    box-shadow:inset 0 0 0 1px #ffffff22;
  }
  .bottom-nav-icon{
    width:28px;height:28px;border-radius:8px;
    background-size:contain;background-repeat:no-repeat;background-position:center;
  }
  .bottom-nav-item[data-icon="dashboard"] .bottom-nav-icon{
    background:
      linear-gradient(#a78bfa,#a78bfa) 2px 10px / 5px 14px no-repeat,
      linear-gradient(#60a5fa,#60a5fa) 10px 4px / 5px 20px no-repeat,
      linear-gradient(#f472b6,#f472b6) 18px 12px / 5px 12px no-repeat;
    border-radius:0;
  }
  .bottom-nav-item[data-icon="truck"] .bottom-nav-icon{
    background:linear-gradient(145deg,#fbbf24,#f59e0b);border-radius:6px;position:relative;
  }
  .bottom-nav-item[data-icon="truck"] .bottom-nav-icon:after{
    content:"";position:absolute;inset:6px 5px;border:2px solid #fff8;border-radius:3px;
  }
  .bottom-nav-item[data-icon="sales"] .bottom-nav-icon{
    background:
      radial-gradient(circle at 30% 35%,#fb7185 0 35%,transparent 36%),
      radial-gradient(circle at 70% 40%,#fdba74 0 28%,transparent 29%),
      linear-gradient(145deg,#ef4444,#ea580c);
    border-radius:6px;
  }
  .bottom-nav-item[data-icon="customers"] .bottom-nav-icon{
    background:
      linear-gradient(#38bdf8,#38bdf8) center 6px / 16px 2px no-repeat,
      linear-gradient(#38bdf8,#38bdf8) center 14px / 16px 2px no-repeat,
      linear-gradient(#38bdf8,#38bdf8) center 22px / 12px 2px no-repeat,
      linear-gradient(145deg,#0ea5e9,#0369a1);
    border-radius:6px;
  }
  .bottom-nav-item[data-icon="payments"] .bottom-nav-icon{
    background:
      radial-gradient(circle at 50% 50%,#fde68a 0 28%,transparent 29%),
      linear-gradient(145deg,#eab308,#a16207);
    border-radius:50%;
  }
  .bottom-nav-item[data-icon="reports"] .bottom-nav-icon{
    background:
      linear-gradient(#7dd3fc,#7dd3fc) 4px 18px / 6px 8px no-repeat,
      linear-gradient(#38bdf8,#38bdf8) 12px 10px / 6px 16px no-repeat,
      linear-gradient(#0284c7,#0284c7) 20px 6px / 6px 20px no-repeat,
      linear-gradient(145deg,#0369a1,#0c4a6e);
    border-radius:6px;
  }
  .bottom-nav-item[data-icon="account"] .bottom-nav-icon{
    background:
      radial-gradient(circle at 50% 38%,#fff 0 28%,transparent 29%),
      linear-gradient(145deg,#22c55e,#15803d);
    border-radius:8px;
  }
  .bottom-nav-label{font-size:11px;font-weight:750;line-height:1.1;text-align:center}
}

@media(max-width:720px){
  .app-salesman .topbar{padding:12px 14px}
  .btn-notify .notify-label{display:none}
  .btn-notify{padding:10px 12px;border-radius:12px}
  .executive-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* —— Factory Control Center dashboard (doc/Dashboard.pdf) —— */
.brand-logo{
  width:52px;height:52px;border-radius:50%;object-fit:cover;flex:0 0 auto;
  background:#fff;border:2px solid #ffffff55;
}
.brand-block{align-items:flex-start}
.brand-text{min-width:0;flex:1}
.brand-text strong{
  display:block;font-size:12px;line-height:1.25;font-weight:800;
  white-space:normal;
}
.brand-text small{display:block;color:#8eb5d3;margin-top:4px;font-weight:500}

.working-date-form{
  display:flex;align-items:center;gap:10px;
}
.working-date-form label{font-size:13px;color:var(--muted);font-weight:650;white-space:nowrap}
.working-date-form input{
  border:1px solid var(--line);border-radius:8px;padding:8px 10px;background:#fff;min-width:150px;
}
.topbar-title-wrap{display:flex;flex-direction:column;gap:6px;min-width:0}
.app-body:not(.role-salesman) .topbar{
  height:72px;padding:0 28px;
}

.factory-kpis{
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin:0 0 18px;width:100%
}
.factory-kpis .card{
  width:100%;max-width:100%;
  border-left:0;border-top:4px solid var(--cyan);
  background:#fff;padding:18px;
}
.factory-kpis .card span{display:block;color:var(--muted);font-size:13px;line-height:1.35}
.factory-kpis .card b{
  display:block;font-size:36px;line-height:1.1;margin-top:10px;
  font-weight:900;font-variant-numeric:tabular-nums
}
.factory-kpis .card b.ok,
.factory-kpis .card b.low{
  font-size:36px;font-weight:900
}
.factory-kpis .card-cyan,.factory-dash .card-cyan{border-top-color:var(--cyan)}
.factory-kpis .card-green,.factory-dash .card-green{border-top-color:var(--green)}
.factory-kpis .card-orange,.factory-dash .card-orange{border-top-color:var(--orange)}
.factory-kpis .card-violet,.factory-dash .card-violet{border-top-color:#7557d8}

/* Single KPI row (e.g. Petty Cash): keep card at 25% width */
.factory-kpis.factory-kpis-single{
  display:block;width:100%
}
.factory-kpis.factory-kpis-single > .card{
  width:25%;max-width:25%;box-sizing:border-box
}
@media(max-width:1100px){
  .factory-kpis.factory-kpis-single > .card{width:50%;max-width:50%}
}
@media(max-width:720px){
  .factory-kpis.factory-kpis-single > .card{width:50%;max-width:50%}
}

.grid2{display:grid;grid-template-columns:1fr 1fr;gap:18px}
.factory-stock-grid .panel{margin-bottom:0}
.factory-stock-grid .panel h3{margin:0 0 14px;font-size:16px}
.ok{color:var(--green);font-weight:750}
.low{color:var(--red);font-weight:800}
td.num,th.num{text-align:right;font-variant-numeric:tabular-nums}

.entry-grid{
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px 14px
}
.entry-grid .field{margin:8px 0}
.entry-grid .field.wide{grid-column:1/-1}
.line-input{
  width:100%;max-width:110px;padding:8px 10px;border:1px solid var(--line);
  border-radius:8px;background:#fff
}
.entry-total td{font-weight:800;background:#e8f6fb}
.is-hidden{display:none!important}
.muted{color:var(--muted);font-size:12px;margin-top:2px}
.actions-cell{white-space:nowrap}
.actions-cell .btn{padding:6px 10px;font-size:12px}
.panel + .panel{margin-top:16px}
#truck-entry-form .panel{margin-bottom:16px}
.hr-tabs{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 16px}
.hr-tabs .btn{box-shadow:none}
.leave-status{display:inline-block;padding:4px 10px;border-radius:999px;font-size:12px;font-weight:750}
.leave-status-work{background:#dff7ea;color:#0d7a4d}
.leave-status-leave{background:#ffe3e3;color:#b42318}
.attendance-on-leave{background:#fff7f0}

/* Truck Details (enhanced py_app parity) */
.truck-context-header{
  display:flex;align-items:center;justify-content:space-between;gap:18px;
  padding:20px 24px!important;border:0!important;
  margin-bottom: 10px;
  background:linear-gradient(110deg,#07354f,#087a91,#6d28d9)!important;color:#fff!important
}
.truck-context-header h2{margin:4px 0 0;font-size:1.25rem;color:#fff}
.truck-switch-eyebrow{font-size:9px;letter-spacing:2px;font-weight:900;opacity:.72}
.truck-context-actions{display:flex;align-items:center;gap:9px}
.truck-context-actions select{
  min-width:180px;padding:10px 34px 10px 12px;border:1px solid #ffffff55;border-radius:11px;
  background:#ffffff1a;color:#fff;font-weight:750
}
.truck-context-actions select option{color:#153047;background:#fff}
.truck-context-actions .btn{
  background:#ffffff1c;color:#fff;border:1px solid #ffffff4d;box-shadow:none
}

/* Sales centre (New Sale workspace) */
.sales-centre-head{
  padding:20px 24px;border-radius:18px 18px 0 0;color:#fff;
  background:linear-gradient(120deg,#0f172a,#1d4ed8,#0891b2)
}
.sales-centre-head span{font-size:9px;letter-spacing:2px;font-weight:900;display:block}
.sales-centre-head h2,.sales-centre-head p{margin:3px 0}
.sales-centre-head h2{font-size:26px}
.sales-centre-head p{opacity:.88}
.sales-centre-tabs{
  display:flex;gap:7px;padding:10px;margin:0 0 16px;border-radius:0 0 16px 16px;
  background:#fff;box-shadow:0 6px 20px #10263a0d;overflow:auto
}
.sales-centre-tabs a{
  flex:1;min-width:125px;padding:10px;border-radius:9px;text-align:center;text-decoration:none;
  background:#eaf0f5;color:#164e63;font-weight:800
}
.sales-centre-tabs a.active{
  color:#fff;background:linear-gradient(110deg,#2563eb,#0891b2)
}
.previous-date-note{
  margin:0 0 14px;padding:10px 12px;border-radius:10px;border:1px solid #bfdbfe;
  background:#eff6ff;color:#1e40af;font-weight:650
}
.multi-sale-table{margin-top:4px;border:1px solid #e2e8f0;border-radius:12px;overflow:auto}
.multi-sale-table table{margin:0;min-width:920px}
.multi-sale-table thead th{
  background:var(--navy);color:#fff;font-size:11px;letter-spacing:.04em;
  text-transform:uppercase;font-weight:800;border-bottom:0;padding:11px 10px;white-space:nowrap;
  text-align:left
}
#invoice-lines thead th.num{text-align:left}
.multi-sale-table td{padding:8px;vertical-align:middle}
.multi-sale-table select,.multi-sale-table input{
  width:100%;min-width:0;padding:8px 9px;border:1px solid #cbd5e1;border-radius:8px;background:#fff
}
.multi-sale-table .mi-remove{min-width:34px;font-size:16px;line-height:1;padding:6px 10px}
.sales-invoice-totals{
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:16px 0 0
}
.sales-invoice-totals>div{
  padding:14px;border-radius:12px;border:1px solid #dbe4ec;background:#f8fafc
}
.sales-invoice-totals span{
  display:block;font-size:11px;font-weight:800;text-transform:uppercase;color:var(--muted);letter-spacing:.04em
}
.sales-invoice-totals b{display:block;margin-top:6px;font-size:20px;color:var(--navy);font-variant-numeric:tabular-nums}
.sales-history-kpis{
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:0 0 16px
}
.sales-history-kpis>div{
  padding:16px;border-radius:14px;border:1px solid #dbe4ec;background:linear-gradient(145deg,#fff,#f8fafc)
}
.sales-history-kpis span{
  display:block;font-size:11px;font-weight:800;text-transform:uppercase;color:var(--muted);letter-spacing:.04em
}
.sales-history-kpis b{display:block;margin-top:6px;font-size:22px;color:var(--navy);font-variant-numeric:tabular-nums}
.sales-history-table thead th{
  background:var(--navy);color:#fff;font-size:11px;text-transform:uppercase;letter-spacing:.04em;font-weight:800
}
.sales-history-table .invoice-items{white-space:normal;min-width:220px;line-height:1.35}
.sales-history-table .invoice-items div{margin:2px 0}
.sales-row-actions{display:flex;gap:6px;flex-wrap:wrap}
.btn-orange{
  background:linear-gradient(135deg,#d97706,#f59e0b)!important;color:#fff!important;border:0;
  box-shadow:0 4px 12px #d9770640
}
.btn-orange:hover{filter:brightness(1.05)}
.btn-orange:disabled,.btn-primary:disabled{opacity:.65;cursor:not-allowed}

/* Invoice Options modal (sales history → Invoice) */
.invoice-printer-modal{
  position:fixed;inset:0;z-index:120;display:grid;place-items:center;padding:20px;
  background:#001722aa
}
.invoice-printer-modal[hidden]{display:none!important}
.printer-dialog{
  width:min(430px,94vw);background:#fff;border-radius:20px;padding:28px 26px 24px;
  box-shadow:0 25px 80px #0008;text-align:center
}
.printer-dialog h3{
  margin:0 0 18px;font-size:22px;line-height:1.35;font-weight:900;color:#1e293b
}
.printer-dialog h3 span{display:inline-block;margin-top:4px;font-size:18px}
.printer-btn{
  display:block;width:100%;margin:10px 0 0;padding:14px 16px;border:0;border-radius:12px;
  font-size:15px;font-weight:800;cursor:pointer;font-family:inherit;line-height:1.2
}
.printer-btn-a4{background:#1e6089;color:#fff}
.printer-btn-a4:hover{filter:brightness(1.06)}
.printer-btn-ghost{background:#eef2f6;color:#1e6089}
.printer-btn-ghost:hover{background:#e4ebf2}
.printer-btn-thermal{background:#5b21b6;color:#fff}
.printer-btn-thermal:hover{filter:brightness(1.08)}
.printer-btn-cancel{background:#c95c47;color:#fff}
.printer-btn-cancel:hover{filter:brightness(1.05)}

/* Edit Full Invoice modal */
.invoice-edit-modal{
  position:fixed;inset:0;z-index:160;display:grid;place-items:center;padding:14px;
  background:#001722d9
}
.invoice-edit-modal[hidden]{display:none!important}
.invoice-edit-card{
  width:min(1050px,98vw);max-height:94vh;overflow:auto;background:#fff;
  border-radius:18px;padding:22px;box-shadow:0 28px 90px #0008
}
.invoice-edit-head{
  display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px
}
.invoice-edit-head h3{margin:0;font-size:22px;color:var(--navy);font-weight:900}
.invoice-edit-close{
  width:36px;height:36px;border:0;border-radius:10px;background:#eef2f6;color:#334155;
  font-size:22px;line-height:1;cursor:pointer;font-weight:700
}
.invoice-edit-close:hover{background:#e2e8f0}
.invoice-edit-meta{margin-bottom:4px}
.invoice-edit-table{margin-top:8px}
.invoice-edit-table .ie-item{min-width:160px;width:100%}
.invoice-edit-table .ie-dtype{min-width:100px}
.invoice-edit-totals{
  border-color:#67e8f9
}
.invoice-edit-totals>div{border-color:#a5f3fc;background:linear-gradient(145deg,#fff,#f0fdff)}
.btn.full{width:100%;display:block;text-align:center}

/* Post-save invoice preview */
.saved-invoice-preview{
  position:fixed;inset:0;z-index:140;display:grid;place-items:center;padding:15px;
  background:#001722cc
}
.saved-invoice-preview[hidden]{display:none!important}
.saved-preview-card{
  width:min(460px,96vw);max-height:92vh;overflow:auto;background:#fff;
  border-radius:18px;padding:22px;box-shadow:0 28px 90px #0008
}
.preview-success{text-align:center;color:#059669;font-size:18px;font-weight:900}
.saved-preview-card h3{text-align:center;margin:8px 0 6px;font-size:24px;color:#0f172a;font-weight:900}
.saved-preview-card>p{text-align:center;margin:0 0 10px;color:#334155;font-weight:650}
.preview-lines{border-block:1px dashed #aab7c2;padding:8px 0;margin:4px 0}
.preview-lines div,.preview-total{
  display:flex;justify-content:space-between;align-items:flex-start;gap:12px;padding:6px 0
}
.preview-total{font-size:18px;font-weight:800;border-top:1px dashed #aab7c2;margin-top:2px;padding-top:10px}
.preview-question{text-align:center;font-weight:800;margin:14px 0 10px;color:#0f172a}
.saved-preview-card .btn{margin-top:9px}
.preview-btn-a4{background:#1e6089!important;color:#fff!important;border:0}
.preview-btn-thermal{background:#5b21b6!important;color:#fff!important;border:0}
.thermal-help{display:block;margin-top:12px;color:#64748b;font-size:12px;line-height:1.4;text-align:center}

/* Sales Order / Quotation workspace */
.sales-doc-hero{
  display:grid;grid-template-columns:1fr auto auto;gap:14px;align-items:center;
  padding:22px;margin:0 0 18px;border-radius:20px;color:#fff;
  background:linear-gradient(120deg,#172554,#2563eb,#06b6d4);box-shadow:0 16px 36px #1d4ed833
}
.sales-doc-hero.quotation{background:linear-gradient(120deg,#4c1d95,#8b5cf6,#ec4899)}
.sales-doc-hero span{font-size:9px;letter-spacing:2px;font-weight:900;display:block;opacity:.9}
.sales-doc-hero h2,.sales-doc-hero p{margin:3px 0}
.sales-doc-hero h2{font-size:26px}
.sales-doc-hero p{opacity:.9}
.sales-doc-hero>div:not(:first-child){
  min-width:120px;padding:13px;border:1px solid #ffffff36;border-radius:14px;background:#ffffff18
}
.sales-doc-hero>div>b,.sales-doc-hero>div>small{display:block}
.sales-doc-hero>div>b{font-size:21px;margin-top:2px}
.sales-doc-hero>div>small{opacity:.85;font-weight:700;margin-top:2px}
.sales-doc-create{padding-top:14px}
.sales-doc-create summary{
  cursor:pointer;font-weight:800;font-size:16px;color:var(--navy);list-style:none;
  display:flex;align-items:center;gap:6px
}
.sales-doc-create summary::-webkit-details-marker{display:none}
.sales-doc-create summary::before{content:'▼';font-size:12px;opacity:.7}
.sales-doc-create:not([open]) summary::before{content:'▶'}
.sales-doc-create form{margin-top:14px}
.sales-doc-meta{margin-bottom:4px}
.sales-doc-table{margin-top:10px}
.sales-doc-actions{
  display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-top:12px
}
.sales-doc-actions strong{margin-left:auto;color:var(--navy);font-size:15px}
.sales-doc-history-table thead th{
  background:var(--navy);color:#fff;font-size:11px;text-transform:uppercase;
  letter-spacing:.04em;font-weight:800;text-align:left
}
.doc-status{
  display:inline-block;width:max-content;padding:3px 8px;border-radius:20px;
  background:#fef3c7;color:#92400e;font-size:10px;font-weight:900;text-transform:uppercase
}
.doc-status.converted,.doc-status.converted_to_order{background:#dcfce7;color:#166534}
.doc-customer-code,.doc-invoice-ref{display:block;color:var(--muted);font-size:11px;margin-top:2px}
@media(max-width:760px){
  .sales-doc-hero{grid-template-columns:1fr 1fr}
  .sales-doc-hero>div:first-child{grid-column:1/-1}
  .sales-doc-actions strong{margin-left:0;width:100%}
  .document-meta{grid-template-columns:1fr 1fr}
}

/* Convert Sales Order modal */
.convert-order-modal{
  position:fixed;inset:0;z-index:320;padding:16px;background:#001722dd;
  display:grid;place-items:center
}
.convert-order-modal[hidden]{display:none!important}
.convert-order-card{
  position:relative;width:min(560px,96vw);padding:28px 26px 24px;
  border-radius:22px;background:#fff;box-shadow:0 22px 50px #0005
}
.convert-order-card>.modal-close{
  position:absolute;top:12px;right:16px;border:0;background:transparent;
  font-size:28px;line-height:1;cursor:pointer;color:#94a3b8
}
.convert-order-card h2{
  margin:0 28px 18px 0;color:#0f172a;font-size:24px;font-weight:800
}
.convert-order-form .field{margin:0 0 14px}
.convert-order-form .field label{
  display:block;margin-bottom:7px;font-weight:750;color:#334155
}
.convert-order-form .field input,
.convert-order-form .field select{
  width:100%;padding:12px 14px;border:1px solid #e2e8f0;border-radius:12px;background:#fff
}
.convert-order-submit{
  display:block;width:100%;margin-top:8px;padding:14px 18px;border:0;border-radius:999px;
  background:#10b981;color:#fff;font-weight:800;font-size:15px;cursor:pointer;
  box-shadow:0 8px 20px #10b98140
}
.convert-order-submit:hover{filter:brightness(1.05)}

/* Sales Order / Quotation view modal */
#salesDocModal{
  position:fixed;inset:0;z-index:300;overflow:auto;padding:12px;background:#001722dd;
  display:grid;place-items:center
}
.sales-doc-modal-card{
  position:relative;width:min(900px,96vw);max-height:94vh;overflow:auto;
  padding:24px;border-radius:20px;background:#fff;box-shadow:0 20px 50px #0005
}
.sales-doc-modal-card>.modal-close{
  position:absolute;top:10px;right:14px;z-index:2;border:0;background:transparent;
  font-size:28px;line-height:1;cursor:pointer;color:#64748b
}
.document-letterhead{
  display:flex;align-items:center;gap:14px;border-bottom:4px solid #0f766e;padding-bottom:10px
}
.document-letterhead img{width:95px;height:65px;object-fit:contain}
.document-letterhead h2,.document-letterhead p{margin:2px 0}
.document-letterhead h2{color:#0f3b52;font-size:18px}
.document-letterhead p{color:#475569;font-size:12px}
.document-title{
  display:flex;justify-content:space-between;align-items:center;gap:12px;margin:18px 0
}
.document-title h1{margin:0;color:#0f3b52;font-size:24px}
.document-title b{
  padding:8px 12px;border-radius:8px;background:#e0f2fe;color:#0f3b52;white-space:nowrap
}
.document-meta{
  display:grid;grid-template-columns:2fr 1fr 1fr 1fr;gap:8px;margin-bottom:14px
}
.document-meta>div{padding:9px;border:1px solid #d8e2eb;border-radius:8px}
.document-meta small,.document-meta b{display:block}
.document-meta small{color:#64748b;font-size:11px;margin-bottom:3px}
.document-print-sheet table{width:100%;border-collapse:collapse;margin-top:8px}
.document-print-sheet th,.document-print-sheet td{
  padding:8px;border-bottom:1px solid #d8e2eb;text-align:left
}
.document-print-sheet th{
  background:#0f3b52;color:#fff;font-size:11px;text-transform:uppercase
}
.document-print-sheet .num{text-align:right;font-variant-numeric:tabular-nums}
.document-print-sheet tfoot th{background:#0f3b52;color:#fff}
.document-notes{padding:10px;background:#f1f5f9;border-radius:8px;margin-top:14px}
.document-sign{
  display:flex;justify-content:space-between;padding-top:55px;font-weight:700;color:#0f3b52
}
.print-doc-button{
  display:block;width:100%;margin-top:18px;padding:14px 18px;border:0;border-radius:12px;
  background:linear-gradient(135deg,#0f766e,#0d9488);color:#fff;font-weight:800;font-size:15px;
  cursor:pointer;box-shadow:0 8px 20px #0f766e33
}
.print-doc-button:hover{filter:brightness(1.05)}

/* Guided Sales Return */
.guided-return{padding:0!important;overflow:hidden;border:1px solid #dbe7f0}
.return-entry-title{
  display:flex;justify-content:space-between;align-items:center;gap:16px;
  padding:22px 24px;color:#fff;background:linear-gradient(120deg,#0f3d56,#116a7b,#159895)
}
.return-entry-title span{font-size:9px;letter-spacing:2px;font-weight:900;opacity:.85}
.return-entry-title h3{margin:4px 0;font-size:23px}
.return-entry-title p{margin:0;opacity:.85}
.return-step{
  padding:9px 14px;border:1px solid #ffffff55;border-radius:999px;
  background:#ffffff18;font-weight:900;white-space:nowrap
}
.return-step-grid{
  display:grid;grid-template-columns:repeat(3,1fr);gap:0;padding:22px 22px 13px;background:#f5fafb
}
.return-step-field{
  position:relative;min-height:138px;padding:18px 15px 14px 58px;
  border:1px solid #d6e4e8;background:#fff
}
.return-step-field:first-child{border-radius:14px 0 0 14px}
.return-step-field:last-child{border-radius:0 14px 14px 0}
.return-step-field + .return-step-field{border-left:0}
.return-step-field i,.return-final-step i{
  position:absolute;left:15px;top:17px;display:grid;place-items:center;
  width:31px;height:31px;border-radius:50%;background:#dbe8ec;color:#47636c;
  font-style:normal;font-weight:900
}
.return-step-field label{display:block;margin-bottom:8px;font-weight:850;color:#163843}
.return-step-field input,.return-step-field select{
  width:100%;min-height:42px;border:1px solid #b9ccd2;border-radius:8px;background:#fff;padding:8px
}
.return-step-field small{display:block;margin-top:8px;color:#647b83}
.return-step-field.active{border:2px solid #159895;box-shadow:0 8px 22px #15989518;z-index:1}
.return-step-field.active i{background:#159895;color:#fff}
.return-step-field.complete{background:#f2fbf7}
.return-step-field.complete i{background:#16845b;color:#fff}
.return-step-field.disabled{opacity:.62;background:#edf3f5}
.return-final-step{
  position:relative;display:flex;align-items:center;gap:13px;
  margin:18px 22px 8px;padding:15px 18px 15px 63px;border-radius:12px;color:#fff;
  background:linear-gradient(110deg,#166534,#159895)
}
.return-final-step i{top:14px;background:#fff;color:#166534}
.return-final-step b,.return-final-step small{display:block}
.return-final-step small{margin-top:3px;opacity:.84}
.return-final-step>span{
  margin-left:auto;padding:6px 9px;border-radius:999px;background:#ffffff20;
  font-size:9px;font-weight:900;letter-spacing:1px
}
.return-details-wrap{padding:16px 22px 8px}
.guided-return form>.return-invoice-summary,
.guided-return form>.entry-grid,
.guided-return form>.return-accounting-note,
.guided-return form>.table-wrap,
.guided-return form>.return-save,
.guided-return form>.return-warning{margin-left:22px;margin-right:22px}
.return-invoice-summary{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:12px 0}
.return-invoice-summary>div{padding:11px;border-radius:10px;background:#eff6ff}
.return-invoice-summary small,.return-invoice-summary b{display:block}
.return-invoice-summary small{color:#64748b;font-size:11px;margin-bottom:4px}
.return-lines thead th{
  background:var(--navy);color:#fff;font-size:11px;text-transform:uppercase;
  letter-spacing:.04em;font-weight:800
}
.return-lines input{width:110px;padding:7px;border:1px solid var(--line);border-radius:7px;text-align:right}
.return-save{
  display:flex;justify-content:flex-end;align-items:center;gap:18px;
  margin-top:13px;margin-bottom:22px;padding:15px;border-top:1px solid #dce7ea;background:#f7fafb
}
.return-empty{
  margin:12px 22px 22px;padding:18px;border:1px dashed #93c5fd;border-radius:11px;
  text-align:center;color:#64748b
}
.return-warning{
  margin:0 22px 12px;padding:12px 14px;border-radius:10px;
  background:#fef3c7;color:#92400e;border:1px solid #fcd34d
}
.return-accounting-note{
  margin:0 22px 12px;padding:11px 13px;border-radius:10px;
  background:#ecfdf5;color:#166534;border:1px solid #a7f3d0;font-size:13px
}
.sales-return-history-table thead th{
  background:var(--navy);color:#fff;font-size:11px;text-transform:uppercase;
  letter-spacing:.04em;font-weight:800;text-align:left
}
.credit-note-btn{white-space:nowrap;color:#075985;border-color:#7dd3fc!important;background:#f0f9ff!important}

/* Credit Note print / modal sheet */
.credit-note-sheet{color:#111;font:12px Arial,Tahoma,sans-serif}
.credit-note-sheet .ar{direction:rtl;font-family:Tahoma,Arial,sans-serif}
.credit-note-sheet .head{
  display:flex;justify-content:space-between;align-items:flex-start;
  border-bottom:1px solid #777;padding-bottom:10px
}
.credit-note-sheet .head img{width:88px;height:72px;object-fit:contain}
.credit-note-sheet .company h1{font-size:22px;margin:0 0 4px}
.credit-note-sheet .company h2{font-size:16px;margin:2px 0}
.credit-note-sheet .company p{margin:3px 0}
.credit-note-sheet .title{text-align:center;color:#666;font-size:24px;margin:14px}
.credit-note-sheet .meta{display:grid;grid-template-columns:1fr 1fr;gap:30px;margin:15px 5px}
.credit-note-sheet .meta>div:last-child{text-align:right}
.credit-note-sheet .meta p{margin:5px 0}
.credit-note-sheet table{width:100%;border-collapse:collapse}
.credit-note-sheet .items th{background:#aaa;color:#fff;padding:7px;text-align:left}
.credit-note-sheet .items td{padding:8px;border-bottom:1px solid #bbb}
.credit-note-sheet .num{text-align:right!important;font-variant-numeric:tabular-nums}
.credit-note-sheet .bottom{display:grid;grid-template-columns:1fr 1fr;gap:34px;margin-top:22px}
.credit-note-sheet .reason{padding:12px;border:1px solid #ddd;background:#f7f7f7}
.credit-note-sheet .reason h3{margin:0 0 7px}
.credit-note-sheet .summary td{padding:7px;border-bottom:1px solid #ddd}
.credit-note-sheet .summary .grand td{background:#aaa;color:#fff;font-weight:bold}
.credit-note-sheet .notice{margin-top:14px;padding:9px;border-left:3px solid #777;color:#444}
.credit-note-sheet .sign{
  display:grid;grid-template-columns:1fr 1fr;gap:90px;margin-top:75px;
  text-align:center;font-weight:bold
}
.credit-note-sheet .sign div{border-top:1px solid #222;padding-top:7px}

@media(max-width:800px){
  .return-entry-title{align-items:flex-start;flex-direction:column}
  .return-step-grid{grid-template-columns:1fr;gap:9px}
  .return-step-field,.return-step-field:first-child,.return-step-field:last-child{
    border:1px solid #d6e4e8;border-radius:12px!important
  }
  .return-step-field + .return-step-field{border-left:1px solid #d6e4e8}
  .return-step-field.active{border:2px solid #159895}
  .return-final-step{align-items:flex-start}
  .return-final-step>span{display:none}
  .return-details-wrap{padding:12px}
  .guided-return form>.return-invoice-summary,
  .guided-return form>.entry-grid,
  .guided-return form>.return-accounting-note,
  .guided-return form>.table-wrap,
  .guided-return form>.return-save,
  .guided-return form>.return-warning,
  .return-empty,.return-warning{margin-left:12px;margin-right:12px}
  .return-invoice-summary{grid-template-columns:1fr}
  .return-save{align-items:stretch;flex-direction:column}
  .return-save .btn{width:100%}
}

@media print{
  @page{size:A4 portrait;margin:10mm}
  body:has(#salesDocModal) .app,
  body:has(#salesDocModal) .sidebar,
  body:has(#salesDocModal) .topbar,
  body:has(#salesDocModal) .main > *:not(#salesDocModal){display:none!important}
  #salesDocModal{position:static;padding:0;background:#fff;overflow:visible;display:block}
  .sales-doc-modal-card{width:100%;max-height:none;padding:0;border-radius:0;box-shadow:none}
  .sales-doc-modal-card>.modal-close,.print-doc-button,.no-print{display:none!important}
  .document-print-sheet{font-size:11px}
  .document-letterhead{display:flex!important}
  .document-print-sheet th,.document-print-sheet tfoot th{
    color:#fff!important;background:#0f3b52!important;
    -webkit-print-color-adjust:exact;print-color-adjust:exact
  }
  .credit-note-sheet .items th,.credit-note-sheet .summary .grand td{
    color:#fff!important;background:#aaa!important;
    -webkit-print-color-adjust:exact;print-color-adjust:exact
  }
}


@media(max-width:900px){
  .sales-invoice-totals,.sales-history-kpis{grid-template-columns:1fr 1fr}
}
@media(max-width:700px){
  .sales-centre-tabs a{min-width:110px}
  .sales-invoice-totals,.sales-history-kpis{grid-template-columns:1fr 1fr}
}

.subtabs{
  display:flex;gap:6px;overflow-x:auto;white-space:nowrap;padding:8px;margin:0 0 16px;
  background:#fff;border-radius:14px;box-shadow:0 8px 25px #17324d0a;border:1px solid var(--line)
}
.subtabs a{
  display:inline-block;padding:9px 14px;border-radius:10px;color:var(--muted);font-weight:750;
  text-decoration:none;border:0;background:transparent;flex:0 0 auto
}
.subtabs a:hover{background:#eef6fb;color:var(--navy)}
.subtabs a.active{background:var(--cyan);color:#fff}
.admin-report-tabs{
  flex-wrap:wrap;white-space:normal;gap:8px;padding:10px;border-radius:16px
}
.truck-reports-page .admin-report-tabs{margin-bottom:14px}
.admin-report-tabs a{
  padding:10px 16px;border-radius:12px;color:var(--blue);background:#e8f4fb
}
.admin-report-tabs a:hover{background:#d8eef8;color:var(--navy)}
.admin-report-tabs a.active{
  background:var(--navy);color:#fff;box-shadow:0 6px 16px #071d3533
}
.truck-report-panel{padding:18px}
/* Unified page filters — same bar as dashboard Single Date / Range */
.page-filter,
.panel.truck-dashboard-filter,
form.page-filter,
form.truck-report-filters,
.report-filter-card.truck-report-filters,
form.report-filter{
  background:linear-gradient(145deg,#fff,#fbfdff);
  border:1px solid #e8eef4;
  border-radius:16px;
  box-shadow:0 10px 28px #17324d0c;
  padding:14px 16px;
  margin:0 0 16px
}
.page-filter > .toolbar,
.truck-dashboard-filter > .toolbar,
form.toolbar.page-filter,
form.truck-report-filters,
.report-filter-card.truck-report-filters,
.page-filter form.toolbar{
  display:flex;flex-direction:row;flex-wrap:wrap;align-items:flex-end;gap:12px;
  margin:0;padding:0;justify-content:flex-start;
  background:transparent;border:0;box-shadow:none
}
.page-filter .field,
.truck-dashboard-filter .field,
.truck-report-filters .field,
form.report-filter .field{
  margin:0;min-width:0;width:170px;flex:0 0 170px
}
.page-filter .field-wide,
.truck-dashboard-filter .field-wide,
.truck-report-filters .field-wide{
  width:200px;flex:0 0 200px
}
.page-filter .field label,
.truck-dashboard-filter .field label,
.truck-report-filters .field label,
form.report-filter .field label{
  font-size:12px;font-weight:800;color:var(--muted);text-transform:uppercase;letter-spacing:.04em;margin-bottom:6px
}
.page-filter .field input,
.page-filter .field select,
.truck-dashboard-filter .field input,
.truck-dashboard-filter .field select,
.truck-report-filters .field input,
.truck-report-filters .field select,
form.report-filter .field input,
form.report-filter .field select{
  width:100%;min-width:0;border-radius:10px;border:1px solid #d7e0e9;padding:9px 11px;background:#fff
}
.truck-report-filter-actions,
.page-filter-actions{
  display:flex;flex-direction:row;flex-wrap:nowrap;gap:8px;align-items:center;
  flex:0 0 auto;padding-bottom:1px;margin-left:4px
}
.truck-report-filter-actions .btn,
.page-filter-actions .btn{white-space:nowrap}
.page-filter-range{
  display:flex;flex-direction:row;flex-wrap:wrap;align-items:flex-end;gap:12px
}
.page-filter-range[hidden]{display:none!important}
@media(max-width:1100px){
  form.truck-report-filters,
  .report-filter-card.truck-report-filters,
  .page-filter > .toolbar,
  .truck-dashboard-filter > .toolbar{flex-wrap:wrap}
}
@media(max-width:720px){
  form.toolbar.page-filter,
  .page-filter > .toolbar,
  .page-filter form.toolbar{
    flex-direction:row;align-items:flex-end
  }
  .page-filter-range{
    display:grid;grid-template-columns:1fr 1fr;gap:10px;
    flex:1 1 auto;min-width:0;width:auto
  }
  .page-filter-range .field{
    width:auto;flex:1 1 auto;min-width:0
  }
  .page-filter .field,
  .page-filter .field-wide,
  .truck-dashboard-filter .field,
  .truck-report-filters .field,
  .truck-report-filters .field-wide,
  form.report-filter .field{flex:1 1 140px;width:auto;min-width:0}
  .page-filter-actions{margin-left:0;flex:0 0 auto}
}
.btn-navy{
  background:var(--navy);color:#fff;box-shadow:0 4px 12px #071d3528
}
.btn-navy:hover{filter:brightness(1.08)}
.btn-print-green,.btn-green{
  background:#16a34a!important;color:#fff!important;
  box-shadow:0 4px 12px #16a34a40
}
.btn-print-green:hover,.btn-green:hover{background:#15803d!important;filter:none}
.btn-cyan{
  background:linear-gradient(135deg,#0891b2,#06b6d4)!important;color:#fff!important;
  box-shadow:0 4px 12px #0891b240;border:0
}
.btn-cyan:hover{filter:brightness(1.06)}

/* Daily Report (salesman / truck-details) */
.daily-letterhead{
  display:none;align-items:center;gap:16px;padding:4px 0 16px;
  border-bottom:4px solid var(--cyan);margin-bottom:16px
}
.daily-letterhead-logo{
  width:72px;height:72px;object-fit:contain;border-radius:50%;flex:0 0 auto;
  background:#fff;box-shadow:0 4px 14px #0f172a14
}
.daily-letterhead h2{margin:0 0 4px;font-size:20px;color:var(--navy)}
.daily-letterhead p{margin:0;color:var(--muted);font-weight:650;line-height:1.4}
.daily-report-title{margin:0 0 4px;font-size:22px;color:#0f172a}
.daily-report-date{margin:0 0 14px;color:var(--text)}
.daily-total-cards{
  display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px;margin:14px 0 18px
}
.daily-total-cards>div{
  padding:12px;border-radius:12px;color:#fff;
  background:linear-gradient(135deg,#1e3a8a,#2563eb);box-shadow:0 8px 18px #1e3a8a18
}
.daily-total-cards .cash{background:linear-gradient(135deg,#059669,#10b981)}
.daily-total-cards .bank{background:linear-gradient(135deg,#0284c7,#06b6d4)}
.daily-total-cards .cheque{background:linear-gradient(135deg,#7c3aed,#a855f7)}
.daily-total-cards .total{background:linear-gradient(135deg,#ea580c,#f59e0b)}
.daily-total-cards .sales{background:linear-gradient(135deg,#1d4ed8,#3b82f6)}
.daily-total-cards .navy{background:linear-gradient(135deg,#0f172a,#1e3a8a)}
.daily-total-cards span{display:block;font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.03em;opacity:.95}
.daily-total-cards b{display:block;margin-top:6px;font-size:16px;font-weight:800}
.combined-transactions thead th,
.daily-a4 .aligned-truck-table thead th{
  background:var(--navy);color:#fff;font-size:11px;letter-spacing:.05em;
  text-transform:uppercase;font-weight:800;border-bottom:0
}
.wrap-cell{white-space:normal;min-width:140px}
@media(max-width:1100px){
  .daily-total-cards{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:720px){
  .daily-total-cards{grid-template-columns:repeat(2,minmax(0,1fr))}
  .daily-letterhead{align-items:flex-start}
}
@media print{
  @page{size:A4 portrait;margin:8mm}
  body.daily-printing .sidebar,
  body.daily-printing .sidebar-backdrop,
  body.daily-printing .topbar,
  body.daily-printing .nav-burger,
  body.daily-printing .bottom-nav,
  body.daily-printing .truck-context-header,
  body.daily-printing .no-print{display:none!important}
  body.daily-printing .main{margin:0!important;width:100%!important}
  body.daily-printing .content{padding:0!important;margin:0!important}
  body.daily-printing,
  body.daily-printing .app,
  body.daily-printing .main,
  body.daily-printing .content{
    background:#fff!important;overflow:visible!important
  }
  body.daily-printing .daily-a4,
  body.daily-printing .report-print-sheet.daily-a4{
    width:100%!important;max-width:100%!important;margin:0!important;padding:0!important;
    box-shadow:none!important;border:0!important;border-radius:0!important;background:#fff!important
  }
  body.daily-printing .daily-letterhead{
    display:flex!important;align-items:center;gap:12px;padding:0 0 8px;margin:0 0 10px;
    border-bottom:3px solid #08a9d6;break-inside:avoid
  }
  body.daily-printing .daily-letterhead-logo{
    width:56px;height:56px;box-shadow:none
  }
  body.daily-printing .daily-letterhead h2{font-size:14px;margin:0 0 2px;color:#071d35}
  body.daily-printing .daily-letterhead p{font-size:9px;color:#64748b}
  body.daily-printing .daily-report-title{font-size:16px;margin:0 0 2px;color:#0f172a}
  body.daily-printing .daily-report-date{font-size:11px;margin:0 0 10px}
  body.daily-printing .daily-total-cards{
    display:grid!important;grid-template-columns:repeat(6,minmax(0,1fr))!important;
    gap:5px!important;margin:8px 0 12px!important;break-inside:avoid
  }
  body.daily-printing .daily-total-cards>div{
    color:#111!important;border:1px solid #cbd5e1!important;background:#fff!important;
    box-shadow:none!important;padding:7px 8px!important;border-radius:8px!important
  }
  body.daily-printing .daily-total-cards span{
    color:#64748b!important;font-size:8px!important;opacity:1
  }
  body.daily-printing .daily-total-cards b{
    color:#0f172a!important;font-size:11px!important;margin-top:3px
  }
  body.daily-printing .daily-a4 h3{
    margin:10px 0 6px;font-size:12px;color:#071d35;break-after:avoid
  }
  body.daily-printing .table-wrap{
    overflow:visible!important;border:0!important;width:100%!important
  }
  body.daily-printing .combined-transactions,
  body.daily-printing .daily-a4 .aligned-truck-table{
    width:100%!important;table-layout:fixed!important;border-collapse:collapse!important;
    font-size:8px!important
  }
  body.daily-printing .combined-transactions th,
  body.daily-printing .combined-transactions td,
  body.daily-printing .daily-a4 .aligned-truck-table th,
  body.daily-printing .daily-a4 .aligned-truck-table td{
    padding:3px 4px!important;white-space:normal!important;word-break:break-word;
    border-bottom:1px solid #e2e8f0;vertical-align:top
  }
  body.daily-printing .combined-transactions thead th,
  body.daily-printing .daily-a4 .aligned-truck-table thead th{
    background:#071d35!important;color:#fff!important;
    -webkit-print-color-adjust:exact;print-color-adjust:exact;
    font-size:8px!important;padding:5px 4px!important
  }
  body.daily-printing .combined-transactions th:nth-child(1){width:10%}
  body.daily-printing .combined-transactions th:nth-child(2){width:16%}
  body.daily-printing .combined-transactions th:nth-child(3){width:14%}
  body.daily-printing .combined-transactions th:nth-child(4){width:24%}
  body.daily-printing .combined-transactions th:nth-child(n+5){width:9%}
  body.daily-printing .wrap-cell{min-width:0!important}
  body.daily-printing .stock-print-part{break-inside:avoid;margin-top:8px}
  body.daily-printing.transaction-print .stock-print-part{display:none!important}
}
.account-summary{
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:14px 0
}
.account-summary>div{
  padding:14px;border-radius:14px;color:#fff;
  background:linear-gradient(135deg,#0f766e,#0891b2);box-shadow:0 8px 20px #0f766e20
}
.account-summary>div:nth-child(4n+2){background:linear-gradient(135deg,#4338ca,#7c3aed)}
.account-summary>div:nth-child(4n+3){background:linear-gradient(135deg,#b45309,#f59e0b)}
.account-summary>div:nth-child(4n){background:linear-gradient(135deg,#6d28d9,#a855f7)}
.account-summary small,.account-summary b{display:block}
.account-summary small{font-size:12px;opacity:.92;font-weight:700}
.account-summary b{margin-top:6px;font-size:20px;font-weight:800;letter-spacing:-.02em}
.accounting-report-title{text-align:center;margin:8px 0 14px}
.accounting-report-title > span{
  display:block;font-size:11px;letter-spacing:2px;font-weight:900;color:#6366f1
}
.accounting-report-title h2{margin:6px 0;font-size:26px;color:var(--navy)}
.accounting-report-title p{margin:0;color:var(--muted);font-weight:650}
.accounting-view-tabs{
  margin:0 0 14px
}
.accounting-view-tabs a{
  background:#e8f4fb;color:var(--blue)
}
.accounting-view-tabs a.active{
  background:var(--navy);color:#fff;box-shadow:0 6px 16px #071d3533
}
.accounting-view-heading{margin:0 0 12px;font-size:18px;color:var(--navy)}
.accounting-table{
  border:1px solid var(--line);border-radius:14px;overflow:hidden;background:#fff
}
.accounting-table thead th{
  background:var(--navy);color:#fff;font-size:11px;letter-spacing:.05em;
  text-transform:uppercase;font-weight:800;border-bottom:0;padding:12px 10px
}
.accounting-table tbody td{padding:10px;border-bottom:1px solid #e8eef4}
.accounting-table .report-total-row th{
  background:var(--navy)!important;color:#fff!important;padding:11px 10px;font-weight:800
}
.accounting-table .num{text-align:right;font-variant-numeric:tabular-nums}
.admin-truck-sales-report .report-title,
.truck-sales-report-title{text-align:center;margin:8px 0 14px}
.truck-sales-report-title > span{
  display:block;font-size:11px;letter-spacing:2px;font-weight:900;color:#6366f1
}
.truck-sales-report-title h2{margin:6px 0;font-size:26px;color:var(--navy)}
.truck-sales-report-title p{margin:0;color:var(--muted);font-weight:650}
.truck-sales-letterhead,.report-print-letterhead{display:none}
.print-only{display:none}
.analysis-report-title{text-align:center;margin:8px 0 14px}
.analysis-report-title > span{
  display:block;font-size:11px;letter-spacing:2px;font-weight:900;color:#6366f1
}
.analysis-report-title h2{margin:6px 0;font-size:26px;color:var(--navy)}
.analysis-report-title p{margin:0;color:var(--muted);font-weight:650}
.analysis-report-table{
  border:1px solid var(--line);border-radius:14px;overflow:hidden;background:#fff
}
.analysis-report-table thead th{
  background:var(--navy);color:#fff;font-size:11px;letter-spacing:.05em;
  text-transform:uppercase;font-weight:800;border-bottom:0;padding:12px 10px
}
.analysis-report-table tbody td{padding:10px;border-bottom:1px solid #e8eef4;background:#fff}
.analysis-report-table tbody tr:nth-child(even) td{background:#fbfcfe}
.analysis-report-table .num{text-align:right;font-variant-numeric:tabular-nums}
.truck-sales-table{
  border:1px solid var(--line);border-radius:14px;overflow:hidden;background:#fff
}
.truck-sales-table thead th{
  background:var(--navy);color:#fff;font-size:11px;letter-spacing:.05em;
  text-transform:uppercase;font-weight:800;border-bottom:0;padding:12px 10px
}
.truck-sales-table tbody td{padding:10px;border-bottom:1px solid #e8eef4;background:#fff}
.truck-sales-table tbody tr:nth-child(even) td{background:#fbfcfe}
.truck-sales-table tfoot th,
.analysis-report-table tfoot th,
.truck-sales-table .report-total-row th,
.analysis-report-table .report-total-row th{
  background:var(--navy)!important;color:#fff!important;padding:11px 10px;font-weight:800
}
.truck-sales-table .num{text-align:right;font-variant-numeric:tabular-nums}
@media(max-width:900px){
  .account-summary,.account-summary.four{grid-template-columns:1fr 1fr}
}
@media(max-width:560px){
  .account-summary,.account-summary.four{grid-template-columns:1fr 1fr}
}
.truck-report-kpis{
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin:0 0 18px
}
.truck-report-kpis .card{
  margin:0;padding:16px 18px;border-radius:14px;background:#fff;
  box-shadow:0 8px 22px #17324d0c
}
.truck-report-kpis .card span{
  display:block;font-size:11px;font-weight:800;letter-spacing:.08em;
  text-transform:uppercase;color:var(--muted);margin-bottom:6px
}
.truck-report-kpis .card b{
  font-size:28px;font-weight:800;letter-spacing:-.02em;color:var(--text);line-height:1.1
}
.truck-report-kpis .card-cyan{border-top:4px solid var(--cyan)}
.truck-report-kpis .card-green{border-top:4px solid var(--green)}
.truck-report-kpis .card-coral{border-top:4px solid #ef6b6b}
.truck-report-table{
  border:1px solid var(--line);border-radius:14px;overflow:hidden;background:#fff
}
.truck-report-table table{margin:0}
.truck-report-table thead th{
  background:var(--navy);color:#fff;font-size:11px;letter-spacing:.06em;
  text-transform:uppercase;font-weight:800;border-bottom:0;padding:12px 14px
}
.truck-report-table tbody td{
  padding:12px 14px;border-bottom:1px solid #e8eef4;background:#fff
}
.truck-report-table tbody tr:nth-child(even) td{background:#fbfcfe}
.truck-report-table tbody tr:hover td{background:#f0f8fc}
.truck-report-table tbody tr:last-child td{border-bottom:0}
.truck-report-table .num{text-align:right;font-variant-numeric:tabular-nums}
.report-filter-card select{min-width:180px}
.report-title{margin:12px 0}
.report-title > span{font-size:10px;letter-spacing:2px;font-weight:900;color:var(--cyan)}
.report-title h2{margin:4px 0}
.report-title p{margin:3px 0;color:var(--muted)}
.accounting-note{
  padding:15px;border-left:4px solid var(--cyan);border-radius:10px;
  background:#ecfeff;color:#164e63;margin:12px 0
}
.expense-report-title{
  padding:18px 20px;border-radius:16px;color:#fff;
  background:linear-gradient(120deg,#7f1d1d,#dc2626,#f97316)
}
.expense-report-title h2,.expense-report-title p{margin:4px 0;color:#fff}
.expense-report-title > b{font-size:11px}
.expense-breakdown{
  padding:13px;border:1px solid #dbe4ec;border-radius:13px;background:#f8fafc
}
.expense-breakdown h3,.expense-detail h3{margin:0 0 10px}
td.num.low,th.num.low,.num.low{color:var(--red, #dc2626);font-weight:800}
td.num.ok,th.num.ok,.num.ok{color:var(--green);font-weight:700}
.accounting-centre table tfoot th,
.admin-truck-sales-report table tfoot th,
.admin-analysis-report table tfoot th,
.expense-analysis-report table tfoot th{
  background:var(--navy);color:#fff
}
@media(max-width:900px){
  .truck-report-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media print{
  @page{size:A4 portrait;margin:9mm}
  .sidebar,.sidebar-backdrop,.topbar,.nav-burger,.bottom-nav,
  .admin-report-tabs,.report-filter-card,.expense-report-filters,
  .truck-report-filters,.no-print{display:none!important}
  .main{margin:0!important}
  .content{padding:0!important}
  .panel,.admin-truck-sales-report,.admin-analysis-report,.accounting-centre{
    box-shadow:none!important;border:0!important;padding:0!important;
    background:#fff!important
  }
  .print-only,.truck-sales-letterhead,.report-print-letterhead{display:flex!important}
  .truck-sales-letterhead,.report-print-letterhead{
    align-items:center;gap:14px;margin:0 0 12px;padding:0 0 10px;
    border-bottom:3px solid #0f766e
  }
  .truck-sales-logo,.report-print-logo{
    width:72px;height:72px;object-fit:contain;flex:0 0 auto
  }
  .truck-sales-letterhead h1,.report-print-letterhead h1{
    margin:0 0 4px;font-size:16px;color:#073f68;line-height:1.25
  }
  .truck-sales-letterhead p,.report-print-letterhead p{
    margin:2px 0;font-size:10px;color:#64748b
  }
  .truck-sales-report-title,.analysis-report-title,.accounting-report-title{margin:10px 0 12px!important}
  .truck-sales-report-title > span,.analysis-report-title > span,.accounting-report-title > span{color:#6366f1!important;font-size:10px}
  .truck-sales-report-title h2,.analysis-report-title h2,.accounting-report-title h2{font-size:20px!important;margin:4px 0!important}
  .truck-sales-report-title p,.analysis-report-title p,.accounting-report-title p{font-size:11px}
  .accounting-view-heading{font-size:14px;margin:0 0 8px}
  .account-summary,.truck-sales-kpis,.accounting-kpis{
    grid-template-columns:1fr 1fr!important;gap:8px!important;margin:10px 0 14px!important
  }
  .account-summary>div,.truck-sales-kpis>div,.accounting-kpis>div{
    color:#111!important;background:#fff!important;border:1px solid #cbd5e1!important;
    box-shadow:none!important;padding:10px 12px!important;border-radius:10px!important
  }
  .account-summary small{color:#64748b!important;opacity:1}
  .account-summary b{color:#111!important;font-size:15px!important}
  .accounting-note{
    color:#111!important;background:#fff!important;border-left:3px solid #0f766e!important
  }
  .truck-sales-table,.analysis-report-table,.accounting-table{
    border:0!important;border-radius:0!important;overflow:visible!important
  }
  .truck-sales-table table,.analysis-report-table table,.accounting-table table{
    width:100%!important;table-layout:auto;font-size:8px!important
  }
  .truck-sales-table th,.truck-sales-table td,
  .analysis-report-table th,.analysis-report-table td,
  .accounting-table th,.accounting-table td{
    padding:4px 3px!important
  }
  .truck-sales-table thead th,
  .truck-sales-table tfoot th,
  .analysis-report-table thead th,
  .analysis-report-table tfoot th,
  .truck-sales-table .report-total-row th,
  .analysis-report-table .report-total-row th,
  .accounting-table thead th,
  .accounting-table .report-total-row th{
    background:#0f3b52!important;color:#fff!important;
    -webkit-print-color-adjust:exact;print-color-adjust:exact
  }
  /* Keep column headers on each page, but print the TOTAL row only once at the end */
  .truck-sales-table thead,
  .analysis-report-table thead,
  .truck-report-table thead,
  .admin-analysis-report thead,
  .admin-truck-sales-report thead{
    display:table-header-group
  }
  .truck-sales-table tfoot,
  .analysis-report-table tfoot,
  .truck-report-table tfoot,
  .admin-analysis-report tfoot,
  .admin-truck-sales-report tfoot,
  .expense-analysis-report tfoot,
  .accounting-centre tfoot{
    display:table-row-group
  }
  .expense-report-title{color:#111!important;background:#fff!important;border-bottom:3px solid #7f1d1d;border-radius:0}
}
.smart-truck-hero{
  background:linear-gradient(125deg,#082f49,#0369a1 58%,#0891b2);color:#fff;border-radius:18px;
  padding:22px 26px;margin-bottom:16px;display:flex;justify-content:space-between;align-items:center;
  box-shadow:0 16px 38px #0759852b
}
.premium-truck-hero{
  background:linear-gradient(120deg,#0f766e,#0369a1 48%,#6d28d9)!important;
  box-shadow:0 20px 48px #0369a12e!important
}
.smart-truck-hero small{letter-spacing:2px;opacity:.8;font-weight:800}
.smart-truck-hero h2{margin:5px 0;font-size:25px;color:#fff}
.smart-truck-hero p{margin:0;opacity:.85}
.hero-ring{
  --p:60;width:92px;height:92px;border-radius:50%;display:grid;place-content:center;text-align:center;
  background:radial-gradient(circle,#075985 57%,transparent 59%),conic-gradient(#67e8f9 calc(var(--p)*1%),#ffffff2b 0)
}
.hero-ring b{font-size:17px;color:#fff}
.hero-ring span{font-size:10px;color:#fff}
.dashboard-shortcuts{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:16px
}
.dashboard-shortcuts a{
  display:flex;align-items:center;gap:12px;padding:16px 18px;border-radius:14px;
  text-decoration:none;color:#fff;box-shadow:0 10px 24px #0f172a18;border:0
}
.dashboard-shortcuts a.dash-shortcut.sale{
  background:linear-gradient(135deg,#2563eb,#0891b2)
}
.dashboard-shortcuts a.dash-shortcut.payment{
  background:linear-gradient(135deg,#059669,#10b981)
}
.dashboard-shortcuts a span{
  width:42px;height:42px;border-radius:12px;display:grid;place-content:center;
  background:#ffffff22;color:#fff;font-size:22px;font-weight:800
}
.dashboard-shortcuts a b{display:block;color:#fff;font-size:16px}
.dashboard-shortcuts a small{color:#ffffffcc}
.premium-panel{background:linear-gradient(145deg,#fff,#fbfdff);box-shadow:0 14px 40px #17324d10}
.smart-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:18px}
.smart-kpis>div{
  position:relative;overflow:hidden;background:#fff;border:1px solid #e2e8f0;border-radius:14px;
  padding:15px;box-shadow:0 6px 18px #0f172a0a
}
.smart-kpis>div:after{
  content:'';position:absolute;width:70px;height:70px;border-radius:50%;right:-28px;top:-28px;
  background:currentColor;opacity:.08
}
.smart-kpis span{display:block;color:#64748b;font-size:11px;font-weight:800;text-transform:uppercase}
.smart-kpis b{display:inline-block;font-size:22px;margin-top:7px;color:#0f172a}
.smart-kpis small{margin-left:4px;color:#64748b}
.smart-kpis .blue{color:#2f80ed}
.smart-kpis .purple{color:#8b5cf6}
.smart-kpis .orange{color:#f59e0b}
.smart-kpis .green{color:#10b981}
.smart-kpis .cyan{color:#06b6d4}
.smart-kpis .red{color:#ef4444}
.smart-kpis .balance-premium{
  background:linear-gradient(135deg,#fff1f2,#fff7ed)!important;color:#ef4444!important
}
.smart-kpis .collection-premium{
  background:linear-gradient(135deg,#ecfdf5,#ecfeff)!important;color:#059669!important
}
.mini-track{height:5px;background:#e8eef5;border-radius:9px;margin-top:10px;overflow:hidden}
.mini-track i{display:block;height:100%;border-radius:9px}
.aligned-truck-table{table-layout:auto}
.item-movement-wrap{
  overflow-x:auto;
  overflow-y:hidden;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior-x:contain;
  max-width:100%;
}
.item-movement-table{
  width:100%;
  min-width:760px;
  border-collapse:collapse;
}
.item-movement-table th,
.item-movement-table td{white-space:nowrap}

@media(max-width:1100px){
  .entry-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .grid2{grid-template-columns:1fr}
  .factory-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
  .smart-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:720px){
  .entry-grid{grid-template-columns:1fr}
  .factory-kpis{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .factory-kpis .card{min-width:0;padding:12px}
  .factory-kpis .card b,
  .factory-kpis .card b.ok,
  .factory-kpis .card b.low{font-size:22px}
  .working-date-form{flex-wrap:wrap}
  .topbar-title-wrap{flex-direction:column;align-items:flex-start;gap:8px}
  .truck-context-header{align-items:stretch;flex-direction:column;padding:17px!important}
  .truck-context-header h2{font-size:18px}
  .truck-context-actions{width:100%}
  .truck-context-actions form{flex:1}
  .truck-context-actions select{width:100%;min-width:0}
  .smart-truck-hero{padding:17px}
  .smart-truck-hero h2{font-size:20px}
  .hero-ring{width:76px;height:76px}
  .dashboard-shortcuts{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .dashboard-shortcuts a{min-width:0;padding:12px 10px;gap:8px}
  .dashboard-shortcuts a span{width:34px;height:34px;font-size:18px;flex:0 0 auto}
  .dashboard-shortcuts a b{font-size:14px}
  .dashboard-shortcuts a small{display:block;font-size:11px;line-height:1.25}
  .smart-kpis{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .smart-kpis>div{min-width:0;padding:12px}
  .smart-kpis b{font-size:18px}
  .smart-kpis small{display:block;margin-left:0;margin-top:2px}
}

/* —— All-Truck Performance Dashboard (py_app enhancements.js premium) —— */
.truck-admin-dashboard{
  --dash-line:#dbe5ef;
  --dash-muted:#6b7f92;
  --dash-text:#10263a;
}
.content:has(.truck-admin-dashboard){
  background:
    radial-gradient(circle at 96% 3%,#dff7ff 0,transparent 25%),
    radial-gradient(circle at 8% 92%,#eee7ff 0,transparent 28%),
    #eef3f9;
}
.truck-admin-dashboard .executive-hero{
  background:linear-gradient(125deg,#172554 0%,#5b21b6 44%,#0891b2 100%);
  box-shadow:0 22px 55px #4338ca35;
  align-items:center;
  padding:28px 32px;
  margin-bottom:18px;
  border-radius:24px;
}
.truck-admin-dashboard .executive-kpis{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
  margin-bottom:18px;
}
.truck-admin-dashboard .executive-kpis article{
  min-height:138px;padding:20px;border-radius:19px;
  box-shadow:0 15px 35px #17255420;
}
.truck-admin-dashboard .premium-panel.dash-chart-card,
.truck-admin-dashboard .premium-panel{
  background:linear-gradient(145deg,#fff,#fbfdff);
  border:1px solid #e1eaf2;
  border-radius:18px;
  box-shadow:0 14px 40px #17324d10;
  padding:20px;
}
.truck-admin-dashboard .dashboard-split{
  display:grid;
  grid-template-columns:1.25fr .75fr;
  gap:16px;
  margin-bottom:18px;
  align-items:stretch;
}
.truck-admin-dashboard .section-heading{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  margin-bottom:18px;
}
.truck-admin-dashboard .section-heading span{
  display:block;
  font-size:10px;
  letter-spacing:2px;
  font-weight:900;
  opacity:.8;
  color:var(--dash-muted);
  text-transform:uppercase;
}
.truck-admin-dashboard .section-heading h3{
  margin:3px 0 0;
  font-size:18px;
  font-weight:800;
  color:var(--dash-text);
  line-height:1.2;
}
.truck-admin-dashboard .section-heading>b{
  font-size:18px;
  font-weight:800;
  color:#5b21b6;
  white-space:nowrap;
  font-variant-numeric:tabular-nums;
  padding-top:2px;
}
.truck-admin-dashboard .truck-balance-chart{display:grid;gap:10px}
.truck-admin-dashboard .truck-balance-row{
  display:grid;
  grid-template-columns:120px minmax(0,1fr) 90px;
  gap:10px;
  align-items:center;
  text-decoration:none;
  color:var(--dash-text);
  border:0;
  background:transparent;
  padding:2px 0;
  cursor:pointer;
}
.truck-admin-dashboard .truck-balance-row:hover .chart-track{background:#e4ebf3}
.truck-admin-dashboard .chart-name{
  display:flex;
  align-items:center;
  gap:0;
  font-weight:700;
  font-size:13px;
  line-height:1.2;
  min-width:0;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.truck-admin-dashboard .chart-dot{
  display:inline-block;
  width:9px;height:9px;
  border-radius:50%;
  margin-right:7px;
  flex:0 0 auto;
  font-style:normal;
}
.truck-admin-dashboard .chart-track{
  height:10px;
  background:#edf2f7;
  border-radius:99px;
  overflow:hidden;
  min-width:0;
}
.truck-admin-dashboard .chart-fill{
  display:block;
  height:100%;
  border-radius:99px;
  font-style:normal;
  min-width:0;
}
.truck-admin-dashboard .chart-value{
  text-align:right;
  font-variant-numeric:tabular-nums;
  font-size:13px;
  font-weight:800;
  color:var(--dash-text);
}
.truck-admin-dashboard .mini-column-chart{
  height:190px;
  display:flex;
  gap:8px;
  align-items:end;
  justify-content:space-around;
  border-bottom:1px solid var(--dash-line);
  padding:20px 4px 0;
  box-sizing:border-box;
}
.truck-admin-dashboard .mini-col{
  height:100%;
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
  align-items:center;
  min-width:24px;
  flex:1 1 0;
  max-width:56px;
}
.truck-admin-dashboard .mini-col b{
  font-size:8px;
  color:var(--dash-muted);
  writing-mode:vertical-rl;
  transform:rotate(180deg);
  font-weight:700;
  font-variant-numeric:tabular-nums;
  margin-bottom:6px;
  letter-spacing:.02em;
}
.truck-admin-dashboard .mini-col-bar{
  display:block;
  width:18px;
  border-radius:7px 7px 2px 2px;
  font-style:normal;
  flex:0 0 auto;
}
.truck-admin-dashboard .mini-col-bar.is-zero{
  height:8px!important;
  width:14px;
  border-radius:999px;
}
.truck-admin-dashboard .mini-col span{
  font-size:8px;
  margin-top:5px;
  text-align:center;
  color:var(--dash-text);
  font-weight:650;
  line-height:1.15;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.truck-admin-dashboard .premium-table{width:100%}
.truck-admin-dashboard .premium-table thead th{
  background:#0f2f49;
  color:#fff;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.03em;
}
.truck-admin-dashboard .premium-table tbody tr{transition:.15s;background:#fff}
.truck-admin-dashboard .premium-table tbody tr:nth-child(even){background:#f8fbfd}
.truck-admin-dashboard .premium-table tbody tr:hover{background:#eef8ff}
.truck-admin-dashboard .premium-table tfoot th{background:#102f49;color:#fff}
.truck-admin-dashboard .truck-avatar{
  display:inline-grid;place-items:center;width:28px;height:28px;border-radius:9px;margin-right:8px;
  color:#fff;background:linear-gradient(135deg,#2563eb,#7c3aed);font-size:12px;font-weight:800;vertical-align:middle;
}
@media(max-width:1100px){
  .truck-admin-dashboard .executive-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
  .truck-admin-dashboard .dashboard-split{grid-template-columns:1fr}
}
@media(max-width:700px){
  .truck-admin-dashboard .executive-hero{padding:20px;align-items:flex-start;flex-direction:column}
  .truck-admin-dashboard .executive-hero h1{font-size:21px}
  .truck-admin-dashboard .executive-kpis{grid-template-columns:1fr 1fr;gap:9px}
  .truck-admin-dashboard .truck-balance-row{grid-template-columns:95px minmax(0,1fr) 70px}
  .truck-admin-dashboard .premium-table{min-width:980px}
  .truck-admin-dashboard .mini-column-chart{overflow-x:auto;justify-content:flex-start;padding-bottom:4px}
  .truck-admin-dashboard .mini-col{flex:0 0 36px}
}
@media print{
  .truck-admin-dashboard .executive-hero,
  .truck-admin-dashboard .executive-kpis article{color:#fff!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .truck-admin-dashboard .premium-panel{box-shadow:none}
  .no-print{display:none!important}
}

/* —— Purchase & Expense (py_app v15.23) —— */
.purchase-expense-page .purchase-tabs{margin-bottom:14px}
.purchase-section-title{margin:-20px -20px 18px;padding:20px;border-radius:16px 16px 0 0;color:#fff;background:linear-gradient(120deg,#0f766e,#0891b2)}
.purchase-section-title.po{background:linear-gradient(120deg,#1e3a8a,#4f46e5,#7c3aed)}
.purchase-section-title.expense{background:linear-gradient(120deg,#9a3412,#ea580c,#f59e0b)}
.purchase-section-title span,.purchase-expense-page .report-title span{font-size:10px;font-weight:900;letter-spacing:1.5px;display:block}
.purchase-section-title h2,.purchase-section-title h3,.purchase-section-title p{margin:4px 0}
.purchase-entry-card,.purchase-order-entry,.purchase-register-card{padding:20px;border-radius:18px;overflow:hidden}
.purchase-total-strip{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;margin:14px 0}
.purchase-total-strip.expense-strip{grid-template-columns:repeat(2,minmax(0,280px))}
.purchase-total-strip>div{padding:13px;border-radius:12px;color:#fff;background:linear-gradient(135deg,#0f766e,#0891b2)}
.purchase-total-strip>div:last-child{background:linear-gradient(135deg,#b45309,#f59e0b)}
.purchase-total-strip.expense-strip>div:last-child{background:linear-gradient(135deg,#b45309,#f59e0b)}
.purchase-total-strip small,.purchase-total-strip b{display:block}
.purchase-total-strip b{font-size:18px;margin-top:4px;font-variant-numeric:tabular-nums}
.purchase-expense-page .report-title{text-align:center;margin:18px 0 12px}
.purchase-expense-page .report-title h2{margin:5px 0}
.purchase-expense-page .form-actions{display:flex;gap:10px;align-items:center;margin-top:8px}
.purchase-expense-page .btn.green{background:linear-gradient(135deg,#0f766e,#0891b2);color:#fff}
.purchase-expense-page .btn.red{background:#dc2626;color:#fff}
.purchase-expense-page .btn.sm{padding:6px 10px;font-size:12px}
.purchase-expense-page .premium-table thead th{background:#0f2f49;color:#fff;font-size:11px;text-transform:uppercase;letter-spacing:.03em}
.expense-register-card{padding:20px;border-radius:18px;overflow:hidden}
.expense-register-tfoot th{background:#7f1d1d;color:#fff}
.po-line-head,.po-line{display:grid;grid-template-columns:2.3fr .6fr .7fr .8fr .7fr auto;gap:7px;align-items:center}
.po-line-head{padding:8px;color:#64748b;font-size:10px;font-weight:900;text-transform:uppercase}
.po-line{margin-bottom:7px;padding:8px;border:1px solid #dbe4ec;border-radius:11px;background:#f8fafc}
.po-line input,.po-line select{width:100%;min-width:0;padding:9px;border:1px solid #cbd5e1;border-radius:8px;background:#fff}
.po-line-total{text-align:right;font-variant-numeric:tabular-nums}
.po-bottom{margin-top:14px}
.po-status{display:inline-block;padding:4px 9px;border-radius:99px;background:#dbeafe;color:#1d4ed8;font-size:10px;font-weight:900;text-transform:uppercase}
.po-status.completed{background:#dcfce7;color:#166534}
.po-status.cancelled{background:#fee2e2;color:#991b1b}
.po-status-select{padding:6px 8px;border-radius:8px;border:1px solid #cbd5e1}
@media(max-width:750px){
  .purchase-total-strip{grid-template-columns:1fr 1fr}
  .po-line-head{display:none}
  .po-line{grid-template-columns:1fr 1fr}
  .po-line .po-desc{grid-column:1/-1}
}
.purchase-register-tfoot th{background:#102f49;color:#fff}
@media print{
  .purchase-expense-page .purchase-tabs,
  .purchase-expense-page .purchase-entry-card,
  .purchase-expense-page .purchase-order-entry,
  .purchase-expense-page .purchase-section-title,
  .purchase-expense-page .form-actions{display:none!important}
  @page purchase-register{size:A4 landscape;margin:8mm}
  .purchase-register-print-sheet{page:purchase-register}
  .purchase-register-print-sheet{
    box-shadow:none!important;border:0!important;padding:0!important;background:#fff!important;border-radius:0!important
  }
  .purchase-register-title{margin:8px 0 10px!important}
  .purchase-register-title span{color:#0f766e!important;font-size:10px;letter-spacing:1.5px}
  .purchase-register-title h2{font-size:18px!important;margin:4px 0!important;color:#073f68}
  .purchase-register-title p{font-size:11px;margin:0;color:#64748b}
  .purchase-expense-page .purchase-total-strip{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:8px!important;margin:8px 0 12px!important
  }
  .purchase-expense-page .purchase-total-strip>div{
    color:#111!important;background:#fff!important;border:1px solid #cbd5e1!important;
    box-shadow:none!important;padding:10px 12px!important;border-radius:8px!important;
    -webkit-print-color-adjust:exact;print-color-adjust:exact
  }
  .purchase-expense-page .purchase-total-strip>div:last-child{
    border-color:#f59e0b!important;background:#fff7ed!important
  }
  .purchase-expense-page .purchase-total-strip small{color:#64748b!important;opacity:1}
  .purchase-expense-page .purchase-total-strip b{color:#111!important;font-size:14px!important}
  .purchase-register-table{overflow:visible!important;border:0!important}
  .purchase-register-table table{
    width:100%!important;table-layout:fixed!important;border-collapse:collapse!important;font-size:8px!important
  }
  .purchase-register-table th,.purchase-register-table td{
    padding:4px 5px!important;border:1px solid #cbd5e1!important;
    white-space:normal!important;overflow-wrap:anywhere;word-break:break-word;line-height:1.25
  }
  .purchase-register-table thead th{
    background:#0f2f49!important;color:#fff!important;-webkit-print-color-adjust:exact;print-color-adjust:exact
  }
  .purchase-register-tfoot th{
    background:#102f49!important;color:#fff!important;-webkit-print-color-adjust:exact;print-color-adjust:exact
  }
  .purchase-register-table tbody tr:nth-child(even){background:#f8fafc!important}
  @page expense-register{size:A4 landscape;margin:8mm}
  .expense-register-print-sheet{page:expense-register}
  .expense-register-print-sheet{
    box-shadow:none!important;border:0!important;padding:0!important;background:#fff!important;border-radius:0!important
  }
  .expense-register-title{margin:8px 0 10px!important}
  .expense-register-title span{color:#b45309!important;font-size:10px;letter-spacing:1.5px}
  .expense-register-title h2{font-size:18px!important;margin:4px 0!important;color:#7f1d1d}
  .expense-register-title p{font-size:11px;margin:0;color:#64748b}
  .purchase-expense-page .expense-strip{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;margin:8px 0 12px!important;max-width:520px
  }
  .expense-register-table{overflow:visible!important;border:0!important}
  .expense-register-table table{
    width:100%!important;table-layout:fixed!important;border-collapse:collapse!important;font-size:10px!important
  }
  .expense-register-table th,.expense-register-table td{
    padding:5px 6px!important;border:1px solid #cbd5e1!important;
    white-space:normal!important;overflow-wrap:anywhere;word-break:break-word;line-height:1.25
  }
  .expense-register-table thead th{
    background:#7f1d1d!important;color:#fff!important;-webkit-print-color-adjust:exact;print-color-adjust:exact
  }
  .expense-register-tfoot th{
    background:#7f1d1d!important;color:#fff!important;-webkit-print-color-adjust:exact;print-color-adjust:exact
  }
  .expense-register-table tbody tr:nth-child(even){background:#fff7ed!important}
}

/* —— Purchase Order preview modal (py_app v15.23) —— */
#purchaseOrderModal{
  position:fixed;inset:0;z-index:300;overflow:auto;padding:20px;background:#001722e8
}
.po-print-modal{
  position:relative;width:min(900px,96vw);margin:auto;padding:22px;border-radius:18px;background:#fff
}
.po-print-modal .modal-close{
  position:absolute;top:10px;right:14px;border:0;background:transparent;font-size:28px;
  line-height:1;cursor:pointer;color:#64748b
}
.po-print-sheet{color:#172033}
.po-letterhead{
  display:flex;align-items:center;gap:18px;padding-bottom:12px;border-bottom:4px solid #1e3a8a
}
.po-letterhead img{width:100px;height:70px;object-fit:contain}
.po-letterhead h2,.po-letterhead p{margin:3px 0}
.po-letterhead h2{color:#083d66;font-size:20px}
.po-letterhead small{color:#64748b}
.po-document-title{display:flex;justify-content:space-between;align-items:center;margin:20px 0;gap:12px}
.po-document-title span{display:block;font-size:10px;letter-spacing:1.5px;font-weight:900;color:#64748b}
.po-document-title h1{margin:2px 0;color:#1e3a8a;font-size:28px}
.po-document-title strong{
  padding:10px 15px;border-radius:9px;background:#dbeafe;color:#1e3a8a;font-size:14px;white-space:nowrap
}
.po-meta{display:grid;grid-template-columns:2fr 1fr;gap:12px;margin-bottom:16px}
.po-meta>div{padding:12px;border:1px solid #cbd5e1;border-radius:10px}
.po-meta small,.po-meta b{display:block;margin:3px 0}
.po-meta small{color:#64748b;font-size:11px}
.po-meta p{margin:4px 0 0;color:#334155}
.po-items-table{width:100%;border-collapse:collapse}
.po-items-table th,.po-items-table td{padding:8px;border:1px solid #cbd5e1}
.po-items-table th{color:#fff;background:#1e3a8a;text-align:left;font-size:11px;text-transform:uppercase}
.po-items-table .num{text-align:right}
.po-totals{width:330px;margin:14px 0 14px auto}
.po-totals>div{display:flex;justify-content:space-between;padding:7px 10px;border-bottom:1px solid #cbd5e1}
.po-totals .grand{color:#fff;background:#1e3a8a}
.po-notes{margin:10px 0;padding:10px;border-radius:8px;background:#f1f5f9}
.po-notes p{margin:5px 0}
.po-signatures{
  display:grid;grid-template-columns:repeat(3,1fr);gap:35px;margin-top:55px;text-align:center;font-weight:700
}
.po-signatures span{display:block;min-height:28px;border-bottom:1px solid #64748b;margin-top:8px}
.po-generated{
  margin-top:20px;padding-top:8px;border-top:1px solid #cbd5e1;text-align:center;font-size:9px;color:#64748b
}
.print-po-button{display:block;margin:16px auto 0;min-width:220px}
.po-standalone-print{padding:20px;background:#fff}
@media(max-width:750px){
  .po-meta{grid-template-columns:1fr}
  .po-signatures{grid-template-columns:1fr;gap:24px}
}
@media print{
  @page{size:A4 portrait;margin:9mm}
  body:has(#purchaseOrderModal) .app,
  body:has(#purchaseOrderModal) .sidebar,
  body:has(#purchaseOrderModal) .topbar,
  body:has(#purchaseOrderModal) .main > *:not(#purchaseOrderModal){display:none!important}
  #purchaseOrderModal{position:static;padding:0;background:#fff;overflow:visible}
  .po-print-modal{width:100%;padding:0;box-shadow:none;border-radius:0}
  .po-print-modal .modal-close,.print-po-button,.no-print{display:none!important}
  .po-print-sheet{font-size:10px}
  .po-letterhead{display:flex!important}
  .po-items-table th,.po-items-table td{padding:5px}
  .po-signatures{margin-top:38px}
  .po-totals .grand{color:#fff!important;background:#1e3a8a!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .po-items-table th{color:#fff!important;background:#1e3a8a!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}
}

/* Company Settings */
.company-settings-panel{padding:0;overflow:hidden}
.company-settings-banner{
  display:flex;align-items:center;justify-content:space-between;gap:16px;
  padding:18px 22px;color:#fff;
  background:linear-gradient(115deg,#1e3a5f 0%,#1e3a8a 55%,#0e7490 100%)
}
.company-settings-banner h2{margin:0;font-size:22px;font-weight:800}
.company-settings-banner span{font-size:13px;opacity:.9;white-space:nowrap}
.company-settings-title{margin:22px 22px 8px;font-size:18px}
.company-settings-panel form{padding:0 22px 22px}
.company-logo-field{display:flex;flex-wrap:wrap;align-items:center;gap:14px}
.company-logo-field input[type=file]{flex:1;min-width:180px}
.company-logo-preview{
  width:72px;height:72px;border-radius:50%;object-fit:cover;
  border:2px solid #dbe5ef;background:#f8fafc;flex:0 0 auto
}
@media(max-width:700px){
  .company-settings-banner{flex-direction:column;align-items:flex-start}
}

/* Approval Centre */
.approval-hero{
  background:linear-gradient(135deg,#172554,#0f766e);color:#fff;padding:22px
}
.approval-card-head{
  display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:14px
}
.approval-diff{display:grid;grid-template-columns:1fr 1fr;gap:12px;align-items:start}
.approval-diff-row{padding:8px;border-bottom:1px solid #e5e7eb}
.approval-diff-row.is-changed{background:#fff7d6;border-left:4px solid #f59e0b}
.approval-diff-row small{display:block;color:#64748b;margin-bottom:4px}
.approval-diff-value{font:600 13px/1.45 Segoe UI,Arial,sans-serif;margin:2px 0}
.approval-items-wrap{margin-top:6px;overflow:auto}
.approval-items-table{width:100%;border-collapse:collapse;font-size:12px;background:#fff}
.approval-items-table th,.approval-items-table td{
  border:1px solid #e2e8f0;padding:6px 8px;vertical-align:top
}
.approval-items-table th{background:#0f766e;color:#fff;font-weight:700;white-space:nowrap}
.approval-items-table .num{text-align:right;font-variant-numeric:tabular-nums}
.approval-diff-row.is-changed .approval-items-table th{background:#b45309}
.btn.btn-approve,.approval-card .btn-approve{
  background:#16a34a!important;color:#fff!important;border:0
}
.btn.btn-approve:hover,.approval-card .btn-approve:hover{background:#15803d!important;filter:none}
.btn.btn-reject,.approval-card .btn-reject{
  background:#dc2626!important;color:#fff!important;border:0
}
.btn.btn-reject:hover,.approval-card .btn-reject:hover{background:#b91c1c!important;filter:none}
@media(max-width:900px){
  .approval-diff{grid-template-columns:1fr}
}

/* Customer Centre */
.customer-centre-head{
  display:grid;grid-template-columns:1fr auto auto;gap:15px;align-items:center;
  padding:23px 27px;margin-bottom:16px;border-radius:22px;color:#fff;
  background:linear-gradient(120deg,#172554,#4338ca,#0891b2);box-shadow:0 18px 45px #3730a32b
}
.customer-centre-head span{font-size:9px;letter-spacing:2px;font-weight:900;display:block}
.customer-centre-head h2{font-size:28px;margin:3px 0}
.customer-centre-head p{margin:0;opacity:.75}
.customer-centre-head>div:not(:first-child){
  min-width:135px;padding:13px;border-radius:14px;background:#ffffff18;text-align:center
}
.customer-centre-head>div>b,.customer-centre-head>div>small{display:block}
.customer-centre-head>div>b{font-size:20px}
.customer-centre-layout{display:grid;grid-template-columns:285px 1fr;gap:15px;align-items:start}
.customer-directory{
  padding:10px!important;display:flex;flex-direction:column;
  max-height:calc(100vh - 210px);min-height:420px
}
.customer-search input{
  width:100%;padding:12px;border:1px solid var(--line);border-radius:11px;background:#fff
}
.customer-directory-list{flex:1;overflow-y:auto;min-height:0;margin-top:8px;padding-right:2px}
.customer-list-row{
  width:100%;display:flex;gap:10px;align-items:center;border:0;background:none;
  padding:10px;border-radius:11px;text-align:left;cursor:pointer;text-decoration:none;color:inherit
}
.customer-list-row[hidden],.empty-customer[hidden]{display:none!important}
.customer-list-row:hover,.customer-list-row.active{background:linear-gradient(100deg,#e0f2fe,#ede9fe)}
.customer-list-row>span,.customer-profile-main>span{
  display:grid;place-items:center;width:38px;height:38px;flex:0 0 auto;border-radius:12px;
  color:#fff;font-weight:900;background:linear-gradient(135deg,#2563eb,#7c3aed)
}
.customer-list-row div,.customer-list-row b,.customer-list-row small{display:block}
.customer-list-row small{color:var(--muted);margin-top:2px}
.customer-workspace{min-width:0}
.customer-workspace.is-loading{opacity:.55;pointer-events:none}
.customer-profile{
  display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;
  background:linear-gradient(145deg,#fff,#f5f3ff)!important
}
.customer-profile-main{display:flex;align-items:center;gap:13px;min-width:0}
.customer-profile-main>span{width:54px;height:54px;font-size:20px}
.customer-profile h2{margin:3px 0}
.customer-profile p{margin:0;color:var(--muted)}
.customer-code-badge{
  display:inline-block;margin-right:9px;padding:4px 8px;border-radius:8px;
  background:#e0e7ff;color:#4338ca;font-size:12px;vertical-align:middle
}
.customer-balance{text-align:right}
.customer-balance b,.customer-balance small{display:block}
.customer-balance b{font-size:23px;color:#dc2626}
.edit-selected-customer{margin-left:auto}
.customer-toolbar{
  display:flex;flex-direction:row;flex-wrap:nowrap;align-items:flex-end;
  gap:12px;margin:0 0 14px
}
.customer-toolbar h3{margin:0 auto 0 0}
.customer-toolbar .page-filter-range{
  display:flex;flex-direction:row;flex-wrap:nowrap;align-items:flex-end;gap:12px;flex:0 0 auto
}
.customer-toolbar .page-filter-range .field{
  margin:0;width:170px;flex:0 0 170px;min-width:0
}
.customer-toolbar .page-filter-range .field label{
  display:block;margin:0 0 6px;font-size:12px;font-weight:800;
  color:var(--muted);text-transform:uppercase;letter-spacing:.04em
}
.customer-toolbar .page-filter-range .field input{
  width:100%;min-height:42px;height:42px;padding:8px 11px;
  border:1px solid #d6e2ea;border-radius:10px;box-sizing:border-box
}
.customer-toolbar .page-filter-actions{
  display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;
  gap:8px;margin:0;padding:0
}
.customer-toolbar .page-filter-actions .btn{
  min-height:42px;height:42px;padding:0 14px;white-space:nowrap;box-sizing:border-box
}
.customer-transactions{display:grid;gap:7px}
.customer-transactions>button{
  display:grid;grid-template-columns:40px 1fr auto 15px;gap:10px;align-items:center;
  width:100%;padding:11px;border:1px solid #e4ebf2;border-radius:12px;background:#fff;
  text-align:left;cursor:pointer;font:inherit
}
.customer-transactions>button:hover{border-color:#93c5fd;background:#f8fbff}
.customer-transactions small{display:block;color:var(--muted);margin-top:3px}
.customer-transactions strong{text-align:right;white-space:nowrap}
.txn-icon{
  display:grid;place-items:center;width:36px;height:36px;border-radius:11px;color:#fff;font-weight:900
}
.txn-icon.sale,.txn-label.sale{background:#2563eb}
.txn-icon.payment,.txn-label.payment{background:#059669}
.txn-icon.sales-return{background:#0f766e}
.customer-add summary{cursor:pointer;font-weight:850}
.empty-customer{text-align:center;color:var(--muted);padding:20px}
.customer-table-code{display:block;color:#6366f1;font-weight:800;margin-top:3px}
.customer-balances-panel .customer-toolbar{margin-bottom:12px}
.customer-balances-table{width:100%!important}
.customer-balances-table thead th{
  background:var(--navy)!important;color:#fff!important;font-size:11px;text-transform:uppercase;
  letter-spacing:.04em;font-weight:800;border-bottom:0!important
}
.dataTables_wrapper .dataTables_length,.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,.dataTables_wrapper .dataTables_paginate{
  color:#475569;font-size:13px;margin:10px 0
}
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select{
  border:1px solid #d6e2ea;border-radius:8px;padding:6px 8px;background:#fff
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover{
  background:var(--navy)!important;color:#fff!important;border:0!important;border-radius:8px
}
table.dataTable thead .sorting,
table.dataTable thead .sorting_asc,
table.dataTable thead .sorting_desc{background-image:none!important}
#customerTxnModal,#customerEditModal,#customerPrintChoice{
  position:fixed;inset:0;z-index:200;display:grid;place-items:center;padding:14px;background:#001722d9
}
#customerEditModal[hidden],#customerPrintChoice[hidden]{display:none!important}
.customer-print-choice{
  position:relative;width:min(500px,96vw);padding:26px;border-radius:22px;background:#fff
}
.customer-print-choice>span{font-size:10px;letter-spacing:2px;font-weight:900;color:#6366f1}
.customer-print-choice h2{margin:8px 0 6px;font-size:22px}
.customer-print-choice>p{margin:0 0 8px;color:#64748b}
.print-choice{
  display:block;width:100%;margin-top:12px;padding:17px;border:1px solid #dbe5ef;
  border-radius:15px;text-align:left;background:#fff;cursor:pointer;font:inherit
}
.print-choice:hover{border-color:#818cf8;background:#f5f3ff}
.print-choice b,.print-choice small{display:block}
.print-choice b{font-size:16px}
.print-choice small{margin-top:5px;color:#64748b}
.print-choice.transactions{border-left:6px solid #0891b2}
.print-choice.full{border-left:6px solid #7c3aed}
.focused-customer-print{display:none}
.customer-txn-card,.customer-edit-card{
  position:relative;width:min(620px,96vw);max-height:92vh;overflow:auto;padding:25px;
  border-radius:20px;background:#fff
}
.customer-edit-card{width:min(760px,96vw)}
.customer-edit-card>span{font-size:10px;letter-spacing:2px;color:#6366f1;font-weight:900}
.customer-edit-card h2,.customer-txn-card h2{margin:8px 0 16px}
.modal-close{position:absolute;right:15px;top:12px;border:0;background:none;font-size:26px;cursor:pointer;color:#64748b}
.txn-label{display:inline-block;padding:5px 10px;border-radius:99px;color:#fff;font-size:10px;font-weight:900}
.txn-detail-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:18px 0}
.txn-detail-grid>div{padding:13px;border-radius:12px;background:#f4f8fb}
.txn-detail-grid small,.txn-detail-grid b{display:block}
.btn.full{width:100%;display:block;text-align:center}
@media(max-width:1100px){
  .customer-toolbar{flex-wrap:wrap}
  .customer-toolbar .page-filter-actions{flex-wrap:wrap}
}
@media(max-width:850px){
  .customer-centre-layout{grid-template-columns:1fr}
  .customer-directory{max-height:330px;min-height:0}
  .customer-toolbar .page-filter-range{
    display:grid;grid-template-columns:1fr 1fr;width:100%;flex:1 1 100%
  }
  .customer-toolbar .page-filter-range .field{width:auto;flex:1 1 auto}
  .customer-toolbar .page-filter-actions{width:100%;margin-left:0}
}
@media(max-width:700px){
  .customer-centre-head{grid-template-columns:1fr 1fr;padding:18px}
  .customer-centre-head>div:first-child{grid-column:1/-1}
  .customer-profile{align-items:flex-start;flex-direction:column}
  .customer-balance{text-align:left}
  .edit-selected-customer{margin-left:0}
  .txn-detail-grid{grid-template-columns:1fr}
  .customer-transactions>button{grid-template-columns:36px 1fr auto}
  .customer-transactions>button>i{display:none}
}
@media print{
  .customer-directory,.customer-add,.customer-centre-head,.customer-balances-panel{display:none!important}
  .customer-centre-layout{display:block}
  @page{size:A4 portrait;margin:8mm}
  body.focused-customer-printing .app,
  body.focused-customer-printing #customerPrintChoice,
  body.focused-customer-printing #customerTxnModal,
  body.focused-customer-printing #customerEditModal,
  body.focused-customer-printing .swal2-container{display:none!important}
  body.focused-customer-printing,
  body.focused-customer-printing #focusedCustomerPrint{background:#fff!important;color:#111!important}
  body.focused-customer-printing #focusedCustomerPrint{display:block!important}
  .focused-letterhead{
    display:flex;align-items:center;gap:14px;border-bottom:4px solid #0f766e;
    padding-bottom:9px;margin-bottom:12px
  }
  .focused-letterhead img{width:88px;height:62px;object-fit:contain}
  .focused-letterhead h1{margin:0;font-size:18px;letter-spacing:.02em}
  .focused-letterhead p{margin:4px 0 0;font-size:9px;color:#64748b}
  .focused-title{text-align:center;margin:10px 0}
  .focused-title span{font-size:8px;letter-spacing:2px;color:#475569;font-weight:800}
  .focused-title h2{margin:3px 0;font-size:20px}
  .focused-title p{margin:2px 0 0;font-size:10px;color:#475569}
  .focused-profile{display:grid;grid-template-columns:repeat(4,1fr);gap:5px;margin-bottom:9px}
  .focused-profile>div{padding:7px;border:1px solid #d8e2eb;border-radius:7px}
  .focused-profile small,.focused-profile b{display:block}
  .focused-profile small{font-size:7px;color:#64748b;text-transform:none}
  .focused-profile b{font-size:9px;margin-top:2px}
  .focused-tx-table{width:100%;border-collapse:collapse;table-layout:fixed;font-size:7.5px}
  .focused-tx-table th,.focused-tx-table td{border:1px solid #cbd5e1;padding:3px;white-space:normal;word-break:break-word}
  .focused-tx-table th{background:#e0f2fe;text-align:left}
  .focused-tx-table th:nth-child(1){width:10%}
  .focused-tx-table th:nth-child(2){width:15%}
  .focused-tx-table th:nth-child(3){width:31%}
  .focused-tx-table th:nth-child(4){width:10%}
  .focused-tx-table th:nth-child(n+5){width:11%}
  .focused-tx-table .num{text-align:right}
  .focused-tx-table tfoot th{background:#0f3b52;color:#fff}
  .focused-footer{display:flex;justify-content:space-between;margin-top:8px;font-size:8px}
  .focused-footer b{color:#b91c1c}
}
