/* ============================================================
   Simplo Office — Lumbatech Workspace
   Tema warna mengacu pada simplo.id
   ============================================================ */

:root {
  /* Brand */
  --brand-900: #0d1826;
  --brand-800: #102036;
  --brand-700: #1a2333;
  --brand-600: #003588;
  --brand-500: #004aad;
  --brand-400: #1a5fe8;
  --brand-300: #5b96f5;
  --brand-200: #d6e8ff;
  --brand-100: #eef5ff;
  --brand-50: #f5f9ff;

  /* Neutrals */
  --gray-900: #0d1826;
  --gray-800: #1a2333;
  --gray-700: #2a3447;
  --gray-600: #475569;
  --gray-500: #6b7685;
  --gray-400: #98a2b3;
  --gray-300: #bcc3cf;
  --gray-200: #e2e6ed;
  --gray-150: #eef0f4;
  --gray-100: #f3f5f8;
  --gray-50: #f7f8fa;
  --white: #ffffff;

  /* Status */
  --success: #10b981;
  --success-soft: #e6f9f2;
  --warning: #f59e0b;
  --warning-soft: #fff3e8;
  --danger: #ef4444;
  --danger-soft: #fff0f0;
  --info: #1a5fe8;
  --info-soft: #eef5ff;
  --purple: #7c3aed;
  --purple-soft: #f0eeff;

  /* Layout */
  --sidebar-w: 264px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(13, 24, 38, 0.06);
  --shadow: 0 4px 12px rgba(13, 24, 38, 0.06), 0 1px 2px rgba(13, 24, 38, 0.04);
  --shadow-lg: 0 12px 32px rgba(13, 24, 38, 0.1);
  --shadow-brand: 0 8px 20px rgba(0, 74, 173, 0.18);

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}
body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--gray-800);
  background: var(--gray-50);
  -webkit-font-smoothing: antialiased;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font-family: inherit;
  cursor: pointer;
  border: 0;
  background: none;
}
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
}
img,
svg {
  display: block;
  max-width: 100%;
}
table {
  border-collapse: collapse;
  width: 100%;
}

/* ============================================================
   Shell layout
   ============================================================ */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: linear-gradient(180deg, #0d1826 0%, #102036 100%);
  color: #cfd6e1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 20px 20px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.sidebar__logo-img {
  display: block;
  width: auto;
  height: 56px;
  max-width: 80%;
  object-fit: contain;
  filter: brightness(0) invert(1);
}
.sidebar__brand-title {
  color: #fff;
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: 0.2px;
  line-height: 1.2;
}

.sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar__nav::-webkit-scrollbar {
  width: 6px;
}
.sidebar__nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
}

.sidebar__nav-label {
  text-transform: uppercase;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: #6b7685;
  padding: 14px 12px 6px;
}
.sidebar__nav-label:first-child {
  padding-top: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #c7cfdb;
  font-weight: 500;
  font-size: 13.5px;
  transition: var(--transition);
  position: relative;
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}
.nav-item__icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: #8b94a3;
  transition: var(--transition);
}
.nav-item__icon svg {
  width: 20px;
  height: 20px;
}
.nav-item:hover .nav-item__icon {
  color: #5b96f5;
}
.nav-item.is-active {
  background: linear-gradient(135deg, rgba(26, 95, 232, 0.18), rgba(0, 74, 173, 0.1));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(91, 150, 245, 0.2);
}
.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, #1a5fe8, #5b96f5);
}
.nav-item.is-active .nav-item__icon {
  color: #5b96f5;
}

/* Collapsible nav group (parent button + nested items) */
.nav-group {
  display: flex;
  flex-direction: column;
}
.nav-item--group {
  background: none;
  border: 0;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: #c7cfdb;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 10px;
}
.nav-item--group:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}
.nav-item--group:hover .nav-item__icon {
  color: #5b96f5;
}
.nav-item__chevron {
  margin-left: auto;
  display: grid;
  place-items: center;
  color: #8b94a3;
  transition: transform 180ms ease;
}
.nav-group.is-open .nav-item__chevron {
  transform: rotate(180deg);
  color: #5b96f5;
}
.nav-group__items {
  display: none;
  flex-direction: column;
  gap: 2px;
  margin: 2px 0 4px 14px;
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}
.nav-group.is-open .nav-group__items {
  display: flex;
}
.nav-item--child {
  padding: 8px 10px;
  font-size: 12.5px;
  border-radius: 8px;
}
.nav-item--child.is-active::before {
  left: -14px;
  top: 6px;
  bottom: 6px;
}
.nav-group.has-active > .nav-item--group {
  color: #fff;
}
.nav-group.has-active > .nav-item--group .nav-item__icon {
  color: #5b96f5;
}

.sidebar__footer {
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.sidebar__user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}
.sidebar__user-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}
.sidebar__user-name {
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar__user-role {
  color: #98a2b3;
  font-size: 11.5px;
}

/* ============================================================
   Content
   ============================================================ */
.content {
  flex: 1;
  padding: 28px 32px 40px;
  min-width: 0;
}

.page {
  display: flex;
  flex-direction: column;
  gap: 22px;
  animation: pageFade 280ms ease;
}
@keyframes pageFade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.page-header__title h1 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--gray-900);
}
.page-header__title p {
  margin: 0;
  color: var(--gray-500);
  font-size: 13.5px;
}
.page-header__actions {
  display: flex;
  gap: 8px;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  transition: var(--transition);
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn svg {
  width: 16px;
  height: 16px;
}
.btn--primary {
  background: linear-gradient(135deg, #004aad, #1a5fe8);
  color: #fff;
  box-shadow: var(--shadow-brand);
}
.btn--primary:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}
.btn--secondary {
  background: #fff;
  color: var(--gray-800);
  border-color: var(--gray-200);
  box-shadow: var(--shadow-sm);
}
.btn--secondary:hover {
  border-color: var(--brand-300);
  color: var(--brand-500);
}
.btn--ghost {
  background: transparent;
  color: var(--gray-700);
}
.btn--ghost:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}
.btn--sm {
  padding: 6px 10px;
  font-size: 12.5px;
}
.btn--danger-ghost {
  background: transparent;
  color: var(--danger);
}
.btn--danger-ghost:hover {
  background: var(--danger-soft);
}

