:root {
  --navy: #16304E;
  --navy-deep: #0D1F35;
  --gold: #D9A441;
  --gold-soft: #F1D9A0;
  --cream: #F7F4EC;
  --paper: #FFFFFF;
  --ink: #22303F;
  --ink-soft: #66748A;
  --line: #E4E0D4;
  --green: #2E7D5B;
  --red: #B4483A;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(13, 31, 53, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
.brand-name,
.nav-item {
  font-family: 'Poppins', sans-serif;
}

/* ---------- Login ---------- */
#loginScreen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy-deep), var(--navy) 60%, #22456E);
  padding: 20px;
}

.login-card {
  background: var(--paper);
  border-radius: 18px;
  width: 100%;
  max-width: 380px;
  padding: 36px 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  text-align: center;
}

.login-card img {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
  margin-bottom: 14px;
}

.login-card h2 {
  margin: 0 0 4px;
  color: var(--navy-deep);
  font-size: 20px;
}

.login-card .sub {
  color: var(--ink-soft);
  font-size: 13px;
  margin-bottom: 22px;
}

.login-card .field {
  text-align: left;
  margin-bottom: 14px;
}

.login-card label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.login-card input {
  width: 100%;
  padding: 11px 13px;
  border-radius: 9px;
  border: 1.5px solid var(--line);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  background: #FCFBF8;
}

.login-card input:focus {
  outline: none;
  border-color: var(--gold);
}

.login-error {
  background: #FBEAE7;
  color: var(--red);
  font-size: 12.5px;
  padding: 9px 12px;
  border-radius: 8px;
  margin-bottom: 14px;
  display: none;
}

.login-hint {
  margin-top: 18px;
  font-size: 11.5px;
  color: var(--ink-soft);
  background: #F7F4EC;
  padding: 10px 12px;
  border-radius: 9px;
  text-align: left;
  line-height: 1.5;
}

/* ---------- Layout ---------- */
.app {
  display: none;
  min-height: 100vh;
}

.app.active {
  display: flex;
}

.sidebar {
  width: 240px;
  background: var(--navy);
  color: #fff;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 10px;
  text-align: center;
}

.brand img {
  width: 190px;
  height: 70px;
  border-radius: 12px;
  object-fit: cover;
  background: #fff;
  padding: 4px;
}

.brand-info {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.brand-name {
  font-weight: 700;
  font-size: 18px;
  line-height: 1.3;
  color: #fff;
}

.brand-sub {
  font-size: 11px;
  color: var(--gold-soft);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-top: 3px;
}

.whoami {
  padding: 0 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 10px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.7);
}

.whoami b {
  color: #fff;
  display: block;
  font-size: 13.5px;
}

nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 12px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10.5px 14px;
  border-radius: 10px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.75);
  font-size: 13.5px;
  font-weight: 500;
  border: none;
  background: none;
  text-align: left;
  width: 100%;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.nav-item.active {
  background: var(--gold);
  color: var(--navy-deep);
  font-weight: 700;
}

.sidebar-footer {
  padding: 14px 20px 0;
}

.logout-btn {
  width: 100%;
  padding: 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.logout-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

main {
  flex: 1;
  padding: 32px 40px;
  max-width: 1320px;
}

.page {
  display: none;
}

.page.active {
  display: block;
  animation: fade .25s ease;
}

@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

header.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 26px;
  flex-wrap: wrap;
  gap: 12px;
}

header.page-head h1 {
  font-size: 25px;
  margin: 0 0 4px;
  color: var(--navy-deep);
}

header.page-head p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13.5px;
}

.btn {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 13px;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform .12s ease, box-shadow .12s ease;
}

.btn-gold {
  background: var(--gold);
  color: var(--navy-deep);
}

.btn-gold:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(217, 164, 65, 0.35);
}

.btn-navy {
  background: var(--navy);
  color: #fff;
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--line);
  color: var(--ink);
}

.btn-outline:hover {
  border-color: var(--navy);
  color: var(--navy);
}

.btn-danger {
  background: #FBEAE7;
  color: var(--red);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 8px;
}

.btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 26px;
}

.kpi {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--gold);
}

.kpi.alt {
  border-left-color: var(--navy);
}

.kpi.green {
  border-left-color: var(--green);
}

.kpi.red {
  border-left-color: var(--red);
}

.kpi .label {
  font-size: 12px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 600;
  margin-bottom: 7px;
}

.kpi .value {
  font-size: 24px;
  font-weight: 800;
  color: var(--navy-deep);
  font-family: 'Poppins', sans-serif;
}

.kpi .sub {
  font-size: 11.5px;
  color: var(--ink-soft);
  margin-top: 4px;
}

.panel {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 22px;
}

.panel h3 {
  margin: 0 0 16px;
  font-size: 16px;
  color: var(--navy-deep);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  text-align: left;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .03em;
  padding: 10px 11px;
  border-bottom: 1.5px solid var(--line);
  white-space: nowrap;
}

td {
  padding: 11px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: #FBFAF6;
}

.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.tag.instock {
  background: #E6F3EC;
  color: var(--green);
}

.tag.low {
  background: #FDF1E0;
  color: #B57A1D;
}

.tag.out {
  background: #FBEAE7;
  color: var(--red);
}

.tag.paid {
  background: #E6F3EC;
  color: var(--green);
}

.tag.pending {
  background: #FDF1E0;
  color: #B57A1D;
}

.tag.yes {
  background: #E6F3EC;
  color: var(--green);
}

.tag.no {
  background: #FBEAE7;
  color: var(--red);
}

.branch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.branch-card {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  border-top: 4px solid var(--navy);
  cursor: pointer;
  transition: transform .15s ease;
}

.branch-card:hover {
  transform: translateY(-3px);
}

.branch-card .bname {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--navy-deep);
  margin-bottom: 2px;
}

.branch-card .bloc {
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 16px;
}

.branch-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
}

.bstat .n {
  font-size: 18px;
  font-weight: 800;
  font-family: 'Poppins', sans-serif;
  color: var(--navy-deep);
}

.bstat .l {
  font-size: 10.5px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: .03em;
}

