:root {
  --ink: #161b24;
  --muted: #687387;
  --line: #d9e1eb;
  --page: #eef2f6;
  --panel: #ffffff;
  --nav: #111111;
  --nav-soft: #333333;
  --green: #222222;
  --green-dark: #000000;
  --gold: #f4c75b;
  --danger: #b84a4a;
  --shadow: 0 12px 34px rgba(32, 49, 68, 0.08);
  --app-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --base-font-size: 16px;
  --title-font-size: 34px;
  --receipt-font-size: 12px;
}

.presentation-conclusion-row td {
  background: #fff7df;
  color: #7a5200;
  line-height: 1.45;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--page);
  font-family: var(--app-font);
  font-size: var(--base-font-size);
  display: grid;
  grid-template-columns: 280px 1fr;
}

body.auth-page {
  display: block;
  background: #e9eef3;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-shell .login-card {
  border-top: 5px solid var(--green);
}

.auth-eyebrow {
  margin: 0 0 5px;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.auth-copy {
  margin-top: 7px !important;
  color: var(--muted);
  line-height: 1.5;
}

.auth-brand-logo {
  width: min(330px, 100%);
  height: 238px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111111;
  border-radius: 10px;
}

.auth-brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.auth-error {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #e1abab;
  border-radius: 6px;
  background: #fff1f1;
  color: #8f2929;
  font-weight: 800;
}

body.locked .sidebar,
body.locked .app {
  filter: blur(2px);
  pointer-events: none;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(238, 242, 246, 0.92);
  padding: 20px;
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.login-card h1,
.login-card p {
  margin: 0;
}

.login-card small {
  color: var(--muted);
  font-weight: 750;
}

.recovery-banner {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding: 12px 14px;
  border: 1px solid #f0c36b;
  border-radius: 8px;
  background: #fff8e6;
  color: #5c4300;
  font-weight: 800;
}

.recovery-banner a {
  margin-left: auto;
  color: #23394b;
}

.logout-dialog {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  background: rgba(20, 32, 44, 0.42);
  padding: 18px;
}

.logout-card {
  width: min(460px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.logout-card h3,
.logout-card p {
  margin-top: 0;
}

.password-field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.password-field input {
  min-width: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

input,
select,
textarea {
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(67, 142, 93, 0.14);
}

button {
  cursor: pointer;
}

.sidebar {
  min-height: 100vh;
  background: var(--nav);
  color: #f7fbff;
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

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

.brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: #ffffff;
  color: #111111;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 21px;
}

.brand-mark img,
.receipt-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: inherit;
}

.brand-logo {
  width: 280px;
  height: 154px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111111;
  border-radius: 10px;
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.brand h1 {
  margin: 0;
  font-size: 25px;
  line-height: 1.05;
}

.brand p {
  margin: 7px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 16px;
}

.mobile-menu-toggle {
  display: none;
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  min-height: 40px;
  padding: 0 14px;
  font-weight: 850;
}

.nav {
  display: grid;
  gap: 10px;
}

.nav-spacer {
  height: 10px;
}

.nav-item {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  text-align: left;
  padding: 15px 16px;
  font-size: 18px;
  font-weight: 700;
  transition: background-color 140ms ease, color 140ms ease;
  text-decoration: none;
  cursor: pointer;
}

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

.nav-item.is-active {
  background: var(--nav-soft);
  color: #fff;
}

.nav-item.nav-green {
  background: var(--green);
  color: #fff;
}

.nav-item.nav-green.is-active {
  background: var(--green-dark);
}

.nav-item.nav-master {
  background: #f4bd3f;
  color: #1d2630;
  font-weight: 900;
}

.nav-item.nav-master.is-active {
  background: #d99b18;
  color: #111820;
}

.nav-item.nav-expense,
.nav-item.nav-expense.is-active,
.button.expense-action {
  background: #b42318;
  color: #fff;
}

.nav-item.nav-expense:hover,
.button.expense-action:hover {
  background: #912018;
  color: #fff;
}

.nav-item.nav-withdrawal,
.nav-item.nav-withdrawal.is-active,
.button.withdrawal-action {
  background: #6941c6;
  color: #fff;
}

.nav-item.nav-withdrawal:hover,
.button.withdrawal-action:hover {
  background: #53389e;
  color: #fff;
}

.nav-group {
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  padding: 6px;
}

.nav-group summary {
  cursor: pointer;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 900;
  padding: 10px;
}

.nav-group .nav-item {
  margin-top: 4px;
  font-size: 16px;
  padding: 12px;
}

.sidebar-actions {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

.button,
.text-button {
  border: 0;
  border-radius: 8px;
  min-height: 48px;
  padding: 0 18px;
  font-weight: 850;
}

.button.success {
  background: var(--green);
  color: #fff;
}

.button.success:hover {
  background: var(--green-dark);
}

.button.light {
  background: #fff;
  color: var(--ink);
}

/* Compact controls keep the existing actions without crowding the filter row. */
.icon-only-label {
  width: 48px;
  min-width: 48px;
  padding: 0;
  font-size: 0;
}

.icon-only-label::before {
  font-size: 21px;
  line-height: 1;
}

#applyTransactionSort::before { content: "\2195"; }
#refreshTransactions::before { content: "\21BB"; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.button.dark {
  background: var(--nav);
  color: #fff;
}

.button.warning {
  background: var(--gold);
  color: #23394b;
}

.button.danger {
  background: var(--danger);
  color: #fff;
}

.text-button {
  background: transparent;
  color: var(--ink);
}

.file-button {
  display: grid;
  place-items: center;
}

.file-button input {
  display: none;
}

.save-status {
  display: block;
  grid-column: 1 / -1;
  color: rgba(255, 255, 255, 0.76);
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
}

.save-status.is-saved {
  color: #b8f2ca;
}

.app {
  min-width: 0;
  padding: 36px 34px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.topbar h2 {
  margin: 0;
  font-size: var(--title-font-size);
  line-height: 1;
}

.topbar p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 17px;
  font-weight: 650;
}

.topbar-meta {
  display: flex;
  align-items: stretch;
  gap: 12px;
}

.topbar-tools {
  display: grid;
  gap: 8px;
  min-width: 140px;
}

.active-user-card {
  min-width: 190px;
  border: 1px solid var(--line);
  background: #fff8df;
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: var(--shadow);
}

.active-user-card span,
.active-user-card small {
  display: block;
  color: var(--muted);
  font-weight: 700;
}

.active-user-card strong {
  display: block;
  margin: 3px 0;
  color: var(--ink);
  font-size: 18px;
}

.logout-save-status {
  display: block;
  margin: 10px 0 16px;
  color: var(--muted);
  font-weight: 700;
}

.logout-save-status.is-saved {
  color: var(--green);
}

.order-card {
  min-width: 210px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  padding: 14px 18px;
  box-shadow: var(--shadow);
}

.order-card span {
  color: var(--muted);
  font-weight: 750;
}

.order-card strong {
  display: block;
  font-size: 30px;
  line-height: 1.05;
}

.view {
  display: none;
}

.view.is-visible {
  display: block;
}

.transaction-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) 430px;
  gap: 22px;
}

.receivable-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px;
  margin-bottom: 18px;
}

.prospect-layout {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.form-panel {
  padding: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  min-height: 44px;
  padding: 9px 12px;
  font-weight: 760;
  outline: none;
}

textarea {
  resize: vertical;
}

.form-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.checkbox-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.checkbox-panel legend {
  padding: 0 6px;
  color: var(--muted);
  font-weight: 900;
}

.checkbox-panel label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
}

.checkbox-panel input {
  width: auto;
  min-height: auto;
}

.password-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.password-inline .small-button {
  min-height: 44px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(67, 142, 93, 0.16);
}

.span-2 {
  grid-column: 1 / -1;
}

.product-actions {
  display: flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
}

.package-picker {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf3;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.package-picker-head,
.package-picker-search {
  display: flex;
  align-items: center;
  gap: 10px;
}

.package-picker-head {
  justify-content: space-between;
}

.package-picker-search input {
  width: 100%;
}

.small-action {
  min-height: 40px;
  padding: 0 12px;
  font-size: 13px;
}

.product-list {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--line);
  background: #fff3bd;
  border: 1px solid #f1cf63;
  border-radius: 8px;
  padding: 12px;
}

.product-chip {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #f8fafc;
  font-weight: 800;
}

.qty-mini {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  font-size: 12px;
}

.qty-mini input {
  width: 68px;
  min-height: 34px;
  padding: 6px 8px;
}

.section-toggle {
  margin-top: 18px;
}

.today-schedule {
  margin-bottom: 18px;
  padding: 16px;
  border-left: 5px solid var(--green);
}

.today-schedule-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.today-schedule-head strong,
.today-schedule-head span {
  display: block;
}

.today-schedule-head span {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 800;
}

.today-schedule-list {
  margin-top: 14px;
  display: flex;
  gap: 8px;
  overflow: hidden;
}

.today-schedule-item {
  min-width: 100%;
  display: grid;
  grid-template-columns: 76px 1fr 1.2fr;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  animation: scheduleSlide 18s infinite;
}

.today-schedule-item small {
  color: var(--muted);
  font-weight: 800;
}

.schedule-receivable {
  color: #c0392b;
  font-weight: 950;
}

.transaction-paid-row {
  color: #227a45;
  background: #f0fbf4;
}

.transaction-paid-row .money,
.transaction-paid-row td {
  color: #227a45;
}

.member-name-button {
  color: #1f6f43;
  font-weight: 900;
  padding: 0;
}

.member-broadcast-panel {
  margin: 14px 0;
  background: #f8fbf6;
  border-color: #d7e8d5;
}

.member-broadcast-panel .detail-head {
  margin-bottom: 12px;
}

.member-broadcast-check {
  width: 20px;
  height: 20px;
  accent-color: var(--green);
}

.broadcast-queue {
  margin-top: 14px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.broadcast-queue-list {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
}

.broadcast-queue-item {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(120px, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  text-align: left;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.broadcast-queue-item.is-opened {
  background: #f0fbf4;
  border-color: #acd9bd;
}

.broadcast-queue-item small {
  color: var(--muted);
  font-weight: 800;
}

.today-schedule.is-minimized .today-schedule-list {
  display: none;
}

@keyframes scheduleSlide {
  0%, 26% { transform: translateX(0); }
  33%, 59% { transform: translateX(calc(-100% - 8px)); }
  66%, 92% { transform: translateX(calc(-200% - 16px)); }
  100% { transform: translateX(0); }
}

.is-hidden {
  display: none !important;
}

.presentation-debt-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
  border: 1px dashed var(--border);
  border-radius: 8px;
}

.presentation-debt-fields span small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-weight: 700;
}

.presentation-debt-fields.is-disabled {
  opacity: .68;
}

@media (max-width: 720px) {
  .presentation-debt-fields { grid-template-columns: 1fr; }
}

.form-actions {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.summary-panel {
  padding: 28px;
  align-self: start;
}

.summary-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.summary-head h3 {
  margin: 0;
  font-size: 28px;
}

.summary-head strong {
  font-size: 20px;
}

.summary-list {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
}

.summary-list div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.summary-list dt {
  color: var(--muted);
  font-size: 19px;
  font-weight: 760;
}

.summary-list dd {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  text-align: right;
}

.note-line {
  grid-template-columns: 1fr;
}

.note-line dd {
  max-width: 285px;
  text-align: left;
  color: var(--muted);
  font-weight: 720;
  overflow-wrap: anywhere;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  background: #fff0c9;
  color: #866210;
  font-weight: 950;
}

.status-pill.lunas {
  background: #dff2e5;
  color: #28623f;
}

.status-pill.overrun {
  background: #ffe0e0;
  color: #a52626;
}

.status-pill.empty {
  background: #edf1f5;
  color: var(--muted);
}

.panel-toolbar {
  padding: 18px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.panel-toolbar input {
  max-width: 460px;
}

.wrap-toolbar {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.wrap-toolbar input,
.wrap-toolbar select {
  max-width: 220px;
}

.shift-status-bar {
  margin-bottom: 14px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.shift-status-bar > div:first-child {
  display: grid;
  gap: 3px;
}

.shift-eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.shift-status-bar small {
  color: var(--muted);
}

.shift-dialog-card {
  width: min(920px, calc(100vw - 32px));
  max-width: none;
}

.transaction-action-card {
  width: min(620px, calc(100vw - 32px));
  max-width: none;
}

.transaction-action-grid {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.report-section {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.report-section > summary {
  padding: 14px 16px;
  cursor: pointer;
  font-weight: 900;
}

.recap-panel {
  margin-top: 18px;
}

.recap-simple-head {
  padding: 16px 18px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.recap-simple-head h3 {
  margin: 0 0 3px;
}

.recap-simple-head small {
  color: var(--muted);
}

.recap-simple-head select {
  width: min(260px, 100%);
}

.table-wrap {
  overflow: auto;
  width: 100%;
  resize: horizontal;
  min-width: 300px;
  max-width: 100%;
}

.master-legacy-modal-field {
  display: none;
}

#view-data .table-wrap {
  resize: none;
}

#view-data table,
#view-data tbody,
#view-data tbody tr,
#view-data tbody td {
  height: auto !important;
  min-height: 0 !important;
}

#view-data tbody td {
  padding: 8px 10px;
  line-height: 1.25;
  vertical-align: top;
}

#view-data tbody tr {
  max-height: none;
}

table {
  width: 100%;
  min-width: 1280px;
  border-collapse: collapse;
  background: #fff;
}

.compact-table table {
  min-width: 0;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 14px;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0;
  background: #f8fafc;
  white-space: nowrap;
  resize: horizontal;
  overflow: auto;
  min-width: 92px;
  position: sticky;
  top: 0;
  z-index: 1;
}

td {
  font-weight: 650;
}

tbody tr:hover td {
  background: #fbfcfd;
}

.money,
.right {
  text-align: right;
  white-space: nowrap;
}

.danger-money {
  color: var(--danger);
  font-weight: 950;
}

tr.source-expense-row > td {
  background: #fff1f2;
  color: #9f1d16;
  border-color: #fecdd3;
}

tr.source-expense-row > td.money {
  color: #b42318;
  font-weight: 950;
}

#savingsBody tr.saving-row-in > td {
  background: #f0fdf4;
}

#savingsBody tr.saving-row-out > td {
  background: #fff7ed;
}

#savingsBody .saving-money-in {
  color: #157347;
  font-weight: 900;
}

#savingsBody .saving-money-out {
  color: #b42318;
  font-weight: 900;
}

tr.source-withdrawal-row > td {
  background: #f5f0ff;
  color: #53389e;
  border-color: #d9d6fe;
}

tr.source-withdrawal-row > td.money,
.withdrawal-money {
  color: #6941c6 !important;
  font-weight: 950;
}

@media print {
  tr.source-expense-row > td {
    background: #fff1f2 !important;
    color: #9f1d16 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  tr.source-withdrawal-row > td {
    background: #f5f0ff !important;
    color: #53389e !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

.table-actions {
  display: flex;
  gap: 8px;
}

.small-button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  min-height: 34px;
  padding: 0 10px;
  font-weight: 850;
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease;
}

.small-button:hover {
  border-color: #aebbc8;
  background: #f3f6f8;
}

.small-button.danger {
  color: var(--danger);
}

.kpi-row,
.dashboard-grid {
  display: grid;
  gap: 16px;
}

.kpi-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 18px;
}

.kpi-row div,
.metric {
  padding: 18px;
}

.kpi-row span,
.metric span {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.kpi-row strong,
.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
}

.metric-button {
  width: 100%;
  border: 1px solid var(--line);
  text-align: left;
  cursor: pointer;
}

.metric-button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover {
  background: #f3f7fb;
}

.highlight-metric {
  border-color: rgba(67, 142, 93, 0.45);
  background: #f1fbf5;
}

.danger-soft {
  border-color: rgba(210, 80, 80, 0.45);
  background: #fff1f1;
}

.warning-soft {
  border-color: rgba(210, 139, 35, 0.45);
  background: #fff7e8;
}

.detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.dashboard-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
  margin-bottom: 18px;
}

.filter-actions {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.calendar-list {
  display: grid;
  gap: 16px;
  padding: 20px 22px 28px;
}

.calendar-minimized .calendar-list,
.calendar-minimized #calendarHistory {
  display: none;
}

.calendar-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(132px, 1fr));
  gap: 8px;
  align-items: stretch;
}

