/* AutoKhata production app — stage 1 styles.
   Brand: emerald + navy (marketing-site palette). Mobile-first. */

:root {
  --navy: #0b2239;
  --navy-2: #10334f;
  --navy-3: #1a4568;
  --emerald: #059669;
  --emerald-2: #10b981;
  --ink: #14212e;
  --muted: #64748b;
  --bg: #f2f6f5;
  --card: #ffffff;
  --border: #dbe5e1;
  --danger-bg: #fdecec;
  --danger: #b3261e;
  --info-bg: #e8f3fd;
  --info: #175d8f;
  --warn-bg: #fdf3e0;
  --warn: #8a5a00;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(11, 34, 57, .05), 0 6px 18px -12px rgba(11, 34, 57, .22);
  --shadow-md: 0 2px 4px rgba(11, 34, 57, .06), 0 14px 30px -16px rgba(11, 34, 57, .30);
  --shadow-lg: 0 24px 60px -18px rgba(2, 12, 24, .45), 0 6px 18px -8px rgba(2, 12, 24, .28);
  --ring: 0 0 0 3px rgba(16, 185, 129, .20);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans", sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font: inherit; cursor: pointer; }
input { font: inherit; }

/* ---------- language switcher ---------- */
.lang-switcher { display: inline-flex; gap: 4px; }
.lang-btn {
  border: 1px solid rgba(255, 255, 255, .35);
  background: transparent;
  color: inherit;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
  line-height: 1.4;
}
.topbar .lang-btn { border-color: var(--border); }
.lang-btn.active { background: var(--emerald); border-color: var(--emerald); color: #fff; }

/* ---------- login ---------- */
.login-body {
  min-height: 100vh;
  background:
    radial-gradient(900px 520px at 88% -10%, rgba(16, 185, 129, .32), rgba(16, 185, 129, 0) 62%),
    radial-gradient(760px 620px at -12% 112%, rgba(26, 69, 104, .55), rgba(26, 69, 104, 0) 58%),
    linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 55%, #0d4d3c 130%);
  color: #fff;
  display: flex;
  flex-direction: column;
}
.login-body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(560px 380px at 88% -6%, rgba(16, 185, 129, .22), rgba(16, 185, 129, 0) 62%),
    radial-gradient(720px 520px at -12% 112%, rgba(26, 69, 104, .40), rgba(26, 69, 104, 0) 60%);
}
/* speedometer dial motif (desktop hero): tick ring + emerald sweep arc */
.login-body::after {
  content: "";
  position: fixed; z-index: 0; pointer-events: none;
  display: none;
}
@media (min-width: 1024px) {
  .login-body::after {
    display: block;
    width: min(370px, 32vw, 74vh); height: min(370px, 32vw, 74vh);
    left: 4vw; top: 50%;
    transform: translateY(-50%);
    border-radius: 50%;
    background:
      repeating-conic-gradient(from -118deg, rgba(255, 255, 255, .55) 0deg 1.6deg, rgba(255, 255, 255, 0) 1.6deg 18deg),
      conic-gradient(from -118deg, rgba(16, 185, 129, .85) 0deg 148deg, rgba(255, 255, 255, .13) 148deg 236deg, rgba(255, 255, 255, 0) 236deg 360deg);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 30px), #000 calc(100% - 29px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 30px), #000 calc(100% - 29px));
    opacity: .75;
  }
  .login-wrap { justify-content: flex-end; padding-right: 8vw; }
}
.login-topbar { display: flex; justify-content: flex-end; padding: 14px 18px 0; position: relative; z-index: 1; }
.login-topbar .lang-switcher {
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  padding: 3px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.login-topbar .lang-btn { border-color: transparent; color: #dbe9e2; }
.login-topbar .lang-btn:hover { color: #fff; }
.login-topbar .lang-btn.active { background: #fff; border-color: #fff; color: var(--navy); font-weight: 700; }
.login-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px 40px;
  position: relative; z-index: 1;
}
.login-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: rgba(255, 255, 255, .98);
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, .65);
  border-radius: 20px;
  padding: 32px 28px 24px;
  box-shadow: var(--shadow-lg);
}
.login-card::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  border-radius: 20px 20px 0 0;
  background: linear-gradient(90deg, var(--emerald-2), var(--emerald) 55%, var(--navy-3));
}
.login-brand { text-align: center; margin-bottom: 8px; }
.brand-logo { max-width: 180px; max-height: 72px; object-fit: contain; }
.brand-logo-sm { max-width: 120px; max-height: 40px; }
.brand-mark {
  width: 58px; height: 58px;
  margin: 0 auto;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--emerald-2), var(--emerald));
  color: #fff;
  font-size: 30px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
/* gauge ring around the login brand mark */
.login-brand .brand-mark {
  position: relative;
  width: 62px; height: 62px;
  border-radius: 50%;
  box-shadow: 0 12px 24px rgba(5, 150, 105, .35), inset 0 0 0 2px rgba(255, 255, 255, .35);
}
.login-brand .brand-mark::after {
  content: "";
  position: absolute; inset: -8px;
  border-radius: 50%;
  background: conic-gradient(from 212deg, var(--emerald) 0deg 232deg, rgba(11, 34, 57, .14) 232deg 360deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
}
.brand-mark-sm { width: 36px; height: 36px; font-size: 19px; border-radius: 9px; margin: 0; flex: none; box-shadow: 0 4px 10px rgba(5, 150, 105, .30); }
.login-brand h1 { margin: 14px 0 2px; font-size: 27px; letter-spacing: -.02em; color: var(--navy); }
.brand-tagline { margin: 0; color: var(--emerald); font-weight: 600; font-size: 13.5px; }
.login-subtitle { text-align: center; color: var(--muted); font-size: 14px; margin: 14px 0 18px; }

.notice { border-radius: 8px; padding: 10px 12px; font-size: 13.5px; margin: 12px 0 0; }
.notice-danger { background: var(--danger-bg); color: var(--danger); }
.notice-info { background: var(--info-bg); color: var(--info); }

.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: var(--navy); }
.field input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 13px;
  background: #f8fbfa;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.field input:hover { border-color: #c3d4cd; }
