/* =====================================================================
   RingUp ERP — UI theme (top navigation, navy + electric blue from the logo)
   ===================================================================== */
:root {
  --nb-navy: #0b1d4d;
  --nb-navy-2: #10276a;
  --nb-blue: #1a6dff;
  --nb-blue-600: #0f5ae0;
  --nb-blue-50: #edf3ff;
  --nb-sky: #3d8bff;
  --nb-bg: #f3f5fa;
  --nb-surface: #ffffff;
  --nb-border: #e3e8f2;
  --nb-text: #16213d;
  --nb-muted: #66718c;
  --nb-radius: 12px;
  --nb-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --bs-primary: var(--nb-blue);
  --bs-primary-rgb: 26, 109, 255;
  --bs-link-color: var(--nb-blue-600);
  --bs-link-color-rgb: 15, 90, 224;
  --bs-body-color: var(--nb-text);
  --bs-border-color: var(--nb-border);
  --bs-body-font-family: "Inter", "Noto Sans Myanmar", system-ui, -apple-system, "Segoe UI", sans-serif;
}

html.lang-my { --bs-body-font-family: "Noto Sans Myanmar", "Inter", system-ui, sans-serif; }
html.lang-my body { line-height: 1.75; }

body { background: var(--nb-bg); font-size: .9rem; color: var(--nb-text); min-height: 100vh; display: flex; flex-direction: column; }
.app-container { max-width: 1480px; padding-left: 1.25rem; padding-right: 1.25rem; }
.app-main { flex: 1; padding: 1.5rem 0 2.5rem; }
.xsmall { font-size: .72rem; }
a { text-decoration: none; }