.calendar-weekday {
  padding: 14px 10px 10px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.calendar-month-cell {
  min-height: 132px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 0 rgba(20, 34, 50, .03);
}

.calendar-month-cell.is-empty {
  background: transparent;
  border-color: transparent;
}

.calendar-month-cell.is-today {
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px var(--green);
}

.calendar-month-cell > strong {
  display: block;
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 16px;
}

.calendar-month-items {
  display: grid;
  gap: 6px;
}

.calendar-month-item {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #d8e1ea;
  border-radius: 6px;
  background: #f8fafc;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-month-item:hover {
  background: #eef5ef;
  border-color: #b7d6bd;
}

.calendar-day {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.calendar-day summary {
  margin: 0;
  padding: 10px 14px;
  background: #f8fafc;
  font-size: 14px;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
}

.calendar-day summary span {
  display: block;
  color: var(--ink);
  font-size: 13px;
  margin-bottom: 2px;
}

.calendar-items {
  display: grid;
}

.calendar-item {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 8px 14px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  cursor: pointer;
}

.calendar-item:hover {
  background: #f8fafc;
}

.calendar-item small {
  grid-column: 2;
  color: var(--muted);
  font-weight: 750;
}

.empty-state {
  padding: 24px;
  color: var(--muted);
  font-weight: 800;
}

.history-box {
  margin: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.history-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
}

.history-head strong,
.history-head span {
  display: block;
}

.history-head span {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 800;
}

.compact-history table {
  min-width: 640px;
}

.chart-panel {
  grid-column: span 2;
  padding: 20px;
}

.chart-panel h3 {
  margin: 0 0 16px;
}

.bar-list {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: 130px 1fr 110px;
  align-items: center;
  gap: 12px;
  font-weight: 800;
}

.bar-track {
  height: 14px;
  background: #edf1f5;
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  min-width: 3px;
  background: var(--green);
}

.graph-main-panel {
  grid-column: 1 / -1;
}

.graph-main-panel canvas,
.mini-graph canvas {
  width: 100%;
  height: 340px;
  display: block;
  background: #fffef8;
  border: 1px solid #cfd8d2;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.72);
}

.mini-graph {
  grid-column: span 1;
}

.expense-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 18px;
}

.expense-form {
  padding: 18px;
  display: grid;
  gap: 14px;
  align-self: start;
}

.expense-form label.checkbox-field,
label.checkbox-field {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.expense-form label.checkbox-field input[type="checkbox"],
label.checkbox-field input[type="checkbox"] {
  width: auto;
}

.modal-page {
  display: grid;
  gap: 16px;
}

.modal-summary-panel {
  display: grid;
  gap: 8px;
}

.modal-header-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.modal-metric-stack {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.modal-metric-stack #modalTargetTotals,
.modal-metric-stack #modalTopTotals {
  display: contents;
}

.modal-target-totals { padding: 0; }

.modal-target-totals .fund-card:nth-child(1) { grid-column: 1 / span 2; grid-row: 1; }
.modal-target-totals .fund-card:nth-child(2) { grid-column: 1; grid-row: 2; }
.modal-target-totals .fund-card:nth-child(3) { grid-column: 2; grid-row: 2; }
.modal-target-totals .fund-card:nth-child(4) { grid-column: 1 / span 2; grid-row: 3; }
.modal-target-totals .fund-card:nth-child(5) { grid-column: 1 / span 2; grid-row: 4; }
.modal-target-totals .fund-card:nth-child(6) { grid-column: 3 / span 2; grid-row: 1; }
.modal-target-totals .fund-card:nth-child(7) { grid-column: 3 / span 2; grid-row: 2; }

.modal-target-totals .fund-card {
  background: #effbf1;
  border-color: #8fdda0;
}

.modal-target-totals .fund-card:first-child {
  background: #fff7e0;
  border-color: #efcc73;
}

.modal-target-totals .fund-card:nth-child(5),
.modal-target-totals .fund-card:nth-child(6),
.modal-target-totals .fund-card:nth-child(7) {
  background: #effbf1;
}

.modal-target-totals .fund-card span em {
  font-size: 0.78em;
  font-weight: 650;
}

.modal-metric-stack #modalTopTotals .fund-card:nth-child(1) { grid-column: 3; grid-row: 3; }
.modal-metric-stack #modalTopTotals .fund-card:nth-child(2) { grid-column: 4; grid-row: 3; }
.modal-metric-stack #modalTopTotals .fund-card:nth-child(3) { grid-column: 5 / span 2; grid-row: 1; }
.modal-metric-stack #modalTopTotals .fund-card:nth-child(4) { grid-column: 5 / span 2; grid-row: 2; }

.target-budget-panel {
  display: grid;
  gap: 10px;
}

.target-budget-panel h3,
.target-budget-panel p {
  margin: 0;
}

.target-budget-panel .compact-form {
  margin-top: 2px;
}

.small-note {
  font-size: 12px;
}

.modal-header-grid h3 {
  margin: 0 0 12px;
}

.modal-top-totals {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding-top: 0;
}

.modal-summary-panel .fund-cards {
  padding: 0;
}

#view-modal #modalTotals {
  grid-template-columns: repeat(8, minmax(140px, 1fr));
  align-items: stretch;
}

#view-modal #modalTotals .modal-card-green {
  grid-column: 7 / span 2;
  grid-row: 1;
}