/* Icon button */
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--gray-600);
  background: transparent;
  position: relative;
  transition: var(--transition);
}
.icon-btn:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}
.icon-btn--ghost {
  color: #c7cfdb;
}
.icon-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.badge-dot {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid #fff;
}

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--gray-200);
}
.card__title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--gray-900);
}
.card__sub {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--gray-500);
}
.card__body {
  padding: 18px;
}
.card__body--flush {
  padding: 0;
}

/* Stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
@media (max-width: 1100px) {
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 560px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }
}

.stat {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}
.stat:hover {
  border-color: var(--brand-200);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.stat__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.stat__label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--gray-500);
}
.stat__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--brand-500);
  background: var(--brand-100);
}
.stat__icon svg {
  width: 18px;
  height: 18px;
}
.stat__icon--green {
  color: var(--success);
  background: var(--success-soft);
}
.stat__icon--orange {
  color: var(--warning);
  background: var(--warning-soft);
}
.stat__icon--purple {
  color: var(--purple);
  background: var(--purple-soft);
}
.stat__value {
  font-size: 26px;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.stat__delta {
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
}
.stat__delta--up {
  color: var(--success);
}
.stat__delta--down {
  color: var(--danger);
}
.stat__delta-sub {
  color: var(--gray-500);
  font-weight: 500;
  margin-left: 2px;
}

/* ============================================================
   Tables
   ============================================================ */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
}
.table {
  width: 100%;
  font-size: 13.5px;
}
.table thead th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}
.table thead th.table-th-sort {
  padding: 0;
  vertical-align: middle;
}
.table thead th.col-num {
  text-align: right;
}
.th-sort-btn {
  appearance: none;
  border: 0;
  margin: 0;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  padding: 12px 16px;
  width: 100%;
  min-height: 42px;
  box-sizing: border-box;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.th-sort-btn:hover,
.th-sort-btn:focus-visible {
  color: var(--gray-800);
  background: var(--gray-100);
  outline: none;
}
.th-sort-btn--end {
  justify-content: flex-end;
}
.th-sort-btn__ico {
  display: inline-flex;
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  opacity: 0.28;
  align-items: center;
  justify-content: center;
}
.th-sort-btn__ico svg {
  width: 14px;
  height: 14px;
}
.th-sort-btn.is-active {
  color: var(--gray-900);
}
.th-sort-btn.is-active .th-sort-btn__ico {
  opacity: 1;
  color: var(--brand-600);
}
.table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-150);
  color: var(--gray-800);
  vertical-align: middle;
}
.table tbody tr:last-child td {
  border-bottom: 0;
}
.table tbody tr {
  transition: background var(--transition);
}
.table tbody tr:hover {
  background: var(--brand-50);
}
.table .col-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.table .col-actions {
  text-align: right;
  white-space: nowrap;
}
.table .cell-primary {
  color: var(--gray-900);
  font-weight: 600;
}
.table .cell-muted {
  color: var(--gray-500);
}

/* Toolbar */
.toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-200);
  flex-wrap: wrap;
}
.toolbar__search {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--gray-50);
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--gray-200);
  color: var(--gray-500);
  min-width: 140px;
  max-width: 220px;
  flex: 0 1 220px;
  height: 36px;
  box-sizing: border-box;
}
.toolbar__search input {
  border: 0;
  background: transparent;
  outline: none;
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  font-size: 13px;
  line-height: 1.25;
  color: var(--gray-800);
}
.toolbar__search svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}
.toolbar__search input::placeholder {
  color: var(--gray-400);
}
.select {
  padding: 8px 12px;
  border: 1px solid var(--gray-200);
  background: #fff;
  border-radius: 8px;
  color: var(--gray-700);
  font-weight: 500;
  outline: none;
  transition: var(--transition);
}
.select:focus {
  border-color: var(--brand-300);
  box-shadow: 0 0 0 3px rgba(26, 95, 232, 0.1);
}

/* Toolbar: samakan tinggi pencarian & dropdown filter */
.toolbar .select {
  height: 36px;
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
  line-height: 1.25;
  box-sizing: border-box;
}
.toolbar__spacer {
  flex: 1;
}

/* ============================================================
   Badges & pills
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--gray-100);
  color: var(--gray-700);
  white-space: nowrap;
  line-height: 1.4;
}
.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}
.badge--success {
  background: var(--success-soft);
  color: var(--success);
}
.badge--warning {
  background: var(--warning-soft);
  color: var(--warning);
}
.badge--danger {
  background: var(--danger-soft);
  color: var(--danger);
}
.badge--info {
  background: var(--info-soft);
  color: var(--info);
}
.badge--purple {
  background: var(--purple-soft);
  color: var(--purple);
}
.badge--neutral {
  background: var(--gray-100);
  color: var(--gray-700);
}

/* ============================================================
   Avatar
   ============================================================ */
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #004aad, #1a5fe8);
  color: #fff;
  font-weight: 700;
  font-size: 12.5px;
  display: grid;
  place-items: center;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--gray-200);
}
.avatar--sm {
  width: 32px;
  height: 32px;
  font-size: 11.5px;
}
.avatar--lg {
  width: 44px;
  height: 44px;
  font-size: 14px;
}
.avatar-stack {
  display: inline-flex;
}
.avatar-stack > * {
  margin-left: -8px;
}
.avatar-stack > *:first-child {
  margin-left: 0;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-cell__name {
  color: var(--gray-900);
  font-weight: 600;
  line-height: 1.2;
}
.user-cell__sub {
  color: var(--gray-500);
  font-size: 12px;
}

/* ============================================================
   Layout helpers
   ============================================================ */
.grid-2 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 1100px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}
.flex-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.text-right {
  text-align: right;
}
.text-muted {
  color: var(--gray-500);
}
.divider {
  height: 1px;
  background: var(--gray-200);
  margin: 8px 0;
}