.field input:focus { outline: 2px solid var(--emerald-2); border-color: transparent; }
.form-error {
  background: var(--danger-bg); color: var(--danger);
  border-radius: 8px; padding: 10px 12px; font-size: 13.5px; margin-bottom: 14px;
}
.btn-primary {
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 12px;
  background: linear-gradient(135deg, var(--emerald-2), var(--emerald) 60%, #047857);
  color: #fff;
  font-weight: 700;
  font-size: 15.5px;
  box-shadow: 0 8px 18px -8px rgba(5, 150, 105, .55);
  transition: box-shadow .18s ease, transform .18s ease, filter .18s ease;
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 12px 22px -8px rgba(5, 150, 105, .6); }
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-primary:disabled { opacity: .65; cursor: wait; }
.login-footer { text-align: center; color: var(--muted); font-size: 12.5px; margin: 18px 0 0; }

/* ---------- shell ---------- */
.app-body { background: var(--bg); }
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 252px;
  flex: none;
  background: linear-gradient(180deg, #0d2a45 0%, var(--navy) 46%, #071a2d 100%);
  color: #dce8f2;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 30;
  box-shadow: 2px 0 18px rgba(4, 20, 34, .16);
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 17px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .10);
  background: rgba(255, 255, 255, .03);
}
.ws-name { font-weight: 700; font-size: 15.5px; color: #fff; line-height: 1.25; }
.side-nav { overflow-y: auto; padding: 10px 10px 20px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .22) transparent; }
.side-nav::-webkit-scrollbar { width: 8px; }
.side-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .18); border-radius: 8px; }
.side-nav::-webkit-scrollbar-track { background: transparent; }
.nav-module {
  font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: #7ea6c4; padding: 15px 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  text-align: left;
  background: transparent; border: 0;
  color: #dce8f2;
  padding: 9px 10px;
  margin-bottom: 2px;
  border-radius: 9px;
  font-size: 14.5px;
  position: relative;
  transition: background .18s ease, transform .18s ease, box-shadow .18s ease;
}
.nav-item:hover { background: rgba(255, 255, 255, .08); transform: translateX(2px); }
.nav-item.active {
  background: linear-gradient(90deg, var(--emerald) 0%, #047857 100%);
  color: #fff; font-weight: 600;
  box-shadow: 0 6px 14px -6px rgba(5, 150, 105, .65);
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-body { background: linear-gradient(180deg, #eaf2ef 0, var(--bg) 260px); }
.topbar {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 6px 18px -14px rgba(11, 34, 57, .35);
  padding: 10px 16px;
  position: sticky; top: 0; z-index: 20;
}
.page-title { font-size: 18px; font-weight: 700; letter-spacing: -.01em; margin: 0; color: var(--navy); flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.user-box { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.user-name { font-weight: 600; font-size: 14px; }
.user-role { font-size: 12px; color: var(--emerald); font-weight: 600; }
.icon-btn {
  border: 1px solid var(--border); background: #fff; border-radius: 10px;
  width: 38px; height: 38px; font-size: 17px; display: none;
  transition: border-color .18s ease, color .18s ease, box-shadow .18s ease;
}
.icon-btn:hover { border-color: var(--emerald-2); color: var(--emerald); box-shadow: var(--shadow-sm); }
.btn-ghost {
  border: 1px solid var(--border); background: #fff; color: var(--navy);
  border-radius: 9px; padding: 8px 14px; font-weight: 600; font-size: 13.5px;
  transition: border-color .18s ease, color .18s ease, background .18s ease, box-shadow .18s ease;
}
.btn-ghost:hover { border-color: var(--emerald); color: var(--emerald); background: #f2f9f6; box-shadow: var(--shadow-sm); }

.banners { padding: 0 16px; }
.banners:empty { padding: 0; }
.banner { border-radius: 10px; padding: 10px 14px; font-size: 13.5px; margin-top: 12px; border: 1px solid rgba(11, 34, 57, .06); box-shadow: var(--shadow-sm); }
.banner-demo { background: var(--info-bg); color: var(--info); }
.banner-info { background: #e6f7f1; color: #065f46; }
.banner-warn { background: var(--warn-bg); color: var(--warn); }

.content { padding: 18px 16px 32px; display: flex; flex-direction: column; gap: 16px; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.card h2 { margin: 0 0 6px; font-size: 17px; color: var(--navy); }
.card p { margin: 0; color: var(--muted); font-size: 14.5px; }
.welcome-card {
  border-left: 4px solid var(--emerald);
  background: linear-gradient(90deg, #e9f7f1 0%, var(--card) 58%);
}

.sidebar-overlay { display: none; }

/* ---------- mobile ---------- */
@media (max-width: 860px) {
  .sidebar {
    position: fixed; left: 0; top: 0;
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: 0 0 40px rgba(0, 0, 0, .3);
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-overlay {
    display: block;
    position: fixed; inset: 0;
    background: rgba(4, 20, 34, .45);
    z-index: 25;
  }
  .icon-btn { display: block; }
  .user-box { display: none; }
  .topbar .lang-switcher { display: none; }
  .login-card { padding: 24px 18px 18px; }
}

/* ---------- stage 2a: shared module UI ---------- */
.muted { color: var(--muted); }
body.modal-open { overflow: hidden; }

.btn-act {
  border: 1px solid var(--border); background: #fff; color: var(--ink);
  border-radius: 9px; padding: 9px 14px; font-size: 13.5px; font-weight: 600;
  cursor: pointer;
  transition: border-color .18s ease, color .18s ease, background .18s ease, box-shadow .18s ease, transform .12s ease;
}
.btn-act:hover:not(:disabled) { border-color: var(--emerald-2); color: var(--emerald); box-shadow: var(--shadow-sm); }
.btn-act:active:not(:disabled) { transform: scale(.98); }
.btn-act:disabled { opacity: .55; cursor: default; }
.btn-act.danger, .btn-act.sm.danger { color: var(--danger); border-color: #f3c6c3; }
.btn-act.danger:hover:not(:disabled) { background: var(--danger-bg); color: var(--danger); }
.btn-act.sm { padding: 5px 10px; font-size: 12.5px; }
.toolbar .btn-primary, .modal-actions .btn-primary { width: auto; padding: 10px 18px; }

.toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  justify-content: space-between; margin-bottom: 14px;
}
.toolbar-search { display: flex; gap: 8px; flex: 1 1 260px; max-width: 520px; }
.toolbar-search input {
  flex: 1; border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; background: #fff; font-size: 14px;
}
.toolbar-search input:focus { outline: 2px solid var(--emerald-2); border-color: transparent; }
.section-title { margin: 0; font-size: 18px; color: var(--navy); }

.state-block { padding: 26px 12px; text-align: center; color: var(--muted); font-size: 14px; }
.state-error { color: var(--danger); }
.spinner {
  display: inline-block; width: 14px; height: 14px; vertical-align: -2px;
  border: 2px solid var(--border); border-top-color: var(--emerald);
  border-radius: 50%; animation: ak-spin .7s linear infinite;
}
@keyframes ak-spin { to { transform: rotate(360deg); } }

.tbl-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
.tbl th {
  text-align: left; padding: 11px 12px; color: var(--navy); font-size: 12.5px;
  text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #f9fcfa, #edf3f0); white-space: nowrap;
}
.tbl td { padding: 10px 12px; border-bottom: 1px solid #eef3f1; vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .num, .tbl th.num { text-align: right; }
.row-actions { white-space: nowrap; }
.row-actions .btn-act { margin-right: 6px; }
.row-actions .btn-act:last-child { margin-right: 0; }

.badge {
  display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; margin-left: 6px; vertical-align: 1px;
  box-shadow: inset 0 0 0 1px rgba(11, 34, 57, .05);
}
.badge::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; margin-right: 5px; opacity: .8; flex: none;
}
.badge-ok { background: #dcf2e7; color: #046c4e; }
.badge-warn { background: #fbeed3; color: var(--warn); }

.pager { display: flex; align-items: center; gap: 12px; justify-content: center; margin-top: 14px; }
.pager .btn-act { border-radius: 999px; }
.pager-info { font-size: 13px; color: var(--muted); background: #eef4f1; border-radius: 999px; padding: 5px 12px; }

/* dashboard */
.stats-grid {
  display: grid; gap: 12px; margin-bottom: 14px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.stat-card {
  position: relative;
  background: var(--card); border: 1px solid var(--border);
  border-top: 3px solid var(--emerald); border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease;
}
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-card.accent-navy { border-top-color: var(--navy-3); }
.stat-card.accent-info { border-top-color: var(--info); }
.stat-card.accent-warn { border-top-color: #d97706; }
.stat-card.accent-danger { border-top-color: var(--danger); }
.stat-label { font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding-right: 48px; }
.stat-value { font-size: 25px; font-weight: 800; letter-spacing: -.01em; color: var(--navy); margin-top: 5px; }
.stat-sub { font-size: 12.5px; color: var(--danger); margin-top: 2px; min-height: 15px; }
.dash-block { margin-bottom: 14px; }
.dash-block h2 { margin: 0 0 6px; font-size: 16px; color: var(--navy); display: flex; align-items: center; gap: 9px; }
.dash-block h2::before {
  content: ""; width: 4px; height: 18px; border-radius: 2px; flex: none;
  background: linear-gradient(180deg, var(--emerald-2), var(--emerald));
}
.balance-list { display: flex; flex-direction: column; gap: 4px; }
.balance-row { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: 10px; transition: background .18s ease; }
.balance-row:hover { background: #f6faf8; }
.balance-name { flex: 0 0 110px; font-weight: 600; font-size: 13.5px; color: var(--navy); display: inline-flex; align-items: center; }
.balance-name::before {
  content: ""; width: 9px; height: 9px; border-radius: 50%; flex: none;
  margin-right: 8px; background: linear-gradient(135deg, var(--emerald-2), var(--emerald));
  box-shadow: 0 0 0 3px rgba(5, 150, 105, .14);
}
.bar-track { flex: 1; height: 12px; background: #e9efec; border-radius: 999px; overflow: hidden; box-shadow: inset 0 1px 3px rgba(11, 34, 57, .12); }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--emerald-2), var(--emerald)); border-radius: 999px; transition: width .6s ease; }
.bar-fill.neg { background: var(--danger); }
.balance-value { flex: 0 0 auto; font-weight: 700; font-size: 13.5px; min-width: 110px; text-align: right; }

/* detail views */
.detail-card { margin-bottom: 14px; }
.detail-card h3 { margin: 0 0 10px; font-size: 15px; color: var(--navy); }
.detail-grid { display: grid; gap: 8px 22px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .detail-grid { grid-template-columns: 1fr 1fr; } }
.detail-row { display: flex; justify-content: space-between; gap: 14px; border-bottom: 1px dashed #e6edea; padding: 5px 0; font-size: 14px; }
.detail-row span { color: var(--muted); }
.detail-row strong { color: var(--ink); text-align: right; }
.mini-list { display: flex; flex-direction: column; }
.mini-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid #eef3f1; font-size: 14px; }
.mini-row:last-child { border-bottom: 0; }

/* modal + form */
.modal-overlay {
  position: fixed; inset: 0; z-index: 60; background: rgba(4, 20, 34, .52);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 18px 12px; overflow-y: auto;
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: ak-fade .18s ease both;
}
.modal-card {
  background: var(--card); border-radius: var(--radius); width: 100%;
  max-width: 640px; padding: 20px; box-shadow: var(--shadow-lg);
  animation: ak-rise .22s ease both;
}
@keyframes ak-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ak-rise { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.modal-head h3 { margin: 0; font-size: 18px; letter-spacing: -.01em; color: var(--navy); }
.modal-x {
  border: 0; background: transparent; font-size: 24px; line-height: 1;
  cursor: pointer; color: var(--muted); padding: 2px 6px;
}
.modal-text { font-size: 14.5px; margin: 4px 0 16px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.form-grid { display: grid; gap: 0 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-grid .field-wide { grid-column: 1 / -1; }
}
.form-grid .field { margin-bottom: 12px; }
.form-grid select, .form-grid textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 8px;
  padding: 11px 12px; background: #fbfdfd; font-size: 14px; font-family: inherit;
}
.form-grid select:focus, .form-grid textarea:focus { outline: 2px solid var(--emerald-2); border-color: transparent; }
.form-grid select:disabled { opacity: .55; }

/* toast */
.toast-wrap {
  position: fixed; right: 14px; bottom: 14px; z-index: 80;
  display: flex; flex-direction: column; gap: 8px; max-width: min(92vw, 380px);
}
.toast {
  background: var(--navy); color: #fff; border-radius: 12px; padding: 12px 15px;
  font-size: 14px; box-shadow: var(--shadow-md);
  border-left: 4px solid var(--emerald-2);
  opacity: 0; transform: translateY(8px); transition: opacity .25s ease, transform .25s ease;
}
.toast.show { opacity: 1; transform: none; }
.toast-error { background: #7f1d1d; border-left-color: #f87171; }

/* ---------- stage 2b: jobs ---------- */
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-navy { background: #e3ebf5; color: var(--navy); }

.filters {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.filter-item { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--navy); }
.filter-item.grow { flex: 1 1 200px; }
.filter-item input, .filter-item select {
  border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px;
  background: #fff; font-size: 14px; font-weight: 400; color: var(--ink);
}
.filter-item input:focus, .filter-item select:focus { outline: 2px solid var(--emerald-2); border-color: transparent; }
.filters .btn-primary { width: auto; padding: 10px 18px; }

.menu-wrap { position: relative; display: inline-block; }
.menu-pop {
  position: fixed; z-index: 300;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-md); min-width: 190px; padding: 5px;
  animation: ak-pop .16s ease both;
}
@keyframes ak-pop { from { opacity: 0; transform: translateY(-3px) scale(.98); } to { opacity: 1; transform: none; } }
.menu-item {
  display: block; width: 100%; text-align: left; background: transparent; border: 0;
  padding: 8px 10px; border-radius: 7px; font-size: 13.5px; color: var(--ink);
}
.menu-item:hover { background: #f0f6f3; }
.menu-item.danger { color: var(--danger); }
.menu-item.danger:hover { background: var(--danger-bg); }

.radio-row { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 12px; }
.radio-item { font-size: 14px; font-weight: 600; color: var(--navy); display: inline-flex; align-items: center; gap: 6px; }
.sub-head { margin: 14px 0 8px; font-size: 14.5px; color: var(--navy); }
.field.align-end { display: flex; align-items: flex-end; padding-bottom: 12px; }

.search-results { margin: 2px 0 10px; }
.result-group {
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); margin: 8px 0 4px;
}
.result-item {
  display: block; width: 100%; text-align: left; background: #fbfdfd;
  border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px;
  margin-bottom: 6px; font-size: 14px;
}
.result-item:hover { border-color: var(--emerald-2); }
.result-empty { padding: 6px 2px; font-size: 13.5px; }
.selected-chip { font-size: 14.5px; margin: 4px 0 10px; }

/* charges editor */
.lines-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 16px 0 8px; font-weight: 700; color: var(--navy); font-size: 14.5px;
}
.lines-head h3 { margin: 0; }
.lines-box { display: flex; flex-direction: column; gap: 10px; }
.line-block { border: 1px solid #eef3f1; border-radius: 10px; padding: 10px; }
.line-row { display: grid; gap: 8px; grid-template-columns: 1fr; }
.line-sub { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; margin-top: 8px; }
@media (min-width: 760px) {
  .lines-box > .line-row { grid-template-columns: 1.6fr 1fr 1fr .8fr auto; align-items: start; }
  .line-block > .line-row { grid-template-columns: 1.6fr .95fr .8fr .85fr auto; align-items: start; }
  .line-sub { grid-template-columns: repeat(5, 1fr); }
}
.line-row input, .line-sub input, .qty-unit select {
  width: 100%; border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 10px; background: #fbfdfd; font-size: 14px;
}
.line-row input:focus, .line-sub input:focus, .qty-unit select:focus { outline: 2px solid var(--emerald-2); border-color: transparent; }
.qty-unit { display: flex; }
.qty-unit input { border-radius: 8px 0 0 8px; border-right: 0; min-width: 0; }
.qty-unit select { width: auto; flex: none; border-radius: 0 8px 8px 0; background: #eef4f1; font-weight: 600; }
.line-amount { font-weight: 700; color: var(--navy); padding: 9px 2px; white-space: nowrap; text-align: right; }

.ac-wrap { position: relative; }
.ac-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 3px); z-index: 45;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(4, 20, 34, .18); overflow: hidden;
}
.ac-row { display: flex; align-items: stretch; border-bottom: 1px solid #eef3f1; }
.ac-row:last-child { border-bottom: 0; }
.ac-item {
  flex: 1; display: flex; justify-content: space-between; gap: 10px; align-items: baseline;
  background: transparent; border: 0; text-align: left; padding: 9px 11px; font-size: 14px;
}
.ac-item:hover { background: #f0f6f3; }
.ac-hint { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.ac-x {
  background: transparent; border: 0; color: var(--muted); font-size: 16px;
  padding: 0 10px; line-height: 1;
}
.ac-x:hover { color: var(--danger); }

.totals-box { margin-top: 16px; border-top: 2px solid var(--border); padding-top: 8px; }
.totals-box .detail-row { max-width: 520px; margin-left: auto; }
.totals-box .detail-row.grand { font-size: 16px; }
.totals-box .detail-row.grand span, .totals-box .detail-row.grand strong { color: var(--navy); font-weight: 800; }
.discount-in input {
  width: 130px; border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 9px; text-align: right; background: #fbfdfd; font-size: 14px;
}

.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.status-ctl { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--navy); }
.status-ctl select {
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px;
  background: #fff; font-size: 13.5px;
}
.row-voided td { opacity: .55; }
.row-voided td .num, .row-voided td { text-decoration: none; }
.cell-sub { font-size: 12.5px; }

/* dashboard monthly chart */
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--navy); }
.chart-legend-item { display: inline-flex; align-items: center; }
.chart-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.chart-svg { width: 100%; height: auto; display: block; }
.chart-val { font-size: 10.5px; fill: #64748b; font-weight: 600; }
.chart-month { font-size: 12px; fill: #14212e; font-weight: 600; }

/* print sheets (gate pass / job card) — ink-friendly: black text, light borders */
#printSheet { display: none; }
.ps-doc-wrap { color: #000; max-width: 760px; margin: 0 auto; font-size: 14px; }
.ps-head { text-align: center; border-bottom: 2px solid #000; padding-bottom: 8px; margin-bottom: 12px; }
.ps-logo { max-height: 54px; max-width: 220px; object-fit: contain; }
.ps-ws { font-size: 22px; font-weight: 800; }
.ps-doc { font-size: 15px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; margin-top: 2px; }
.ps-meta { display: flex; justify-content: space-between; font-weight: 700; margin-top: 6px; }
.ps-reg {
  font-size: 25px; font-weight: 800; text-align: center;
  border: 1.5px solid #000; border-radius: 8px; padding: 8px; margin: 10px 0;
}
.ps-row { display: flex; justify-content: space-between; gap: 14px; padding: 4px 0; border-bottom: 1px dashed #aaa; }
.ps-row span { color: #222; }
.ps-grid { display: grid; grid-template-columns: 1fr; }
@media (min-width: 640px) { .ps-grid { grid-template-columns: 1fr 1fr; column-gap: 26px; } }
.ps-lines { margin-bottom: 8px; }
.ps-sec { font-weight: 800; font-size: 14px; margin: 14px 0 6px; text-transform: uppercase; }
.ps-tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ps-tbl th, .ps-tbl td { border: 1px solid #999; padding: 5px 7px; text-align: left; }
.ps-tbl th { font-weight: 800; }
.ps-tbl .num { text-align: right; }
.ps-sub { color: #333; font-size: 12px; }
.ps-totals { margin-top: 10px; }
.ps-totals .ps-row strong { font-weight: 800; }
.ps-note { margin-top: 10px; }
.ps-sigs { display: flex; gap: 30px; margin-top: 46px; }
.ps-sig { flex: 1; text-align: center; font-size: 13px; }
.ps-sig-line { border-top: 1.5px solid #000; margin-bottom: 5px; }

@media print {
  .app-layout, .toast-wrap, .modal-overlay { display: none !important; }
  #printSheet { display: block !important; }
  body { background: #fff !important; }
}

/* stage 2c: invoices + quotations */
.badge-danger { background: #fee2e2; color: #991b1b; }
.inv-note { margin: 0 2px 12px; font-size: 13px; }
.line-row > .line-grow-in { flex: 1 1 150px; min-width: 110px; }

/* print sheets: invoice / quotation extensions (ink-friendly, spec 5.3) */
.ps-doc-wrap { page: a4sheet; }
.ps-header-strip { display: block; width: 100%; max-height: 110px; object-fit: contain; margin: 0 auto 8px; }
.ps-contact { font-size: 12.5px; text-align: center; color: #222; }
.ps-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin: 8px 0 10px; }
.ps-title { font-size: 19px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.ps-meta-r { text-align: right; font-size: 13.5px; line-height: 1.5; }
.ps-stamp {
  display: inline-block; margin-top: 6px; padding: 2px 10px;
  border: 2px solid #000; font-weight: 800; letter-spacing: .14em;
  text-transform: uppercase; transform: rotate(-4deg); opacity: .7;
}
.ps-cust-label { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #333; }
.ps-row.ps-grand { border-top: 1.5px solid #000; border-bottom: 3px double #000; font-size: 15px; }
.ps-words { margin-top: 12px; font-weight: 700; }
.ps-ledger { margin-top: 12px; }
.ps-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-top: 20px; }
.ps-foot-sigs { flex: 1; }
.ps-foot-sigs .ps-sigs { margin-top: 30px; }
.ps-qr { text-align: left; }
.ps-qr-svg svg { width: 84px; height: 84px; display: block; }
.ps-qr-cap { font-size: 11px; font-weight: 700; margin-top: 3px; }

/* pilot layout: invoice + job sheet (compact, ~11px body, solid black) */
.ps2-doc { font-size: 11.5px; color: #000; line-height: 1.35; max-width: 180mm; margin: 0 auto; }
.ps2-band { overflow: hidden; margin: 0 0 6px; }
.ps2-title-block { text-align: center; margin: 0; padding-top: 2px; }
.ps2-title { font-size: 20px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.ps2-qr { margin-top: 4px; }
.ps2-qr svg { width: 50px; height: 50px; display: block; margin: 0 auto; }
.ps2-qr-cap { font-size: 8.5px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; margin-top: 3px; color: #777; }
.ps2-cust { float: left; width: 43%; }
.ps2-cust-head { font-size: 9px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #888; margin-bottom: 5px; }
.ps2-line { margin: 2px 0; font-size: 12.5px; }
.ps2-meta { float: right; width: 30%; text-align: right; font-size: 12.5px; line-height: 1.5; }
.ps2-meta-time { font-size: 9.5px; color: #888; margin-top: 1px; }
.ps2-stamp { display: block; margin-top: 4px; font-weight: 800; font-size: 13.5px; letter-spacing: .06em; text-transform: uppercase; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.ps2-stamp.is-paid { color: #067647; }
.ps2-stamp.is-partial { color: #dc6803; }
.ps2-stamp.is-unpaid { color: #e0655f; }
.ps2-vgrid { width: 100%; border-collapse: collapse; margin: 2px 0 6px; table-layout: fixed; }
.ps2-vgrid td { border: 1px solid #c8c8c8; padding: 4px 8px 5px; vertical-align: top; }
.ps2-vlab { font-size: 8.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #777; line-height: 1.2; }
.ps2-vval { font-weight: 700; font-size: 12.5px; line-height: 1.25; }
.ps2-sec { margin-top: 7px; }
.ps2-sec-bar { background: #ececec; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-weight: 800; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border: 1px solid #c8c8c8; border-bottom: none; }
.ps2-tbl { width: 100%; border-collapse: collapse; font-size: 11.5px; table-layout: fixed; line-height: 1.28; }
.ps2-tbl th, .ps2-tbl td { border: 1px solid #c8c8c8; padding: 3px 7px; text-align: left; }
.ps2-tbl th { padding-top: 2px; padding-bottom: 2px; }
.ps2-tbl th { font-weight: 600; font-size: 9.5px; color: #777; }
.ps2-tbl .num { text-align: right; }
.ps2-tbl td.ps2-net { font-weight: 700; }
.ps2-tbl tfoot td { font-weight: 800; font-size: 12px; border-top: 1px solid #c8c8c8; }
.ps2-tbl td.ps2-foot-row { text-align: right; }
.ps2-name { font-weight: 700; font-size: 12px; line-height: 1.25; }
.ps2-sub { font-size: 9px; color: #777; line-height: 1.25; }
.ps2-bottom { display: flex; gap: 20px; margin-top: 9px; align-items: flex-start; }
.ps2-left { flex: 1 1 auto; }
.ps2-right { flex: 0 0 38%; }
.ps2-words-lab { font-size: 9px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #888; }
.ps2-words { font-weight: 800; font-size: 13px; line-height: 1.3; margin: 1px 0 8px; }
.ps2-due-strip { display: flex; align-items: center; gap: 10px; margin: 4px 0 8px; }
.ps2-due-cell { padding: 0 2px; }
.ps2-due-lab { font-size: 9px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #888; }
.ps2-due-val { font-weight: 800; font-size: 12.5px; }
.ps2-due-op { font-weight: 800; }
.ps2-note { margin-top: 8px; font-size: 11px; font-weight: 700; }
.ps2-totbox { border: 1px solid #999; }
.ps2-trow { display: flex; justify-content: space-between; gap: 12px; padding: 2px 8px; line-height: 1.25; border-bottom: 1px solid #d5d5d5; }
.ps2-trow:last-child { border-bottom: none; }
.ps2-trow.due { border-top: 1px solid #999; font-size: 12.5px; }
.ps2-sigs { display: flex; gap: 26px; margin-top: 36px; }
.ps2-sig { flex: 1; text-align: center; font-size: 11px; }
.ps2-sig-name { min-height: 15px; font-weight: 700; font-size: 12px; }
.ps2-sig-line { border-top: 1.5px solid #000; margin: 2px 0 4px; }
.ps2-sig-lab.is-bold { font-weight: 700; }
.ps2-pagefoot { text-align: right; font-size: 10px; margin-top: 14px; }

/* pad mode: letterhead as full-page background, content below its header */
.ps-pad-wrap { position: relative; min-height: 255mm; }
.ps-pad-bg {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 0;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.ps-pad-content { position: relative; z-index: 1; padding-top: 118px; }

/* thermal 80mm */
.ps-thermal { page: thermal; width: 80mm; max-width: 80mm; margin: 0 auto; color: #000; font-size: 11.5px; }
.ps-thermal .ps-ws { font-size: 16px; }
.ps-thermal .ps-title { font-size: 14px; }
.ps-thermal .ps-tbl { font-size: 11px; }
.ps-thermal .ps-tbl th, .ps-thermal .ps-tbl td { padding: 3px 4px; }
.ps-thermal .ps-grid { grid-template-columns: 1fr; }
.ps-thermal .ps-sigs { gap: 10px; margin-top: 26px; font-size: 10.5px; }
.ps-thermal .ps-foot { flex-direction: column; align-items: center; }
.ps-thermal .ps-qr { text-align: center; }
.ps-thermal .ps-qr-svg svg { width: 64px; height: 64px; margin: 0 auto; }

@page a4sheet { size: A4; margin: 10mm; }
@page thermal { size: 80mm auto; margin: 3mm; }

/* stage 2d: accounts — vouchers, ledgers, reports */
.link-btn {
  background: none; border: none; padding: 0; cursor: pointer;
  color: #047857; font: inherit; font-weight: 700; text-decoration: underline;
}
.voucher-line .line-row { flex-wrap: wrap; }
.voucher-line .line-sub { display: flex; flex-direction: column; gap: 2px; font-size: 11.5px; color: #555; flex: 1 1 110px; }
.voucher-line .line-sub select, .voucher-line .line-sub input { width: 100%; }
.voucher-totals { margin: 8px 2px 0; font-weight: 600; }
.tbl tfoot .tbl-total-row td { font-weight: 700; border-top: 1.5px solid #999; }
.ledger-tabs { gap: 8px; }
.ps-tbl tfoot td { font-weight: 700; border-top: 1.5px solid #000; }
@media (max-width: 640px) {
  .voucher-line .line-sub { flex: 1 1 45%; }
}

/* stage 2e: suppliers, GRN, stock, movements */
.qty-pos { color: #047857; font-weight: 700; }
.qty-neg { color: var(--danger); font-weight: 700; }
.check-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--navy); padding: 9px 2px; }
.check-chip input { width: 17px; height: 17px; accent-color: var(--emerald); }
.grn-line .line-row { align-items: start; }
.grn-line .line-link { font-size: 12.5px; margin-top: 6px; }
.tbl td .badge + .badge { margin-left: 6px; }
.detail-card .detail-actions { margin: 12px 0 0; }

/* stage 2f: HR — employees, attendance grid, salary */
.badge-bad { background: var(--danger-bg); color: var(--danger); }
.month-tools { align-items: flex-end; }
.tool-field { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--navy); }
.tool-field input, .tool-field select { padding: 8px 10px; border: 1px solid var(--border, #d5dce6); border-radius: 8px; font: inherit; font-weight: 500; background: #fff; }
.att-legend { margin: 4px 2px 10px; font-size: 13px; }
.att-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border, #d5dce6); border-radius: 10px; }
.att-grid { border-collapse: separate; border-spacing: 0; min-width: 100%; }
.att-grid th, .att-grid td { padding: 4px 3px; text-align: center; white-space: nowrap; }
.att-grid thead th { font-size: 11.5px; }
.att-emp-col {
  position: sticky; left: 0; z-index: 2; background: #fff;
  text-align: left !important; min-width: 132px; max-width: 180px;
  white-space: normal !important; box-shadow: 2px 0 0 var(--border, #d5dce6);
}
.att-grid thead .att-emp-col { z-index: 3; background: #f6f8fb; }
.att-cell {
  width: 27px; height: 27px; border-radius: 7px; border: 1px solid #d5dce6;
  background: #fff; font-size: 11px; font-weight: 700; cursor: pointer;
  position: relative; line-height: 1; padding: 0;
}
.att-cell.att-p { background: #e2f5ec; color: #047857; border-color: #9fd8bd; }
.att-cell.att-a { background: var(--danger-bg); color: var(--danger); border-color: #f0b3ae; }
.att-cell.att-l { background: var(--warn-bg); color: var(--warn); border-color: #ecd28f; }
.att-cell.att-h { background: #e8edf7; color: #334e8f; border-color: #b3c4e8; }
.att-cell.att-default { opacity: .75; }
.att-cell.att-dirty { outline: 2px solid var(--emerald-2, #10b981); outline-offset: -1px; }
.att-cell.att-locked { background: #f1f3f6; color: #9aa5b5; cursor: not-allowed; }
.att-ot-dot { position: absolute; top: -3px; right: 0; font-size: 12px; color: #b45309; }
.att-sum { font-weight: 700; font-size: 13px; }
.att-save-cell { min-width: 64px; }
.att-editor { margin-top: 12px; padding: 12px 14px; }
.att-editor-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.att-editor-row .field { flex: 0 1 170px; }
.att-year { margin-top: 16px; padding: 14px; }
.att-year h3 { margin: 0 0 10px; }
@media (max-width: 640px) {
  .att-emp-col { min-width: 104px; }
  .att-cell { width: 25px; height: 25px; }
}

/* ---- stage 2g: users / roles / access rights / settings ---- */
.avatar {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%; flex: none; overflow: hidden;
  background: var(--navy-3); color: #fff; font-weight: 700; font-size: 14px;
}
.avatar-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.user-cell { display: inline-flex; align-items: center; gap: 10px; }
.cell-badge { margin-left: 8px; vertical-align: 2px; }
.hint-text { font-size: 12.5px; color: var(--muted); margin: 4px 0 10px; }
.check-grid { display: grid; grid-template-columns: 1fr; gap: 4px 18px; margin: 6px 0 10px; }
@media (min-width: 640px) { .check-grid { grid-template-columns: 1fr 1fr; } }
.check-item {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; color: var(--navy); padding: 5px 0; cursor: pointer;
}
.check-item input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--emerald); flex: none; }
.matrix-tbl { min-width: 420px; }
.matrix-check { width: 90px; text-align: center; }
.matrix-check input[type="checkbox"] { width: 19px; height: 19px; accent-color: var(--emerald); }
.matrix-module-row td {
  background: #eef4f1; font-weight: 700; color: var(--navy);
  font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em;
}
.slot-block { border-top: 1px solid #eef3f1; padding: 12px 0 4px; }
.slot-block:first-of-type { border-top: 0; }
.brand-fit-box {
  height: 110px; border: 1px dashed var(--border); border-radius: 10px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: #fbfdfc; margin-bottom: 8px; padding: 8px;
}
.brand-fit-box img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ================= polish batch 1 (look-only) ================= */
h1, h2, h3 { letter-spacing: -.01em; }
.section-title { letter-spacing: -.01em; }
.lang-btn { transition: background .18s ease, color .18s ease, border-color .18s ease; }
.menu-item, .result-item, .ac-item { transition: background .15s ease, border-color .15s ease, color .15s ease; }

/* unified focus rings */
.field input:focus, .form-grid select:focus, .form-grid textarea:focus,
.filter-item input:focus, .filter-item select:focus, .toolbar-search input:focus,
.line-row input:focus, .line-sub input:focus, .qty-unit select:focus,
.discount-in input:focus, .tool-field input:focus, .tool-field select:focus,
.status-ctl select:focus {
  outline: none;
  border-color: var(--emerald-2);
  box-shadow: var(--ring);
}
:focus-visible { outline: 2px solid var(--emerald-2); outline-offset: 2px; }
.field input, .form-grid select, .form-grid textarea, .filter-item input, .filter-item select,
.toolbar-search input, .line-row input, .line-sub input, .qty-unit select,
.discount-in input, .tool-field input, .tool-field select, .status-ctl select {
  transition: border-color .18s ease, box-shadow .18s ease;
}

/* toolbar search icon */
.toolbar-search input {
  padding-left: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 11px center;
  background-size: 16px;
}

/* ---------- sidebar menu icons ---------- */
.nav-item::before {
  content: ""; width: 19px; height: 19px; flex: none;
  background-repeat: no-repeat; background-position: center; background-size: 19px;
  opacity: .72; transition: opacity .18s ease;
}
.nav-item:hover::before { opacity: .95; }
.nav-item.active::before { opacity: 1; }
.nav-item[data-menu="dashboard"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7' rx='1'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1'/%3E%3C/svg%3E"); }
.nav-item[data-menu="jobs"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/%3E%3Crect x='8' y='2' width='8' height='4' rx='1'/%3E%3C/svg%3E"); }
.nav-item[data-menu="job_create"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Cline x1='12' y1='18' x2='12' y2='12'/%3E%3Cline x1='9' y1='15' x2='15' y2='15'/%3E%3C/svg%3E"); }
.nav-item[data-menu="gate_pass"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z'/%3E%3Cline x1='4' y1='22' x2='4' y2='15'/%3E%3C/svg%3E"); }
.nav-item[data-menu="service_register"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z'/%3E%3C/svg%3E"); }
.nav-item[data-menu="invoices"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Cline x1='16' y1='13' x2='8' y2='13'/%3E%3Cline x1='16' y1='17' x2='8' y2='17'/%3E%3C/svg%3E"); }
.nav-item[data-menu="quotations"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3C/svg%3E"); }
.nav-item[data-menu="customers"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M23 21v-2a4 4 0 0 0-3-3.87'/%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E"); }
.nav-item[data-menu="customer_ledger"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z'/%3E%3Cpath d='M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z'/%3E%3C/svg%3E"); }
.nav-item[data-menu="vehicles"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='1' y='3' width='15' height='13' rx='1'/%3E%3Cpolygon points='16 8 20 8 23 11 23 16 16 16 16 8'/%3E%3Ccircle cx='5.5' cy='18.5' r='2.5'/%3E%3Ccircle cx='18.5' cy='18.5' r='2.5'/%3E%3C/svg%3E"); }
.nav-item[data-menu="stock"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z'/%3E%3Cpolyline points='3.29 7 12 12 20.71 7'/%3E%3Cline x1='12' y1='22' x2='12' y2='12'/%3E%3C/svg%3E"); }
.nav-item[data-menu="stock_movements"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='17 1 21 5 17 9'/%3E%3Cpath d='M3 11V9a4 4 0 0 1 4-4h14'/%3E%3Cpolyline points='7 23 3 19 7 15'/%3E%3Cpath d='M21 13v2a4 4 0 0 1-4 4H3'/%3E%3C/svg%3E"); }
.nav-item[data-menu="grn"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='7 10 12 15 17 10'/%3E%3Cline x1='12' y1='15' x2='12' y2='3'/%3E%3C/svg%3E"); }
.nav-item[data-menu="suppliers"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='7' width='20' height='14' rx='2'/%3E%3Cpath d='M16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16'/%3E%3C/svg%3E"); }
.nav-item[data-menu="supplier_ledger"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19.5A2.5 2.5 0 0 1 6.5 17H20'/%3E%3Cpath d='M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z'/%3E%3C/svg%3E"); }
.nav-item[data-menu="accounts"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='1' y='4' width='22' height='16' rx='2'/%3E%3Cline x1='1' y1='10' x2='23' y2='10'/%3E%3C/svg%3E"); }
.nav-item[data-menu="account_heads"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='8' y1='6' x2='21' y2='6'/%3E%3Cline x1='8' y1='12' x2='21' y2='12'/%3E%3Cline x1='8' y1='18' x2='21' y2='18'/%3E%3Cline x1='3' y1='6' x2='3.01' y2='6'/%3E%3Cline x1='3' y1='12' x2='3.01' y2='12'/%3E%3Cline x1='3' y1='18' x2='3.01' y2='18'/%3E%3C/svg%3E"); }
.nav-item[data-menu="receive_vouchers"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolyline points='8 12 12 16 16 12'/%3E%3Cline x1='12' y1='8' x2='12' y2='16'/%3E%3C/svg%3E"); }
.nav-item[data-menu="pay_vouchers"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolyline points='16 12 12 8 8 12'/%3E%3Cline x1='12' y1='16' x2='12' y2='8'/%3E%3C/svg%3E"); }
.nav-item[data-menu="ledgers"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='12 2 2 7 12 12 22 7 12 2'/%3E%3Cpolyline points='2 17 12 22 22 17'/%3E%3Cpolyline points='2 12 12 17 22 12'/%3E%3C/svg%3E"); }
.nav-item[data-menu="cost_profit"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21.21 15.89A10 10 0 1 1 8 2.83'/%3E%3Cpath d='M22 12A10 10 0 0 0 12 2v10z'/%3E%3C/svg%3E"); }
.nav-item[data-menu="financial_reports"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='20' x2='12' y2='10'/%3E%3Cline x1='18' y1='20' x2='18' y2='4'/%3E%3Cline x1='6' y1='20' x2='6' y2='16'/%3E%3C/svg%3E"); }
.nav-item[data-menu="employees"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E"); }
.nav-item[data-menu="attendance"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E"); }
.nav-item[data-menu="salary"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='1' x2='12' y2='23'/%3E%3Cpath d='M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6'/%3E%3C/svg%3E"); }
.nav-item[data-menu="users"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='8.5' cy='7' r='4'/%3E%3Cpolyline points='17 11 19 13 23 9'/%3E%3C/svg%3E"); }
.nav-item[data-menu="roles"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 2l-2 2m-7.61 7.61a5.5 5.5 0 1 1-7.778 7.778 5.5 5.5 0 0 1 7.777-7.777zm0 0L15.5 7.5m0 0l3 3L22 7l-3-3m-3.5 3.5L19 4'/%3E%3C/svg%3E"); }
.nav-item[data-menu="access_rights"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E"); }
.nav-item[data-menu="settings"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='4' y1='21' x2='4' y2='14'/%3E%3Cline x1='4' y1='10' x2='4' y2='3'/%3E%3Cline x1='12' y1='21' x2='12' y2='12'/%3E%3Cline x1='12' y1='8' x2='12' y2='3'/%3E%3Cline x1='20' y1='21' x2='20' y2='16'/%3E%3Cline x1='20' y1='12' x2='20' y2='3'/%3E%3Cline x1='1' y1='14' x2='7' y2='14'/%3E%3Cline x1='9' y1='8' x2='15' y2='8'/%3E%3Cline x1='17' y1='16' x2='23' y2='16'/%3E%3C/svg%3E"); }
.nav-item[data-menu="branding"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'/%3E%3Cpolyline points='21 15 16 10 5 21'/%3E%3C/svg%3E"); }
.nav-item[data-menu="data_backup"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cellipse cx='12' cy='5' rx='9' ry='3'/%3E%3Cpath d='M21 12c0 1.66-4 3-9 3s-9-1.34-9-3'/%3E%3Cpath d='M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5'/%3E%3C/svg%3E"); }

/* ---------- stat card icon chips ---------- */
.stat-card::before {
  content: ""; position: absolute; top: 14px; right: 14px;
  width: 40px; height: 40px; border-radius: 12px;
  background-color: #eef4f1; background-repeat: no-repeat; background-position: center; background-size: 21px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/%3E%3Crect x='8' y='2' width='8' height='4' rx='1'/%3E%3C/svg%3E");
}
.stat-card.accent-emerald::before { background-color: #dcf2e7; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23059669' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 11.08V12a10 10 0 1 1-5.93-9.14'/%3E%3Cpolyline points='22 4 12 14.01 9 11.01'/%3E%3C/svg%3E"); }
.stat-card.accent-navy::before { background-color: #dfe9f5; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a4568' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/%3E%3Crect x='8' y='2' width='8' height='4' rx='1'/%3E%3C/svg%3E"); }
.stat-card.accent-info::before { background-color: #e0eefc; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23175d8f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='22 12 16 12 14 15 10 15 8 12 2 12'/%3E%3Cpath d='M5.45 5.11L2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z'/%3E%3C/svg%3E"); }
.stat-card.accent-warn::before { background-color: #fbeed3; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b45309' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolyline points='12 6 12 12 16 14'/%3E%3C/svg%3E"); }
.stat-card.accent-danger::before { background-color: #fde3e3; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b3261e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='8' x2='12' y2='12'/%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'/%3E%3C/svg%3E"); }
.stat-card.stat-total_sales::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23059669' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='23 6 13.5 15.5 8.5 10.5 1 18'/%3E%3Cpolyline points='17 6 23 6 23 12'/%3E%3C/svg%3E"); }
.stat-card.stat-open_jobs::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23175d8f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='22 12 16 12 14 15 10 15 8 12 2 12'/%3E%3Cpath d='M5.45 5.11L2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z'/%3E%3C/svg%3E"); }
.stat-card.stat-pending_jobs::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b45309' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolyline points='12 6 12 12 16 14'/%3E%3C/svg%3E"); }
.stat-card.stat-completed_jobs::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23059669' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 11.08V12a10 10 0 1 1-5.93-9.14'/%3E%3Cpolyline points='22 4 12 14.01 9 11.01'/%3E%3C/svg%3E"); }
.stat-card.stat-total_dues::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b3261e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='8' x2='12' y2='12'/%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'/%3E%3C/svg%3E"); }
.stat-card.stat-gate_passes::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a4568' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z'/%3E%3Cline x1='4' y1='22' x2='4' y2='15'/%3E%3C/svg%3E"); }

/* ---------- branded account-balance segments ---------- */
.balance-row.bal-bkash .bar-fill { background: linear-gradient(90deg, #f06292, #e2136e); }
.balance-row.bal-bkash .balance-name::before { background: #e2136e; box-shadow: 0 0 0 3px rgba(226, 19, 110, .14); }
.balance-row.bal-nagad .bar-fill { background: linear-gradient(90deg, #fb8c00, #ee4023); }
.balance-row.bal-nagad .balance-name::before { background: #ee4023; box-shadow: 0 0 0 3px rgba(238, 64, 35, .14); }
.balance-row[class*="bank"] .bar-fill { background: linear-gradient(90deg, #42a5f5, #175d8f); }
.balance-row[class*="bank"] .balance-name::before { background: #175d8f; box-shadow: 0 0 0 3px rgba(23, 93, 143, .14); }
.balance-row .bar-fill.neg { background: var(--danger); }

/* ---------- monthly chart ---------- */
.chart-wrap {
  border-radius: 10px;
  background:
    linear-gradient(#e7efec, #e7efec) 0 10.4% / 100% 1px no-repeat,
    linear-gradient(#e7efec, #e7efec) 0 29.8% / 100% 1px no-repeat,
    linear-gradient(#e7efec, #e7efec) 0 49.2% / 100% 1px no-repeat,
    linear-gradient(#e7efec, #e7efec) 0 68.6% / 100% 1px no-repeat,
    linear-gradient(#d3ded9, #d3ded9) 0 88% / 100% 1px no-repeat;
}
.chart-svg rect { rx: 4px; }
.chart-legend { margin-bottom: 10px; }
.chart-dot { border-radius: 50%; box-shadow: 0 0 0 3px rgba(11, 34, 57, .06); }
.chart-val { fill: #7d8a99; }

/* ---------- tables: zebra, hover, sticky header ---------- */
.tbl tbody tr:not(.matrix-module-row):nth-child(even) > td { background: #fafcfb; }
.tbl tbody tr:not(.matrix-module-row):hover > td { background: #edf7f2; }
.tbl tbody tr > td { transition: background .15s ease; }
@media (min-width: 861px) {
  .tbl thead th { position: sticky; top: 0; z-index: 6; }
}

/* ---------- badge color depth ---------- */
.badge-info { background: #e0eefc; color: var(--info); }
.badge-navy { background: #dfe9f5; color: var(--navy); }
.badge-danger { background: #fde3e3; color: #991b1b; }
.badge-bad { background: #fde3e3; color: var(--danger); }

/* ---------- states: empty illustration, loading shimmer, spinner ---------- */
.state-block { position: relative; overflow: hidden; }
.state-block:not(.state-empty):not(.state-error):not(.muted)::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, rgba(16, 185, 129, 0) 30%, rgba(16, 185, 129, .08) 50%, rgba(16, 185, 129, 0) 70%);
  transform: translateX(-100%);
  animation: ak-shimmer 1.5s ease-in-out infinite;
}
@keyframes ak-shimmer { to { transform: translateX(100%); } }
.spinner {
  width: 18px; height: 18px; vertical-align: -3px;
  border-width: 2.5px; border-color: rgba(5, 150, 105, .18); border-top-color: var(--emerald);
}
.state-empty { padding: 36px 12px; }
.state-empty::before {
  content: ""; display: block; width: 62px; height: 62px; margin: 0 auto 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='22 12 16 12 14 15 10 15 8 12 2 12'/%3E%3Cpath d='M5.45 5.11L2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: .8;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ================= polish batch 2 (look-only) ================= */

/* ---------- forms: rhythm, labels, unified fields ---------- */
.form-grid { gap: 2px 16px; }
.form-grid .field { margin-bottom: 13px; }
.field > span { font-size: 12.5px; letter-spacing: .03em; }
.form-grid select, .form-grid textarea, .field select {
  background: #f8fbfa; border-radius: 10px;
}
.field select {
  width: 100%; border: 1px solid var(--border);
  padding: 11px 12px; font-size: 14px; font-family: inherit;
}
.form-grid textarea { min-height: 64px; resize: vertical; }
.hint-text { background: #f6faf8; border: 1px solid #e7efeb; border-radius: 8px; padding: 7px 10px; }

/* ---------- section cards: emerald-tick headers ---------- */
.detail-card h3, .lines-head h3, .att-year h3 {
  display: flex; align-items: center; gap: 9px;
}
.detail-card h3 {
  padding-bottom: 9px; margin-bottom: 12px;
  border-bottom: 1px solid #eef3f1;
}
.detail-card h3::before, .lines-head h3::before, .sub-head::before {
  content: ""; width: 4px; height: 17px; border-radius: 2px; flex: none;
  background: linear-gradient(180deg, var(--emerald-2), var(--emerald));
}
.sub-head { display: flex; align-items: center; gap: 8px; }
.sub-head::before { height: 14px; }
.toolbar .section-title { display: flex; align-items: center; gap: 9px; }
.toolbar .section-title::before {
  content: ""; width: 4px; height: 19px; border-radius: 2px; flex: none;
  background: linear-gradient(180deg, var(--emerald-2), var(--emerald));
}

/* ---------- detail rows ---------- */
.detail-row { padding: 7px 4px; border-radius: 6px; transition: background .15s ease; }
.detail-row:hover { background: #f6faf8; }
.detail-row strong { color: var(--navy); font-variant-numeric: tabular-nums; }
.detail-row span { font-variant-numeric: tabular-nums; }
.mini-row { padding: 8px 4px; border-radius: 6px; transition: background .15s ease; }
.mini-row:hover { background: #f6faf8; }

/* ---------- totals box: grand / paid / due / payment rows ---------- */
.totals-box .detail-row { padding-left: 8px; padding-right: 8px; }
.totals-box .detail-row.grand {
  background: linear-gradient(90deg, #e9f7f1, #f6fbf9);
  border: 1px solid #cfe8dc; border-radius: 10px; padding: 9px 10px;
}
.totals-box .detail-row.pay-row span {
  background: #e9f7f1; color: #046c4e; border-radius: 999px;
  padding: 3px 10px; font-weight: 600; font-size: 13px;
}
.totals-box .detail-row.pay-row strong { color: #047857; }
.detail-row.paid-row strong { color: var(--emerald); }
.totals-box .detail-row.due-row {
  background: linear-gradient(90deg, #fdecec, #fdf6f6);
  border-color: #f3c6c3;
}
.totals-box .detail-row.due-row span,
.totals-box .detail-row.due-row strong { color: var(--danger); }

/* ---------- charges / voucher line cards ---------- */
.lines-box { gap: 12px; }
.line-block {
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 12px; box-shadow: var(--shadow-sm);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.line-block:focus-within { border-color: #bfe3d2; box-shadow: var(--shadow-sm), var(--ring); }
.line-amount { color: #047857; }
.voucher-line .line-sub { color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.voucher-totals {
  background: #f6faf8; border: 1px dashed #cfe0d8; border-radius: 10px;
  padding: 8px 12px;
}

/* ---------- qty + unit group ---------- */
.qty-unit { border-radius: 8px; }
.qty-unit:focus-within { box-shadow: var(--ring); }
.qty-unit input:focus, .qty-unit select:focus { box-shadow: none; border-color: var(--border); }
.qty-unit select {
  background: linear-gradient(180deg, #f2f7f4, #e4ede9);
  color: var(--navy);
}

/* ---------- autocomplete dropdown ---------- */
.ac-list { border-radius: 12px; box-shadow: var(--shadow-md); max-height: 264px; overflow-y: auto; }
.ac-item { padding: 10px 12px; }
.ac-hint { background: #eef4f1; border-radius: 999px; padding: 2px 8px; }
.ac-x { transition: background .15s ease, color .15s ease; }
.ac-x:hover { background: var(--danger-bg); }

/* ---------- job detail action bar, status pill, action menu ---------- */
.detail-actions {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 12px; box-shadow: var(--shadow-sm);
}
.status-ctl select {
  border-radius: 999px; padding: 8px 30px 8px 14px; font-weight: 600;
  appearance: none; -webkit-appearance: none;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 10px center / 14px;
}
.menu-pop { border-radius: 14px; padding: 6px; border-top: 3px solid var(--emerald); }
.menu-item { padding: 9px 11px; border-radius: 9px; }

/* ---------- accounts: ledger emphasis, balance chips, P&L cards ---------- */
.tbl td.bal-cell { font-weight: 700; color: var(--navy); }
.tbl tfoot .tbl-total-row td {
  background: #eef4f1; color: var(--navy); border-top: 2px solid var(--emerald);
}
.link-btn {
  background: #e9f7f1; border-radius: 999px; padding: 2px 8px;
  text-decoration: none; transition: background .15s ease;
}
.link-btn:hover { background: #dcf2e7; }
.balance-value {
  background: #eef4f1; border-radius: 999px; padding: 4px 12px;
}
.pl-card { overflow: hidden; }
.pl-card.pl-income { border-top: 3px solid var(--emerald); }
.pl-card.pl-expenses { border-top: 3px solid var(--danger); }
.pl-income tfoot .tbl-total-row td {
  background: linear-gradient(90deg, #dcf2e7, #eef9f4);
  color: #065f46; border-top: 2px solid var(--emerald);
}
.pl-expenses tfoot .tbl-total-row td {
  background: linear-gradient(90deg, #fde3e3, #fdf1f1);
  color: #991b1b; border-top: 2px solid var(--danger);
}
.pl-net {
  background: linear-gradient(90deg, #e9f7f1, var(--card) 65%);
  border-left: 4px solid var(--emerald);
}
.pl-net .detail-row { border-bottom: 0; }
.pl-net .detail-row strong { font-size: 19px; }

/* ---------- ledger tabs: segmented control ---------- */
.filters.ledger-tabs {
  display: inline-flex; background: #e8efec; border: 0; box-shadow: none;
  padding: 5px; border-radius: 999px; gap: 4px;
}
.filters.ledger-tabs .btn-act {
  border-color: transparent; background: transparent; border-radius: 999px;
}
.filters.ledger-tabs .btn-act:hover { background: #fff; box-shadow: none; }
.filters.ledger-tabs .btn-primary {
  border-radius: 999px; box-shadow: 0 4px 10px -4px rgba(5, 150, 105, .5);
}

/* ---------- purchase: GRN lines, low stock, movements ---------- */
.grn-lines-tbl td:nth-child(3) { color: #047857; font-weight: 700; }
.grn-lines-tbl td:nth-child(4) { color: #b45309; font-weight: 700; }
.tbl tbody tr.row-low.row-low > td { background: #fdf1f1; }
.tbl tbody tr.row-low:hover > td { background: #fbe4e4; }
.qty-pos::before { content: "↑ "; font-weight: 800; }
.qty-neg::before { content: "↓ "; font-weight: 800; }
.check-chip {
  background: #fff; border: 1px solid var(--border); border-radius: 999px;
  padding: 8px 13px; box-shadow: var(--shadow-sm);
}

/* ---------- HR: attendance grid ---------- */
.att-wrap { border-radius: 12px; box-shadow: var(--shadow-sm); }
.att-grid thead th {
  position: sticky; top: 0; z-index: 5;
  background: linear-gradient(180deg, #f9fcfa, #e9f1ed); color: var(--navy);
}
.att-emp-col {
  font-weight: 600; color: var(--navy);
  box-shadow: 2px 0 0 var(--border), 8px 0 14px -8px rgba(11, 34, 57, .18);
}
.att-grid thead .att-emp-col {
  z-index: 9;
  background: linear-gradient(180deg, #f9fcfa, #e9f1ed);
  box-shadow: 2px 0 0 var(--border), 8px 0 14px -8px rgba(11, 34, 57, .22);
}
.att-cell {
  box-shadow: 0 1px 2px rgba(11, 34, 57, .08);
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease;
}
.att-cell:hover { transform: scale(1.14); box-shadow: var(--shadow-sm); }
.att-cell.att-p { background: linear-gradient(180deg, #dcf5e8, #c9efdc); border-color: #7fd1ab; color: #046c4e; }
.att-cell.att-a { background: linear-gradient(180deg, #fde9e9, #fbdede); border-color: #eda49f; }
.att-cell.att-l { background: linear-gradient(180deg, #fdf6e0, #fbeed0); border-color: #e3c878; }
.att-cell.att-h { background: linear-gradient(180deg, #e9edf3, #dde4ee); border-color: #b6c2d2; color: #42526b; }
.att-cell.att-locked { box-shadow: none; }
.att-legend {
  display: inline-block; background: #fff; border: 1px solid var(--border);
  border-radius: 999px; padding: 7px 14px; box-shadow: var(--shadow-sm);
  font-weight: 600; color: var(--navy);
}
.att-editor { border-top: 3px solid var(--emerald); }
.att-year { border-top: 3px solid var(--navy-3); }

/* ---------- admin & settings ---------- */
.avatar {
  background: linear-gradient(145deg, var(--navy-3), var(--emerald));
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35), 0 4px 10px -4px rgba(11, 34, 57, .4);
}
.tbl.matrix-tbl tbody td:first-child {
  position: sticky; left: 0; z-index: 4;
  box-shadow: 2px 0 0 var(--border);
  font-weight: 600; color: var(--navy); background: #fff;
}
.tbl.matrix-tbl tbody tr:nth-child(even) td:first-child { background: #fafcfb; }
.tbl.matrix-tbl tbody tr:hover td:first-child { background: #edf7f2; }
.tbl.matrix-tbl tbody tr.matrix-module-row td:first-child { background: #eef4f1; }
.tbl.matrix-tbl thead th:first-child {
  position: sticky; left: 0; z-index: 8;
  box-shadow: 2px 0 0 var(--border);
}
.matrix-tbl tbody td.matrix-check { transition: background .15s ease; }
.tbl.matrix-tbl tbody td.matrix-check:hover { background: #e9f7f1; }
.matrix-check input[type="checkbox"], .perm-toggle { cursor: pointer; }
.matrix-check input[type="checkbox"]:hover, .perm-toggle:hover { transform: scale(1.12); }
.check-item { border-radius: 8px; padding: 6px 8px; transition: background .15s ease; }
.check-item:hover { background: #f2f9f6; }
.slot-block {
  background: #fbfdfd; border: 1px solid #e7efeb; border-radius: 12px;
  padding: 14px; margin-top: 12px;
}
.slot-block:first-of-type { border-top: 1px solid #e7efeb; margin-top: 4px; }
.brand-fit-box {
  border: 1.5px dashed #b9cdc4;
  background: repeating-linear-gradient(45deg, #fbfdfc, #fbfdfc 12px, #f3f8f6 12px, #f3f8f6 24px);
  transition: border-color .18s ease;
}
.brand-fit-box:hover { border-color: var(--emerald-2); }
.slot-title { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--navy); }
.slot-actions { display: flex; gap: 8px; align-items: center; }
.slot-file-input { display: none; }

/* ---------- shared leftovers: pager, confirm dialog ---------- */
.pager .btn-act:disabled { opacity: .45; box-shadow: none; }
.modal-card:has(.modal-actions > .btn-act.danger) { border-top: 4px solid var(--danger); }

/* ================= polish batch 3 (comparison fixes) ================= */

/* page-head + shared empty state layout */
.page-head { margin-bottom: 14px; }
.state-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.state-empty .state-msg { font-size: 14px; color: var(--muted); }
.state-empty .state-cta { width: auto; padding: 10px 20px; }

/* invoice detail: info chip + payment-row alignment with totals rows */
.inv-chip { white-space: normal; text-align: left; line-height: 1.45; font-weight: 600; }
.totals-box .detail-row.pay-row span { margin-left: -10px; }
.btn-ico { width: 15px; height: 15px; vertical-align: -2px; margin-right: 6px; }

/* settings: sticky save bar + full-width detail row */
.sticky-actions {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; justify-content: flex-end; gap: 10px;
  margin-top: 16px; padding: 12px 4px;
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border-top: 1px solid var(--border);
}
.sticky-actions .btn-primary { width: auto; padding: 10px 26px; }
.detail-row.span-all { grid-column: 1 / -1; }

/* form values read as values, not placeholders */
input:not([type='checkbox']):not([type='radio']), select, textarea { color: #0b1a29; }
::placeholder { color: #a3b8b0; opacity: 1; }

/* jobs stat cards: one distinct icon per card */
.stat-card.stat-jobs_open::before { background-color: #e0eefc; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23175d8f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z'/%3E%3C/svg%3E"); }
.stat-card.stat-jobs_progress::before { background-color: #fbeed3; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b45309' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z'/%3E%3C/svg%3E"); }
.stat-card.stat-jobs_done::before { background-color: #dcf2e7; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23059669' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 11.08V12a10 10 0 1 1-5.93-9.14'/%3E%3Cpolyline points='22 4 12 14.01 9 11.01'/%3E%3C/svg%3E"); }
.stat-card.stat-jobs_converted::before { background-color: #dcf2e7; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23059669' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='17 1 21 5 17 9'/%3E%3Cpath d='M3 11V9a4 4 0 0 1 4-4h14'/%3E%3Cpolyline points='7 23 3 19 7 15'/%3E%3Cpath d='M21 13v2a4 4 0 0 1-4 4H3'/%3E%3C/svg%3E"); }
.stat-card.stat-jobs_total::before { background-color: #dfe9f5; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a4568' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='12 2 2 7 12 12 22 7 12 2'/%3E%3Cpolyline points='2 17 12 22 22 17'/%3E%3Cpolyline points='2 12 12 17 22 12'/%3E%3C/svg%3E"); }

/* dashboard chart: axis + smaller month labels */
.chart-axis { font-size: 10px; fill: #8494a3; font-weight: 600; }
.chart-grid { stroke: #e3ece8; stroke-width: 1; }
.chart-month { font-size: 10.5px; }

/* customers: avatar-initial circle */
.avatar-cell { display: inline-flex; align-items: center; gap: 9px; }
.avatar-dot {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, #d7f0e4, #eef7f2); color: #046c4e;
  font-size: 13px; font-weight: 700; border: 1px solid #cfe8dc;
}

/* admin: panel heading row (title + action side by side) */
.panel-head-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel-head-row .btn-primary { width: auto; padding: 8px 16px; }

.detail-actions .btn-primary { width: auto; padding: 9px 22px; }
