/* COLORJET Business Manager - Custom Styles */
:root {
  --navy: #1A237E;
  --navy-dark: #121858;
  --navy-light: #3949AB;
  --orange: #F57C00;
  --orange-light: #FFF3E0;
  --sky-blue: #E3F2FD;
  --card-shadow: 0 2px 12px rgba(26, 35, 126, 0.10);
  --sidebar-width: 260px;
  --top-nav-height: 60px;
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', sans-serif;
  background: #f5f6fa;
  color: #2c3e50;
  font-size: 14px;
}

/* ── Sidebar ─────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--navy);
  position: fixed;
  top: 0; left: 0;
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: transform 0.3s ease;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-header {
  padding: 20px 16px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 38px; height: 38px;
  background: var(--orange);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  font-size: 14px;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.brand-name {
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.5px;
}

.brand-sub {
  color: rgba(255,255,255,0.6);
  font-size: 11px;
}

.sidebar-user {
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.user-avatar {
  width: 38px; height: 38px;
  background: var(--orange);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: 13px;
  flex-shrink: 0;
}

.user-name {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  color: rgba(255,255,255,0.6);
  font-size: 11px;
}

.sidebar-nav {
  list-style: none;
  margin: 0;
  padding: 8px 0;
  flex: 1;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 13.5px;
  transition: all 0.2s;
  border-radius: 0;
  white-space: nowrap;
}

.sidebar-nav .nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
}

.sidebar-nav .nav-link.active {
  color: #fff;
  background: rgba(245,124,0,0.25);
  border-right: 3px solid var(--orange);
  font-weight: 600;
}

.sidebar-nav .nav-link i {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.text-danger-light { color: #ff6b6b !important; }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.4);
  font-size: 11px;
  text-align: center;
}

/* ── Sidebar Overlay (mobile) ───────────────────────────────────── */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1039;
  display: none;
}

.sidebar-overlay.show { display: block; }

/* ── Page Content ──────────────────────────────────────────────── */
#page-content-wrapper {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Top Navbar ────────────────────────────────────────────────── */
.top-navbar {
  height: var(--top-nav-height);
  background: #fff;
  border-bottom: 1px solid #e8edf2;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

/* ── Avatar ─────────────────────────────────────────────────────── */
.avatar-sm {
  width: 32px; height: 32px;
  background: var(--navy);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

/* ── Cards ──────────────────────────────────────────────────────── */
.card {
  border: none;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
}

.card-header {
  background: #fff;
  border-bottom: 1px solid #f0f0f5;
  border-radius: 12px 12px 0 0 !important;
  padding: 14px 20px;
  font-weight: 600;
}

/* ── Stat Cards ─────────────────────────────────────────────────── */
.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--card-shadow);
  border: 1px solid rgba(26,35,126,0.06);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26,35,126,0.15);
  color: inherit;
}

.stat-card .stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-card .stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
}

.stat-card .stat-label {
  font-size: 12px;
  color: #8a94a6;
  margin-top: 2px;
}

.stat-card .stat-change {
  font-size: 12px;
  margin-top: 6px;
}