/* ---------- Top header: brand bar ---------- */
.app-header { z-index: 1030; box-shadow: 0 2px 10px rgba(11, 29, 77, .08); }
.brandbar { background: #fff; border-bottom: 1px solid var(--nb-border); height: 64px; display: flex; align-items: center; }
.brand { display: flex; align-items: center; flex-shrink: 0; }
.brand-full { height: 38px; width: auto; }
.brand-icon { height: 32px; width: auto; display: none; }
@media (max-width: 575.98px) { .brand-full { display: none; } .brand-icon { display: block; } }

.company-chip, .btn-company {
  background: var(--nb-blue-50); color: var(--nb-navy); border: 1px solid #d6e3ff; border-radius: 999px;
  padding: .3rem .8rem; font-size: .8rem; font-weight: 600; max-width: 260px; align-items: center; white-space: nowrap;
}
.btn-company:hover, .btn-company.show { background: #dfeaff; color: var(--nb-navy); border-color: #c4d7ff; }

.global-search { position: relative; align-items: center; width: 100%; max-width: 420px; }
.global-search .bi-search { position: absolute; left: .85rem; color: var(--nb-muted); font-size: .9rem; }
.global-search .form-control { padding-left: 2.3rem; padding-right: 2rem; border-radius: 10px; background: var(--nb-bg); border-color: transparent; height: 38px; }
.global-search .form-control:focus { background: #fff; border-color: var(--nb-blue); box-shadow: 0 0 0 .2rem rgba(26, 109, 255, .12); }
.global-search kbd { position: absolute; right: .6rem; background: #fff; color: var(--nb-muted); border: 1px solid var(--nb-border); font-size: .7rem; padding: 0 .35rem; }

.lang-switch { display: inline-flex; background: var(--nb-bg); border-radius: 999px; padding: 3px; margin-right: .25rem; }
.lang-switch a { font-size: .75rem; font-weight: 600; color: var(--nb-muted); padding: .2rem .65rem; border-radius: 999px; }
.lang-switch a.active { background: #fff; color: var(--nb-navy); box-shadow: var(--nb-shadow); }

.btn-icon { width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: var(--nb-navy); border: 0; }
.btn-icon:hover { background: var(--nb-bg); }
.notif-dot { position: absolute; top: 4px; right: 4px; min-width: 17px; height: 17px; border-radius: 9px; background: #ef4444; color: #fff; font-size: .65rem; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 4px; border: 2px solid #fff; }
.notif-menu { width: 320px; border-radius: 12px; border-color: var(--nb-border); }
.notif-item { display: flex; gap: .65rem; align-items: center; white-space: normal; padding: .55rem 1rem; font-size: .84rem; }
.notif-icon { width: 32px; height: 32px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }

.user-btn { border: 0; border-radius: 10px; padding: .25rem .5rem; }
.user-btn:hover, .user-btn.show { background: var(--nb-bg); }
.avatar { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--nb-blue), var(--nb-navy-2)); color: #fff; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }

/* ---------- Top header: module bar ---------- */
.modulebar { background: var(--nb-navy); }
@media (min-width: 992px) { .modulebar { min-height: 48px; } }
.modulebar .navbar-nav { gap: .15rem; }
.modulebar .nav-link { color: rgba(255, 255, 255, .78); font-weight: 500; padding: .8rem .9rem !important; display: flex; align-items: center; gap: .45rem; position: relative; font-size: .875rem; }
.modulebar .nav-link .bi { font-size: 1rem; opacity: .9; }
.modulebar .nav-link:hover, .modulebar .nav-link.show { color: #fff; background: rgba(255, 255, 255, .06); }
.modulebar .nav-link.active { color: #fff; }
.modulebar .nav-link.active::after { content: ""; position: absolute; left: .9rem; right: .9rem; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--nb-sky); }
.modulebar .dropdown-toggle::after { margin-left: .15rem; opacity: .6; }
.modulebar .dropdown-menu { border-radius: 12px; border: 1px solid var(--nb-border); padding: .4rem; min-width: 240px; margin-top: 0 !important; }
.dropdown-item { border-radius: 8px; padding: .48rem .75rem; font-size: .86rem; display: flex; align-items: center; gap: .6rem; }
.dropdown-item .bi { color: var(--nb-muted); width: 18px; }
.dropdown-item:hover { background: var(--nb-blue-50); color: var(--nb-navy); }
.dropdown-item.active, .dropdown-item:active { background: var(--nb-blue); color: #fff; }
.dropdown-item.active .bi, .dropdown-item:active .bi { color: #fff; }
.dropdown-header { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--nb-muted); font-weight: 700; padding: .55rem .75rem .25rem; }
@media (min-width: 992px) {
  .modulebar .dropdown:hover > .dropdown-menu { display: block; }
}
@media (max-width: 991.98px) {
  .modulebar .navbar-collapse { padding-bottom: .75rem; }
  .modulebar .nav-link.active::after { display: none; }
  .modulebar .nav-link.active { background: rgba(255, 255, 255, .1); border-radius: 8px; }
  .modulebar .dropdown-menu { background: var(--nb-navy-2); border: 0; box-shadow: none !important; }
  .modulebar .dropdown-item { color: rgba(255, 255, 255, .85); }
  .modulebar .dropdown-item .bi { color: rgba(255, 255, 255, .6); }
  .modulebar .dropdown-header { color: rgba(255, 255, 255, .5); }
  .modulebar .global-search { max-width: none; }
}

/* ---------- Page structure ---------- */
.page-head { margin-bottom: 1.25rem; }
.page-title { font-size: 1.45rem; font-weight: 700; color: var(--nb-navy); margin: 0; letter-spacing: -.01em; }
.page-subtitle { color: var(--nb-muted); margin: .2rem 0 0; }
.breadcrumb { font-size: .78rem; }
.breadcrumb a { color: var(--nb-muted); }

.card { border: 1px solid var(--nb-border); border-radius: var(--nb-radius); box-shadow: var(--nb-shadow); }
.card-header { background: transparent; border-bottom: 1px solid var(--nb-border); padding: .9rem 1.1rem; font-weight: 600; color: var(--nb-navy); }
.card-body { padding: 1.1rem; }
.card-title { font-weight: 700; color: var(--nb-navy); font-size: 1rem; }
.section-title { font-size: .75rem; text-transform: uppercase; letter-spacing: .07em; color: var(--nb-muted); font-weight: 700; margin-bottom: .75rem; }

/* ---------- KPI cards ---------- */
.kpi-card { background: #fff; border: 1px solid var(--nb-border); border-radius: var(--nb-radius); padding: 1rem 1.1rem; display: flex; gap: .9rem; align-items: center; box-shadow: var(--nb-shadow); height: 100%; transition: transform .15s, box-shadow .15s; }
a .kpi-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(11, 29, 77, .08); }
.kpi-icon { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; }
.kpi-label { color: var(--nb-muted); font-size: .78rem; font-weight: 500; }
.kpi-value { font-size: 1.3rem; font-weight: 700; color: var(--nb-navy); line-height: 1.25; font-variant-numeric: tabular-nums; }
.kpi-hint { font-size: .74rem; color: var(--nb-muted); }
.tone-primary .kpi-icon { background: var(--nb-blue-50); color: var(--nb-blue); }
.tone-success .kpi-icon { background: #e7f7ef; color: #12915a; }
.tone-warning .kpi-icon { background: #fff4e0; color: #c77700; }
.tone-danger .kpi-icon { background: #fdecec; color: #d03434; }
.tone-navy .kpi-icon { background: #e8ebf5; color: var(--nb-navy); }
.tone-info .kpi-icon { background: #e6f6fb; color: #0b8bb3; }

/* ---------- Tables ---------- */
.table { --bs-table-hover-bg: #f7f9fd; margin-bottom: 0; font-size: .86rem; }
.table > thead th { background: #f7f9fc; color: var(--nb-muted); font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--nb-border); white-space: nowrap; padding: .65rem .75rem; }
.table > tbody td { padding: .65rem .75rem; vertical-align: middle; border-color: #eef1f6; }
.table > tfoot td, .table > tfoot th { font-weight: 700; background: #fafbfe; padding: .65rem .75rem; }
.table-card { border-radius: var(--nb-radius); overflow: hidden; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.doc-link { font-weight: 600; color: var(--nb-blue-600); }
.text-navy { color: var(--nb-navy) !important; }

.badge { font-weight: 600; padding: .35em .65em; border-radius: 6px; font-size: .72rem; }
.badge-soft-success { background: #e3f6ec; color: #0f7a4b; }
.badge-soft-warning { background: #fff2d9; color: #a35f00; }
.badge-soft-danger { background: #fde8e8; color: #b42318; }
.badge-soft-primary { background: var(--nb-blue-50); color: var(--nb-blue-600); }
.badge-soft-info { background: #e0f4fa; color: #0a7798; }
.badge-soft-secondary { background: #eef0f4; color: #4b5570; }
.badge-soft-dark { background: #e5e7eb; color: #1f2937; text-decoration: line-through; }

/* ---------- Forms & buttons ---------- */
.form-label { font-weight: 600; font-size: .8rem; color: #2f3a58; margin-bottom: .3rem; }
.form-control, .form-select { border-radius: 9px; font-size: .88rem; border-color: #d8deea; }
.form-control:focus, .form-select:focus { border-color: var(--nb-blue); box-shadow: 0 0 0 .2rem rgba(26, 109, 255, .12); }
.form-text { font-size: .75rem; }
.required::after { content: " *"; color: #d03434; }
.btn { border-radius: 9px; font-weight: 600; font-size: .86rem; padding: .45rem .95rem; }
.btn-sm { padding: .25rem .6rem; font-size: .78rem; border-radius: 7px; }
.btn-primary { background: var(--nb-blue); border-color: var(--nb-blue); }
.btn-primary:hover, .btn-primary:focus { background: var(--nb-blue-600); border-color: var(--nb-blue-600); }
.btn-navy { background: var(--nb-navy); color: #fff; border-color: var(--nb-navy); }
.btn-navy:hover { background: var(--nb-navy-2); color: #fff; }
.btn-light { background: #fff; border-color: var(--nb-border); color: var(--nb-text); }
.btn-light:hover { background: var(--nb-bg); border-color: #d1d8e6; }
.filter-bar { background: #fff; border: 1px solid var(--nb-border); border-radius: var(--nb-radius); padding: .85rem 1rem; margin-bottom: 1rem; box-shadow: var(--nb-shadow); }
.filter-bar .form-control, .filter-bar .form-select { height: 36px; font-size: .84rem; }

/* ---------- Line items editor ---------- */
.lines-table td { padding: .4rem .45rem !important; }
.lines-table .form-control, .lines-table .form-select { font-size: .84rem; padding: .35rem .5rem; }
.lines-table .col-product { min-width: 240px; }
.lines-table .col-num { width: 110px; }
.lines-table .col-tax { width: 80px; }
.lines-table .line-total { font-weight: 600; text-align: right; white-space: nowrap; padding-top: .7rem !important; }
.scan-box { max-width: 360px; }
.totals-box { background: #f8faff; border: 1px solid var(--nb-border); border-radius: var(--nb-radius); padding: 1rem 1.1rem; }
.totals-box .row-t { display: flex; justify-content: space-between; padding: .25rem 0; font-variant-numeric: tabular-nums; }
.totals-box .grand { border-top: 1px dashed #c9d3e6; margin-top: .4rem; padding-top: .6rem; font-size: 1.15rem; font-weight: 700; color: var(--nb-navy); }

/* ---------- Empty states, misc ---------- */
.empty-state { text-align: center; }
.empty-icon { width: 72px; height: 72px; border-radius: 20px; background: var(--nb-blue-50); color: var(--nb-blue); display: inline-flex; align-items: center; justify-content: center; font-size: 2rem; margin-bottom: 1rem; }
.chart-box { position: relative; height: 300px; }
.list-compact .list-group-item { padding: .6rem 1rem; border-color: #eef1f6; font-size: .85rem; }
.perm-group { border: 1px solid var(--nb-border); border-radius: 10px; padding: .75rem 1rem; height: 100%; background: #fff; }
.perm-group h6 { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--nb-navy); font-weight: 700; }
.app-footer { border-top: 1px solid var(--nb-border); background: #fff; padding: .85rem 0; color: var(--nb-muted); font-size: .78rem; }
.stat-line { display: flex; justify-content: space-between; padding: .45rem 0; border-bottom: 1px dashed #e5e9f2; }
.stat-line:last-child { border-bottom: 0; }
.fin-table td { padding: .45rem .75rem !important; }
.fin-table .grp td { background: #f5f7fc; font-weight: 700; color: var(--nb-navy); text-transform: uppercase; font-size: .74rem; letter-spacing: .05em; }
.fin-table .tot td { font-weight: 700; border-top: 2px solid #d5dcea; }
.fin-table .grand td { font-weight: 800; font-size: 1rem; color: var(--nb-navy); background: var(--nb-blue-50); }

/* ---------- Auth pages ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: #fff; }
.auth-brand { background: radial-gradient(1200px 600px at -10% -20%, #1b3d9c 0%, transparent 60%), radial-gradient(900px 500px at 120% 120%, #1a6dff 0%, transparent 55%), var(--nb-navy); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-brand .logo-dark { width: 220px; max-width: 60%; }
.auth-brand h2 { font-weight: 700; font-size: 2rem; line-height: 1.3; max-width: 460px; }
.auth-brand p { color: rgba(255, 255, 255, .72); max-width: 440px; }
.auth-feature { display: flex; gap: .75rem; align-items: flex-start; margin-bottom: .9rem; color: rgba(255, 255, 255, .85); }
.auth-feature .bi { background: rgba(255, 255, 255, .1); border-radius: 10px; width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 2rem; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card .logo-light { width: 150px; margin-bottom: 1.25rem; }
.auth-card .form-control { height: 46px; }
.auth-card .btn-lg { height: 46px; font-size: .95rem; }
@media (max-width: 991.98px) { .auth-wrap { grid-template-columns: 1fr; } .auth-brand { display: none; } }

/* ---------- Print (invoices, reports) ---------- */
.print-doc { background: #fff; border: 1px solid var(--nb-border); border-radius: var(--nb-radius); padding: 2.5rem; box-shadow: var(--nb-shadow); }
.print-doc .doc-logo { height: 70px; }
.print-doc .doc-title { font-size: 1.6rem; font-weight: 800; color: var(--nb-navy); letter-spacing: .04em; text-transform: uppercase; }
.print-doc .meta td { padding: .15rem .5rem; font-size: .85rem; }
.print-doc .party { background: #f8faff; border-radius: 10px; padding: .9rem 1rem; }
@media print {
  @page { margin: 12mm; }
  body { background: #fff; }
  .app-header, .app-footer, .no-print, .page-actions, .alert, .filter-bar .btn { display: none !important; }
  .app-main { padding: 0; }
  .print-doc, .card { border: 0; box-shadow: none; padding: 0; }
  .table > thead th { background: #f0f2f7 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- P1 additions ---------- */
.btn-branch { background: #fff7e6; color: #8a5300; border: 1px solid #ffe2a8; border-radius: 999px; padding: .3rem .8rem; font-size: .8rem; font-weight: 600; max-width: 220px; display: inline-flex; align-items: center; }
.btn-branch:hover, .btn-branch.show { background: #ffefcc; color: #8a5300; }
@media (min-width: 992px) {
  .modulebar .mega-menu.show, .modulebar .dropdown:hover > .mega-menu { display: grid !important; grid-template-columns: repeat(2, minmax(230px, 1fr)); column-gap: .25rem; min-width: 520px; }
  .modulebar .mega-menu > li:has(> .dropdown-header) { grid-column: 1 / -1; }
  .modulebar .mega-menu .dropdown-header { border-top: 1px solid var(--nb-border); margin-top: .25rem; padding-top: .6rem; }
  .modulebar .mega-menu > li:first-child .dropdown-header { border-top: 0; margin-top: 0; }
}
.modulebar .dropdown-menu { max-height: calc(100vh - 130px); overflow-y: auto; }
.nav-tabs-nb { border-bottom: 1px solid var(--nb-border); gap: .25rem; margin-bottom: 1rem; }
.nav-tabs-nb .nav-link { border: 0; color: var(--nb-muted); font-weight: 600; padding: .6rem .9rem; border-bottom: 3px solid transparent; border-radius: 0; }
.nav-tabs-nb .nav-link.active { color: var(--nb-blue); border-bottom-color: var(--nb-blue); background: transparent; }
.timeline { list-style: none; padding-left: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 1rem 1.6rem; border-left: 2px solid var(--nb-border); margin-left: .5rem; }
.timeline li:last-child { border-left-color: transparent; }
.timeline li .dot { position: absolute; left: -.55rem; top: 0; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: #fff; border: 2px solid var(--nb-blue); }
.check-ok { color: #12915a; } .check-bad { color: #d03434; } .check-warn { color: #c77700; }
.rec-row.cleared { background: #f0faf4; }
.curr-tag { font-size: .7rem; font-weight: 700; background: #eef3ff; color: var(--nb-blue-600); border-radius: 5px; padding: .1rem .35rem; margin-left: .25rem; }

/* P2: more top-level modules — compact the module bar on narrower desktops */
@media (min-width: 992px) and (max-width: 1599.98px) {
  .modulebar .nav-link { padding: .8rem .6rem !important; gap: .35rem; }
  .modulebar .nav-link.active::after { left: .6rem; right: .6rem; }
}
@media (min-width: 992px) and (max-width: 1279.98px) {
  .modulebar .nav-link > .bi { display: none; }
  .modulebar .nav-link { font-size: .82rem; padding: .8rem .5rem !important; }
}
.modulebar .mega-menu.mega-wide { min-width: 640px; }

/* ===== P2 ===== */
.notif-menu { width: 360px; max-height: 70vh; overflow-y: auto; }
.notif-item { white-space: normal; display: flex; gap: .6rem; align-items: flex-start; }
.min-w-0 { min-width: 0; }
.list-compact .list-group-item { padding: .55rem .9rem; }
/* Kanban */
.kanban { display: flex; gap: .75rem; overflow-x: auto; padding-bottom: .5rem; align-items: flex-start; }
.kanban-col { flex: 0 0 280px; background: var(--nb-surface-2, #f3f6fb); border: 1px solid var(--nb-border); border-radius: 12px; display: flex; flex-direction: column; max-height: 75vh; }
.kanban-col-head { padding: .6rem .8rem; font-weight: 600; border-bottom: 1px solid var(--nb-border); display: flex; justify-content: space-between; align-items: center; }
.kanban-col-body { padding: .5rem; overflow-y: auto; min-height: 80px; flex: 1; }
.kanban-col-body.drag-over { background: rgba(26,109,255,.06); }
.kanban-card { background: #fff; border: 1px solid var(--nb-border); border-radius: 10px; padding: .55rem .7rem; margin-bottom: .5rem; cursor: grab; box-shadow: 0 1px 2px rgba(11,29,77,.04); }
.kanban-card:active { cursor: grabbing; }
.kanban-card.dragging { opacity: .5; }
/* Gantt */
.gantt { overflow-x: auto; border: 1px solid var(--nb-border); border-radius: 12px; background: #fff; }
.gantt table { border-collapse: collapse; min-width: 100%; }
.gantt th, .gantt td { border-bottom: 1px solid var(--nb-border); font-size: .78rem; padding: 0; height: 32px; }
.gantt .g-name { position: sticky; left: 0; background: #fff; z-index: 2; min-width: 240px; max-width: 240px; padding: 0 .6rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-right: 1px solid var(--nb-border); }
.gantt .g-day { min-width: 22px; width: 22px; text-align: center; color: var(--nb-muted, #6b7a99); border-left: 1px solid rgba(0,0,0,.03); }
.gantt .g-day.we { background: rgba(11,29,77,.03); }
.gantt .g-day.today { background: rgba(26,109,255,.10); }
.gantt .g-cell { position: relative; }
.gantt .g-bar { position: absolute; top: 7px; height: 18px; border-radius: 9px; background: #1a6dff; color: #fff; font-size: .68rem; line-height: 18px; padding: 0 6px; white-space: nowrap; overflow: hidden; }
.gantt .g-bar .g-prog { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(255,255,255,.28); }
.gantt .g-bar.done { background: #16a34a; }
.gantt .g-bar.blocked { background: #dc2626; }
.gantt .g-bar.late { background: #f59e0b; }
.gantt .g-ms { position: absolute; top: 8px; width: 16px; height: 16px; transform: rotate(45deg); background: #7c3aed; }
/* Org chart */
.org-tree, .org-tree ul { list-style: none; padding-left: 1.5rem; margin: 0; position: relative; }
.org-tree { padding-left: 0; }
.org-tree li { position: relative; padding: .35rem 0 .35rem 1rem; }
.org-tree ul li::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; border-left: 2px solid var(--nb-border); }
.org-tree ul li:last-child::before { bottom: auto; height: 1.4rem; }
.org-tree ul li::after { content: ""; position: absolute; left: 0; top: 1.4rem; width: .9rem; border-top: 2px solid var(--nb-border); }
.org-node { display: inline-flex; gap: .6rem; align-items: center; background: #fff; border: 1px solid var(--nb-border); border-radius: 12px; padding: .45rem .8rem; box-shadow: 0 1px 2px rgba(11,29,77,.05); }
.org-node .avatar-sm, .avatar-sm { width: 34px; height: 34px; border-radius: 50%; background: #e8f0ff; color: #1a6dff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: 0 0 34px; object-fit: cover; }
.avatar-lg { width: 88px; height: 88px; border-radius: 50%; background: #e8f0ff; color: #1a6dff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 2rem; object-fit: cover; }
/* Attendance calendar */
.att-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.att-cal .d { border: 1px solid var(--nb-border); border-radius: 8px; min-height: 64px; padding: 4px 6px; font-size: .72rem; background: #fff; }
.att-cal .d .n { font-weight: 700; }
.att-cal .d.present { background: #ecfdf3; } .att-cal .d.late { background: #fff7e6; } .att-cal .d.absent { background: #fdecec; }
.att-cal .d.leave { background: #eef2ff; } .att-cal .d.holiday, .att-cal .d.off { background: #f3f4f6; } .att-cal .d.half_day { background: #fff1f2; }
.att-grid td.att { width: 26px; min-width: 26px; text-align: center; font-size: .7rem; padding: .25rem 0 !important; }
.att-P { background: #dcfce7; } .att-L { background: #fef3c7; } .att-A { background: #fee2e2; } .att-V { background: #e0e7ff; } .att-H, .att-O { background: #f3f4f6; color: #6b7280; } .att-½ { background: #ffe4e6; }
/* Driver app + signature */
.sig-pad { border: 2px dashed var(--nb-border); border-radius: 12px; width: 100%; height: 200px; touch-action: none; background: #fff; }
.driver-card { border-radius: 14px; }
.big-btn { padding: .9rem 1rem; font-size: 1.05rem; font-weight: 600; border-radius: 12px; }
/* Heat / bars */
.bar-track { height: 8px; background: #edf1f7; border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: #1a6dff; border-radius: 4px; }
.heat-0 { background: #f8fafc; } .heat-1 { background: #dbeafe; } .heat-2 { background: #93c5fd; } .heat-3 { background: #3b82f6; color: #fff; } .heat-4 { background: #1d4ed8; color: #fff; }
.payslip { max-width: 820px; margin: 0 auto; }
.payslip table td, .payslip table th { padding: .3rem .5rem; }
.star-rating i { color: #f59e0b; }
@media print { .kanban-col { max-height: none; } .gantt { overflow: visible; } }

/* ---------- P3: customer / supplier portal ---------- */
body.portal { background: #f4f6fb; }
.portal-header { background: linear-gradient(120deg, var(--nb-navy), var(--nb-navy-2)); box-shadow: 0 2px 10px rgba(11, 29, 77, .18); }
.portal-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--nb-blue); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.1rem; }
.portal-nav { background: rgba(255, 255, 255, .06); border-top: 1px solid rgba(255, 255, 255, .08); }
.portal-link { color: rgba(255, 255, 255, .75); text-decoration: none; padding: .6rem .85rem; display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; font-weight: 500; border-bottom: 2px solid transparent; }
.portal-link:hover { color: #fff; }
.portal-link.active { color: #fff; border-bottom-color: var(--nb-sky); }
.portal-lang { background: rgba(255, 255, 255, .12); }
.portal-lang a { color: rgba(255, 255, 255, .8); }
.portal-lang a.active { background: #fff; color: var(--nb-navy); }
.portal-hero { background: #fff; border: 1px solid var(--nb-border); border-radius: var(--nb-radius); padding: 1.25rem 1.5rem; }
.pay-qr { width: 180px; height: 180px; object-fit: contain; border: 1px solid var(--nb-border); border-radius: 12px; background: #fff; padding: 6px; }
/* ---------- P3: documents & shop floor ---------- */
.doc-paper { max-width: 1000px; }
@keyframes nbBlink { 50% { opacity: .25; } }
.blink { animation: nbBlink 1.2s infinite; }
@media print { .portal-header, .portal-nav { display: none !important; } }
/* ---------- P3: keep the 12-module bar on one line on laptop screens ---------- */
@media (min-width: 992px) and (max-width: 1499.98px) {
  .modulebar .navbar-nav { gap: 0; }
  .modulebar .nav-link { padding: .8rem .5rem !important; gap: .3rem; font-size: .84rem; }
  .modulebar .dropdown-toggle::after { display: none; }
  .modulebar .nav-link.active::after { left: .5rem; right: .5rem; }
  .lang-my .modulebar .nav-link > .bi { display: none; }
}
@media (min-width: 992px) and (max-width: 1299.98px) {
  .modulebar .nav-link > .bi { display: none; }
  .modulebar .nav-link { font-size: .82rem; padding: .8rem .45rem !important; }
}