/* ============================================================
   Activity / list items
   ============================================================ */
.activity {
  display: flex;
  flex-direction: column;
}
.activity__item {
  display: flex;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--gray-150);
}
.activity__item:last-child {
  border-bottom: 0;
}
.activity__icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--brand-100);
  color: var(--brand-500);
}
.activity__title {
  font-weight: 600;
  color: var(--gray-900);
  margin: 0 0 2px;
  font-size: 13.5px;
}
.activity__meta {
  margin: 0;
  font-size: 12.5px;
  color: var(--gray-500);
}
.activity__time {
  margin-left: auto;
  font-size: 12px;
  color: var(--gray-400);
  white-space: nowrap;
}

/* ============================================================
   Mini bar chart (for dashboard)
   ============================================================ */
.bars {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 10px;
  padding: 24px 18px 12px;
  align-items: end;
  height: 220px;
}
.bars__col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.bars__bar {
  width: 100%;
  background: linear-gradient(180deg, #1a5fe8, #004aad);
  border-radius: 6px 6px 2px 2px;
  min-height: 6px;
  position: relative;
  transition: filter var(--transition);
}
.bars__bar:hover {
  filter: brightness(1.1);
}
.bars__bar::after {
  content: attr(data-value);
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--gray-500);
  white-space: nowrap;
  opacity: 0;
  transition: var(--transition);
}
.bars__bar:hover::after {
  opacity: 1;
}
.bars__label {
  font-size: 11px;
  color: var(--gray-500);
  font-weight: 500;
}

/* ============================================================
   Empty state / placeholder
   ============================================================ */
.empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--gray-500);
}
.empty__icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--brand-100);
  color: var(--brand-500);
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
}

/* ============================================================
   Form elements (basic)
   ============================================================ */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--gray-700);
}
.input {
  padding: 10px 12px;
  border: 1px solid var(--gray-200);
  background: #fff;
  border-radius: 9px;
  outline: none;
  transition: var(--transition);
  color: var(--gray-900);
}
.input:focus {
  border-color: var(--brand-300);
  box-shadow: 0 0 0 4px rgba(26, 95, 232, 0.1);
}

/* ============================================================
   Responsive sidebar
   ============================================================ */
@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: relative;
    top: auto;
    height: auto;
    max-height: min(52vh, 420px);
    width: 100%;
    transform: none;
    z-index: auto;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }
  .content {
    padding: 18px;
  }
}

/* ============================================================
   Modal & toast (Pelanggan / forms)
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.modal.is-open {
  opacity: 1;
  pointer-events: auto;
}
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 24, 38, 0.45);
  backdrop-filter: blur(2px);
}
.modal__panel {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: min(92vh, 720px);
  overflow: auto;
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-lg);
  animation: pageFade 220ms ease;
}
.modal__panel--wide {
  max-width: 640px;
}
.modal__panel--xwide {
  max-width: 960px;
}
.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--gray-200);
}
.modal__title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.02em;
}
.modal__sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--gray-500);
}
.modal__body {
  padding: 18px 20px 20px;
}
.modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}
@media (max-width: 560px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}
.form-grid .field--full {
  grid-column: 1 / -1;
}
.pel-form-split {
  display: grid;
  grid-template-columns: minmax(104px, 132px) 1fr;
  gap: 12px;
  align-items: end;
}
@media (max-width: 560px) {
  .pel-form-split {
    grid-template-columns: 1fr;
  }
}
textarea.input {
  min-height: 88px;
  resize: vertical;
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
  filter: none !important;
}
.table-loading td {
  text-align: center;
  padding: 36px 16px !important;
  color: var(--gray-500);
  font-weight: 500;
}
.table-error td {
  text-align: center;
  padding: 28px 16px !important;
  color: var(--danger);
  font-weight: 500;
}
.toast-host {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(420px, calc(100vw - 32px));
}
.toast {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--gray-200);
  background: #fff;
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--gray-800);
  animation: pageFade 200ms ease;
}
.toast--ok {
  border-color: rgba(16, 185, 129, 0.35);
  background: var(--success-soft);
  color: #047857;
}
.toast--err {
  border-color: rgba(239, 68, 68, 0.35);
  background: var(--danger-soft);
  color: #b91c1c;
}
.dl-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px 12px;
  font-size: 13.5px;
}
.dl-grid dt {
  margin: 0;
  color: var(--gray-500);
  font-weight: 600;
}
.dl-grid dd {
  margin: 0;
  color: var(--gray-900);
  font-weight: 500;
}
.dl-grid dd.dd-pre {
  white-space: pre-wrap;
  word-break: break-word;
}
.cell-pel-alamat {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--gray-700);
}

/* ============================================================
   Gudang — Brand autocomplete
   ============================================================ */