/* Icon background colors */
.icon-navy { background: rgba(26,35,126,0.1); color: var(--navy); }
.icon-orange { background: rgba(245,124,0,0.1); color: var(--orange); }
.icon-success { background: rgba(40,167,69,0.1); color: #28a745; }
.icon-danger { background: rgba(220,53,69,0.1); color: #dc3545; }
.icon-info { background: rgba(23,162,184,0.1); color: #17a2b8; }
.icon-warning { background: rgba(255,193,7,0.1); color: #ffc107; }
.icon-purple { background: rgba(102,16,242,0.1); color: #6610f2; }
.icon-teal { background: rgba(32,201,151,0.1); color: #20c997; }

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn-navy {
  background: var(--navy);
  color: #fff;
  border: none;
}
.btn-navy:hover { background: var(--navy-dark); color: #fff; }
.btn-orange {
  background: var(--orange);
  color: #fff;
  border: none;
}
.btn-orange:hover { background: #e65100; color: #fff; }

/* ── Tables ──────────────────────────────────────────────────────── */
.table {
  font-size: 13.5px;
}

.table thead th {
  background: #f8f9fc;
  font-weight: 600;
  color: #5a6679;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid #e8edf2;
  padding: 10px 12px;
}

.table tbody td { padding: 10px 12px; vertical-align: middle; }
.table-hover tbody tr:hover { background: #f8f9fc; }

/* ── Forms ──────────────────────────────────────────────────────── */
.form-control, .form-select {
  border-radius: 8px;
  border-color: #d8dce6;
  font-size: 14px;
  padding: 8px 12px;
}

.form-control:focus, .form-select:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(26,35,126,0.1);
}

.form-label {
  font-size: 13px;
  font-weight: 500;
  color: #4a5568;
  margin-bottom: 4px;
}

/* ── Login Page ──────────────────────────────────────────────────── */
.login-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--navy) 0%, #3949AB 50%, #1E88E5 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.login-logo .brand-icon {
  width: 48px; height: 48px;
  font-size: 18px;
}

/* ── Daily Ledger ────────────────────────────────────────────────── */
.ledger-in { color: #28a745; font-weight: 600; }
.ledger-out { color: #dc3545; font-weight: 600; }
.ledger-balance { color: var(--navy); font-weight: 700; font-size: 16px; }

/* ── Agreement Preview ───────────────────────────────────────────── */
.agreement-preview {
  background: #fff;
  border: 1px solid #ddd;
  padding: 40px;
  font-size: 14px;
  line-height: 1.8;
  font-family: 'Times New Roman', serif;
}

.agreement-preview h2 {
  text-align: center;
  color: var(--navy);
  font-size: 20px;
  margin-bottom: 20px;
}

/* ── Print Styles ───────────────────────────────────────────────── */
@media print {
  .sidebar, .top-navbar, .no-print, .btn, nav { display: none !important; }
  #page-content-wrapper { margin-left: 0 !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}

/* ── Badges ──────────────────────────────────────────────────────── */
.badge { font-size: 11px; font-weight: 500; padding: 4px 8px; border-radius: 6px; }

/* ── Status Timeline ─────────────────────────────────────────────── */
.timeline { position: relative; padding-left: 20px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 6px; top: 0; bottom: 0;
  width: 2px;
  background: #e8edf2;
}
.timeline-item { position: relative; margin-bottom: 16px; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -18px;
  top: 4px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--navy);
  border: 2px solid #fff;
}

/* ── Progress Bars ────────────────────────────────────────────────── */
.progress { height: 8px; border-radius: 4px; }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.show {
    transform: translateX(0);
  }
  #page-content-wrapper {
    margin-left: 0 !important;
  }
}

/* ── Misc ────────────────────────────────────────────────────────── */
.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--orange);
  display: inline-block;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
}

.text-navy { color: var(--navy) !important; }
.text-orange { color: var(--orange) !important; }
.bg-navy { background: var(--navy) !important; }
.bg-navy-light { background: rgba(26,35,126,0.08); }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #8a94a6;
}
.empty-state i { font-size: 48px; margin-bottom: 12px; display: block; }

/* v1.1.0: original brand asset + service workflow */
.brand-image{width:42px;height:42px;object-fit:contain;border-radius:10px;background:#fff;padding:2px;flex:0 0 auto}
.ticket-action-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(132px,1fr));gap:.65rem}.ticket-action-grid form{margin:0}.ticket-action-grid .btn{width:100%;min-height:42px;font-size:.84rem}.service-photo-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(116px,1fr));gap:.75rem}.service-photo-grid a{display:block;border:1px solid #e2e8f0;border-radius:.65rem;overflow:hidden;background:#f8fafc}.service-photo-grid img{display:block;width:100%;height:104px;object-fit:cover}.service-photo-grid small{display:block;padding:.35rem;color:#475569}.signature-box{border:1px solid #cbd5e1;border-radius:.55rem;background:#fff;overflow:hidden}.signature-canvas{width:100%;height:160px;display:block;touch-action:none;cursor:crosshair}.print-brand-logo{width:54px;height:54px;object-fit:contain}.status-timeline{border-left:2px solid #cbd5e1;margin-left:.5rem;padding-left:1rem}.status-timeline .entry{position:relative;padding-bottom:.8rem}.status-timeline .entry:before{content:'';width:10px;height:10px;border-radius:50%;background:#0ea5e9;position:absolute;left:-1.36rem;top:.35rem}@media(max-width:575px){.ticket-action-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.page-header{gap:.5rem;align-items:flex-start}.page-header .d-flex{flex-wrap:wrap}.brand-image{width:36px;height:36px}}

/* v1.2 Business Command Center refinements */
.text-sky { color: #0284c7 !important; }
.section-title { display:flex; justify-content:space-between; align-items:center; gap:12px; margin:24px 0 12px; font-weight:700; color:#0f172a; font-size:15px; }
.section-title > span:first-child { position:relative; padding-left:12px; }
.section-title > span:first-child:before { content:""; position:absolute; left:0; top:3px; bottom:3px; width:4px; border-radius:5px; background:#0ea5e9; }
.section-title a { color:#0369a1; font-size:12px; text-decoration:none; font-weight:600; }
.dashboard-card, .command-card { min-height: 154px; position:relative; overflow:hidden; transition:transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.dashboard-card:hover, .command-card:hover { transform:translateY(-2px); box-shadow:0 10px 24px rgba(15,23,42,.09); border-color:#7dd3fc; }
.dashboard-card .stat-icon, .command-card .stat-icon { margin-bottom:12px; }
.dashboard-card .stat-value, .command-card .stat-value { font-size:clamp(18px, 2.2vw, 24px); letter-spacing:-.03em; word-break:break-word; }
.command-sync-banner { background:linear-gradient(90deg,#e0f2fe,#f8fafc); color:#0f172a; }
.business-switcher-item { display:flex; gap:12px; align-items:center; padding:14px; border:1px solid #bae6fd; border-radius:14px; background:#f0f9ff; }
.business-switcher-icon { width:42px; height:42px; border-radius:12px; display:grid; place-items:center; background:#0284c7; color:#fff; font-size:20px; }
.mini-kpi { min-height:76px; border:1px solid #e2e8f0; border-radius:12px; padding:10px; background:#fff; }
.mini-kpi span { display:block; color:#64748b; font-size:11px; margin-bottom:4px; }
.mini-kpi strong { display:block; color:#0f172a; font-size:14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.empty-state { text-align:center; max-width:620px; margin:18px auto; padding:32px 18px; }
.empty-state > i { display:block; color:#0ea5e9; font-size:46px; margin-bottom:12px; }
.empty-state h3 { font-size:20px; margin:0 0 10px; color:#0f172a; }
.empty-state p { color:#64748b; margin:0 auto 10px; }
@media (max-width: 575.98px) {
  .page-header { align-items:flex-start; gap:12px; flex-direction:column; }
  .page-header .btn { width:100%; }
  .section-title { margin-top:18px; }
  .dashboard-card, .command-card { min-height:142px; padding:14px; }
  .stat-card .stat-value { font-size:18px !important; }
  .mini-kpi strong { font-size:12px; }
}
@media print {
  .sidebar, .topbar, .page-header .btn, form, .btn, .no-print, .command-sync-banner { display:none !important; }
  #page-content-wrapper, .container-fluid { margin:0 !important; padding:0 !important; width:100% !important; }
  .card, .stat-card { box-shadow:none !important; border:1px solid #cbd5e1 !important; break-inside:avoid; }
  .section-title { margin-top:14px; }
}


/* v1.4.0 — high-volume customer transaction tables */
.customer-control-table-wrap { max-height: calc(100vh - 270px); min-height: 360px; overflow: auto; }
.customer-control-table { min-width: 1260px; font-size: .82rem; }
.customer-control-table thead th { position: sticky; top: 0; z-index: 2; background: #f8fafc; white-space: nowrap; box-shadow: 0 1px 0 #e2e8f0; }
.customer-control-table tbody tr:hover { background: #f0f9ff; }
.max-cell-180 { max-width: 180px; }
.max-cell-260 { max-width: 260px; white-space: normal; }
@media (max-width: 575.98px) {
  .customer-control-table-wrap { max-height: none; min-height: 0; }
  .customer-control-table { font-size: .78rem; }
  .customer-control-table td, .customer-control-table th { padding: .55rem .5rem; }
}

/* ── COLORJET Business Manager v1.5 mobile UI and interaction system ───── */
:root {
  --cj-primary: var(--brand-primary, #0D47A1);
  --cj-navy: #182078;
  --cj-blue: #0097E8;
  --cj-orange: var(--brand-accent, #FF6F00);
  --cj-bg: #F3F5F9;
  --cj-text: #1F2937;
  --cj-subtext: #526887;
  --cj-border: #E4E8EF;
  --cj-success: #22C55E;
  --cj-warning: #F59E0B;
  --cj-danger: #EF4444;
  --cj-purple: #7C3AED;
}
body { background:var(--cj-bg); color:var(--cj-text); font-weight:500; padding-bottom:0; }
body, .form-control, .form-select, .btn { font-size:max(15px, 1em); }
.form-label, .card-title, .card-header, .page-title { font-weight:700; color:var(--cj-text); }
.form-control, .form-select { min-height:44px; color:var(--cj-text); border-color:var(--cj-border); background:#fff; }
.form-control:focus,.form-select:focus { color:var(--cj-text); border-color:var(--cj-blue); box-shadow:0 0 0 .2rem rgba(0,151,232,.14); }
.btn { min-height:40px; border-radius:var(--button-radius,10px); font-weight:800; transition:transform .16s ease,box-shadow .16s ease,background-color .16s ease; }
.btn:active,.card-clickable:active,.stat-card:active,.task-card:active { transform:scale(.98); }
.btn-navy { background:var(--cj-primary); }.btn-navy:hover{background:#093B86;box-shadow:0 8px 18px rgba(13,71,161,.19)}
.btn-orange { background:var(--cj-orange); }.btn-orange:hover{background:#D95E00;box-shadow:0 8px 18px rgba(255,111,0,.2)}
.card,.stat-card,.task-card,.ticket-card,.customer-card,.invoice-card,.stock-card,.report-card,.schedule-card {
  background:#fff;border:1px solid var(--cj-border);border-radius:16px;position:relative;overflow:hidden;
  box-shadow:calc(var(--brand-card-shadow, 1) * 0 3px 14px rgba(24,32,120,.08));
}
.card::before,.stat-card::before,.task-card::before,.ticket-card::before,.customer-card::before,.invoice-card::before,.stock-card::before,.report-card::before,.schedule-card::before{content:"";position:absolute;left:0;top:0;bottom:0;width:4px;background:var(--card-bar,#0097E8)}
.stat-card{min-height:148px;padding:18px;}
.stat-card:hover,.card-clickable:hover,.task-card:hover,.ticket-card:hover,.customer-card:hover,.invoice-card:hover,.stock-card:hover,.report-card:hover,.schedule-card:hover{transform:translateY(-2px);border-color:rgba(0,151,232,.55);box-shadow:0 10px 26px rgba(24,32,120,.13);color:inherit}
.stat-card .stat-value{font-weight:800;color:var(--cj-text)}.stat-card .stat-label{font-size:13px;font-weight:700;color:var(--cj-subtext)}
.stat-card:nth-child(5n+1),.bar-blue{--card-bar:#0097E8}.bar-green{--card-bar:#22C55E}.bar-orange{--card-bar:#FF6F00}.bar-red{--card-bar:#EF4444}.bar-purple{--card-bar:#7C3AED}
.table{color:var(--cj-text)}.table thead th{color:#334155;font-weight:800}.table td{vertical-align:middle}
a:not(.btn):not(.nav-link){color:var(--cj-primary);font-weight:700;text-decoration:none;background:linear-gradient(currentColor,currentColor) 0 100%/0 1px no-repeat;transition:background-size .2s ease,color .2s ease}a:not(.btn):not(.nav-link):hover{background-size:100% 1px;color:var(--cj-blue)}
.section-title a:hover{color:var(--cj-orange)}
.badge{font-weight:800;letter-spacing:.01em}
.app-loading-shell{position:fixed;inset:0;z-index:3000;background:rgba(243,245,249,.98);display:flex;align-items:center;justify-content:center;flex-direction:column;gap:9px;padding:24px;text-align:center;color:var(--cj-text);transition:opacity .26s ease,visibility .26s ease}.app-loading-shell.is-hidden{opacity:0;visibility:hidden;pointer-events:none}.loading-logo-ring{width:106px;height:106px;border-radius:50%;display:grid;place-items:center;position:relative;background:#fff;box-shadow:0 12px 32px rgba(13,71,161,.15)}.loading-logo-ring::before{content:"";position:absolute;inset:-7px;border-radius:50%;border:4px solid transparent;border-top-color:#0097E8;border-right-color:#FF6F00;animation:cjSpin 1.1s linear infinite}.loading-logo{width:78px;height:78px;object-fit:contain;border-radius:14px}.app-loading-shell strong{font-size:18px;font-weight:800}.app-loading-shell span{color:var(--cj-subtext);font-size:14px}.network-notice{position:fixed;left:12px;right:12px;top:10px;z-index:2500;padding:10px 14px;border-radius:12px;color:#fff;font-size:14px;font-weight:700;box-shadow:0 8px 18px rgba(15,23,42,.15)}.network-offline{background:#b45309}.network-update{background:var(--cj-primary);border:0;text-align:left}@keyframes cjSpin{to{transform:rotate(360deg)}}
.pwa-install-banner{position:fixed;z-index:2400;left:max(12px,env(safe-area-inset-left));right:max(12px,env(safe-area-inset-right));bottom:calc(14px + env(safe-area-inset-bottom));background:#fff;border:1px solid rgba(0,151,232,.38);border-radius:16px;padding:14px;box-shadow:0 18px 38px rgba(24,32,120,.24);display:flex;gap:12px;justify-content:space-between;align-items:center}.pwa-install-copy{display:flex;flex-direction:column;gap:3px}.pwa-install-copy strong{font-size:14px}.pwa-install-copy span{font-size:12px;color:var(--cj-subtext);max-width:460px}
.mobile-bottom-nav{display:none}
@media (max-width:991.98px){
  body{padding-bottom:76px}.sidebar{width:min(82vw,310px)}#page-content-wrapper{margin-left:0}.container-fluid.py-4.px-4{padding:16px!important}.top-navbar{height:58px}.page-title{font-size:20px}.page-header{gap:10px;align-items:flex-start}.page-header .btn{min-height:42px}.stat-card{min-height:134px;padding:15px}.stat-card .stat-icon{width:42px;height:42px;font-size:19px}.stat-card .stat-value{font-size:20px}.card{border-radius:14px}.table-responsive{border-radius:14px}.table thead{display:none}.mobile-card-table tbody,.table.mobile-card-table tbody{display:block}.mobile-card-table tr,.table.mobile-card-table tr{display:block;padding:12px;border-bottom:1px solid var(--cj-border)}.mobile-card-table td,.table.mobile-card-table td{display:flex;justify-content:space-between;gap:12px;border:0;padding:4px 0}.mobile-card-table td::before,.table.mobile-card-table td::before{content:attr(data-label);font-weight:800;color:var(--cj-subtext)}
  .mobile-bottom-nav{position:fixed;z-index:2000;bottom:0;left:0;right:0;height:68px;background:#fff;border-top:1px solid var(--cj-border);box-shadow:0 -8px 20px rgba(15,23,42,.08);display:flex;justify-content:space-around;align-items:stretch;padding-bottom:env(safe-area-inset-bottom)}.mobile-bottom-nav a{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;color:#64748b;text-decoration:none;background:none;font-size:10px;font-weight:800}.mobile-bottom-nav a i{font-size:20px}.mobile-bottom-nav a.active{color:var(--cj-primary)}.mobile-bottom-nav a.active::after{content:"";height:3px;width:22px;border-radius:99px;background:var(--cj-orange);position:absolute;bottom:4px}
  .modal-dialog{margin:0;min-height:100%;display:flex;align-items:flex-end}.modal-content{border-radius:20px 20px 0 0}.modal-body{max-height:72vh;overflow-y:auto}.pwa-install-banner{bottom:80px;align-items:flex-start;flex-direction:column}.pwa-install-banner .d-flex{width:100%;justify-content:flex-end}.breadcrumb{display:none!important}
}
@media (max-width:430px){.row.g-3>*,.row.g-2>*{min-width:0}.page-header{display:flex;flex-direction:column}.page-header>div:last-child{width:100%}.page-header .btn{width:100%}.stat-card{min-height:122px}.stat-card .stat-value{font-size:18px}.card-header{padding:13px 15px}.card-body{padding:15px}.pwa-install-copy span{font-size:11px}}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}
/* v1.5.1 user profile photos */
.avatar-image{object-fit:cover;border:2px solid #fff;box-shadow:0 2px 7px rgba(13,71,161,.18)}
.user-table-avatar{width:42px;height:42px;border-radius:50%;object-fit:cover;border:2px solid #e4e8ef;background:#fff;flex:0 0 auto}
.user-table-avatar-fallback{width:42px;height:42px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-size:13px;font-weight:800;background:#0D47A1;color:#fff;flex:0 0 auto}
.profile-avatar{width:96px;height:96px;border-radius:50%;object-fit:cover;border:3px solid #fff;box-shadow:0 5px 18px rgba(13,71,161,.18)}
.profile-avatar-fallback{display:flex;align-items:center;justify-content:center;background:#0D47A1;color:#fff;font-size:30px;font-weight:800}
.access-summary{font-size:12px;line-height:1.45;color:#526887}

/* Fresh Install v2.2.0 — premium mobile-first refinement */
:root{--cj-primary:#0D47A1;--cj-navy:#182078;--cj-sky:#0097E8;--cj-orange:#FF6F00;--cj-bg:#F3F5F9;--cj-text:#1F2937;--cj-sub:#526887;--cj-border:#E4E8EF;--cj-shadow:0 8px 24px rgba(24,32,120,.09)}
body{background:var(--cj-bg);color:var(--cj-text);font-size:15px;font-weight:500}
.brand-image{width:44px;height:44px;object-fit:contain;background:#fff;border-radius:12px;padding:3px;box-shadow:0 3px 10px rgba(0,0,0,.12)}
.sidebar-user .user-avatar{overflow:hidden;background:#fff;border:2px solid rgba(255,255,255,.35)}
.sidebar-user .user-avatar img{width:100%;height:100%;object-fit:cover}
.card,.stat-card{border:1px solid var(--cj-border);border-radius:16px;box-shadow:var(--cj-shadow)}
.stat-card{position:relative;overflow:hidden;padding:18px;border-left:5px solid var(--cj-sky)}
.stat-card.card-border-green{border-left-color:#22C55E}.stat-card.card-border-orange{border-left-color:#FF6F00}.stat-card.card-border-red{border-left-color:#EF4444}.stat-card.card-border-purple{border-left-color:#7C3AED}
.stat-card:active,.btn:active{transform:scale(.98)!important}.stat-card:hover{transform:translateY(-3px);border-color:#9ad5ff;box-shadow:0 12px 28px rgba(13,71,161,.16)}
.page-title{font-weight:800;color:var(--cj-navy);letter-spacing:-.3px}.page-header{margin-bottom:20px}.text-muted{color:var(--cj-sub)!important}.form-label{font-weight:700;color:var(--cj-text)}
.btn{min-height:44px;border-radius:12px;font-weight:800}.btn-navy{background:var(--cj-navy);color:#fff;border-color:var(--cj-navy)}.btn-navy:hover{background:#10175c;color:#fff}.btn-primary{background:var(--cj-primary);border-color:var(--cj-primary)}
.settings-section-label{font-weight:800;color:#8A909B;font-size:13px;letter-spacing:.8px;margin:22px 0 10px}.settings-card{overflow:hidden}.settings-row{min-height:76px;padding:15px 20px;display:flex;align-items:center;justify-content:space-between;gap:16px;border-bottom:1px solid var(--cj-border)}.settings-row:last-child{border-bottom:0}.settings-row strong{font-size:17px;color:var(--cj-text)}.settings-row small{display:block;margin-top:3px;color:var(--cj-sub)}
.premium-switch{position:relative;display:inline-block;width:54px;height:31px;flex:0 0 54px}.premium-switch input{opacity:0;width:0;height:0}.premium-switch span{position:absolute;inset:0;border-radius:999px;background:#cbd5e1;transition:.18s}.premium-switch span:before{content:"";position:absolute;width:25px;height:25px;left:3px;top:3px;border-radius:50%;background:#fff;box-shadow:0 2px 5px rgba(0,0,0,.18);transition:.18s}.premium-switch input:checked+span{background:#22C55E}.premium-switch input:checked+span:before{transform:translateX(23px)}
.mobile-bottom-nav{background:rgba(255,255,255,.97)!important;backdrop-filter:blur(12px);box-shadow:0 -8px 26px rgba(24,32,120,.13);height:72px;padding:7px max(8px,env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));display:flex;justify-content:space-around;gap:3px}.mobile-bottom-nav a{min-width:0;flex:1;min-height:56px;border-radius:14px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;color:#65708a;font-size:10.5px;font-weight:800;text-decoration:none;white-space:nowrap}.mobile-bottom-nav a i{font-size:20px;line-height:1}.mobile-bottom-nav a.active{background:#e7f4ff;color:var(--cj-primary)}
.sticky-mobile-action{position:sticky;bottom:0;background:linear-gradient(180deg,rgba(243,245,249,0),var(--cj-bg) 20%);padding:16px 0 calc(16px + env(safe-area-inset-bottom));z-index:10}
@media(max-width:991.98px){body{padding-bottom:86px}.container-fluid.py-4.px-4{padding:16px!important}.top-navbar{height:60px}.sidebar{box-shadow:8px 0 22px rgba(0,0,0,.2)}.page-header{display:block}.stat-card .stat-value{font-size:22px}.table-responsive table{min-width:680px}.card-header{padding:14px 16px}.form-control,.form-select{font-size:16px;min-height:46px}.settings-row{padding:15px 16px}.settings-row strong{font-size:16px}}
@media(max-width:380px){.mobile-bottom-nav a{font-size:9px}.mobile-bottom-nav a i{font-size:18px}.brand-text{max-width:140px;overflow:hidden}.settings-row small{font-size:11px}}
@media print{.mobile-bottom-nav,.sidebar,.top-navbar,.sticky-mobile-action,.btn,.dropdown{display:none!important}#page-content-wrapper{margin:0!important}.container-fluid{padding:0!important}.card,.stat-card{box-shadow:none!important;border:1px solid #ccc!important}}

/* Live-Ready v2.2.0 — final mobile navigation and original-logo background cleanup */
.brand-image,.loading-logo{background:#fff!important;isolation:isolate}
.brand-image{padding:4px!important}
.logo-light-safe{background:#fff;border-radius:14px;padding:5px;box-shadow:0 4px 14px rgba(13,71,161,.12)}
@media(max-width:991.98px){
  .mobile-bottom-nav{display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px!important;align-items:stretch!important;height:78px!important;padding:7px max(8px,env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left))!important}
  .mobile-bottom-nav a{width:100%;min-width:0!important;min-height:60px!important;overflow:hidden;text-overflow:ellipsis;position:relative;letter-spacing:-.05px;line-height:1.05}
  .mobile-bottom-nav a i{font-size:21px!important;display:block}
  .mobile-bottom-nav a span{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis}
  .mobile-bottom-nav a.active{background:linear-gradient(180deg,#ecf7ff 0%,#e3f2ff 100%)!important;box-shadow:inset 0 0 0 1px rgba(0,151,232,.16)}
  .mobile-bottom-nav a.active::after{content:""!important;position:absolute!important;left:50%!important;bottom:4px!important;transform:translateX(-50%)!important;width:22px!important;height:3px!important;border-radius:99px!important;background:#FF6F00!important}
  body{padding-bottom:92px!important}
  .pwa-install-banner{bottom:92px!important}
}
@media(max-width:375px){.mobile-bottom-nav a{font-size:9px!important}.mobile-bottom-nav a i{font-size:19px!important}}


/* v2.2.0 — Field operations, corporate print and premium engineer mobile UI */
.print-only{display:none}.print-corporate-header,.print-corporate-footer{display:none}
.engineer-hero{background:linear-gradient(135deg,#182078 0%,#0D47A1 54%,#0097E8 100%);color:#fff;border-radius:20px;padding:20px;box-shadow:0 16px 32px rgba(24,32,120,.18)}
.engineer-hero h1{font-size:22px;font-weight:800;margin:0;color:#fff}.engineer-hero p{color:rgba(255,255,255,.82);margin:.35rem 0 0}.engineer-availability{display:inline-flex;align-items:center;gap:7px;padding:8px 11px;border-radius:999px;background:rgba(255,255,255,.13);font-size:12px;font-weight:800}.engineer-availability:before{content:"";width:9px;height:9px;border-radius:50%;background:#22c55e;box-shadow:0 0 0 3px rgba(34,197,94,.18)}
.field-tracking-widget{border:1px solid #bfdbfe;background:linear-gradient(135deg,#eff8ff,#fff);border-radius:16px;padding:14px}.field-tracking-widget .tracking-icon{width:42px;height:42px;border-radius:12px;background:#dbeafe;color:#0D47A1;display:grid;place-items:center;font-size:21px}.field-tracking-widget .tracking-status{font-weight:800;color:#172554}.field-tracking-widget .tracking-note{font-size:12px;color:#526887}.field-tracking-widget .btn{min-height:40px}
.schedule-card{position:relative;background:#fff;border:1px solid #e4e8ef;border-radius:16px;padding:15px;box-shadow:0 6px 18px rgba(24,32,120,.06);margin-bottom:12px;border-left:5px solid #0097E8}.schedule-card.pending{border-left-color:#F59E0B}.schedule-card.completed{border-left-color:#22C55E}.schedule-card.overdue{border-left-color:#EF4444}.schedule-card .time{font-weight:800;color:#182078;font-size:15px}.schedule-card .ticket{font-size:12px;font-weight:800;color:#526887}.schedule-card .customer{font-size:16px;font-weight:800;color:#1F2937}.schedule-card .meta{font-size:12px;color:#526887}.schedule-card .actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:12px}.schedule-card .actions .btn{min-height:40px}
.engineer-kpi-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.engineer-mini-kpi{background:#fff;border:1px solid #e4e8ef;border-radius:14px;padding:12px;min-height:92px;box-shadow:0 4px 14px rgba(24,32,120,.05)}.engineer-mini-kpi strong{display:block;font-size:21px;color:#182078;font-weight:800}.engineer-mini-kpi span{display:block;font-size:11px;color:#526887;font-weight:700;line-height:1.15;margin-top:5px}.engineer-mini-kpi i{color:#0097E8;font-size:18px;float:right}
.field-map-link{display:inline-flex;gap:6px;align-items:center;text-decoration:none;font-weight:800;font-size:12px;color:#0D47A1}.field-map-link:hover{text-decoration:underline;text-decoration-color:#FF6F00;text-underline-offset:4px}
.operation-board{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px}.operation-board .operation-chip{background:#fff;border:1px solid #e4e8ef;border-radius:14px;padding:13px;text-decoration:none;color:#1F2937;box-shadow:0 5px 14px rgba(24,32,120,.05);border-left:4px solid #0097E8}.operation-board .operation-chip strong{display:block;font-size:21px;color:#182078}.operation-board .operation-chip span{display:block;font-size:11px;font-weight:800;color:#526887;margin-top:4px}
.employee-card{background:#fff;border:1px solid #e4e8ef;border-radius:16px;padding:14px;display:flex;align-items:center;gap:12px;box-shadow:0 5px 15px rgba(24,32,120,.05)}.employee-card img,.employee-card .photo-fallback{width:54px;height:54px;border-radius:50%;object-fit:cover;flex:0 0 54px}.employee-card .photo-fallback{display:grid;place-items:center;background:#0D47A1;color:#fff;font-weight:800}.employee-card .employee-name{font-weight:800;color:#1F2937}.employee-card .employee-meta{font-size:12px;color:#526887}
.stock-allocation-card{border:1px solid #e4e8ef;border-radius:14px;padding:12px;background:#fff}.stock-allocation-card .qty{font-weight:800;color:#182078}.stock-allocation-card .loc{font-size:11px;color:#526887}.billing-draft-card{border:1px solid #ddd6fe;border-radius:14px;padding:12px;background:#fafaff}
.report-link{text-decoration:none;color:#0D47A1;font-weight:800}.report-link:hover{color:#FF6F00;text-decoration:underline;text-underline-offset:4px}
@media(max-width:991.98px){.engineer-kpi-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.operation-board{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.operation-board .operation-chip{padding:11px}.operation-board .operation-chip strong{font-size:18px}.engineer-hero{padding:17px}.engineer-hero h1{font-size:20px}.schedule-card{padding:14px}.field-tracking-widget{padding:13px}}
@media(max-width:390px){.engineer-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.operation-board{grid-template-columns:repeat(2,minmax(0,1fr))}.engineer-mini-kpi{min-height:85px}.engineer-mini-kpi strong{font-size:19px}}
@media print{.print-only{display:block!important}.print-corporate-header{padding:0 0 12px;border-bottom:2px solid #0D47A1;margin-bottom:14px}.print-brand-left{display:flex;gap:12px;align-items:center}.print-brand-left img{width:54px;height:54px;object-fit:contain;background:#fff}.print-brand-left strong{display:block;font-size:17px;color:#0D47A1}.print-brand-left span{display:block;font-size:11px;color:#334155}.print-company-contact{text-align:right;float:right;margin-top:-52px;font-size:8.5px;line-height:1.45;color:#334155;max-width:48%}.print-corporate-footer{position:fixed;left:0;right:0;bottom:0;border-top:1px solid #94a3b8;padding-top:6px;font-size:8px;color:#475569;display:flex!important;justify-content:space-between;gap:8px}.print-corporate-footer span{white-space:nowrap}.card{break-inside:avoid}.invoice-card{border:none!important}}


/* v2.3.0 — Customer Machine & Site Asset Registry (from audited legacy mobile concepts; local data only) */
.asset-card{height:100%;background:#fff;border:1px solid var(--cj-border);border-radius:16px;overflow:hidden;box-shadow:0 6px 18px rgba(24,32,120,.06);transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease;color:var(--cj-text)}
.asset-card:hover{transform:translateY(-3px);box-shadow:0 13px 30px rgba(13,71,161,.15);border-color:#95d5ff}.asset-card:active{transform:scale(.99)}
.asset-thumb{height:138px;background:linear-gradient(145deg,#edf7ff,#f7fbff);display:grid;place-items:center;border-bottom:1px solid var(--cj-border);overflow:hidden}.asset-thumb img{width:100%;height:100%;object-fit:cover}.asset-thumb i{font-size:42px;color:var(--cj-primary)}
.asset-content{padding:14px}.asset-code{font-size:11px;letter-spacing:.5px;font-weight:800;color:var(--cj-primary);background:#eaf5ff;border-radius:999px;padding:4px 8px}.asset-content h5{margin:10px 0 3px;font-weight:800;font-size:17px}.asset-model,.asset-customer{font-size:12px;color:var(--cj-sub);margin-top:4px}.asset-meta{display:flex;flex-wrap:wrap;gap:10px;margin-top:12px;font-size:11px;font-weight:700;color:#50627c}.asset-meta i{color:var(--cj-sky)}
.asset-detail-image{height:240px;background:linear-gradient(145deg,#edf7ff,#fff);display:grid;place-items:center;overflow:hidden}.asset-detail-image img{width:100%;height:100%;object-fit:contain;padding:14px}.asset-detail-image i{font-size:74px;color:var(--cj-primary)}
.asset-dl{display:grid;grid-template-columns:105px 1fr;gap:9px 10px;font-size:13px}.asset-dl dt{color:var(--cj-sub);font-weight:700}.asset-dl dd{margin:0;font-weight:600}.asset-dl dd small{display:block;color:var(--cj-sub);font-weight:500;margin-top:2px}.asset-gallery-item{display:block;border:1px solid var(--cj-border);border-radius:12px;overflow:hidden;text-decoration:none;background:#fff;color:var(--cj-text)}.asset-gallery-item img{display:block;width:100%;height:126px;object-fit:cover;background:#f5f7fa}.asset-gallery-item span{display:block;padding:7px 9px;font-size:11px;font-weight:800;text-transform:capitalize}
@media(max-width:991.98px){.asset-thumb{height:122px}.asset-content{padding:13px}.asset-detail-image{height:210px}.asset-dl{grid-template-columns:95px 1fr}.asset-gallery-item img{height:112px}}


/* v3.2.2 — Mobile invoice form: persistent Back + Save controls */
#addInvoiceModal .invoice-modal-back{white-space:nowrap}
@media (max-width:991.98px){
  #addInvoiceModal .mobile-invoice-dialog{
    margin:0;
    width:100%;
    max-width:none;
    min-height:100dvh;
    height:100dvh;
    display:flex;
    align-items:stretch;
  }
  #addInvoiceModal .modal-content{
    width:100%;
    height:100%;
    min-height:100%;
    border-radius:0;
    display:flex;
    flex-direction:column;
  }
  #addInvoiceModal form{
    display:flex;
    flex:1 1 auto;
    min-height:0;
    flex-direction:column;
  }
  #addInvoiceModal .modal-header{
    flex:0 0 auto;
    position:relative;
    z-index:2;
    padding:12px 14px;
  }
  #addInvoiceModal .modal-title{font-size:17px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  #addInvoiceModal .modal-body{
    flex:1 1 auto;
    min-height:0;
    max-height:none;
    overflow-y:auto;
    -webkit-overflow-scrolling:touch;
    padding:16px;
    padding-bottom:20px;
  }
  #addInvoiceModal .invoice-modal-footer{
    flex:0 0 auto;
    display:flex;
    gap:10px;
    justify-content:space-between;
    align-items:center;
    background:#fff;
    border-top:1px solid var(--cj-border);
    box-shadow:0 -8px 22px rgba(15,23,42,.08);
    padding:12px 14px calc(12px + env(safe-area-inset-bottom));
  }
  #addInvoiceModal .invoice-modal-footer .btn{min-height:46px;flex:1;font-weight:800}
  #addInvoiceModal .table-responsive{margin-bottom:4px}
}

/* v3.3.0 — controlled financial workflow & mobile action safety */
.workflow-header{align-items:center}.workflow-steps{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.workflow-step{display:block;text-decoration:none;color:var(--cj-text);background:#fff;border:1px solid var(--cj-border);border-radius:16px;padding:15px;box-shadow:var(--cj-shadow);min-height:118px}.workflow-step:hover{border-color:#8fd4ff;color:var(--cj-text);transform:translateY(-2px)}.workflow-step>span{display:grid;place-items:center;width:30px;height:30px;border-radius:50%;background:#e8f5ff;color:var(--cj-primary);font-size:13px;font-weight:900;margin-bottom:10px}.workflow-step strong{display:block;font-size:14px;font-weight:900}.workflow-step small{display:block;color:var(--cj-sub);font-size:11px;margin-top:5px}.workflow-kpi{min-height:114px;display:flex;flex-direction:column;gap:5px;text-decoration:none;color:var(--cj-text);background:#fff;border:1px solid var(--cj-border);border-left:4px solid var(--cj-sky);border-radius:15px;padding:14px;box-shadow:var(--cj-shadow)}.workflow-kpi:hover{color:var(--cj-text);border-color:#9ad5ff}.workflow-kpi i{font-size:22px;color:var(--cj-primary)}.workflow-kpi span{font-size:11px;font-weight:800;color:var(--cj-sub)}.workflow-kpi strong{font-size:25px;color:var(--cj-navy)}.workflow-section{scroll-margin-top:90px;margin-bottom:18px}.workflow-section .card-header{font-weight:900}.workflow-list{display:flex;flex-direction:column;gap:8px}.workflow-list-row{display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid var(--cj-border);border-radius:12px;padding:11px;background:#fbfdff}.workflow-list-row strong{display:block;color:var(--cj-navy);font-size:13px}.workflow-list-row small{display:block;color:var(--cj-sub);font-size:11px;margin-top:3px}.workflow-empty{border:1px dashed #b8c6d8;border-radius:12px;padding:16px;color:var(--cj-sub);font-size:13px;background:#fbfcfe}.workflow-note{border:1px solid #bae6fd;background:#f0f9ff;border-radius:12px;padding:11px 13px;color:#0c4a6e;font-size:13px}.sticky-form-submit{display:flex;align-items:end}.purchase-status-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.purchase-status-grid>div{background:#f8fafc;border:1px solid var(--cj-border);border-radius:12px;padding:10px}.purchase-status-grid span{display:block;font-size:11px;color:var(--cj-sub);font-weight:800}.purchase-status-grid strong{display:block;margin-top:3px;font-size:13px}.detail-label{font-size:11px;font-weight:900;color:var(--cj-sub);text-transform:uppercase;letter-spacing:.5px;margin-bottom:4px}.mobile-action-dock{display:none}
@media(max-width:991.98px){
  .workflow-steps{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.workflow-step{padding:12px;min-height:104px}.workflow-step>span{margin-bottom:7px}.workflow-kpi{min-height:108px;padding:12px}.workflow-section .card-body{padding:14px}.workflow-list-row{align-items:flex-start;flex-direction:column}.workflow-list-row>div:last-child{width:100%;display:flex}.workflow-list-row .btn,.workflow-list-row form{flex:1}.workflow-list-row form .btn{width:100%}.workflow-section .sticky-form-submit{position:sticky;bottom:0;z-index:5;background:linear-gradient(180deg,rgba(255,255,255,0),#fff 22%);padding-top:14px;padding-bottom:calc(4px + env(safe-area-inset-bottom))}.workflow-section .sticky-form-submit .btn{min-height:50px}.purchase-status-grid{grid-template-columns:1fr}.purchase-detail-card .table-responsive table{min-width:0}.purchase-detail-card .table thead,.purchase-detail-card .table tfoot{display:none}.purchase-detail-card .table tbody{display:block}.purchase-detail-card .table tbody tr{display:block;border-bottom:1px solid var(--cj-border);padding:10px 0}.purchase-detail-card .table tbody td{display:flex;justify-content:space-between;gap:10px;border:0;padding:4px 0}.purchase-detail-card .table tbody td::before{content:attr(data-label);font-size:12px;font-weight:900;color:var(--cj-sub)}
  .workflow-modal .modal-dialog,#purchaseModal .modal-dialog,#expenseModal .modal-dialog{margin:0;width:100%;max-width:none;min-height:100dvh;height:100dvh;display:flex;align-items:stretch}.workflow-modal .modal-content,#purchaseModal .modal-content,#expenseModal .modal-content{width:100%;height:100%;border-radius:0;display:flex;flex-direction:column}.workflow-modal form,#purchaseModal form,#expenseModal form{min-height:0;display:flex;flex:1 1 auto;flex-direction:column}.workflow-modal .modal-body,#purchaseModal .modal-body,#expenseModal .modal-body{flex:1 1 auto;min-height:0;max-height:none;overflow-y:auto}.workflow-modal .modal-footer,#purchaseModal .modal-footer,#expenseModal .modal-footer{flex:0 0 auto;position:sticky;bottom:0;background:#fff;border-top:1px solid var(--cj-border);box-shadow:0 -8px 20px rgba(15,23,42,.09);padding:12px 14px calc(12px + env(safe-area-inset-bottom))}.workflow-modal .modal-footer .btn,#purchaseModal .modal-footer .btn,#expenseModal .modal-footer .btn{flex:1;min-height:48px}.mobile-action-dock{position:fixed;z-index:1900;left:0;right:0;bottom:72px;background:#fff;border-top:1px solid var(--cj-border);box-shadow:0 -8px 20px rgba(15,23,42,.10);padding:9px 12px;display:flex;gap:8px;padding-bottom:9px}.mobile-action-dock>*{flex:1;min-width:0}.mobile-action-dock .btn{width:100%;display:flex;flex-direction:column;gap:1px;align-items:center;justify-content:center;min-height:50px;font-size:11px}.mobile-action-dock .btn i{font-size:18px}.mobile-action-dock+*{margin-bottom:76px}
}
@media(max-width:430px){.workflow-step strong{font-size:12px}.workflow-step small{font-size:10px}.workflow-kpi strong{font-size:21px}.workflow-kpi span{font-size:10px}.workflow-header .btn{width:auto}}


/* v3.4.0 — Field Service & Warranty mobile workflow */
.service-field-workflow{scroll-margin-top:86px}.service-proof-checklist{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.service-proof-item{border:1px solid var(--cj-border);border-radius:12px;padding:11px;background:#fff;display:grid;grid-template-columns:auto 1fr;column-gap:8px;align-items:center}.service-proof-item i{grid-row:span 2;font-size:21px}.service-proof-item span{font-size:11px;font-weight:800;color:var(--cj-sub)}.service-proof-item strong{font-size:12px}.service-proof-item.is-ready{border-color:#86efac;background:#f0fdf4;color:#15803d}.service-proof-item.is-required{border-color:#fde68a;background:#fffbeb;color:#a16207}.service-ticket-mobile-list,.warranty-mobile-list{display:none}.service-mobile-dock form{display:flex;flex:1;min-width:0}.service-mobile-dock form .btn{flex:1}.service-mobile-dock-spacer{display:none}
@media(max-width:991.98px){
  .service-desktop-table,.warranty-desktop-table{display:none}.service-ticket-mobile-list,.warranty-mobile-list{display:flex;flex-direction:column;gap:10px}.service-ticket-mobile-card,.warranty-mobile-card{background:#fff;border:1px solid var(--cj-border);border-radius:16px;padding:13px 14px;box-shadow:var(--cj-shadow);position:relative;overflow:hidden}.service-ticket-mobile-card:before,.warranty-mobile-card:before{content:"";position:absolute;left:0;top:0;bottom:0;width:4px;background:var(--cj-sky)}.service-ticket-card-top,.warranty-mobile-top,.service-ticket-footer,.service-ticket-actions{display:flex;align-items:center;justify-content:space-between;gap:8px}.service-ticket-card-top .ticket-number{font-weight:900;color:var(--cj-navy)}.service-ticket-customer{font-weight:900;font-size:16px;margin-top:10px}.service-ticket-meta,.service-ticket-issue,.service-ticket-footer{font-size:12px;color:var(--cj-sub);margin-top:6px}.service-ticket-issue{line-height:1.45;color:var(--cj-text);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.service-ticket-footer{border-top:1px solid var(--cj-border);padding-top:9px;margin-top:10px}.service-ticket-actions{margin-top:12px}.service-ticket-actions .btn{min-height:42px}.warranty-mobile-card.is-expired:before{background:#ef4444}.warranty-mobile-card.is-expiring:before{background:#f59e0b}.warranty-mobile-top>div{display:flex;align-items:center;gap:7px}.warranty-mobile-top strong{font-size:15px}.warranty-machine{font-weight:800;margin-top:12px}.warranty-mobile-card code{display:block;color:var(--cj-sub);font-size:12px;margin-top:3px}.warranty-mobile-dates{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;border-top:1px solid var(--cj-border);margin-top:12px;padding-top:10px}.warranty-mobile-dates span{font-size:10px;color:var(--cj-sub);font-weight:800}.warranty-mobile-dates strong{display:block;font-size:12px;color:var(--cj-text);margin-top:2px}.service-proof-checklist{grid-template-columns:1fr;gap:7px}.service-proof-item{padding:9px 10px}.service-field-workflow .ticket-action-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.service-field-workflow .ticket-action-grid .btn{min-height:46px;font-size:13px}.service-mobile-dock{bottom:72px}.service-mobile-dock-spacer{display:block;height:82px}.service-mobile-dock .btn{min-height:54px}.service-mobile-dock+ .service-mobile-dock-spacer{margin:0}
  #addTicketModal .modal-dialog,#editTicketModal .modal-dialog,#addWarrantyModal .modal-dialog,#addScheduleModal .modal-dialog{margin:0;width:100%;max-width:none;min-height:100dvh;height:100dvh;display:flex;align-items:stretch}#addTicketModal .modal-content,#editTicketModal .modal-content,#addWarrantyModal .modal-content,#addScheduleModal .modal-content{width:100%;height:100%;border-radius:0;display:flex;flex-direction:column}#addTicketModal form,#editTicketModal form,#addWarrantyModal form,#addScheduleModal form{display:flex;min-height:0;flex:1 1 auto;flex-direction:column}#addTicketModal .modal-body,#editTicketModal .modal-body,#addWarrantyModal .modal-body,#addScheduleModal .modal-body{flex:1 1 auto;overflow-y:auto;min-height:0}#addTicketModal .modal-footer,#editTicketModal .modal-footer,#addWarrantyModal .modal-footer,#addScheduleModal .modal-footer{position:sticky;bottom:0;flex:0 0 auto;background:#fff;border-top:1px solid var(--cj-border);box-shadow:0 -8px 18px rgba(15,23,42,.10);padding:12px 14px calc(12px + env(safe-area-inset-bottom));display:flex;gap:9px}#addTicketModal .modal-footer .btn,#editTicketModal .modal-footer .btn,#addWarrantyModal .modal-footer .btn,#addScheduleModal .modal-footer .btn{flex:1;min-height:48px}
}
@media(max-width:430px){.service-ticket-card-top .badge,.warranty-mobile-top .badge{font-size:10px}.service-mobile-dock{padding-left:8px;padding-right:8px;gap:6px}.service-mobile-dock .btn{font-size:10px}.service-mobile-dock .btn i{font-size:17px}}


/* v3.5.0 — Agreements, EMI receipts and warranty-linked sales workflow */
.agreement-mobile-list,.agreement-schedule-mobile{display:none}.agreement-logo{width:54px;height:54px;object-fit:contain}.agreement-document-head{border-bottom:3px solid var(--cj-primary);padding-bottom:18px}.agreement-info-box{border:1px solid var(--cj-border);background:#f8fbff;border-radius:14px;padding:14px;display:flex;flex-direction:column;gap:4px}.agreement-info-box h6{font-size:12px;color:var(--cj-primary);font-weight:900;margin:0 0 3px}.agreement-info-box strong{font-size:15px;color:var(--cj-navy)}.agreement-info-box span{font-size:12px;color:var(--cj-sub)}.agreement-financial-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:9px}.agreement-financial-grid>div{border:1px solid var(--cj-border);border-radius:12px;padding:11px;background:#fff}.agreement-financial-grid span{display:block;color:var(--cj-sub);font-size:10px;font-weight:900;text-transform:uppercase;letter-spacing:.3px}.agreement-financial-grid strong{display:block;color:var(--cj-navy);font-size:14px;margin-top:4px}.agreement-receipt-summary{display:flex;justify-content:space-between;gap:10px;border:1px solid #bae6fd;border-radius:12px;background:#f0f9ff;padding:12px;color:#075985;font-size:13px}.agreement-receipt-summary span{display:flex;flex-direction:column;gap:3px}.agreement-receipt-summary strong{font-size:16px;color:#0c4a6e}.agreement-mobile-dock-spacer{display:none}
@media(max-width:991.98px){
  .agreement-desktop-table,.agreement-schedule-desktop{display:none}.agreement-mobile-list,.agreement-schedule-mobile{display:flex;flex-direction:column;gap:10px}.agreement-mobile-card,.emi-mobile-card{position:relative;overflow:hidden;border:1px solid var(--cj-border);border-radius:16px;background:#fff;padding:13px 14px;box-shadow:var(--cj-shadow)}.agreement-mobile-card:before,.emi-mobile-card:before{content:"";position:absolute;left:0;top:0;bottom:0;width:4px;background:var(--cj-sky)}.agreement-mobile-card.is-overdue:before,.emi-mobile-card.is-overdue:before{background:#ef4444}.emi-mobile-card.is-paid:before{background:#22c55e}.agreement-mobile-top,.agreement-mobile-actions,.emi-mobile-top{display:flex;align-items:center;justify-content:space-between;gap:8px}.agreement-mobile-top>div{display:flex;align-items:center;gap:7px}.agreement-number{color:var(--cj-navy);font-weight:900;text-decoration:none}.agreement-customer{font-weight:900;font-size:16px;margin-top:10px}.agreement-machine,.emi-mobile-date{font-size:12px;color:var(--cj-sub);margin-top:5px}.agreement-mobile-amounts,.emi-mobile-values{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;border-top:1px solid var(--cj-border);margin-top:12px;padding-top:10px}.agreement-mobile-amounts span,.emi-mobile-values span{font-size:10px;color:var(--cj-sub);font-weight:800}.agreement-mobile-amounts strong,.emi-mobile-values strong{display:block;font-size:13px;color:var(--cj-text);margin-top:2px}.agreement-mobile-actions{margin-top:12px}.agreement-mobile-actions .btn:first-child{flex:1;min-height:42px}.emi-mobile-card{box-shadow:none;border-radius:0;border-width:0 0 1px;padding:14px 16px}.emi-mobile-card:last-child{border-bottom:0}.emi-mobile-top strong{font-size:15px;color:var(--cj-navy)}.agreement-summary-card .card-body{padding:16px!important}.agreement-financial-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.agreement-financial-grid>div{padding:10px}.agreement-financial-grid strong{font-size:13px}.agreement-info-box{padding:12px}.agreement-receipt-summary{flex-direction:column}.agreement-mobile-dock{bottom:72px}.agreement-mobile-dock .btn{min-height:54px}.agreement-mobile-dock-spacer{display:block;height:82px}
  #addAgreementModal .modal-dialog,#emiCollectionModal .modal-dialog{margin:0;width:100%;max-width:none;min-height:100dvh;height:100dvh;display:flex;align-items:stretch}#addAgreementModal .modal-content,#emiCollectionModal .modal-content{width:100%;height:100%;border-radius:0;display:flex;flex-direction:column}#addAgreementModal form,#emiCollectionModal form{display:flex;min-height:0;flex:1 1 auto;flex-direction:column}#addAgreementModal .modal-body,#emiCollectionModal .modal-body{flex:1 1 auto;overflow-y:auto;min-height:0}#addAgreementModal .modal-footer,#emiCollectionModal .modal-footer{position:sticky;bottom:0;flex:0 0 auto;background:#fff;border-top:1px solid var(--cj-border);box-shadow:0 -8px 18px rgba(15,23,42,.1);padding:12px 14px calc(12px + env(safe-area-inset-bottom));display:flex;gap:9px}#addAgreementModal .modal-footer .btn,#emiCollectionModal .modal-footer .btn{flex:1;min-height:48px}
}
@media(max-width:430px){.agreement-mobile-dock{padding-left:8px;padding-right:8px;gap:6px}.agreement-mobile-dock .btn{font-size:10px}.agreement-mobile-dock .btn i{font-size:17px}.agreement-financial-grid strong{font-size:12px}}


/* v3.5.1 — Invoice mobile modal priority and visible submit action */
@media (max-width:991.98px){
  /* Bootstrap modals must be above the app's persistent bottom navigation. */
  body.modal-open .mobile-bottom-nav{display:none!important;}
  .modal{z-index:3100!important;padding:0!important;}
  .modal-backdrop{z-index:3090!important;}
  #addInvoiceModal .modal-dialog{margin:0!important;width:100%!important;max-width:none!important;min-height:100dvh!important;height:100dvh!important;display:flex!important;align-items:stretch!important;}
  #addInvoiceModal .modal-content{height:100dvh!important;min-height:100dvh!important;border-radius:0!important;}
  #addInvoiceModal .modal-body{padding-bottom:18px!important;}
  #addInvoiceModal .invoice-modal-footer{position:sticky!important;bottom:0!important;z-index:8!important;display:flex!important;visibility:visible!important;opacity:1!important;min-height:72px!important;padding:12px 14px calc(12px + env(safe-area-inset-bottom))!important;background:#fff!important;border-top:1px solid var(--cj-border)!important;box-shadow:0 -10px 22px rgba(15,23,42,.14)!important;}
  #addInvoiceModal .invoice-modal-footer .btn{display:flex!important;align-items:center!important;justify-content:center!important;min-height:48px!important;}
}


/* v3.7.0 — Supply-chain clean routes and mobile workflow controls */
.detail-label{font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.04em;color:var(--cj-sub);margin-bottom:3px}.supply-status-list{display:flex;flex-direction:column;gap:12px}.supply-status-list>div{border-bottom:1px solid var(--cj-border);padding-bottom:10px}.supply-status-list>div:last-child{border-bottom:0;padding-bottom:0}.supply-status-list span{display:block;font-size:11px;color:var(--cj-sub);font-weight:800}.supply-status-list strong{font-size:14px;color:var(--cj-text)}
.product-mobile-list,.stock-mobile-list,.purchase-mobile-list,.supplier-mobile-list,.purchase-order-mobile-list,.lc-mobile-list{display:none}.supply-mobile-card{position:relative;overflow:hidden;border:1px solid var(--cj-border);border-radius:16px;background:#fff;padding:13px 14px;box-shadow:var(--cj-shadow)}.supply-mobile-card:before{content:"";position:absolute;left:0;top:0;bottom:0;width:4px;background:var(--cj-sky)}.supply-mobile-card.is-warning:before{background:#f59e0b}.supply-mobile-card.is-danger:before{background:#ef4444}.supply-mobile-top,.supply-mobile-actions{display:flex;align-items:center;justify-content:space-between;gap:8px}.supply-mobile-title{font-weight:900;color:var(--cj-navy);text-decoration:none;font-size:15px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.supply-mobile-meta{font-size:12px;color:var(--cj-sub);margin-top:7px}.supply-mobile-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;border-top:1px solid var(--cj-border);padding-top:10px;margin-top:11px}.supply-mobile-grid small{display:block;font-size:10px;color:var(--cj-sub);font-weight:800}.supply-mobile-grid strong{display:block;font-size:12px;color:var(--cj-text);margin-top:2px;word-break:break-word}.supply-mobile-actions{margin-top:12px}.supply-mobile-actions .btn{flex:1;min-height:40px}.supply-inline-footer{background:#fff;border-top:1px solid var(--cj-border);padding:12px}
@media(max-width:767.98px){
  .product-desktop-table,.stock-desktop-table,.purchase-desktop-table,.supplier-desktop-table,.purchase-order-desktop-table,.lc-desktop-table{display:none!important}
  .product-mobile-list,.stock-mobile-list,.purchase-mobile-list,.supplier-mobile-list,.purchase-order-mobile-list,.lc-mobile-list{display:flex;flex-direction:column;gap:10px}
  #addProductModal .modal-dialog,#stockAdjustModal .modal-dialog,#editProductModal .modal-dialog,#purchaseModal .modal-dialog,#addSupplierModal .modal-dialog,#editSupplierModal .modal-dialog,#purchaseOrderModal .modal-dialog,#addLCModal .modal-dialog,#editLCModal .modal-dialog{margin:0;width:100%;max-width:none;min-height:100dvh;height:100dvh;display:flex;align-items:stretch}
  #addProductModal .modal-content,#stockAdjustModal .modal-content,#editProductModal .modal-content,#purchaseModal .modal-content,#addSupplierModal .modal-content,#editSupplierModal .modal-content,#purchaseOrderModal .modal-content,#addLCModal .modal-content,#editLCModal .modal-content{width:100%;height:100%;border-radius:0;display:flex;flex-direction:column}
  #addProductModal form,#stockAdjustModal form,#editProductModal form,#purchaseModal form,#addSupplierModal form,#editSupplierModal form,#purchaseOrderModal form,#addLCModal form,#editLCModal form{display:flex;min-height:0;flex:1 1 auto;flex-direction:column}
  #addProductModal .modal-body,#stockAdjustModal .modal-body,#editProductModal .modal-body,#purchaseModal .modal-body,#addSupplierModal .modal-body,#editSupplierModal .modal-body,#purchaseOrderModal .modal-body,#addLCModal .modal-body,#editLCModal .modal-body{flex:1 1 auto;overflow-y:auto;min-height:0}
  .supply-modal-footer{position:sticky!important;bottom:0;z-index:6;flex:0 0 auto;background:#fff!important;border-top:1px solid var(--cj-border)!important;box-shadow:0 -8px 18px rgba(15,23,42,.11);padding:12px 14px calc(12px + env(safe-area-inset-bottom))!important;display:flex!important;gap:9px}.supply-modal-footer .btn{flex:1;min-height:48px}
  .page-header{gap:9px;align-items:flex-start}.page-header>.d-flex{flex-wrap:wrap}.page-header .btn{min-height:38px}
}


/* v3.8.0 Finance Control — account-native reporting and mobile-first financial review */
.finance-filter-card{border-left:4px solid var(--cj-primary)}
.finance-shortcut{display:flex;min-height:126px;padding:16px;flex-direction:column;justify-content:center;gap:6px;color:var(--cj-text)!important;background:#fff;border:1px solid var(--cj-border);border-radius:16px;box-shadow:var(--cj-shadow);text-decoration:none!important}
.finance-shortcut:hover{transform:translateY(-2px);border-color:rgba(0,151,232,.58);box-shadow:0 12px 24px rgba(24,32,120,.14);background:#fff}
.finance-shortcut i{font-size:25px;color:var(--cj-primary)}.finance-shortcut strong{font-size:14px}.finance-shortcut span{font-size:12px;color:var(--cj-subtext);font-weight:600}
.finance-policy-list{display:flex;flex-direction:column;gap:14px}.finance-policy{display:flex;gap:11px;align-items:flex-start;padding:11px;border:1px solid var(--cj-border);border-radius:12px;background:#f8fafc}.finance-policy>i{font-size:19px;color:var(--cj-primary)}.finance-policy strong{display:block;font-size:13px}.finance-policy span{display:block;font-size:12px;color:var(--cj-subtext);line-height:1.45;margin-top:2px}.finance-policy.is-alert{background:#fff7ed;border-color:#fed7aa}.finance-policy.is-alert>i{color:#c2410c}
.finance-kpis .stat-card{text-decoration:none!important;color:var(--cj-text)!important}
@media (max-width:991.98px){
  body.modal-open .mobile-bottom-nav{display:none!important}
  .finance-page-header .d-flex{width:100%}.finance-page-header .btn{flex:1}
  .finance-shortcut{min-height:118px;padding:14px}.finance-shortcut i{font-size:22px}
  .finance-filter-card .card-body{padding:14px}
  .mobile-card-table tfoot{display:block;padding:10px 12px;background:#f8fafc}.mobile-card-table tfoot tr{display:flex;justify-content:space-between;gap:8px}.mobile-card-table tfoot td{display:block!important;padding:2px 0!important}.mobile-card-table tfoot td::before{display:none}
}


/* v3.9.0 — Operations Control, task detail and delivery command */
.operations-hero{border:0;background:linear-gradient(135deg,#172a76 0%,#056eaf 58%,#0097e8 100%);color:#fff;overflow:hidden;position:relative}.operations-hero:after{content:"";position:absolute;width:260px;height:260px;border:42px solid rgba(255,255,255,.08);border-radius:50%;right:-86px;top:-135px}.operations-hero .card-body{position:relative;z-index:1;padding:24px}.operations-hero-grid{display:flex;align-items:center;justify-content:space-between;gap:18px}.operations-eyebrow{font-size:11px;letter-spacing:.11em;font-weight:900;color:rgba(255,255,255,.72)}.operations-hero h2{font-size:24px;line-height:1.15;margin:7px 0}.operations-hero p{max-width:620px;color:rgba(255,255,255,.8);margin:0;line-height:1.5}.operations-hero-actions{display:flex;gap:10px;flex-wrap:wrap}.operations-hero-actions .btn{min-height:42px}.operations-queue-list{display:flex;flex-direction:column}.operations-queue-item{display:flex;gap:12px;align-items:center;color:var(--cj-text);text-decoration:none!important;padding:14px 16px;border-bottom:1px solid var(--cj-border);transition:.16s ease}.operations-queue-item:last-child{border-bottom:0}.operations-queue-item:hover{background:#f8fbff}.operations-queue-item.is-overdue{background:#fff7f7}.operations-queue-icon{flex:0 0 38px;width:38px;height:38px;border-radius:11px;display:grid;place-items:center;color:var(--cj-primary);background:#eaf6fd}.operations-queue-item.is-overdue .operations-queue-icon{background:#fee2e2;color:#dc2626}.operations-queue-date{font-size:12px;font-weight:800;color:var(--cj-subtext);white-space:nowrap}.operations-rule{display:flex;gap:11px;padding:12px 0;border-bottom:1px solid var(--cj-border)}.operations-rule:last-child{border-bottom:0}.operations-rule>i{font-size:19px;color:var(--cj-primary)}.operations-rule strong{display:block;font-size:13px}.operations-rule span{display:block;font-size:12px;color:var(--cj-subtext);line-height:1.45;margin-top:2px}.operations-rule.is-alert>i{color:#dc2626}.task-note-box{padding:12px 13px;border:1px solid var(--cj-border);border-radius:12px;background:#f8fafc;line-height:1.55;min-height:43px}.task-comment-list{display:flex;flex-direction:column;gap:13px}.task-comment{display:flex;align-items:flex-start;gap:10px;padding:11px 0;border-bottom:1px solid var(--cj-border);line-height:1.5}.task-comment:last-child{border-bottom:0}.task-comment-avatar{width:32px;height:32px;display:grid;place-items:center;border-radius:50%;background:#eaf6fd;color:#075985;font-size:12px;font-weight:900;flex:0 0 auto}.detail-label{font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.04em;color:var(--cj-sub);margin-bottom:3px}.operation-mobile-dock{position:fixed;z-index:1030;left:0;right:0;bottom:0;display:flex;gap:9px;padding:10px 12px calc(10px + env(safe-area-inset-bottom));background:rgba(255,255,255,.97);border-top:1px solid var(--cj-border);box-shadow:0 -9px 20px rgba(15,23,42,.12)}.operation-mobile-dock .btn{flex:1;display:flex;align-items:center;justify-content:center;gap:7px;min-height:50px}.operation-mobile-spacer{height:75px}
@media(max-width:991.98px){.operations-hero .card-body{padding:18px}.operations-hero-grid{align-items:flex-start;flex-direction:column}.operations-hero h2{font-size:21px}.operations-hero-actions{width:100%}.operations-hero-actions .btn{flex:1}.operations-queue-item{padding:12px;align-items:flex-start}.operations-queue-date{white-space:normal;text-align:right;min-width:66px}.operations-kpis .stat-card{min-height:120px}.task-detail-header .d-flex{width:100%;justify-content:flex-start}.task-comment{font-size:13px}#addTaskModal .modal-dialog,#editTaskModal .modal-dialog{margin:0;width:100%;max-width:none;min-height:100dvh;height:100dvh;display:flex;align-items:stretch}#addTaskModal .modal-content,#editTaskModal .modal-content{width:100%;height:100%;border-radius:0;display:flex;flex-direction:column}#addTaskModal form,#editTaskModal form{display:flex;min-height:0;flex:1 1 auto;flex-direction:column}#addTaskModal .modal-body,#editTaskModal .modal-body{flex:1 1 auto;overflow-y:auto;min-height:0}#addTaskModal .modal-footer,#editTaskModal .modal-footer{position:sticky;bottom:0;z-index:8;flex:0 0 auto;background:#fff;border-top:1px solid var(--cj-border);box-shadow:0 -8px 18px rgba(15,23,42,.1);padding:12px 14px calc(12px + env(safe-area-inset-bottom));display:flex;gap:9px}#addTaskModal .modal-footer .btn,#editTaskModal .modal-footer .btn{flex:1;min-height:48px}}

/* v4.0.0 — Owner Control & Audit Center */
.owner-hero{border:0;background:linear-gradient(135deg,#0f214f 0%,#075985 56%,#0284c7 100%);color:#fff;overflow:hidden;position:relative}.owner-hero:after{content:"";position:absolute;width:275px;height:275px;border:42px solid rgba(255,255,255,.08);border-radius:50%;right:-112px;top:-146px}.owner-hero .card-body{padding:25px;position:relative;z-index:1}.owner-hero-grid{display:flex;align-items:center;justify-content:space-between;gap:20px}.owner-eyebrow{font-size:11px;font-weight:900;letter-spacing:.12em;color:rgba(255,255,255,.7)}.owner-hero h2{font-size:26px;margin:7px 0;line-height:1.14}.owner-hero p{margin:0;max-width:670px;color:rgba(255,255,255,.82);line-height:1.55}.owner-hero-actions{display:flex;gap:9px;flex-wrap:wrap}.owner-metric{display:flex;min-height:130px;flex-direction:column;gap:5px;text-decoration:none!important;color:var(--cj-text)!important;background:#fff;border:1px solid var(--cj-border);border-left:4px solid var(--cj-primary);border-radius:16px;padding:15px;box-shadow:var(--cj-shadow)}.owner-metric:hover{transform:translateY(-2px);border-color:#9bd7fc}.owner-metric>i{font-size:23px;color:var(--cj-primary)}.owner-metric span{font-size:11px;font-weight:900;color:var(--cj-sub)}.owner-metric strong{font-size:25px;color:var(--cj-navy);line-height:1.1}.owner-metric small{font-size:11px;color:var(--cj-subtext);font-weight:700}.owner-queue-card .card-header{font-weight:900}.owner-queue-list{display:flex;flex-direction:column}.owner-queue-item{display:flex;gap:11px;align-items:center;padding:13px 15px;border-bottom:1px solid var(--cj-border);text-decoration:none!important;color:var(--cj-text)!important}.owner-queue-item:last-child{border-bottom:0}.owner-queue-item:hover{background:#f8fbff}.owner-queue-item.is-danger{background:#fffafb}.owner-queue-item.is-warning{background:#fffdf7}.owner-queue-icon{width:38px;height:38px;flex:0 0 38px;border-radius:11px;display:grid;place-items:center;background:#eaf6fd;color:#075985}.owner-queue-item.is-danger .owner-queue-icon{background:#fee2e2;color:#b91c1c}.owner-queue-item.is-warning .owner-queue-icon{background:#fef3c7;color:#a16207}.owner-queue-item strong{display:block;font-size:13px}.owner-queue-item small{display:block;color:var(--cj-subtext);font-size:11px;margin-top:3px}.owner-queue-amount{font-weight:900;color:var(--cj-navy);font-size:13px;text-align:right}.owner-empty{padding:22px 16px;color:var(--cj-subtext);font-size:13px;display:flex;align-items:center;gap:8px}.owner-empty i{font-size:19px;color:#16a34a}.owner-activity-list{display:flex;flex-direction:column}.owner-activity{display:flex;gap:9px;padding:11px 14px;border-bottom:1px solid var(--cj-border)}.owner-activity:last-child{border-bottom:0}.owner-activity-mark{width:25px;color:var(--cj-primary);font-size:25px;line-height:18px}.owner-activity strong{font-size:12px}.owner-activity p{font-size:12px;line-height:1.45;margin:2px 0;color:var(--cj-text)}.owner-activity small{font-size:11px;color:var(--cj-subtext)}.owner-rule{display:flex;gap:10px;padding:11px 0;border-bottom:1px solid var(--cj-border)}.owner-rule:last-child{border-bottom:0}.owner-rule>i{font-size:19px;color:var(--cj-primary)}.owner-rule strong{display:block;font-size:13px}.owner-rule span{display:block;margin-top:2px;font-size:12px;line-height:1.45;color:var(--cj-subtext)}.audit-filter-card{border-left:4px solid #7c3aed}.audit-kpi{height:100%;background:#fff;border:1px solid var(--cj-border);border-radius:15px;padding:15px;box-shadow:var(--cj-shadow);display:flex;flex-direction:column;gap:5px}.audit-kpi i{font-size:22px}.audit-kpi span{font-size:11px;font-weight:900;color:var(--cj-sub)}.audit-kpi strong{font-size:25px;color:var(--cj-navy)}.audit-list{display:flex;flex-direction:column}.audit-event{display:flex;gap:12px;padding:14px 16px;border-bottom:1px solid var(--cj-border)}.audit-event:last-child{border-bottom:0}.audit-event-icon{width:39px;height:39px;flex:0 0 39px;display:grid;place-items:center;border-radius:12px;background:#eef8ff;color:#0369a1}.audit-event-icon.tone-success{background:#dcfce7;color:#15803d}.audit-event-icon.tone-warning{background:#fef3c7;color:#a16207}.audit-event-icon.tone-primary{background:#e0e7ff;color:#4338ca}.audit-event strong{font-size:13px}.audit-event p{font-size:12px;margin:2px 0;line-height:1.45;color:var(--cj-text)}.audit-event small{font-size:11px;color:var(--cj-subtext)}.audit-event-time{font-size:11px;font-weight:800;color:var(--cj-subtext)}.audit-note{display:flex;gap:11px;align-items:flex-start;padding:4px}.audit-note>i{font-size:21px;color:#15803d}.audit-note strong{display:block;font-size:13px}.audit-note span{display:block;font-size:12px;color:var(--cj-subtext);line-height:1.5;margin-top:2px}
@media(max-width:991.98px){.owner-hero .card-body{padding:18px}.owner-hero-grid{align-items:flex-start;flex-direction:column}.owner-hero h2{font-size:22px}.owner-hero-actions{width:100%}.owner-hero-actions .btn{flex:1}.owner-metric{min-height:118px;padding:13px}.owner-metric strong{font-size:21px}.owner-queue-item{align-items:flex-start;padding:12px}.owner-queue-amount{font-size:12px;max-width:92px;overflow-wrap:anywhere}.audit-event{align-items:flex-start;padding:12px}.audit-event-time{white-space:nowrap}.audit-page-header .btn{width:100%}}


/* v4.1 Alert Center — read-only exception feed */
.alert-center-card{border:1px solid var(--cj-border);overflow:hidden}.alert-feed{display:flex;flex-direction:column}.alert-feed-item{display:flex;gap:13px;align-items:flex-start;padding:15px 18px;border-bottom:1px solid var(--cj-border);background:#fff;color:var(--cj-text);transition:background .15s ease,transform .15s ease}.alert-feed-item:last-child{border-bottom:0}.alert-feed-item:hover{background:#f8fbff;color:var(--cj-text)}.alert-feed-item.severity-critical{border-left:4px solid #dc2626}.alert-feed-item.severity-warning{border-left:4px solid #f59e0b}.alert-feed-item.severity-info{border-left:4px solid var(--cj-sky)}.alert-feed-icon{font-size:22px;line-height:1.2;flex:0 0 auto}.alert-feed-copy{min-width:0;flex:1}.alert-feed-copy strong{font-size:15px;color:var(--cj-navy)}.alert-feed-arrow{color:var(--cj-sub);padding-top:6px}.alerts-summary-grid .stat-card{min-height:120px}@media(max-width:767.98px){.alert-center-card .card-header{padding:13px}.alert-feed-item{padding:13px 12px;gap:10px}.alert-feed-copy strong{font-size:14px}.alert-feed-copy .text-muted{font-size:12px}.alert-feed-arrow{display:none}.alerts-summary-grid .stat-card{min-height:112px;padding:13px}.alerts-summary-grid .stat-icon{width:36px;height:36px;font-size:17px}}
/* v4.2.0 Decision Reports */
.report-hero{border:0;background:linear-gradient(135deg,#0f214f 0%,#075985 56%,#0284c7 100%);color:#fff;overflow:hidden;position:relative}.report-hero:after{content:"";position:absolute;width:280px;height:280px;border:40px solid rgba(255,255,255,.08);right:-110px;top:-150px;border-radius:50%}.report-hero .card-body{padding:25px;position:relative;z-index:1}.report-hero-grid{display:flex;align-items:center;justify-content:space-between;gap:20px}.report-hero h2{font-size:26px;line-height:1.15;margin:7px 0}.report-hero p{max-width:720px;margin:0;color:rgba(255,255,255,.85);line-height:1.55}.report-hero-actions{display:flex;gap:8px;flex-wrap:wrap}.report-kpi{height:100%;display:flex;flex-direction:column;gap:5px;border:1px solid var(--cj-border);border-left:4px solid var(--cj-primary);border-radius:16px;background:#fff;padding:15px;box-shadow:var(--cj-shadow);text-decoration:none!important;color:var(--cj-text)!important}.report-kpi.is-danger{border-left-color:#dc2626}.report-kpi.is-warning{border-left-color:#f59e0b}.report-kpi.is-success{border-left-color:#16a34a}.report-kpi>i{font-size:22px;color:var(--cj-primary)}.report-kpi span{font-size:11px;font-weight:900;color:var(--cj-sub)}.report-kpi strong{font-size:24px;line-height:1.1;color:var(--cj-navy)}.report-kpi small{font-size:11px;color:var(--cj-subtext);font-weight:700}.report-table-header{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:13px 16px;border-bottom:1px solid var(--cj-border)}.report-chart-wrap{height:300px;position:relative}.report-aging-row{display:grid;grid-template-columns:90px minmax(0,1fr) auto;gap:11px;align-items:center;padding:12px 0;border-bottom:1px solid var(--cj-border)}.report-aging-label{font-size:12px;font-weight:900;color:var(--cj-navy)}.report-aging-track{height:10px;border-radius:999px;background:#eef2f7;overflow:hidden}.report-aging-fill{height:100%;border-radius:999px;background:var(--cj-primary)}.report-aging-row.is-warning .report-aging-fill{background:#f59e0b}.report-aging-row.is-danger .report-aging-fill{background:#dc2626}.report-aging-value{font-size:13px;font-weight:900;color:var(--cj-navy)}.report-note{display:flex;gap:10px;align-items:flex-start;padding:12px 14px;border:1px solid #bae6fd;background:#f0f9ff;border-radius:12px;color:#0c4a6e;font-size:12px;line-height:1.5}.report-note i{font-size:18px}@media(max-width:991.98px){.report-hero .card-body{padding:18px}.report-hero-grid{align-items:flex-start;flex-direction:column}.report-hero h2{font-size:22px}.report-hero-actions{width:100%}.report-hero-actions .btn{flex:1}.report-kpi{min-height:118px;padding:13px}.report-kpi strong{font-size:20px}.report-chart-wrap{height:250px}.report-aging-row{grid-template-columns:68px minmax(0,1fr);gap:7px}.report-aging-value{grid-column:2;font-size:12px}}
/* v4.3.0 Workforce Access Control */
.access-hero{border:0;background:linear-gradient(135deg,#102653 0%,#0f5f89 53%,#0284c7 100%);color:#fff;overflow:hidden;position:relative}.access-hero:after{content:"";position:absolute;width:250px;height:250px;border:38px solid rgba(255,255,255,.1);right:-115px;top:-135px;border-radius:50%}.access-hero .card-body{padding:25px;position:relative;z-index:1}.access-hero-grid{display:flex;align-items:center;justify-content:space-between;gap:20px}.access-kicker{font-weight:900;font-size:11px;letter-spacing:.08em;color:#d8f1ff}.access-hero h2{font-size:26px;line-height:1.15;margin:7px 0}.access-hero p{max-width:735px;margin:0;color:rgba(255,255,255,.86);line-height:1.55}.access-hero-actions{display:flex;gap:8px;flex-wrap:wrap}.access-kpi{height:100%;display:flex;flex-direction:column;gap:5px;border:1px solid var(--cj-border);border-left:4px solid #0284c7;border-radius:16px;background:#fff;padding:15px;box-shadow:var(--cj-shadow)}.access-kpi>i{font-size:21px;color:#0284c7}.access-kpi span{font-size:11px;font-weight:900;color:var(--cj-sub)}.access-kpi strong{font-size:25px;line-height:1.1;color:var(--cj-navy)}.access-kpi small{font-size:11px;font-weight:700;color:var(--cj-subtext)}.access-kpi.is-warning{border-left-color:#f59e0b}.access-kpi.is-warning>i{color:#d97706}.access-kpi.is-danger{border-left-color:#dc2626}.access-kpi.is-danger>i{color:#dc2626}.access-kpi.is-info{border-left-color:#7c3aed}.access-kpi.is-info>i{color:#7c3aed}.access-panel{overflow:hidden}.access-panel .card-header{font-weight:900}.access-role-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.access-role-card{display:flex;justify-content:space-between;align-items:center;gap:10px;border:1px solid var(--cj-border);background:#fbfdff;border-radius:12px;padding:12px}.access-role-card strong{display:block;color:var(--cj-navy);font-size:13px}.access-role-card small{display:block;margin-top:3px;color:var(--cj-subtext);font-size:11px}.access-role-card>span{width:34px;height:34px;border-radius:10px;display:grid;place-items:center;background:#e7f5ff;color:#075985;font-size:15px;font-weight:900}.access-queue-list{display:flex;flex-direction:column}.access-queue-item{display:flex;align-items:center;gap:11px;padding:13px 15px;border-bottom:1px solid var(--cj-border);text-decoration:none!important;color:var(--cj-text)!important}.access-queue-item:last-child{border-bottom:0}.access-queue-item:hover{background:#f8fbff}.access-queue-item.is-warning{background:#fffdf6}.access-queue-item.is-danger{background:#fffafb}.access-queue-icon{width:36px;height:36px;flex:0 0 36px;border-radius:10px;display:grid;place-items:center;background:#e9f7ff;color:#0369a1}.access-queue-item.is-warning .access-queue-icon{background:#fef3c7;color:#a16207}.access-queue-item.is-danger .access-queue-icon{background:#fee2e2;color:#b91c1c}.access-queue-item span:nth-child(2){flex:1;min-width:0}.access-queue-item strong{display:block;font-size:13px}.access-queue-item small{display:block;font-size:11px;color:var(--cj-subtext);margin-top:2px;line-height:1.42}.access-queue-item>b{font-size:18px;color:var(--cj-navy)}.access-profile-list,.access-login-list,.access-scope-list{display:flex;flex-direction:column}.access-profile-row,.access-login-row{display:flex;gap:10px;align-items:center;padding:12px 14px;border-bottom:1px solid var(--cj-border)}.access-profile-row:last-child,.access-login-row:last-child{border-bottom:0}.access-avatar{width:36px;height:36px;flex:0 0 36px;border-radius:50%;display:grid;place-items:center;background:#e7f5ff;color:#075985;font-size:12px;font-weight:900}.access-profile-row strong,.access-login-row strong{display:block;font-size:13px;color:var(--cj-navy)}.access-profile-row small,.access-login-row small{display:block;font-size:11px;color:var(--cj-subtext);margin-top:2px}.access-empty{padding:18px;color:var(--cj-subtext);display:flex;gap:8px;align-items:center;font-size:12px}.access-empty i{font-size:17px;color:#16a34a}.access-scope-row{display:grid;grid-template-columns:140px minmax(0,1fr);gap:12px;padding:12px 15px;border-bottom:1px solid var(--cj-border)}.access-scope-row:last-child{border-bottom:0}.access-scope-row strong{font-size:12px;color:var(--cj-navy)}.access-scope-row span{font-size:12px;color:var(--cj-subtext);line-height:1.45}.access-login-icon{width:30px;height:30px;flex:0 0 30px;display:grid;place-items:center;border-radius:10px;background:#fee2e2;color:#b91c1c}.access-login-icon.is-success{background:#dcfce7;color:#15803d}.access-login-row time{font-size:11px;text-align:right;color:var(--cj-subtext);max-width:100px}.access-page-header .btn{white-space:nowrap}@media(max-width:991.98px){.access-hero .card-body{padding:18px}.access-hero-grid{align-items:flex-start;flex-direction:column}.access-hero h2{font-size:22px}.access-hero-actions{width:100%}.access-hero-actions .btn{flex:1}.access-kpi{min-height:112px;padding:13px}.access-kpi strong{font-size:21px}.access-role-grid{grid-template-columns:1fr}.access-queue-item{align-items:flex-start;padding:12px}.access-queue-item>b{font-size:15px}.access-scope-row{grid-template-columns:1fr;gap:4px;padding:12px}.access-login-row{align-items:flex-start;padding:12px}.access-login-row time{font-size:10px;white-space:nowrap}.access-page-header .btn{flex:1}}

/* v6.1 production stability: PWA install prompt must not obstruct desktop ERP forms. */
@media (min-width:992px){.pwa-install-banner{display:none!important}}


/* v6.2.0 — Device-adaptive navigation shell.
   The left navigation has a fixed brand/profile area and an independently scrollable module list.
   The current module is positioned by app.js so long role menus remain usable on every screen height. */
:root { --cj-sidebar-desktop-width: clamp(238px, 15.6vw, 270px); }
html, body { max-width: 100%; overflow-x: hidden; }
.sidebar {
  width: var(--cj-sidebar-desktop-width);
  height: 100dvh;
  min-height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  overscroll-behavior: contain;
}
.sidebar-header, .sidebar-user, .sidebar-footer { flex: 0 0 auto; }
.sidebar-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 10px 0 16px;
  -webkit-overflow-scrolling: touch;
}
.sidebar-nav::-webkit-scrollbar { width: 8px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.22); border: 2px solid transparent; border-radius: 999px; background-clip: padding-box; }
.sidebar-nav .nav-link { min-height: 43px; padding: 10px 16px; }
#page-content-wrapper {
  min-width: 0;
  width: calc(100% - var(--cj-sidebar-desktop-width));
  margin-left: var(--cj-sidebar-desktop-width);
}

/* Tablet and phone: use the same off-canvas menu, not a cramped desktop sidebar. */
@media (max-width:1199.98px) {
  body.sidebar-open { overflow: hidden; }
  .sidebar {
    width: min(86vw, 340px);
    height: 100dvh;
    min-height: 100dvh;
    max-height: 100dvh;
    transform: translateX(-100%);
    z-index: 3040;
    box-shadow: 10px 0 30px rgba(12, 22, 68, .26);
  }
  .sidebar.show { transform: translateX(0); }
  .sidebar-overlay { z-index: 3039; }
  .sidebar-nav { padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  #page-content-wrapper { width: 100%; margin-left: 0 !important; }
  #sidebarToggleBtn.d-lg-none, #sidebarToggle.d-lg-none { display: inline-flex !important; }
  .mobile-bottom-nav.d-lg-none { display: grid !important; }
  .pwa-install-banner { bottom: 92px !important; }
}

/* Wide screens keep the PWA prompt out of financial and long-table workflows. */
@media (min-width:1200px) { .pwa-install-banner { display: none !important; } }

@media (max-width:575.98px) {
  .sidebar-header { padding: 16px 14px 10px; }
  .sidebar-user { padding: 13px 14px; }
  .sidebar-nav .nav-link { min-height: 46px; padding: 11px 14px; }
}


/* Phase 3: configurable print/letterhead foundation */
.print-watermark{display:none}
@media print{
  .print-watermark{display:block!important;position:fixed;inset:40% 0 auto;text-align:center;font-size:70px;font-weight:800;letter-spacing:8px;color:rgba(15,23,42,.06);transform:rotate(-28deg);z-index:-1}
  .print-page-number::after{content:counter(page)}
  .print-style-compact .print-brand-left img{width:42px;height:42px}.print-style-compact .print-company-contact{font-size:8px;margin-top:-42px}
  .print-style-minimal{border-bottom:1px solid #94a3b8!important}.print-style-minimal .print-brand-left img{width:36px;height:36px}.print-style-minimal .print-brand-left span{display:none}
}
.print-preview-card{background:#eef2f7;padding:14px}.print-preview-card>.card-body{min-height:520px;box-shadow:0 8px 30px rgba(15,23,42,.12)}
/* COLORJET Business Brain v8.0 */
.brain-chat-card{min-height:720px}.brain-messages{height:570px;overflow:auto;background:#f7f9fc;padding:18px}.brain-message{max-width:88%;margin:0 0 16px;padding:14px 16px;border:1px solid #e4e8ef;border-radius:16px;background:#fff;box-shadow:0 4px 14px rgba(24,32,120,.06)}.brain-message.user{margin-left:auto;border-left:4px solid #0097e8}.brain-message.assistant{margin-right:auto;border-left:4px solid #ff6f00}.brain-message-head{display:flex;justify-content:space-between;gap:12px;margin-bottom:7px;font-size:13px}.brain-message-head small{color:#667085}.brain-message-content{font-weight:500;line-height:1.65;white-space:normal}.brain-empty{text-align:center;color:#526887;padding:80px 20px}.brain-empty i{font-size:44px;color:#0097e8}.brain-conversation-list{max-height:680px;overflow:auto}.brain-input-form textarea{font-size:16px;resize:vertical}@media(max-width:1199.98px){.brain-chat-card{min-height:650px}.brain-messages{height:500px}}@media(max-width:575.98px){.brain-message{max-width:96%;padding:12px}.brain-messages{height:54vh;padding:12px}.brain-chat-card{min-height:auto}.brain-layout>.col-xl-3:first-child{order:2}.brain-layout>.col-xl-6{order:1}.brain-layout>.col-xl-3:last-child{order:3}}