#view-modal #modalCategoryTotals {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.modal-section-title {
  justify-self: center;
  min-width: min(520px, 100%);
  background: #b8b8b8;
  color: #fff;
  text-align: center;
  font-weight: 950;
  padding: 10px 16px;
  margin-top: 4px;
}

.modal-card-blue { background: #f2f2f2; border-color: #999999; }
.modal-card-yellow { background: #fff8df; border-color: #f3cf74; }
.modal-card-red { background: #ffe5e8; border-color: #f59aa6; }
.modal-card-pink { background: #ffe6fb; border-color: #f08add; }
.modal-card-orange { background: #fff0e8; border-color: #f2a78d; }
.modal-card-green { background: #e4ffe9; border-color: #55e58a; }

.modal-workspace {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

#modalPaymentForm {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

#modalPaymentForm h3,
.modal-report-panel h3 {
  margin: 0;
}

#modalPaymentForm .span-2 {
  grid-column: auto;
}

.modal-report-panel {
  min-width: 0;
}

.modal-report-panel .table-wrap {
  margin-top: 8px;
}

#modalCategoryDetailPanel {
  margin: 0;
}

.detail-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.fund-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 18px 0;
}

.fund-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #f8fafc;
}

button.fund-card {
  appearance: none;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

button.fund-card:hover {
  border-color: var(--green);
  box-shadow: 0 4px 12px rgba(38, 70, 83, 0.12);
}

.fund-card span {
  display: block;
  color: var(--muted);
  font-weight: 850;
}

.fund-card strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.compact-total {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.total-card {
  background: #fff8e4;
  border-color: #f1d48a;
}

.total-toggle {
  margin: 10px 18px 0;
}

.recap-table-head {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
}

.recap-table-head h3 {
  margin: 0;
  font-size: 15px;
}

.recap-table-head .total-toggle {
  margin: 0;
}

.activity-live-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #f7fbf8;
}

.activity-live-strip strong,
.activity-live-strip span {
  display: block;
}

.activity-live-strip div > span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.evaluation-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(520px, 1.7fr);
  gap: 16px;
  align-items: start;
}

.compact-dashboard {
  gap: 10px;
}

.compact-dashboard .metric {
  padding: 12px;
}

.compact-dashboard .metric small {
  font-size: 11px;
}

.presentation-summary-layout {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-areas:
    "rev rev rev pay pay pay gap exp exp exp bal bal"
    "pc pc pb pb ec ec eb eb cash cash bank bank"
    "mt mt mt mt mt mt rt rt rt rt rt rt"
    "modal modal modal bill bill bill margin margin margin margin margin margin"
    "remain remain remain wd wd wd margin margin margin margin margin margin"
    "input input input bridge bridge bridge mbank mbank mbank mcash mcash mcash"
    "next next next rec rec rec profit profit profit profit profit profit"
    ". . . . . . pcash pcash pcash pbank pbank pbank";
  align-items: stretch;
}

.presentation-summary-layout .present-card {
  min-height: 82px;
}

.presentation-summary-layout .present-card strong {
  font-size: 24px;
}

.presentation-summary-layout .presentation-section-title {
  border-radius: 0;
  background: #c9c9c9;
  color: #111827;
  font-size: 20px;
  font-style: italic;
  font-weight: 900;
  line-height: 1;
  padding: 10px 14px;
  text-align: center;
}

.present-revenue { grid-area: rev; }
.present-payment { grid-area: pay; }
.present-expense-total { grid-area: exp; }
.present-balance { grid-area: bal; }
.present-payment-cash { grid-area: pc; }
.present-payment-bank { grid-area: pb; }
.present-expense-cash { grid-area: ec; }
.present-expense-bank { grid-area: eb; }
.present-cash { grid-area: cash; }
.present-bank { grid-area: bank; }
.present-modal-title { grid-area: mt; }
.present-margin-title { grid-area: rt; }
.present-modal { grid-area: modal; background: #d7fbff; border-color: #b8eff6; }
.present-modal-bill { grid-area: bill; }
.present-modal-remaining { grid-area: remain; }
.present-withdrawal { grid-area: wd; }
.present-card.present-withdrawal {
  background: #f3e8ff;
  border-color: #9333ea;
}
.present-card.present-withdrawal span,
.present-card.present-withdrawal strong,
.present-card.present-withdrawal small {
  color: #581c87;
}
.present-bill-total { grid-area: input; }
.present-bridge { grid-area: bridge; }
.present-next-bill { grid-area: next; background: #ffe2ef; border-color: #ffc5dc; }
.present-receivable { grid-area: rec; }
.present-margin {
  grid-area: margin;
  align-content: center;
  background: #fffde5;
  border-color: #efe7a8;
  min-height: 210px;
  padding: 28px;
}
.present-margin span,
.present-margin strong {
  color: #53533f;
}
.present-margin strong {
  font-size: 44px;
}
.present-margin small {
  color: #202018;
  font-size: 15px;
  font-style: italic;
  font-weight: 900;
}
.present-margin-bank { grid-area: mbank; }
.present-margin-cash { grid-area: mcash; }
.present-profit { grid-area: profit; background: #dcffd9; border-color: #b9f4b4; }
.present-profit-cash { grid-area: pcash; }
.present-profit-bank { grid-area: pbank; }

.finance-summary-layout {
  grid-template-columns: minmax(260px, 1fr) minmax(360px, 2fr) minmax(260px, 1fr) minmax(260px, 1fr);
  align-items: stretch;
  grid-auto-flow: row dense;
}

.finance-card-revenue { grid-column: 1; grid-row: 1; }
.finance-card-payment { grid-column: 1; grid-row: 2; }
.finance-card-expense { grid-column: 1; grid-row: 3; }
.finance-card-receivable { grid-column: 1; grid-row: 4; }
.finance-card-estimate { grid-column: 1; grid-row: 6; background: #f3fff2; border-color: #c7efc4; }
.finance-card-profit { grid-column: 1; grid-row: 7; background: #fff0dc; border-color: #f2cf9c; }
.finance-card-discount { grid-column: 4; grid-row: 4; background: #fff7ed; border-color: #f3c08c; }

.finance-card-cash { grid-column: 2; grid-row: 1; }
.finance-card-noncash { grid-column: 2; grid-row: 2; }
.finance-card-before { grid-column: 2; grid-row: 3; }

.finance-card-modal { grid-column: 3; grid-row: 1; }
.finance-card-modal-left { grid-column: 4; grid-row: 1; }

.finance-drink-title {
  grid-column: 3 / 5;
  grid-row: 2;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 6px;
  background: #5f8ec5;
  color: #fff;
  font-weight: 900;
  letter-spacing: 0;
  text-align: center;
}

.finance-profit-title {
  grid-column: 1;
  grid-row: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border-radius: 0;
  background: #8bcf94;
  color: #fff;
  font-weight: 950;
  font-size: 16px;
}

.finance-card-beverage { grid-column: 3; grid-row: 3; }
.finance-card-beverage-hpp { grid-column: 4; grid-row: 3; }
.finance-card-beverage-profit { grid-column: 1; grid-row: 8; align-self: stretch; background: #eef8ff; border-color: #a7cdeb; }

.finance-total-table-panel {
  grid-column: 2 / 4;
  grid-row: 4 / span 5;
}

.finance-modal-breakdown-panel {
  grid-column: 2;
  grid-row: 9;
}

.modal-info-table {
  margin: 0;
  border-radius: 6px;
  background: #fff;
}

.modal-info-table table {
  min-width: 0;
}

.modal-info-table th,
.modal-info-table td {
  padding: 12px 14px;
  font-size: 13px;
}

.modal-info-table .money {
  white-space: nowrap;
}

.fund-transfer {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
  align-items: end;
}

.settings-panel {
  padding: 22px;
}

.settings-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin-top: 14px;
  background: #fff;
}

.settings-group summary {
  cursor: pointer;
  font-weight: 950;
  color: var(--ink);
}

.settings-group[open] summary {
  margin-bottom: 14px;
}

.settings-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
}

.settings-head h3 {
  margin: 0;
  font-size: 24px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.guide-editor {
  width: 100%;
  min-height: 460px;
  resize: vertical;
  line-height: 1.55;
}

.debt-overdue {
  border-left: 4px solid #c0392b;
  background: #fff2f0;
  padding: 10px;
}

.debt-overdue > strong {
  color: #a93226;
}

.settings-preview {
  margin-top: 22px;
  padding: 22px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.employee-panel {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.employee-grid,
.permission-grid {
  display: grid;
  gap: 12px;
}

.employee-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.employee-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.permission-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 14px 0;
}

.permission-heading {
  grid-column: 1 / -1;
  margin-top: 6px;
  color: var(--ink);
  font-size: 13px;
}

.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
}

.check-line input {
  width: auto;
  min-height: auto;
}

.preview-receipt {
  background: #fff;
  border: 1px solid var(--line);
  padding: 18px;
}

.receipt-logo {
  width: 54px;
  height: 54px;
  margin: 0 auto 8px;
  border-radius: 10px;
  background: #111111;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 20px;
}

.receipt h2,
.receipt p {
  text-align: center;
  margin: 0;
}

.receipt hr {
  border: 0;
  border-top: 1px dashed currentColor;
  margin: 10px 0;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 5px 0;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: var(--ink);
  color: #fff;
  padding: 13px 16px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: 0.2s ease;
  font-weight: 800;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

#printArea {
  display: none;
}

/* Compact polish: keeps the existing layout while improving rhythm and scanability. */
.view.is-visible {
  display: block;
}

.view.is-visible > * + * {
  margin-top: 14px;
}

.view > .panel,
.view > form.panel,
.view > section.panel {
  min-width: 0;
}

.panel {
  box-shadow: 0 7px 22px rgba(32, 49, 68, 0.065);
}

.panel h3,
.panel h4 {
  line-height: 1.25;
}

.panel-toolbar {
  align-items: center;
  gap: 10px;
}

.panel-toolbar .button,
.panel-toolbar .small-button,
.table-actions .small-button {
  white-space: nowrap;
}

.table-actions {
  flex-wrap: wrap;
  align-items: center;
}

th,
td {
  padding: 11px 12px;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.fund-card {
  min-width: 0;
}

.fund-card strong,
.fund-card small,
.fund-card span {
  overflow-wrap: anywhere;
}

.report-section {
  overflow: hidden;
}

.report-section > summary {
  background: #f8fafc;
  color: var(--ink);
}

.report-section[open] > summary {
  border-bottom: 1px solid var(--line);
}

.payment-history-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 7px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.compact-action {
  min-height: 30px;
  padding: 4px 9px;
}

.activity-panel {
  overflow: hidden;
}

.activity-json {
  max-height: 520px;
  overflow: auto;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #101820;
  color: #e8eef5;
  font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

#view-hutang .expense-layout {
  align-items: start;
}

#view-hutang .report-section {
  margin: 10px 18px 0;
}

#view-hutang .report-section:last-of-type {
  margin-bottom: 18px;
}

@media (max-width: 1100px) {
  .calendar-month-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .calendar-weekday {
    display: none;
  }
}

@media (max-width: 720px) {
  .calendar-month-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
  }

  .transaction-grid,
  .receivable-layout,
  .prospect-layout,
  .expense-layout,
  .modal-workspace {
    grid-template-columns: 1fr;
  }

  .evaluation-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
  }

  .nav,
  .sidebar-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .nav-item {
    text-align: center;
    padding: 12px 8px;
    font-size: 14px;
  }

  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .finance-summary-layout > * {
    grid-column: auto;
    grid-row: auto;
  }

  .presentation-summary-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas: none;
  }

  .presentation-summary-layout > * {
    grid-area: auto;
  }

  .presentation-summary-layout .present-margin {
    min-height: auto;
    padding: 18px;
  }

  .presentation-summary-layout .present-margin strong {
    font-size: 28px;
  }

  .finance-drink-title {
    grid-column: 1 / -1;
  }

  .fund-transfer,
  .fund-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .modal-target-totals {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .modal-target-totals .fund-card {
    grid-column: auto !important;
    grid-row: auto !important;
  }

  .modal-metric-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .modal-metric-stack #modalTopTotals .fund-card {
    grid-column: auto !important;
    grid-row: auto !important;
  }
}

@media (max-width: 720px) {
  .app,
  .sidebar {
    padding: 20px;
  }

  .modal-metric-stack {
    grid-template-columns: 1fr;
  }

  .topbar,
  .topbar-meta,
  .form-actions,
  .panel-toolbar,
  .shift-status-bar,
  .recap-simple-head {
    display: grid;
  }

  .order-card,
  .panel-toolbar input {
    max-width: none;
    width: 100%;
  }

  .form-grid,
  .checkbox-panel,
  #modalPaymentForm,
  .kpi-row,
  .dashboard-grid,
  .dashboard-filters,
  .settings-grid,
  .employee-grid,
  .permission-grid,
  .fund-cards,
  .fund-transfer {
    grid-template-columns: 1fr;
  }

  .brand {
    align-items: center;
  }

  .brand h1 {
    font-size: 19px;
  }

  .brand-logo {
    width: min(340px, 100%);
    height: 190px;
  }

  .brand p {
    margin-top: 4px;
    font-size: 13px;
  }

  .brand-mark {
    width: 46px;
    height: 46px;
  }

  .mobile-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .sidebar {
    max-height: 100dvh;
    overflow-y: auto;
    gap: 16px;
    padding: 14px 16px;
  }

  .sidebar:not(.is-mobile-open) .nav,
  .sidebar:not(.is-mobile-open) .sidebar-actions {
    display: none;
  }

  .sidebar.is-mobile-open .nav,
  .sidebar.is-mobile-open .sidebar-actions {
    display: grid;
  }

  .nav,
  .sidebar-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-chip,
  .history-head {
    display: grid;
  }

  table {
    min-width: 960px;
  }

  .chart-panel {
    grid-column: auto;
  }
}

@media print {
  body {
    display: block;
    background: #fff;
  }

  .sidebar,
  .toast,
  .tk-toast {
    display: none !important;
  }

  .app { display: block !important; min-height: 0 !important; }
  .app > *:not(#printArea) { display: none !important; }

  #printArea {
    display: block;
    padding: 20px;
    color: #000;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  }

  .receipt {
    max-width: 320px;
    margin: 0 auto;
    font-size: var(--receipt-font-size);
  }

  .receipt-logo {
    width: 54px;
    height: 54px;
    margin: 0 auto 8px;
    border-radius: 10px;
    background: var(--green);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 900;
    font-size: 20px;
  }

  .receipt h2,
  .receipt p {
    text-align: center;
    margin: 0;
  }

  .receipt h2 {
    font-size: 18px;
  }

  .receipt p {
    font-size: 12px;
  }

  .receipt hr {
    border: 0;
    border-top: 1px dashed #000;
    margin: 10px 0;
  }

  .receipt-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin: 5px 0;
  }

  .receipt-note {
    font-size: var(--receipt-font-size);
    white-space: pre-wrap;
  }

  .dashboard-print {
    font-family: var(--app-font);
    font-size: 11px;
  }

  .dashboard-print h2,
  .dashboard-print p {
    text-align: center;
    margin: 0;
  }

  .print-table {
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
  }

  .print-table th,
  .print-table td {
    border: 1px solid #000;
    padding: 5px;
    font-size: 10px;
  }

  .presentation-print {
    font-size: 11px;
  }

  .presentation-print h2 {
    margin: 0 0 10px;
    font-size: 20px;
  }

  .presentation-print h3 {
    margin: 42px 0 14px;
    font-size: 14px;
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
    letter-spacing: 0;
  }

  .presentation-print h4 {
    margin: 26px 0 12px;
    font-size: 12px;
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
    letter-spacing: 0;
  }

  .presentation-print table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 44px;
    page-break-inside: auto;
  }

  .presentation-print th,
  .presentation-print td {
    border-bottom: 1px solid #d7dde6;
    padding: 9px 12px;
    vertical-align: top;
  }

  .presentation-print th {
    background: #f4f6f9;
    color: #647084;
    text-transform: uppercase;
  }

  .presentation-print-section td {
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
  }

  .presentation-print-spacer td {
    height: 26px;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .presentation-print-section.blue-soft td { background: #eeeeee; }
  .presentation-print-section.pink-soft td { background: #ffe2ef; }
  .presentation-print-section.yellow-soft td { background: #fff5df; }
  .presentation-print-section.cyan-soft td { background: #dff6ff; }
  .presentation-print-section.green-soft td { background: #e8fae6; }
  .presentation-print-section.orange-soft td { background: #fff0dd; }
  .presentation-print-section.purple-soft td { background: #e9e7ff; }
}
/* Modul TK sengaja memakai aksen kuning agar terpisah dari halaman lama. */
.nav-tk { border-left: 4px solid #f4c542; background: #fff6c7; color: #5b4300; font-weight: 700; }
.tk-view { background: linear-gradient(135deg, #fffdf0 0%, #fff7c9 100%); }
.tk-shell { --tk-yellow: #f4c542; --tk-ink: #4b3900; color: var(--tk-ink); }
.tk-hero { display:flex; justify-content:space-between; gap:20px; align-items:center; padding:22px; border:1px solid #e7c94f; border-radius:16px; background:linear-gradient(120deg,#fff1a8,#fffbe2); box-shadow:0 10px 24px rgba(137,101,0,.12); }
.tk-hero h2 { margin:4px 0; color:#3e3000; }
.tk-hero p { margin:0; color:#78621d; }
.tk-kicker { font-size:11px; letter-spacing:.14em; font-weight:800; }
.tk-ledger-note { padding:10px 14px; border-radius:10px; background:#fff; border:1px dashed #d5ad27; font-size:12px; }
.tk-tabs { display:flex; flex-wrap:wrap; gap:8px; margin:16px 0; }
.tk-navigation { display:grid; gap:10px; margin:16px 0; }
.tk-shell.tk-master-mode .tk-navigation { display:none; }
.tk-shell.tk-master-mode > .tk-tabs .tk-tab:not([data-tk-tab="master"]) { display:none; }
.tk-nav-group { overflow:hidden; border:1px solid #ead77b; border-radius:14px; background:rgba(255,255,255,.62); }
.tk-nav-heading { display:block; width:100%; padding:15px 20px; border:0; border-left:7px solid #f4c542; background:#303030; color:#fff; text-align:left; font-size:22px; font-weight:500; letter-spacing:.02em; cursor:pointer; }
.tk-nav-group.is-open .tk-nav-heading, .tk-nav-heading:hover { background:#383838; font-weight:800; }
.tk-nav-items { display:none; padding:4px 12px 8px; }
.tk-nav-group.is-open .tk-nav-items { display:block; }
.tk-nav-items .tk-tabs { margin:4px 0; }
.tk-sidebar-nav { width:100%; text-align:left; cursor:pointer; }
.tk-master-tabs { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:14px; padding-bottom:12px; border-bottom:1px solid #f0e5ad; }
.tk-management-tabs { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 14px; padding:10px 0; border-bottom:1px solid #f0e5ad; }
.tk-management-form { margin-bottom:16px; }
.tk-auto-invoice-modal { position:fixed; inset:0; z-index:1000; display:block; padding:0; background:#fff; }
.tk-auto-invoice-backdrop { display:none; }
.tk-auto-invoice-dialog { position:relative; z-index:1; width:100%; min-height:100%; max-height:100vh; overflow:auto; padding:24px clamp(16px, 4vw, 64px); border:0; border-radius:0; background:#fff; box-shadow:none; }
.tk-auto-invoice-content { width:min(100%, 1000px); margin:12px auto 0; padding:0; border:0; border-radius:0; background:#fff; }
.tk-auto-invoice-content .tk-invoice { max-width:none; margin:0; border:0; box-shadow:none; }
.tk-auto-invoice-dialog .tk-invoice-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:14px; }
.tk-work-assignment-grid { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:12px; }
.tk-work-assignment { display:grid; gap:8px; padding:12px; border:1px solid var(--line); border-radius:10px; background:#fbfcfe; }
.tk-work-assignment strong { color:var(--ink); font-size:13px; }
@media (max-width:900px) { .tk-work-assignment-grid { grid-template-columns:1fr; } }
.tk-permission-fieldset { margin:14px 0 0; padding:12px; border:1px solid #ead77b; border-radius:10px; }
.tk-permission-fieldset legend { padding:0 6px; color:#4b3900; font-weight:800; }
.tk-permission-grid { display:grid; grid-template-columns:repeat(4, minmax(150px, 1fr)); gap:9px 14px; }
.tk-permission-option { display:flex; align-items:center; gap:7px; color:#263248; font-size:13px; font-weight:700; }
.tk-permission-option input { width:auto; accent-color:#2563eb; }
@media (max-width:900px) { .tk-permission-grid { grid-template-columns:repeat(2, minmax(0, 1fr)); } }
@media (max-width:540px) { .tk-permission-grid { grid-template-columns:1fr; } }
.tk-master-panel { min-width:0; }
.tk-tab { border:1px solid #d8b62f; background:#fff9dc; color:#5b4300; border-radius:999px; padding:9px 14px; cursor:pointer; font-weight:700; }
.tk-tab.is-active, .tk-tab:hover { background:#2563eb; border-color:#2563eb; color:#fff; }
.tk-grid { display:grid; grid-template-columns: minmax(260px,360px) 1fr; gap:16px; }
.tk-card { background:#fff; border:1px solid #ead77b; border-radius:14px; padding:16px; box-shadow:0 6px 16px rgba(137,101,0,.08); }
.tk-card h3 { margin-top:0; color:#4b3900; }
.tk-table-heading { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px; }
.tk-table-heading h3 { margin:0; }
.tk-sort-controls { display:inline-flex; gap:4px; }
.tk-sort-button { border:1px solid #2563eb; border-radius:6px; background:#eff6ff; color:#1d4ed8; padding:4px 7px; font-size:11px; font-weight:800; cursor:pointer; }
.tk-sort-button:hover { background:#2563eb; color:#fff; }
.tk-filter-grid { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:10px; margin-bottom:12px; }
.tk-filter-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:7px; margin:0 0 12px; padding:8px; border:1px solid #dbe5f2; border-radius:10px; background:#f8fbff; }
.tk-filter-toolbar input, .tk-filter-toolbar select { min-height:32px; box-sizing:border-box; border:1px solid #b9cbe5; border-radius:7px; padding:6px 8px; background:#fff; color:#172554; font-size:12px; }
.tk-filter-toolbar input[data-tk-table-search] { flex:1 1 190px; min-width:150px; }
.tk-filter-toolbar select { flex:1 1 210px; min-width:170px; }
.tk-filter-toolbar .tk-button { min-height:32px; padding:6px 9px; font-size:11px; }
.is-filtered-out { display:none !important; }
.tk-history { line-height:1.45; }
.tk-history h3 { margin:18px 0 8px; }
.tk-history-grid { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:8px; }
.tk-excel-nav-button { margin-left:auto; background:#2563eb !important; color:#fff !important; border-color:#2563eb !important; }
.tk-excel-modal { display:none; }
.tk-excel-modal.is-open { display:block; }
.tk-excel-backdrop { position:fixed; inset:0; z-index:1000; background:rgba(15,23,42,.42); }
.tk-excel-dialog { position:fixed; z-index:1001; top:50%; left:50%; width:min(460px, calc(100vw - 28px)); max-height:calc(100vh - 28px); overflow:auto; transform:translate(-50%, -50%); padding:18px; border:1px solid #b9d0f7; border-radius:14px; background:#fff; box-shadow:0 24px 70px rgba(15,23,42,.24); }
.tk-excel-dialog > label { display:grid; gap:6px; margin:14px 0; font-weight:700; }
.tk-excel-dialog select { min-height:40px; padding:8px; border:1px solid #cbd5e1; border-radius:8px; background:#fff; }
.tk-excel-modal-actions { display:flex; flex-wrap:wrap; gap:8px; }
.tk-excel-modal-actions input[type="file"] { display:none; }
.tk-excel-preview { margin-top:16px; padding-top:14px; border-top:1px solid #dbe5f2; }
.tk-excel-preview h3 { margin:0 0 10px; }
.tk-excel-counts { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:8px; margin-bottom:12px; }
.tk-excel-counts span { padding:9px; border-radius:8px; background:#f1f5f9; }
.tk-excel-counts strong { display:block; font-size:18px; color:#174ea6; }
.tk-excel-problem-list { max-height:180px; overflow:auto; margin-top:10px; padding:10px; border-radius:8px; background:#fff7ed; color:#7c2d12; }
.tk-excel-problem-list ul { margin:6px 0 10px; padding-left:18px; }
#tkPanelTransactions .tk-table-wrap { overflow-x:auto; }
#tkPanelTransactions .tk-table td:last-child { min-width:420px; max-width:none; white-space:normal; vertical-align:top; }
#tkPanelTransactions .tk-table td:last-child br { display:none; }
#tkPanelTransactions .tk-table td:last-child .tk-button { display:inline-block; margin:2px; padding:4px 7px; border-radius:5px; font-size:11px; line-height:1.15; white-space:nowrap; }
#tkPanelTransactions .tk-table th:last-child { min-width:420px; }
@media (max-width:720px) { #tkPanelTransactions .tk-table td:last-child, #tkPanelTransactions .tk-table th:last-child { min-width:260px; } }
.tk-shell.tk-costs-with-orders { display:grid; grid-template-columns:minmax(0, 1.35fr) minmax(360px, .65fr); gap:16px; align-items:start; }
.tk-shell.tk-costs-with-orders .tk-hero,
.tk-shell.tk-costs-with-orders .tk-tabs { grid-column:1 / -1; }
.tk-shell.tk-costs-with-orders #tkPanelOrders { grid-column:1; }
.tk-shell.tk-costs-with-orders #tkPanelCosts { grid-column:2; }
@media (max-width:720px) { .tk-filter-grid, .tk-history-grid { grid-template-columns:1fr; } }
@media (max-width:720px) { .tk-filter-toolbar { gap:6px; } .tk-filter-toolbar input[data-tk-table-search], .tk-filter-toolbar select, .tk-filter-toolbar input[type="date"] { flex:1 1 calc(50% - 6px); min-width:0; } .tk-filter-toolbar input[data-tk-table-search] { flex-basis:100%; } .tk-filter-toolbar .tk-button { flex:1 1 calc(50% - 6px); } }
@media (max-width:900px) { .tk-shell.tk-costs-with-orders { display:block; } }
.tk-material-checklist { grid-column:1/-1; display:grid; gap:8px; border:1px solid #dac36a; border-radius:10px; padding:12px; background:#fffef5; }
.tk-material-checklist legend { padding:0 5px; font-weight:800; }
.tk-material-option { display:grid; grid-template-columns:22px 1fr 110px; align-items:center; gap:8px; font-weight:700; }
.tk-material-option input[type="checkbox"] { width:18px; height:18px; }
.tk-material-qty { max-width:110px; }
.tk-bom-picker { grid-column:1/-1; border:1px solid #dac36a; border-radius:10px; padding:10px; background:#fffef5; }
.tk-bom-picker summary { cursor:pointer; font-weight:800; color:#1d4ed8; }
.tk-bom-picker-tools { display:flex; flex-wrap:wrap; gap:8px; margin:10px 0; }
.tk-bom-picker-tools input, .tk-bom-picker-tools select { flex:1 1 180px; min-width:0; }
.tk-selected-materials { grid-column:1/-1; padding:10px; border:1px dashed #b9cbe5; border-radius:10px; background:#f8fbff; }
.tk-selected-materials > strong { display:block; margin-bottom:7px; }
.tk-selected-material-chip { display:inline-flex; gap:7px; margin:3px; padding:5px 8px; border-radius:999px; background:#eff6ff; color:#1e3a8a; font-size:12px; }
.tk-draft-autosave-status { align-self:center; color:#64748b; font-size:11px; font-weight:700; }
.tk-production-funds { margin-top:8px; padding:8px 10px; border-radius:8px; background:#eff6ff; color:#1e3a8a; font-weight:800; }
.tk-stats-toolbar label { display:grid; gap:4px; min-width:130px; flex:1 1 130px; font-size:11px; font-weight:800; color:#334155; }
.tk-stats-toolbar select, .tk-stats-toolbar input { min-height:32px; }
.tk-stats-summary { margin:12px 0; }
.tk-chart-card { overflow:hidden; }
#tkStatsCanvas { display:block; width:100%; min-height:340px; }
.tk-form-grid { display:grid; gap:10px; grid-template-columns:repeat(2,minmax(0,1fr)); }
.tk-form-grid .full { grid-column:1/-1; }
.tk-card label { display:grid; gap:5px; font-size:12px; font-weight:700; }
.tk-card input, .tk-card select, .tk-card textarea { width:100%; box-sizing:border-box; border:1px solid #dac36a; border-radius:8px; padding:9px; background:#fffef5; color:#332700; }
.tk-button { border:1px solid #1d4ed8; background:#2563eb; color:#fff; border-radius:8px; padding:9px 12px; font-weight:800; cursor:pointer; }
.tk-button:hover { background:#1d4ed8; border-color:#1e40af; }
.tk-button.secondary { background:#eff6ff; border-color:#2563eb; color:#1d4ed8; }
.tk-button.danger { background:#ffe1d9; border-color:#d4775d; }
.tk-summary { display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:10px; margin-bottom:16px; }
.tk-metric { padding:14px; border-radius:12px; background:#fff; border:1px solid #ead77b; }
.tk-metric span { display:block; font-size:12px; color:#826e2b; }
.tk-metric strong { display:block; font-size:20px; margin-top:5px; }
.tk-table { width:100%; border-collapse:collapse; font-size:12px; }
.tk-table th, .tk-table td { padding:8px; border-bottom:1px solid #f0e5ad; text-align:left; vertical-align:top; }
.tk-table th { background:#fff5bc; }
.tk-table-wrap { overflow:auto; }
.tk-inline-list { display:grid; gap:7px; margin:10px 0; }
.tk-row { display:grid; grid-template-columns:1.2fr .6fr .8fr auto; gap:7px; align-items:center; }
.tk-muted { color:#8a762d; font-size:12px; }
@media (max-width:720px) { .tk-hero { display:block; } .tk-ledger-note { margin-top:12px; } .tk-grid { grid-template-columns:1fr; } .tk-form-grid { grid-template-columns:1fr; } .tk-form-grid .full { grid-column:auto; } .tk-row { grid-template-columns:1fr 80px 110px auto; } }
.tk-cashier-layout { display:grid; grid-template-columns:minmax(0,1.3fr) minmax(330px,.7fr); gap:18px; align-items:start; }
.tk-cashier-main { min-width:0; }
.tk-cashier-side { min-width:0; position:sticky; top:18px; }
.tk-section-title { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:0 0 14px; }
.tk-section-title h3 { margin:0; }
.tk-section-title > strong { padding:10px 14px; border-radius:9px; background:#fff6d4; color:#6d5000; }
.tk-product-title { margin-top:24px; padding-top:18px; border-top:1px solid #f0e5ad; }
.tk-product-table { border:1px solid #eadfc0; border-radius:10px; overflow:auto; }
.tk-product-head, .tk-product-table .tk-row { min-width:650px; display:grid; grid-template-columns:42px minmax(180px,1.5fr) minmax(120px,1fr) 82px minmax(120px,1fr) 42px; gap:8px; align-items:center; padding:9px 10px; }
.tk-product-head { background:#fff7d0; color:#66531c; font-size:11px; font-weight:800; }
.tk-product-table .tk-row { border-top:1px solid #f0e8c9; }
.tk-product-table .tk-row input, .tk-product-table .tk-row select { min-width:0; }
.tk-row-number { text-align:center; color:#80691c; font-weight:800; }
.tk-row-total { text-align:right; white-space:nowrap; }
.tk-payment-card { margin-top:18px; padding-top:18px; border-top:1px solid #f0e5ad; }
.tk-payment-grid { display:grid; grid-template-columns:1fr 1fr; gap:18px; }
.tk-payment-grid label { margin-bottom:10px; }
.tk-amount-box { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:10px; padding:15px; border-radius:10px; background:#fff4ca; color:#5e4700; }
.tk-amount-box strong { font-size:21px; color:#261f08; white-space:nowrap; }
.tk-balance-field input { color:#db251c !important; background:#fff0f0 !important; font-weight:800; }
.tk-cashier-actions { display:flex; flex-wrap:wrap; gap:9px; justify-content:flex-end; margin-top:18px; padding-top:15px; border-top:1px solid #f0e5ad; }
.tk-cashier-actions .tk-button { min-height:42px; }
.tk-button.tk-primary { background:#2563eb; color:#fff; }
.tk-button.tk-print-button { background:#29313d; border-color:#29313d; color:#fff; }
.tk-production-schedule-toolbar label { flex:1 1 145px; min-width:125px; }
.tk-production-schedule-toolbar label:first-child { flex:2 1 240px; }
.tk-production-schedule-toolbar input, .tk-production-schedule-toolbar select { width:100%; }
.tk-schedule-filter-details { flex:0 0 auto; position:relative; }
.tk-schedule-filter-details > summary { list-style:none; cursor:pointer; }
.tk-schedule-filter-details > summary::-webkit-details-marker { display:none; }
.tk-schedule-date-grid { position:absolute; z-index:5; top:42px; right:0; display:grid; grid-template-columns:repeat(2, minmax(145px, 1fr)); gap:8px; width:min(520px, calc(100vw - 32px)); padding:10px; border:1px solid #b9cbe5; border-radius:10px; background:#fff; box-shadow:0 8px 22px rgba(23,37,84,.14); }
.tk-schedule-date-grid label { min-width:0; }
.tk-schedule-receivables { margin-top:16px; }
.tk-production-schedule-table { min-width:1120px; }
.tk-schedule-receivable-cell { white-space:nowrap; }
.tk-schedule-receivable-cell.has-receivable { color:#b91c1c; font-weight:800; background:#fff3f3; }
.tk-schedule-badge { display:inline-block; margin-top:4px; padding:3px 6px; border-radius:999px; background:#eaf2ff; color:#1d4ed8; font-size:10px; font-weight:800; white-space:nowrap; }
.tk-schedule-badge.late { background:#ffe1e1; color:#b91c1c; }
.tk-schedule-badge.today { background:#fff1b8; color:#854d0e; }
.tk-schedule-detail { min-width:210px; padding:8px; margin-top:6px; border:1px solid #dbe5f2; border-radius:8px; background:#f8fbff; line-height:1.55; }
.tk-production-schedule-table details summary.tk-button { display:inline-block; list-style:none; }
.tk-production-schedule-table details summary.tk-button::-webkit-details-marker { display:none; }
.tk-invoice-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:4px; }
.tk-invoice-head h3 { margin:0; }
.tk-icon-button { width:32px; height:32px; border:1px solid #e0c95d; border-radius:8px; background:#fff9df; cursor:pointer; color:#5e4700; font-size:17px; }
.tk-invoice-minimized { padding-bottom:10px; }
.tk-invoice-minimized .tk-invoice-head { margin-bottom:0; }
.tk-invoice { margin:10px 0 0; padding:12px; border:1px solid #ece4ce; border-radius:10px; background:#fff; font-size:12px; }
.tk-invoice h2 { margin:0 0 8px; font-size:20px; }
.tk-invoice p { margin:5px 0 10px; }
.tk-invoice .print-table { width:100%; }
.tk-invoice-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.tk-invoice-compact { max-width:720px; margin:12px auto 0; padding:22px; border:1px solid #d7dbe2; border-radius:12px; background:#fff; color:#171b24; font-family:ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.tk-invoice-brand { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; padding-bottom:14px; border-bottom:1px solid #171b24; }
.tk-invoice-brand div { display:grid; gap:2px; }
.tk-invoice-brand strong { font-size:18px; letter-spacing:.04em; }
.tk-invoice-brand span { color:#667085; font-size:10px; letter-spacing:.16em; text-transform:uppercase; }
.tk-invoice-brand h2 { margin:0; font-size:25px; letter-spacing:.08em; }
.tk-invoice-meta { display:grid; grid-template-columns:1fr 1fr; gap:12px; padding:13px 0; border-bottom:1px solid #e5e7eb; }
.tk-invoice-meta div, .tk-invoice-field { display:flex; justify-content:space-between; gap:12px; }
.tk-invoice-meta span, .tk-invoice-field span, .tk-invoice-customer > span, .tk-invoice-note > span { color:#667085; font-size:10px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.tk-invoice-meta strong, .tk-invoice-field strong { font-size:12px; text-align:right; }
.tk-invoice-customer { display:grid; gap:5px; padding:14px 0; border-bottom:1px solid #e5e7eb; }
.tk-invoice-customer > strong { font-size:17px; margin-bottom:3px; }
.tk-invoice-section, .tk-invoice-summary { padding:14px 0; border-bottom:1px solid #e5e7eb; }
.tk-invoice-compact h3 { margin:0 0 8px; font-size:11px; letter-spacing:.1em; }
.tk-invoice-compact .print-table { border:1px solid #d7dbe2; }
.tk-invoice-items { table-layout:fixed; }
.tk-invoice-items .item-name { width:46%; }
.tk-invoice-items .item-qty { width:13%; }
.tk-invoice-items .item-price { width:20%; }
.tk-invoice-items .item-total { width:21%; }
.tk-invoice-items td:first-child { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tk-invoice-compact .print-table th, .tk-invoice-compact .print-table td { padding:7px 8px; border-bottom:1px solid #e5e7eb; }
.tk-invoice-compact .print-table th { background:#f4f5f7; color:#475467; font-size:10px; text-transform:uppercase; }
.tk-invoice-compact .print-table th:nth-child(n+2), .tk-invoice-compact .print-table td:nth-child(n+2) { text-align:right; white-space:nowrap; }
.tk-invoice-total-row { display:flex; justify-content:flex-end; gap:28px; padding:3px 0; font-size:12px; }
.tk-invoice-total-row span { min-width:130px; color:#667085; text-align:right; }
.tk-invoice-total-row strong { min-width:130px; text-align:right; }
.tk-invoice-total-row.grand { margin-top:4px; padding:8px 0; border-top:1px solid #171b24; border-bottom:1px solid #171b24; font-size:14px; }
.tk-invoice-payment { width:min(58%, 430px); margin:8px 0 0 auto; display:grid; gap:3px; }
.tk-invoice-payment .tk-invoice-field { display:grid; grid-template-columns:1fr auto; align-items:baseline; gap:26px; min-height:22px; }
.tk-invoice-payment .tk-invoice-field span, .tk-invoice-payment .tk-invoice-total-row span { min-width:0; text-align:right; }
.tk-invoice-payment .tk-invoice-field strong, .tk-invoice-payment .tk-invoice-total-row strong { min-width:150px; text-align:right; }
.tk-invoice-payment .tk-invoice-total-row { padding:4px 0; }
.tk-invoice-payment .tk-invoice-total-row.balance { padding-top:6px; }
.tk-invoice-total-row.balance strong { color:#b42318; }
.tk-invoice-status { display:inline-block; margin-top:10px; padding:5px 9px; border:1px solid #98a2b3; border-radius:999px; font-size:10px; font-weight:900; letter-spacing:.08em; }
.tk-invoice-note { padding:12px 0; border-bottom:1px solid #e5e7eb; }
.tk-invoice-note p { margin:6px 0 0; white-space:pre-wrap; font-size:12px; text-align:left; }
.tk-invoice-footer { display:grid; gap:6px; padding-top:14px; color:#667085; font-size:11px; text-align:center; }
.tk-invoice-footer strong { color:#171b24; font-size:12px; letter-spacing:.08em; }
@media (max-width:600px) { .tk-invoice-compact { padding:15px; } .tk-invoice-brand h2 { font-size:20px; } .tk-invoice-meta { gap:8px; } .tk-invoice-total-row { gap:12px; } .tk-invoice-total-row span, .tk-invoice-total-row strong { min-width:0; } .tk-invoice-payment { width:100%; } .tk-invoice-payment .tk-invoice-field strong, .tk-invoice-payment .tk-invoice-total-row strong { min-width:0; } }
@media print { .tk-invoice-compact { max-width:none; margin:0; padding:0; border:0; border-radius:0; } .tk-invoice-compact .print-table { page-break-inside:auto; } .tk-invoice-compact tr { page-break-inside:avoid; } .tk-invoice-summary, .tk-invoice-note, .tk-invoice-footer { page-break-inside:avoid; } }
@media (max-width:900px) { .tk-cashier-layout { grid-template-columns:1fr; } .tk-cashier-side { position:static; } }
@media (max-width:600px) { .tk-payment-grid { grid-template-columns:1fr; gap:0; } .tk-cashier-actions { justify-content:stretch; } .tk-cashier-actions .tk-button { flex:1 1 45%; } }
#tkPanelMaterials #tkEmbeddedPurchases { display: none; }