.gd-brand-field [data-gd-brand-input] {
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.gd-brand-field [data-gd-brand-input]::placeholder {
  text-transform: none;
  letter-spacing: normal;
}
.gd-brand-field {
  position: relative;
}
.gd-autocomplete {
  position: relative;
  display: block;
}
.gd-autocomplete > .input {
  width: 100%;
}
.gd-autocomplete__list {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: 4px;
}
.gd-autocomplete__item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  background: transparent;
  color: var(--gray-800);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.gd-autocomplete__item:hover,
.gd-autocomplete__item.is-active {
  background: var(--brand-50);
  color: var(--brand-600);
}
.gd-autocomplete__empty {
  padding: 10px 12px;
  font-size: 12.5px;
  color: var(--gray-500);
}

/* ============================================================
   Gudang — Harga jual grid (Retail / Partner × UoM / UoM Bulk)
   ============================================================ */
.gd-sell-section {
  border: 1px dashed var(--gray-200);
  border-radius: 12px;
  padding: 12px 14px 14px;
  background: var(--brand-50);
}
.gd-sell-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.gd-sell-section__title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--gray-700);
}
.gd-sell-section__hint {
  font-size: 11.5px;
}
.gd-sell-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
}
@media (max-width: 560px) {
  .gd-sell-grid {
    grid-template-columns: 1fr;
  }
}
.gd-sell-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.gd-sell-cell label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--gray-600);
}
.gd-sell-cell input[disabled] {
  background: var(--gray-100);
  color: var(--gray-400);
  cursor: not-allowed;
}

/* ============================================================
   Gudang — Import dari Excel
   ============================================================ */
.gd-import-panel {
  max-width: 860px;
}
.gd-import-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.gd-import-step {
  border: 1px solid var(--gray-200);
  background: var(--gray-50);
  border-radius: var(--radius-md, 10px);
  padding: 14px 16px;
}
.gd-import-step__title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.01em;
}
.gd-import-step__desc {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--gray-600);
}
.gd-import-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.gd-import-help {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--gray-600);
}
.gd-import-help summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--gray-700);
  padding: 4px 0;
  user-select: none;
}
.gd-import-help summary:hover {
  color: var(--gray-900);
}
.gd-import-help-table {
  font-size: 12px;
}
.gd-import-help-table code {
  font-size: 11.5px;
  background: var(--gray-100);
  padding: 1px 6px;
  border-radius: 4px;
}
.gd-import-file {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.gd-import-file input[type="file"] {
  flex: 1;
  min-width: 220px;
  font-size: 13px;
  padding: 8px 10px;
  border: 1px dashed var(--gray-300);
  border-radius: 8px;
  background: #fff;
  color: var(--gray-700);
}
.gd-import-file input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 6px 12px;
  border: 1px solid var(--gray-300);
  background: var(--gray-100);
  color: var(--gray-700);
  border-radius: 6px;
  font-size: 12.5px;
  cursor: pointer;
}
.gd-import-file input[type="file"]::file-selector-button:hover {
  background: var(--gray-200);
}
.gd-import-file-info {
  margin: 8px 0 0;
  font-size: 12.5px;
  color: var(--gray-600);
}
.gd-import-file-name {
  font-weight: 600;
  color: var(--gray-800);
}
.gd-import-summary {
  margin-bottom: 10px;
}
.gd-import-summary__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}
.gd-import-summary__note {
  margin: 0;
  font-size: 12.5px;
  color: var(--gray-600);
}
.gd-import-pill {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--gray-200);
  background: #fff;
  color: var(--gray-700);
}
.gd-import-pill--ok {
  border-color: rgba(22, 163, 74, 0.35);
  color: #166534;
  background: rgba(22, 163, 74, 0.08);
}
.gd-import-pill--err {
  border-color: rgba(220, 38, 38, 0.35);
  color: #991b1b;
  background: rgba(220, 38, 38, 0.08);
}
.gd-import-pill--total {
  border-color: rgba(59, 130, 246, 0.35);
  color: #1d4ed8;
  background: rgba(59, 130, 246, 0.08);
}
.gd-import-pill--warn {
  border-color: rgba(217, 119, 6, 0.35);
  color: #92400e;
  background: rgba(217, 119, 6, 0.10);
}

/* ----- Consumables: form Tambah Stok / penerimaan ----- */
.cs-receipt-form-panel {
  max-width: min(920px, 96vw);
}
.cs-receipt-lines__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.cs-receipt-lines__table {
  font-size: 13px;
  table-layout: fixed;
  width: 100%;
}
.cs-receipt-lines__table td,
.cs-receipt-lines__table th {
  vertical-align: middle;
  padding: 6px 6px;
}
.cs-receipt-lines__table .input,
.cs-receipt-lines__table .select {
  height: 32px;
  padding: 4px 8px;
  font-size: 13px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
/* Hilangkan spinner number native supaya digit lega terbaca (4-7 angka). */
.cs-receipt-lines__table .input[type="number"] {
  text-align: right;
  font-variant-numeric: tabular-nums;
  padding-right: 8px;
  -moz-appearance: textfield;
  appearance: textfield;
}
.cs-receipt-lines__table .input[type="number"]::-webkit-inner-spin-button,
.cs-receipt-lines__table .input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}
.cs-receipt-lines__table [data-cs-r-subtotal] {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: right;
}
.cs-receipt-lines__table .select {
  text-overflow: ellipsis;
}
/* Bungkus tabel di form penerimaan: jangan tampilkan scrollbar horizontal. */
.cs-receipt-form-panel .table-wrapper {
  overflow-x: hidden;
}
.gd-import-preview-table {
  font-size: 12.5px;
}
.gd-import-preview-table td,
.gd-import-preview-table th {
  vertical-align: top;
}
.gd-import-row--err {
  background: rgba(220, 38, 38, 0.04);
}
.gd-import-err-list {
  margin: 6px 0 0;
  padding-left: 16px;
  color: #991b1b;
  font-size: 11.5px;
  line-height: 1.45;
}
.gd-import-err-list li + li {
  margin-top: 2px;
}
.text-danger {
  color: var(--danger, #dc2626) !important;
}

/* ============================================================
   Penawaran Harga (Quotation) editor
   ============================================================ */

/* Header form */
.pn-header-grid {
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 560px) {
  .pn-header-grid {
    grid-template-columns: 1fr;
  }
}
.pn-customer-field {
  position: relative;
}

/* Autocomplete (customer + item description) */
.pn-autocomplete {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
}
.pn-autocomplete > .input,
.pn-autocomplete > .pn-input--desc {
  flex: 1;
  width: 100%;
}
.pn-autocomplete__list {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: 4px;
}
.pn-autocomplete__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  background: transparent;
  color: var(--gray-800);
  font-size: 13px;
  cursor: pointer;
}
.pn-autocomplete__item:hover,
.pn-autocomplete__item:focus {
  background: var(--brand-50);
  color: var(--brand-600);
  outline: none;
}
.pn-autocomplete__title {
  font-weight: 600;
  color: var(--gray-900);
}
.pn-autocomplete__sub {
  font-size: 11.5px;
  color: var(--gray-500);
}
.pn-autocomplete__kind {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border-radius: 999px;
  margin-right: 6px;
  vertical-align: middle;
  border: 1px solid transparent;
}
.pn-autocomplete__kind--service {
  background: rgba(124, 58, 237, 0.1);
  color: #6d28d9;
  border-color: rgba(124, 58, 237, 0.25);
}
.pn-autocomplete__kind--product {
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.22);
}
.pn-autocomplete__empty {
  padding: 12px;
  font-size: 12.5px;
  color: var(--gray-500);
  text-align: center;
}
.pn-autocomplete__item--add {
  border-top: 1px dashed var(--gray-200);
  margin-top: 4px;
  padding-top: 10px;
}
.pn-autocomplete__item--add .pn-autocomplete__title {
  color: var(--brand-600);
  font-weight: 700;
}
.pn-autocomplete__item--add:hover .pn-autocomplete__title,
.pn-autocomplete__item--add:focus .pn-autocomplete__title {
  color: var(--brand-700, var(--brand-600));
}