.branch-card .bvalue {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.branch-card .bvalue .n {
  color: var(--green);
  font-weight: 800;
  font-size: 17px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 31, 53, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal-overlay.nested {
  z-index: 200;
}

.modal {
  background: var(--paper);
  border-radius: 16px;
  width: 100%;
  max-width: 460px;
  padding: 28px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal.wide {
  max-width: 680px;
}

.modal.xwide {
  max-width: 960px;
}

.perm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  margin-top: 6px;
}

.perm-table th,
.perm-table td {
  padding: 7px 6px;
  border: 1px solid var(--line);
  text-align: center;
}

.perm-table th {
  background: var(--cream);
  font-weight: 600;
  color: var(--navy-deep);
}

.perm-table td:first-child,
.perm-table th:first-child {
  text-align: left;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.perm-table input[type=checkbox] {
  width: 18px;
  height: 18px;
  accent-color: var(--navy);
  cursor: pointer;
}

.perm-table-wrap {
  max-height: 320px;
  overflow-y: auto;
  border-radius: 8px;
}

.modal h3 {
  margin: 0 0 18px;
  font-size: 18px;
  color: var(--navy-deep);
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1.5px solid var(--line);
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  background: #FCFBF8;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--gold);
}

.row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.row3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.modal-actions .btn {
  flex: 1;
  justify-content: center;
}

.empty {
  text-align: center;
  padding: 44px 20px;
  color: var(--ink-soft);
}

.empty .icon {
  font-size: 36px;
  margin-bottom: 10px;
}

.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.toolbar select,
.toolbar input {
  padding: 9px 12px;
  border-radius: 9px;
  border: 1.5px solid var(--line);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  background: var(--paper);
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--navy-deep);
  color: #fff;
  padding: 13px 20px;
  border-radius: 10px;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  z-index: 300;
  opacity: 0;
  transform: translateY(10px);
  transition: all .25s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 13px;
  cursor: pointer;
  margin-bottom: 14px;
  font-weight: 600;
}

.back-link:hover {
  color: var(--navy);
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.toggle input {
  display: none;
}

.toggle .track {
  width: 38px;
  height: 21px;
  border-radius: 20px;
  background: #DDD8C8;
  position: relative;
  transition: .2s;
}

.toggle .track::after {
  content: '';
  position: absolute;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff;
  top: 2px;
  left: 2px;
  transition: .2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.toggle input:checked+.track {
  background: var(--green);
}

.toggle input:checked+.track::after {
  left: 19px;
}

.toggle span.tl {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
}

.item-rows {
  border: 1.5px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
}

.item-row {
  display: grid;
  grid-template-columns: 2fr 70px 90px 90px 30px;
  gap: 8px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  align-items: center;
}

.item-row:last-child {
  border-bottom: none;
}

.item-row.head {
  background: #FBFAF6;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.item-row select,
.item-row input {
  padding: 7px 8px;
  font-size: 12.5px;
  border-radius: 7px;
  border: 1.5px solid var(--line);
}

.rm-row {
  background: #FBEAE7;
  color: var(--red);
  border: none;
  border-radius: 6px;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-weight: 700;
}

.totals-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  margin-top: 12px;
  font-size: 13.5px;
}

.totals-box .grand {
  font-size: 18px;
  font-weight: 800;
  color: var(--navy-deep);
  font-family: 'Poppins', sans-serif;
}

.menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: var(--navy);
  color: #fff;
  border: none;
  cursor: pointer;
  margin-bottom: 16px;
}

/* Action dropdown */
.action-wrap {
  position: relative;
  display: inline-block;
}

.action-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  z-index: 20;
  min-width: 170px;
  overflow: hidden;
}

.action-menu.open {
  display: block;
}

.action-menu button {
  width: 100%;
  text-align: left;
  padding: 9px 14px;
  border: none;
  background: none;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.action-menu button:hover {
  background: #F7F4EC;
}

.action-menu button.danger {
  color: var(--red);
}

/* Report pills */
.pill-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.pill {
  padding: 9px 16px;
  border-radius: 20px;
  background: var(--navy-deep);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
}

.pill.active {
  background: var(--gold);
  color: var(--navy-deep);
}

.subpill-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.subpill {
  padding: 7px 13px;
  border-radius: 20px;
  background: transparent;
  border: 1.5px solid var(--line);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

.subpill.active {
  border-color: var(--gold);
  background: #FDF6E7;
  color: #B57A1D;
}

@media(max-width:820px) {
  .sidebar {
    position: fixed;
    left: -240px;
    z-index: 50;
    transition: left .2s;
  }

  .sidebar.open {
    left: 0;
  }

  main {
    padding: 20px;
  }

  .menu-btn {
    display: flex !important;
  }

  .item-row {
    grid-template-columns: 1fr;
  }
}

/* ================================================
   RESPONSIVE — TABLET (1024px)
   ================================================ */
@media (max-width: 1024px) {
  main {
    padding: 28px 24px;
  }

  .kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
  }

  .branch-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }

  .modal.xwide {
    max-width: 820px;
  }
}

/* ================================================
   RESPONSIVE — MOBILE PHONES (600px)
   ================================================ */
@media (max-width: 600px) {
  main {
    padding: 16px 14px 70px;
  }

  /* ---- Page headers ---- */
  header.page-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  header.page-head h1 {
    font-size: 19px;
  }

  header.page-head .btn {
    width: 100%;
    justify-content: center;
  }

  /* ---- KPI cards ---- */
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .kpi {
    padding: 13px 14px;
  }

  .kpi .value {
    font-size: 18px;
  }

  /* ---- Panels & tables ---- */
  .panel {
    padding: 14px;
    border-radius: 12px;
  }

  /* Every table container in your app (JS-injected tables live in these divs) */
  #allProductTable,
  #bd-productTable,
  #customerTable,
  #vendorTable,
  #rawMaterialTable,
  #employeeTableArea,
  #leadTable,
  #expenseTable,
  #salesTableGst,
  #salesTableNonGst,
  #poTable,
  #purchasesTable,
  #reportTableArea,
  #staffTable,
  #dashboardBranchTable {
    overflow-x: auto;
  }

  #allProductTable table,
  #bd-productTable table,
  #customerTable table,
  #vendorTable table,
  #rawMaterialTable table,
  #employeeTableArea table,
  #leadTable table,
  #expenseTable table,
  #salesTableGst table,
  #salesTableNonGst table,
  #poTable table,
  #purchasesTable table,
  #reportTableArea table,
  #staffTable table,
  #dashboardBranchTable table {
    min-width: 640px;
  }

  /* ---- Toolbars (branch filter selects + export buttons + anchor buttons) ---- */
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar select,
  .toolbar input,
  .toolbar a,
  .toolbar .btn {
    width: 100%;
  }

  .toolbar a button {
    width: 100%;
  }

  /* Sales page GST/Non-GST section headers with inline export buttons */
  h3[style*="justify-content:space-between"] {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 8px;
  }

  h3[style*="justify-content:space-between"] .btn {
    width: 100%;
    justify-content: center;
  }

  /* ---- Forms & modals ---- */
  .row2 {
    grid-template-columns: 1fr;
  }

  .row3 {
    grid-template-columns: 1fr;
  }

  .modal {
    padding: 18px;
    max-width: 100%;
    width: 100%;
    border-radius: 14px;
    max-height: 94vh;
  }

  .modal.wide,
  .modal.xwide {
    max-width: 100%;
  }

  .modal-actions {
    flex-direction: column;
  }

  .modal-actions .btn {
    width: 100%;
  }

  /* ---- Item rows (Sale / Purchase / PO line items) ---- */
  .item-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 10px;
    position: relative;
  }

  .item-row.head {
    display: none;
  }

  /* Per-field labels for stacked item rows on mobile */
  .item-row:not(.head) [data-label] {
    width: 100%;
  }

  .item-row:not(.head) [data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--ink-soft);
    margin-bottom: 3px;
  }

  .item-row:not(.head)>div[data-label] {
    padding: 7px 8px;
    background: #FBFAF6;
    border-radius: 7px;
    border: 1px solid var(--line);
    font-size: 13px;
  }

  .item-row select,
  .item-row input {
    width: 100%;
  }

  .rm-row {
    justify-self: end;
  }

  /* ---- Totals box ---- */
  .totals-box {
    align-items: stretch;
    text-align: right;
  }

  /* ---- Branch cards ---- */
  .branch-grid {
    grid-template-columns: 1fr;
  }

  /* ---- Pills (Employees tabs, Reports tabs, Sale/Sub invoice type pills) ---- */
  .pill-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }

  .pill {
    flex-shrink: 0;
    white-space: nowrap;
  }

  .subpill-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .subpill {
    flex-shrink: 0;
    white-space: nowrap;
  }

  /* ---- Permission matrix (Staff modal) ---- */
  .perm-table-wrap {
    overflow-x: auto;
  }

  .perm-table {
    min-width: 520px;
  }

  /* ---- Action dropdown menu (sales/purchase/PO row actions) ---- */
  .action-menu {
    position: fixed;
    left: 16px;
    right: 16px;
    top: auto;
    bottom: 16px;
    min-width: unset;
  }

  /* ---- Customer Ledger modal ---- */
  #ledgerContent table {
    font-size: 11.5px;
  }

  #ledgerContent td,
  #ledgerContent th {
    padding: 4px !important;
  }

  /* ---- Login screen ---- */
  .login-card {
    padding: 26px 20px;
  }

  /* ---- Sidebar brand logo ---- */
  .brand img {
    width: 160px;
    height: 60px;
  }
}

/* ================================================
   RESPONSIVE — SMALL PHONES (380px)
   ================================================ */
@media (max-width: 380px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  header.page-head h1 {
    font-size: 17px;
  }

  .brand img {
    width: 140px;
    height: 52px;
  }

  .login-card {
    padding: 22px 16px;
  }
}