/* Line items table */
.pn-table-wrap {
  width: 100%;
  overflow-x: auto;
  transition: padding-bottom 160ms ease;
}
/* When the line-item description autocomplete is open, expand the scroll
   container's height so the absolutely-positioned dropdown isn't clipped by
   `overflow-x: auto` (which is treated as overflow-y: auto by browsers). */
.pn-table-wrap:has([data-pn-desc-list]:not([hidden])) {
  padding-bottom: 260px;
}
.pn-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  table-layout: fixed;
}
.pn-table thead th {
  text-align: left;
  background: var(--gray-50);
  color: var(--gray-500);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 10px 8px;
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}
.pn-table .pn-col-handle {
  width: 32px;
}
.pn-table .pn-col-rm {
  width: 36px;
  text-align: right;
}
.pn-table .pn-col-desc {
  width: 285px;
}
.pn-table .pn-col-qty {
  width: 70px;
}
.pn-table .pn-col-uom {
  width: 96px;
}
.pn-table .pn-col-num {
  width: 134px;
  text-align: right;
}
.pn-table .pn-col-disc {
  width: 169px;
}
.pn-table thead th.pn-col-num {
  text-align: right;
}

.pn-table tbody td {
  padding: 8px 8px;
  border-bottom: 1px solid var(--gray-150);
  vertical-align: middle;
  background: #fff;
}
.pn-table tbody tr.is-active td {
  background: var(--brand-50);
}
.pn-table tbody tr.is-dragging td {
  opacity: 0.4;
}
.pn-table tbody tr.pn-drop-before td:first-child {
  box-shadow: inset 4px 0 0 var(--brand-400), inset 0 2px 0 var(--brand-400);
}
.pn-table tbody tr.pn-drop-before td {
  box-shadow: inset 0 2px 0 var(--brand-400);
}
.pn-table tbody tr.pn-drop-after td {
  box-shadow: inset 0 -2px 0 var(--brand-400);
}

.pn-handle {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: var(--gray-400);
  cursor: grab;
  transition: var(--transition);
}
.pn-handle:hover {
  color: var(--brand-500);
  background: var(--brand-100);
}
.pn-handle:active {
  cursor: grabbing;
}
.pn-handle svg {
  width: 16px;
  height: 16px;
}

.pn-table .input,
.pn-table .select {
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 13px;
  width: 100%;
  background: #fff;
}
.pn-table .input--num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.pn-table .pn-cell-total {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--gray-900);
  text-align: right;
  padding-right: 12px;
  white-space: nowrap;
}

.pn-input--cat {
  font-weight: 700;
  color: var(--brand-600);
  background: var(--brand-50) !important;
  letter-spacing: 0.3px;
}
.pn-input--note {
  resize: vertical;
  min-height: 36px;
  background: var(--gray-50) !important;
  font-style: italic;
}
.pn-row--category td,
.pn-row--note td {
  background: transparent;
}
.pn-col-cat,
.pn-col-note {
  padding: 6px 8px !important;
}

.pn-sku-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--brand-100);
  color: var(--brand-600);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  margin-left: 6px;
}

.pn-empty {
  text-align: center;
  padding: 28px 16px !important;
  color: var(--gray-500);
}

.icon-btn--sm {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}
.icon-btn--sm svg {
  width: 15px;
  height: 15px;
}

.btn--sm svg {
  width: 14px;
  height: 14px;
}

.select--sm {
  height: 32px;
  padding: 0 8px;
  font-size: 12.5px;
}
.select--xs {
  height: 30px;
  padding: 0 2px;
  font-size: 11.5px;
  width: 44px;
  flex: 0 0 auto;
  font-weight: 600;
  text-align: center;
  text-align-last: center;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: none;
}

.pn-disc-input {
  display: flex;
  align-items: center;
  gap: 3px;
}
.pn-disc-input .input--num {
  flex: 0 0 auto;
  min-width: 0;
  padding-left: 6px;
  padding-right: 6px;
}

/* Line-item Disc. column: 30px Rp/% selector + 120px nominal input */
.pn-col-disc .pn-disc-input .select--xs {
  width: 30px;
  padding: 0 2px;
  font-size: 11px;
}
.pn-col-disc .pn-disc-input .input--num {
  width: 120px;
  flex: 0 0 120px;
}

/* Footer "Diskon Keseluruhan" keeps its previous proportions */
.pn-summary__row--disc .pn-disc-input .select--xs {
  width: 44px;
}
.pn-summary__row--disc .pn-disc-input .input--num {
  flex: 1 1 auto;
  width: 100%;
}

/* PPN row toggle checkbox sits inline with the label */
.pn-ppn-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.pn-ppn-toggle {
  width: 14px;
  height: 14px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--brand-500);
}

.pn-add-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
  flex-wrap: wrap;
}
.pn-add-bar__hint {
  margin-left: auto;
  font-size: 12px;
}

/* Footer summary */
.pn-footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  gap: 16px;
}
@media (max-width: 900px) {
  .pn-footer-grid {
    grid-template-columns: 1fr;
  }
}

/* Left column hosts Modal & Profit (compact) on top of Keterangan (fills remaining height) */
.pn-footer-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}
.pn-footer-col > .card {
  margin: 0;
}
.pn-summary--compact {
  flex: 0 0 auto;
}
.pn-notes-card {
  flex: 1 1 auto;
  display: flex;
  min-height: 0;
}
.pn-notes-card .card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  min-height: 0;
}
.pn-notes-input {
  flex: 1 1 auto;
  width: 100%;
  min-height: 140px;
  resize: vertical;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
  color: var(--gray-900);
  padding: 10px 12px;
}

.pn-summary .card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pn-summary__title {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.01em;
}
.pn-summary__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--gray-150);
  font-size: 13px;
}
.pn-summary__row:last-child {
  border-bottom: 0;
}
.pn-summary__row span {
  color: var(--gray-500);
  font-weight: 500;
}
.pn-summary__row strong {
  color: var(--gray-900);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.pn-summary__row--disc {
  align-items: center;
}
.pn-summary__row--disc .pn-disc-input {
  flex: 0 0 auto;
}
.pn-summary__row--disc .input--num {
  width: 130px;
}
.pn-summary__row--total {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 2px solid var(--brand-500);
  border-bottom: 0 !important;
}
.pn-summary__row--total span {
  color: var(--gray-900);
  font-weight: 700;
}
.pn-summary__row--total strong {
  color: var(--brand-600);
  font-size: 17px;
}
.pn-summary--cost .pn-summary__title {
  color: var(--purple);
}
.pn-summary--cost .pn-summary__row strong {
  color: var(--gray-900);
}

/* Setting TOP modal */
.pn-top-list-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}
.pn-top-editor .field {
  margin-bottom: 16px;
}
.pn-top-rows {
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  background: var(--gray-50);
  padding: 12px;
}
.pn-top-rows__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--gray-700);
}
.pn-top-rows__foot {
  display: flex;
  justify-content: flex-start;
  margin-top: 10px;
}
.pn-top-total {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--gray-200);
}
.pn-top-total.is-ok {
  color: var(--green);
  border-color: var(--green);
}
.pn-top-total.is-warn {
  color: var(--orange);
  border-color: var(--orange);
}
.pn-top-row {
  display: grid;
  grid-template-columns: 1fr 140px 36px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.pn-top-row:last-child {
  margin-bottom: 0;
}
.pn-top-row__pct {
  position: relative;
}
.pn-top-row__pct .input--num {
  padding-right: 22px;
}
.pn-top-row__suffix {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-500);
  font-size: 12px;
  font-weight: 600;
  pointer-events: none;
}
.pn-top-empty {
  text-align: center;
  padding: 18px 12px;
  color: var(--gray-500);
  font-size: 13px;
  background: #fff;
  border: 1px dashed var(--gray-200);
  border-radius: 8px;
}

/* Payment Term hint (TOP profile detail) */
.pn-top-hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--gray-600);
}
.pn-top-hint--legacy {
  padding: 6px 10px;
  background: var(--orange-50, #fff7ed);
  color: var(--orange);
  border: 1px dashed var(--orange);
  border-radius: 8px;
}
.pn-top-hint--empty {
  color: var(--gray-500);
  font-style: italic;
}

/* ============================================================
   Penawaran — Paket (package) line + modal
   ============================================================ */
.pn-row--package td {
  background: linear-gradient(180deg, #fffdf3 0%, #ffffff 100%);
}
.pn-row--package.is-active td {
  background: var(--brand-50);
}
.pn-pkg-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.pn-pkg-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 0;
  padding: 4px 6px;
  margin: -4px -6px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  color: var(--gray-900);
  transition: var(--transition);
  min-width: 0;
}
.pn-pkg-edit-btn:hover {
  background: var(--brand-50);
  color: var(--brand-700, var(--brand-600));
}
.pn-pkg-cell__badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--orange, #f59e0b);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  flex: 0 0 auto;
}
.pn-pkg-cell__title {
  font-weight: 700;
  color: inherit;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pn-pkg-cell__meta {
  font-size: 11.5px;
  color: var(--gray-500);
  padding-left: 4px;
}
.pn-pkg-price-cell {
  padding: 6px 8px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--gray-700);
  font-weight: 600;
}

.pn-row--pkg-child td {
  background: #f8fafc;
  border-bottom: 1px solid var(--gray-150);
}
.pn-col-pkg-child {
  padding: 6px 10px 6px 14px !important;
  color: var(--gray-600);
  font-size: 12.5px;
  font-style: italic;
}
.pn-pkg-child__bullet {
  color: var(--orange, #f59e0b);
  font-weight: 700;
  margin-right: 6px;
}
.pn-pkg-child__text {
  color: var(--gray-700);
}

/* Package modal editor */
.pn-pkg-editor {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.pn-pkg-section {
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  background: var(--gray-50);
  padding: 12px;
}
.pn-pkg-section__head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--gray-700);
}
.pn-pkg-section__head .text-muted {
  font-size: 12px;
  color: var(--gray-500);
}
.pn-pkg-section__foot {
  display: flex;
  justify-content: flex-start;
  margin-top: 10px;
}
.pn-pkg-items-wrap {
  width: 100%;
  overflow-x: auto;
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--gray-200);
  transition: padding-bottom 160ms ease;
}
.pn-pkg-items-wrap:has([data-pn-pkg-desc-list]:not([hidden])) {
  padding-bottom: 220px;
}
.pn-pkg-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
  table-layout: fixed;
}
.pn-pkg-table thead th {
  text-align: left;
  background: var(--gray-50);
  color: var(--gray-500);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 8px 6px;
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}
.pn-pkg-table tbody td {
  padding: 6px;
  border-bottom: 1px solid var(--gray-150);
  vertical-align: top;
  background: #fff;
}
.pn-pkg-table tbody tr:last-child td {
  border-bottom: 0;
}
.pn-pkg-col-show {
  width: 64px;
  text-align: center;
  padding-top: 12px !important;
}
.pn-pkg-table thead th.pn-pkg-col-show {
  text-align: center;
}
.pn-pkg-col-desc {
  width: auto;
}
.pn-pkg-col-qty {
  width: 70px;
}
.pn-pkg-col-uom {
  width: 90px;
}
.pn-pkg-col-num {
  width: 140px;
  text-align: right;
}
.pn-pkg-table thead th.pn-pkg-col-num {
  text-align: right;
}
.pn-pkg-col-rm {
  width: 40px;
  text-align: right;
}
.pn-pkg-table .input,
.pn-pkg-table .select {
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 12.5px;
  width: 100%;
  background: #fff;
}
.pn-pkg-table .input--num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.pn-pkg-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.pn-pkg-check input {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--brand-500);
}
.pn-pkg-subtotal {
  margin-top: 4px;
  font-size: 11px;
  color: var(--gray-500);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.pn-pkg-empty {
  text-align: center;
  padding: 22px 12px;
  color: var(--gray-500);
  font-size: 13px;
  background: #fff;
  border-radius: 8px;
}
.pn-pkg-summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 16px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-50) 0%, #fff 100%);
  border: 1px solid var(--brand-100);
}
.pn-pkg-summary__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}
.pn-pkg-summary__row span {
  color: var(--gray-600);
  font-weight: 500;
}
.pn-pkg-summary__row strong {
  color: var(--gray-900);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.pn-pkg-summary__row:last-child strong {
  color: var(--brand-600);
  font-size: 16px;
}
.pn-top-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pn-top-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--brand-50);
  color: var(--brand-600);
  font-weight: 600;
  font-size: 12px;
  border: 1px solid var(--brand-200, #cfe6ff);
}
.pn-top-chip__desc {
  color: var(--gray-700);
  font-weight: 500;
}
.pn-top-chip__pct {
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   KOP Surat (Letterhead) — controls + preview simulator
   ============================================================ */
.page--kop .card {
  padding: 0;
}
.kop-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
@media (max-width: 1100px) {
  .kop-layout {
    grid-template-columns: 1fr;
  }
}
.kop-controls .card__body {
  padding: 18px 20px;
}
.kop-loading {
  padding: 40px 16px;
  text-align: center;
  color: var(--gray-500);
  font-weight: 500;
}
.kop-loading--err {
  color: var(--danger);
}
.kop-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.kop-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px 16px;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  background: #fff;
}
.kop-section__head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 4px;
}
.kop-section__title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.01em;
}
.kop-section__sub {
  margin: 0;
  font-size: 12.5px;
  color: var(--gray-500);
}
.kop-row3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 14px;
}
@media (max-width: 720px) {
  .kop-row3 {
    grid-template-columns: 1fr;
  }
}

/* Preset layout grid */
.kop-preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}
.kop-preset {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
  padding: 10px 10px 8px;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--gray-700);
  transition: var(--transition);
}
.kop-preset:hover {
  border-color: var(--brand-300);
  background: var(--brand-50);
}
.kop-preset.is-active {
  border-color: var(--brand-500);
  background: var(--brand-50);
  color: var(--brand-600);
  box-shadow: 0 0 0 3px rgba(26, 95, 232, 0.12);
}
.kop-preset__svg {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}

/* Logo controls */
.kop-logo-grid {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 14px;
  align-items: start;
}
@media (max-width: 560px) {
  .kop-logo-grid {
    grid-template-columns: 1fr;
  }
}
.kop-logo-thumb {
  width: 130px;
  height: 130px;
  border: 1px dashed var(--gray-300, #cbd5e1);
  border-radius: 12px;
  background:
    linear-gradient(45deg, #f8fafc 25%, transparent 25%) 0 0/16px 16px,
    linear-gradient(-45deg, #f8fafc 25%, transparent 25%) 0 8px/16px 16px,
    linear-gradient(45deg, transparent 75%, #f8fafc 75%) 8px -8px/16px 16px,
    linear-gradient(-45deg, transparent 75%, #f8fafc 75%) -8px 0/16px 16px,
    #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.kop-logo-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}
.kop-logo-thumb__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--gray-400);
  font-size: 12px;
  font-weight: 500;
}
.kop-logo-thumb__empty svg {
  width: 28px;
  height: 28px;
}
.kop-logo-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Color pickers */
.kop-color-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.kop-color-row input[type="color"] {
  width: 44px;
  height: 36px;
  padding: 2px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}
.kop-color-hex {
  flex: 1;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}

/* Range slider in KOP form */
.kop-form input[type="range"] {
  width: 100%;
  accent-color: var(--brand-500);
}

/* Segmented (align) buttons */
.kop-seg {
  display: inline-flex;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 9px;
  padding: 2px;
  gap: 2px;
}
.kop-seg__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  color: var(--gray-600);
  font-size: 12.5px;
  font-weight: 600;
  transition: var(--transition);
}
.kop-seg__btn:hover {
  color: var(--brand-600);
}
.kop-seg__btn.is-active {
  background: #fff;
  color: var(--brand-600);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}
.kop-seg__ico {
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
}
.kop-seg__lbl {
  font-size: 12px;
}
@media (max-width: 480px) {
  .kop-seg__lbl {
    display: none;
  }
}

/* Checkbox row */
.kop-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  cursor: pointer;
  user-select: none;
}
.kop-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--brand-500);
}

/* ---- Preview panel ---- */
.kop-preview {
  position: sticky;
  top: 18px;
}
@media (max-width: 1100px) {
  .kop-preview {
    position: static;
  }
}
.kop-preview-shell {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md, 0 4px 14px rgba(15, 23, 42, 0.05));
  overflow: hidden;
}
.kop-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);
}
.kop-preview-toolbar__label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--gray-700);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.kop-preview-toolbar__zoom {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  color: var(--gray-600);
  font-variant-numeric: tabular-nums;
}
.kop-preview-toolbar__zoom .icon-btn {
  width: 26px;
  height: 26px;
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-700);
}
.kop-preview-stage {
  padding: 16px;
  background:
    linear-gradient(0deg, var(--gray-100) 1px, transparent 1px) 0 0/20px 20px,
    linear-gradient(90deg, var(--gray-100) 1px, transparent 1px) 0 0/20px 20px,
    #f8fafc;
  display: flex;
  justify-content: center;
  overflow: auto;
  max-height: min(82vh, 900px);
}

/* Paper itself — A4/Letter/Folio at full px size; .kop-preview-stage scales it. */
.kop-paper {
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transform-origin: top center;
  position: relative;
}
.kop-paper__header {
  display: block;
}
.kop-paper__divider {
  height: 2px;
  background: var(--brand-500);
}
.kop-paper__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  padding-top: 12px;
}
.kop-body-line {
  height: 9px;
  background: #eef2f7;
  border-radius: 3px;
  width: 100%;
}
.kop-body-line--lg {
  height: 14px;
  width: 50%;
  background: #e2e8f0;
}
.kop-body-spacer {
  height: 8px;
}

/* Logo wrap inside header */
.kop-logo-wrap {
  flex-shrink: 0;
  display: inline-block;
}
.kop-logo-wrap--ph {
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
  background: #f8fafc;
}
.kop-textblock {
  min-width: 0;
}

/* ============================================================
   Auth / Login screen
   ============================================================ */
body:not(.is-authed) .app-shell {
  display: none;
}
body.is-anon {
  background: linear-gradient(135deg, #eef5ff 0%, #f7f8fa 60%, #ffffff 100%);
}
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(13, 24, 38, 0.12), 0 4px 12px rgba(13, 24, 38, 0.05);
  padding: 32px 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: pageFade 280ms ease;
}
@media (max-width: 480px) {
  .auth-card {
    padding: 24px 20px 22px;
  }
}
.auth-card__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}
.auth-card__logo-img {
  display: block;
  width: auto;
  height: 96px;
  max-width: 80%;
  object-fit: contain;
}
.auth-card__title {
  font-weight: 800;
  font-size: 26px;
  color: var(--gray-900);
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.auth-card__heading {
  margin: 8px 0 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--gray-900);
  text-align: center;
}
.auth-card__hint {
  margin: -6px 0 4px;
  color: var(--gray-500);
  font-size: 13px;
  text-align: center;
}
.auth-msg {
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
}
.auth-msg--err {
  background: var(--danger-soft);
  color: #b91c1c;
  border-color: rgba(239, 68, 68, 0.35);
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.auth-form .input {
  font-size: 14px;
  padding: 11px 13px;
}
.auth-form__err {
  font-size: 12.5px;
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 8px;
  padding: 8px 10px;
  font-weight: 500;
}
.auth-form__submit {
  margin-top: 4px;
  justify-content: center;
  padding: 12px 16px;
  font-size: 14px;
}
.auth-card__footer {
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--gray-500);
  text-align: center;
}

/* ============================================================
   Sidebar visibility helper (perm-based hiding)
   ============================================================ */
.sidebar__nav .is-hidden,
.sidebar__nav-label.is-hidden {
  display: none !important;
}

/* ============================================================
   User Role — menu picker + form helpers
   ============================================================ */
.field__hint {
  font-size: 11.5px;
  color: var(--gray-500);
  font-weight: 500;
}
.ur-menu-actions {
  display: inline-flex;
  gap: 4px;
}
.ur-menu-actions .btn--sm {
  padding: 4px 8px;
  font-size: 11.5px;
}
.ur-menu-picker {
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  background: var(--gray-50);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 320px;
  overflow-y: auto;
}
.ur-menu-picker__loading {
  font-size: 12.5px;
  color: var(--gray-500);
  text-align: center;
  padding: 16px;
}
.ur-menu-group__title {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.ur-menu-group__items {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px;
}
@media (max-width: 560px) {
  .ur-menu-group__items {
    grid-template-columns: 1fr;
  }
}
.ur-menu-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--gray-200);
  font-size: 13px;
  color: var(--gray-800);
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}
.ur-menu-item:hover {
  border-color: var(--brand-300);
  background: var(--brand-50);
}
.ur-menu-item input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--brand-500);
  margin: 0;
  cursor: pointer;
}
.ur-menu-item input[type="checkbox"]:checked + .ur-menu-item__lbl {
  color: var(--brand-600);
  font-weight: 600;
}
.ur-menu-item.is-disabled {
  opacity: 0.7;
  cursor: not-allowed;
}
.ur-menu-item.is-disabled:hover {
  border-color: var(--gray-200);
  background: #fff;
}
.ur-check {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--gray-200);
  background: var(--gray-50);
  cursor: pointer;
  user-select: none;
  font-size: 13px;
}
.ur-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--brand-500);
  margin-top: 2px;
  cursor: pointer;
}
.ur-check--admin strong {
  color: var(--gray-900);
}
