:root {
  --ink: #18221c;
  --muted: #6d786f;
  --line: #dce4dc;
  --paper: #f6f8f5;
  --card: #fff;
  --green: #157347;
  --green-pale: #eaf6ef;
  --amber: #a15c00;
  --amber-pale: #fff4dc;
  --red: #b42318;
  --red-pale: #fff0ee;
  --blue: #255ea8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font: 14px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

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

button {
  cursor: pointer;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
}

/* Sidebar navigation */
aside {
  padding: 25px 16px;
  background: #132a20;
  color: #eef6f0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 26px;
  font-weight: 750;
  font-size: 16px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: #d2ec63;
  color: #1e3427;
  border-radius: 10px;
  font-size: 18px;
}

.shop {
  margin: 2px 8px 14px;
  color: #b7cbbd;
  font-size: 12px;
}

.sidebar-date-pill {
  margin: 0 8px 18px;
  padding: 7px 11px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #d8eedf;
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.sidebar-date-pill:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

nav {
  display: grid;
  gap: 5px;
}

nav button {
  border: 0;
  text-align: left;
  background: transparent;
  color: #c8d8cd;
  padding: 10px 12px;
  border-radius: 8px;
}

nav button.active, nav button:hover {
  background: #244534;
  color: #fff;
}

.side-note {
  position: fixed;
  bottom: 20px;
  left: 24px;
  color: #9ab0a0;
  font-size: 12px;
}

.cloud-button {
  width: calc(100% - 16px);
  margin: 18px 8px 0;
  padding: 9px 10px;
  border: 1px solid #50705b;
  border-radius: 8px;
  background: transparent;
  color: #e4f1e6;
  text-align: left;
  font-size: 12px;
}

.cloud-button.connected {
  border-color: #a6d79f;
  color: #d7f4d2;
}

/* User Session Card & Auth Trigger */
.user-session-card {
  width: calc(100% - 16px);
  margin: 12px 8px 0;
  padding: 10px 12px;
  background: #1c3628;
  border: 1px solid #3d604b;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
  box-sizing: border-box;
}

.user-session-card:hover {
  background: #244634;
  border-color: #558367;
  transform: translateY(-1px);
}

.user-session-card.logged-in {
  background: #173b26;
  border-color: #508864;
}

.user-session-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #2a4c39;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.user-session-card.is-manager .user-session-avatar {
  background: #395729;
}

.user-session-info {
  flex: 1;
  min-width: 0;
}

.user-session-name {
  font-size: 13px;
  font-weight: 700;
  color: #f0f7f2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-session-role {
  font-size: 11px;
  color: #9cb5a3;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 1px;
}

.user-session-terminal {
  font-size: 10.5px;
  color: #cde4d3;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0.9;
}

.user-session-icon {
  font-size: 14px;
  opacity: 0.85;
  flex-shrink: 0;
}

.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.pill-dot.online {
  background: #4ade80;
  box-shadow: 0 0 6px #4ade80;
}

.pill-dot.offline {
  background: #f59e0b;
}

/* Status indicator dot in side-note */
.status-indicator-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 4px;
  vertical-align: middle;
}

.status-indicator-dot.online {
  background: #4ade80;
  box-shadow: 0 0 5px rgba(74, 222, 128, 0.7);
}

.status-indicator-dot.syncing {
  background: #38bdf8;
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.8);
  animation: pulse-sync 0.8s infinite alternate;
}

.status-indicator-dot.offline {
  background: #fbbf24;
}

@keyframes pulse-sync {
  from { opacity: 0.4; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1.15); }
}

.side-note.sync-online {
  color: #a3e635;
}

.side-note.sync-syncing {
  color: #38bdf8;
}

.side-note.sync-offline {
  color: #9ab0a0;
}

/* Login Modal Tabs & Layout */
.login-modal {
  max-width: 520px;
}

.modal-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.modal-close-btn {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.modal-close-btn:hover {
  background: #e6ede6;
  color: var(--ink);
}

.login-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 18px;
}

.login-tab-btn {
  flex: 1;
  padding: 9px 12px;
  border-radius: 7px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  user-select: none;
}

.login-tab-btn:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--ink);
}

.login-tab-btn.active {
  background: var(--green) !important;
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(21, 115, 71, 0.25);
}

/* Logged-In Cloud Account View */
.cloud-account-card {
  background: var(--green-pale);
  border: 1px solid #c2e2ce;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.cloud-account-avatar {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #d4ecdb;
  border: 1px solid #a8dbb5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.cloud-account-meta {
  flex: 1;
  min-width: 0;
}

.cloud-account-title {
  font-size: 14px;
  font-weight: 700;
  color: #0e4c2c;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cloud-account-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
  flex-wrap: wrap;
}

.cloud-account-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: #157347;
}

.cloud-actions-box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 14px;
}

.security-expandable {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  margin-top: 12px;
}

.security-expandable summary {
  padding: 12px 14px;
  background: var(--paper);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
}

.security-expandable summary::-webkit-details-marker {
  display: none;
}

.security-expandable summary::after {
  content: '▾';
  font-size: 12px;
  color: var(--muted);
  transition: transform 0.2s ease;
}

.security-expandable[open] summary::after {
  transform: rotate(180deg);
}

.security-expandable-content {
  padding: 14px;
  border-top: 1px solid var(--line);
}

.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrapper input {
  width: 100%;
  padding-right: 40px;
}

.btn-toggle-pwd {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--muted);
  padding: 4px 6px;
  font-size: 14px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-toggle-pwd:hover {
  color: var(--ink);
  background: rgba(0, 0, 0, 0.05);
}

.shift-handover-prompt {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.shift-handover-prompt-text {
  font-size: 12px;
  color: var(--muted);
}

.shift-handover-prompt-text strong {
  display: block;
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 2px;
}

.active-shift-banner {
  background: #f0f7f3;
  border: 1px solid #c9e6d4;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.active-shift-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #d8eedf;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.active-shift-meta {
  flex: 1;
  min-width: 0;
}

.active-shift-name {
  font-size: 13px;
  font-weight: 700;
  color: #0e4c2c;
}

.active-shift-sub {
  font-size: 11.5px;
  color: #437d5c;
}

/* Main content */
main {
  max-width: 1350px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 34px 60px;
  min-width: 0;
}

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

h1 {
  margin: 0;
  font-size: 25px;
  letter-spacing: -.5px;
}

h2 {
  margin: 0;
  font-size: 17px;
}

p {
  margin: 4px 0 0;
  color: var(--muted);
}

.date {
  color: var(--muted);
  text-align: right;
  font-size: 13px;
}

/* Common UI Elements */
.btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 9px 12px;
  border-radius: 8px;
  font-weight: 650;
  transition: opacity 0.15s ease, background-color 0.15s ease;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn.primary {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

.btn.primary:hover:not(:disabled) {
  background: #11603a;
}

.btn.warn {
  color: #8a4f00;
  background: var(--amber-pale);
  border-color: #f0cf83;
}

.btn.danger {
  color: var(--red);
  background: var(--red-pale);
  border-color: #f5c2be;
}

.btn.btn-whatsapp,
.btn-whatsapp {
  color: #fff !important;
  background: #25d366 !important;
  border-color: #25d366 !important;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn.btn-whatsapp:hover:not(:disabled),
.btn-whatsapp:hover:not(:disabled) {
  background: #1eb956 !important;
  border-color: #1eb956 !important;
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.35);
}

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

.stat, .panel {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 12px;
}

.stat {
  padding: 16px;
  min-height: 104px;
}

.stat .label {
  color: var(--muted);
  font-size: 12px;
}

.stat strong {
  display: block;
  font-size: 23px;
  margin-top: 8px;
  letter-spacing: -.5px;
}

.stat .sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.panel {
  padding: 18px;
  margin-top: 16px;
}

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

.alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 13px 14px;
  background: var(--amber-pale);
  color: #6f4800;
  border: 1px solid #f1d48c;
  border-radius: 9px;
  margin-bottom: 16px;
}

.alert strong {
  display: block;
}

.alert p {
  color: #825c13;
  margin: 2px 0 0;
}

/* Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  color: var(--muted);
  font-weight: 600;
  text-align: left;
  font-size: 12px;
  padding: 0 10px 10px;
}

td {
  padding: 12px 10px;
  border-top: 1px solid #edf0ed;
  vertical-align: top;
}

.right {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--muted);
}

.negative {
  color: var(--red);
}

.positive {
  color: var(--green);
}

/* Badges and pills */
.pill {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  background: #edf1ee;
  color: #526057;
}

.pill.sale {
  background: #e8f4ec;
  color: #13633d;
}

.pill.service {
  background: #e8effb;
  color: #255c9d;
}

.pill.expense {
  background: #fff0ee;
  color: #9d2f26;
}

.pill.advance {
  background: #fdf4db;
  color: #7f5700;
}

.pill.collection {
  background: #eaf6ef;
  color: #12633d;
  border: 1px solid #c2e5d0;
}

.pill.warning {
  background: var(--amber-pale);
  color: #8b5200;
}

.pill.closed {
  background: #47544b;
  color: #fff;
}

.split {
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 16px;
}

.cashbox {
  padding: 18px;
  background: #f1f7f2;
  border-radius: 10px;
}

.cashline {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  color: #3d4e42;
}

.cashline.total {
  border-top: 1px solid #bdd4c1;
  margin-top: 5px;
  padding-top: 12px;
  color: var(--ink);
  font-weight: 750;
  font-size: 16px;
}

/* Transactions view components */
.transactions-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  padding: 18px;
  background: #173629;
  color: #f4fbf5;
  border-radius: 14px;
  margin-bottom: 16px;
}

.transactions-hero h1 {
  color: #fff;
}

.transactions-hero p {
  color: #c7dbcd;
}

.day-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #dbeade;
  font-size: 13px;
  white-space: nowrap;
}

.day-picker input {
  width: auto;
  background: #264b37;
  border-color: #507761;
  color: #fff;
}

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

.quick-action {
  min-height: 88px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.quick-action:hover:not(:disabled) {
  border-color: #7cad88;
  background: #f5faf5;
}

.quick-action:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.quick-action strong {
  font-size: 15px;
}

.quick-action span {
  color: var(--muted);
  font-size: 12px;
}

.quick-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--green-pale);
  color: var(--green);
  font-size: 16px;
}

.transaction-summary {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 10px;
  padding: 0 0 16px;
}

.transaction-summary div {
  padding: 10px 12px;
  background: #f5f8f5;
  border-radius: 8px;
}

.transaction-summary span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.transaction-summary strong {
  display: block;
  margin-top: 3px;
  font-size: 17px;
}

.filters {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.filter-chip {
  border: 1px solid var(--line);
  background: #fff;
  color: #4c5a51;
  padding: 6px 9px;
  border-radius: 20px;
  font-size: 12px;
}

.filter-chip.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.transaction-ref {
  font-weight: 750;
}

.transaction-note {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.allocation {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.allocation span {
  padding: 3px 6px;
  border-radius: 5px;
  background: #eef4ef;
  color: #3d5946;
  font-size: 11px;
}

.empty {
  padding: 24px 0 8px;
  color: var(--muted);
}

/* Modals & Dialogs */
dialog {
  width: min(600px, calc(100% - 32px));
  border: 0;
  border-radius: 14px;
  padding: 0;
  box-shadow: 0 18px 65px #0c20152e;
}

dialog::backdrop {
  background: #10221866;
}

.modal {
  padding: 22px;
}

.modal h2 {
  font-size: 19px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 18px 0;
}

label, .form-field-group {
  display: grid;
  gap: 5px;
  color: #4c5a51;
  font-size: 12px;
  font-weight: 650;
}

.form-field-group > span,
.form-field-group > label {
  font-size: 12px;
  font-weight: 650;
  color: #4c5a51;
}

/* Accessibility: High-Contrast Focus Visible Ring */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

input, select, textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #cfd9d0;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
}

textarea {
  min-height: 66px;
  resize: vertical;
}

.full {
  grid-column: 1 / -1;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.close-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 12px 0 18px;
}

.close-grid > div {
  padding: 12px;
  background: #f7f9f7;
  border-radius: 8px;
}

.close-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.close-grid strong {
  display: block;
  margin-top: 5px;
  font-size: 18px;
}

.notice {
  margin-top: 12px;
  padding: 10px;
  border-radius: 8px;
  display: none;
}

.notice.show {
  display: block;
}

.notice.error {
  background: var(--red-pale);
  color: #94332b;
}

.notice.ok {
  background: var(--green-pale);
  color: #17603d;
}

.variance-box {
  margin-top: 14px;
  padding: 12px;
  background: var(--amber-pale);
  border: 1px solid #f1d48c;
  border-radius: 8px;
  display: none;
}

.variance-box.show {
  display: block;
}

[hidden] {
  display: none !important;
}

/* Responsive design */
@media (max-width: 800px) {
  .shell {
    display: block;
  }
  aside {
    padding: 14px;
    position: sticky;
    top: 0;
    z-index: 2;
  }
  .brand, .shop, .side-note {
    display: none;
  }
  nav {
    display: flex;
    overflow: auto;
  }
  nav button {
    white-space: nowrap;
  }
  main {
    padding: 20px 16px 40px;
  }
  .grid, .quick-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .split {
    grid-template-columns: 1fr;
  }
  .transactions-hero {
    align-items: flex-start;
    flex-direction: column;
  }
  .transaction-summary {
    grid-template-columns: 1fr;
  }
  .top {
    flex-direction: column;
  }
  .date {
    text-align: left;
  }
  .form-grid, .close-grid {
    grid-template-columns: 1fr;
  }
  .table-wrap {
    overflow: auto;
  }
  .table-wrap > table:not(.receipt-items-table):not(.shortcuts-table) {
    min-width: 700px;
  }
  .receipt-items-table, .shortcuts-table {
    min-width: 100% !important;
  }
}

/* Interactive Split Payment Builder */
.allocation-builder {
  background: #fbfdfb;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  margin-top: 6px;
}
.allocation-builder-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
}
.allocation-row {
  display: grid;
  grid-template-columns: 1.6fr 1.2fr auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.btn-remove-allocation {
  width: 32px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--red);
  border-radius: 7px;
  font-size: 16px;
  padding: 0;
}
.btn-remove-allocation:hover {
  background: var(--red-pale);
  border-color: #f7c3bf;
}
.balance-indicator {
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 650;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}
.balance-indicator.balanced {
  background: #e8f4ec;
  color: #13633d;
  border: 1px solid #b7dfc6;
}
.balance-indicator.unbalanced {
  background: #fff0ee;
  color: #b42318;
  border: 1px solid #f6cfcb;
}

/* Advance Lookup Banner */
.advance-lookup-banner {
  background: #fff8eb;
  border: 1px solid #f2d294;
  padding: 10px 14px;
  border-radius: 9px;
  font-size: 12px;
  color: #7b4f00;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0 14px;
}
.btn-apply-adce {
  background: #a15c00;
  color: #fff;
  border: 0;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.btn-apply-adce:hover {
  background: #7f4800;
}

/* Denomination Counter Matrix */
.denom-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 12px 0 16px;
}
.denom-card {
  background: #f7f9f7;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.denom-card label {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  margin: 0;
}
.denom-card input {
  text-align: right;
  font-weight: 700;
  padding: 6px 8px;
}
.denom-card .subtotal {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  text-align: right;
}
@media (max-width: 800px) {
  .denom-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Financial Analytics Visual Charts (Zero-Build Pure CSS/SVG) */
.chitta-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.chart-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.chart-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.chart-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 6px;
}

.chart-total-pill {
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
  background: var(--green-pale);
  padding: 2px 8px;
  border-radius: 6px;
}

.stacked-bar-container {
  height: 18px;
  border-radius: 6px;
  display: flex;
  overflow: hidden;
  background: #eef2ef;
  margin-bottom: 14px;
}

.stacked-bar-segment {
  height: 100%;
  transition: width 0.3s ease;
  min-width: 2px;
}

.chart-legend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--ink);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.revenue-mix-bar {
  margin-bottom: 10px;
}

.revenue-mix-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 4px;
}

.revenue-mix-track {
  height: 10px;
  background: #edf2ee;
  border-radius: 5px;
  overflow: hidden;
}

.revenue-mix-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.3s ease;
}

/* Chitta Sheet & Reports Styling */
.chitta-sheet {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 20px #0000000a;
}
.chitta-header {
  border-bottom: 2px solid #132a20;
  padding-bottom: 16px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.chitta-title {
  font-size: 20px;
  font-weight: 800;
  color: #132a20;
  letter-spacing: -0.5px;
}
.chitta-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}
.chitta-meta {
  text-align: right;
  font-size: 12px;
  color: var(--muted);
}
.chitta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
.chitta-box {
  background: #fbfdfb;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}
.chitta-box-title {
  font-size: 14px;
  font-weight: 750;
  color: #1a3829;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  margin-bottom: 10px;
}
.chitta-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px dashed #e6ece7;
}
.chitta-row:last-child {
  border-bottom: 0;
}
.chitta-row.total {
  border-top: 1px solid #1a3829;
  border-bottom: 0;
  font-weight: 750;
  font-size: 14px;
  margin-top: 6px;
  padding-top: 8px;
  color: #132a20;
}
.chitta-signatures {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  text-align: center;
}
.chitta-sig-line {
  border-top: 1px dashed #728477;
  padding-top: 8px;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
}

/* Print Optimization */
@media print {
  body {
    background: #fff !important;
    font-size: 11pt !important;
    color: #000 !important;
  }
  aside,
  nav,
  .cloud-button,
  .user-session-card,
  .side-note,
  .btn,
  .day-picker,
  .filters,
  .top,
  dialog {
    display: none !important;
  }
  .shell {
    display: block !important;
  }
  main {
    padding: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
  }
  main section:not(#reports-view) {
    display: none !important;
  }
  #reports-view {
    display: block !important;
  }
  #report-tab-chitta {
    display: block !important;
  }
  #report-tab-advances,
  #report-tab-khata,
  #report-tab-finance {
    display: none !important;
  }
  .chitta-sheet {
    border: 1px solid #000 !important;
    box-shadow: none !important;
    padding: 10px !important;
  }
}

/* Utility & Extracted Component Classes */
.btn-sm {
  padding: 4px 8px;
  font-size: 11px;
}
.btn-xs {
  padding: 3px 6px;
  font-size: 10px;
}
.font-bold {
  font-weight: 700;
}
.text-right {
  text-align: right;
}
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 14px; }
.mt-3 { margin-top: 16px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }

.closing-alert-card {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.service-breakdown-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: #f6f9f6;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
}
@media (max-width: 800px) {
  .service-breakdown-card {
    grid-template-columns: 1fr;
  }
}

/* Utilities */
.bg-muted { background: #f6f8f6 !important; }
.text-red { color: var(--red) !important; }
.font-bold { font-weight: 700 !important; }
.mt-2 { margin-top: 8px !important; }
.mt-3 { margin-top: 16px !important; }
.mb-2 { margin-bottom: 12px !important; }
.w-full { width: 100% !important; }

/* Settings View Enhancements */
#settings-view .filters {
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}
#settings-view .filters .filter-chip {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px;
}
#settings-view .filters .filter-chip.active {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

kbd {
  display: inline-block;
  padding: 3px 7px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
  background: #f1f5f2;
  border: 1px solid #bccdc1;
  border-radius: 4px;
  box-shadow: 0 1px 0 #bccdc1;
}

/* Search & Header Date Controls */
.date-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: right;
}
.day-picker-input {
  width: auto;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}
.search-wrap {
  margin-bottom: 12px;
}
.search-wrap input {
  max-width: 480px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
}
.search-wrap input:focus {
  border-color: var(--green);
  outline: none;
  box-shadow: 0 0 0 3px #1573471a;
}

/* ==========================================================================
   Authentic Thermal POS Receipt Slip & Live Preview
   ========================================================================== */

#settings-tab-profile .split {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: flex-start;
}

.receipt-width-toggle .btn {
  background: #e2e8f0;
  color: #334155;
  border: 1px solid #cbd5e1;
  font-weight: 600;
  transition: all 0.15s ease;
}

.receipt-width-toggle .btn.active {
  background: var(--green) !important;
  color: #ffffff !important;
  border-color: #0f5132 !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.receipt-preview-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px 10px 24px;
  background: #f1f4f1;
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 480px;
  overflow: auto;
}

.receipt-modal {
  max-width: 440px;
  width: 100%;
  padding: 16px;
  background: #f1f4f1;
  border-radius: 14px;
}

#receipt-print-area {
  display: flex;
  justify-content: center;
}

/* Thermal Paper Slip */
.receipt-slip {
  background: #ffffff;
  color: #111827;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 11.5px;
  line-height: 1.4;
  padding: 24px 20px 26px;
  position: relative;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  margin: 0 auto;
  box-sizing: border-box;
  width: 100%;
  max-width: 350px; /* 80mm standard */
  transition: max-width 0.2s ease, padding 0.2s ease;
}

.receipt-slip.width-58mm {
  max-width: 270px; /* 58mm compact */
  padding: 16px 12px 20px;
  font-size: 10.5px;
}

/* Jagged Tear-off Edge Effect at Top & Bottom */
.receipt-slip::before,
.receipt-slip::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 6px;
  background-size: 10px 6px;
  background-repeat: repeat-x;
}

.receipt-slip::before {
  top: -6px;
  background-image: radial-gradient(circle at 5px 6px, transparent 5px, #ffffff 5px);
}

.receipt-slip::after {
  bottom: -6px;
  background-image: radial-gradient(circle at 5px 0, transparent 5px, #ffffff 5px);
}

/* Header */
.receipt-header {
  text-align: center;
  padding-bottom: 2px;
}

.receipt-brand-logo {
  font-size: 20px;
  margin-bottom: 2px;
}

.receipt-shop-name {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.6px;
  color: #0f172a;
  margin: 0 0 3px;
  line-height: 1.2;
}

.receipt-slip.width-58mm .receipt-shop-name {
  font-size: 15px;
}

.receipt-shop-tagline {
  font-size: 10.5px;
  color: #475569;
  font-weight: 600;
  margin-bottom: 3px;
}

.receipt-shop-address {
  font-size: 10.5px;
  color: #64748b;
  line-height: 1.35;
  margin-bottom: 3px;
}

.receipt-shop-contacts {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 10px;
  color: #334155;
}

/* Dividers */
.receipt-divider.dashed {
  border: 0;
  border-top: 1px dashed #64748b;
  margin: 10px 0;
}

.receipt-divider.double {
  border: 0;
  border-top: 3px double #0f172a;
  margin: 10px 0;
}

/* Metadata Grid */
.receipt-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 8px;
  font-size: 11px;
}

.receipt-meta-grid .meta-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px;
}

.receipt-meta-grid .meta-item span {
  color: #64748b;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.receipt-meta-grid .meta-item strong {
  color: #0f172a;
  font-weight: 700;
}

.receipt-meta-grid .meta-item.full {
  grid-column: span 2;
  border-top: 1px dotted #cbd5e1;
  padding-top: 4px;
  margin-top: 2px;
}

.receipt-meta-grid .meta-item .receipt-type-pill {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 9.5px;
  letter-spacing: 0.6px;
  font-weight: 800;
  text-transform: uppercase;
}

.receipt-meta-grid .meta-item .receipt-type-pill.sale {
  background: #15803d;
  color: #ffffff !important;
}

.receipt-meta-grid .meta-item .receipt-type-pill.service {
  background: #0284c7;
  color: #ffffff !important;
}

.receipt-meta-grid .meta-item .receipt-type-pill.advance {
  background: #7e22ce;
  color: #ffffff !important;
}

.receipt-meta-grid .meta-item .receipt-type-pill.expense {
  background: #dc2626;
  color: #ffffff !important;
}

/* Vehicle / Bicycle / Job Card Info Block */
.receipt-vehicle-block {
  margin: 8px 0 2px;
  padding: 6px 8px;
  background: #f8fafc;
  border: 1px dashed #94a3b8;
  border-radius: 4px;
  font-size: 10.5px;
  color: #1e293b;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.receipt-vehicle-block strong {
  color: #0f172a;
}

.frame-tag {
  font-family: ui-monospace, monospace;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: #e2e8f0;
  padding: 1px 4px;
  border-radius: 2px;
}

/* Items Table */
.receipt-items-table {
  width: 100%;
  border-collapse: collapse;
  margin: 6px 0;
  font-size: 11px;
}

.receipt-items-table th {
  padding: 4px 2px;
  border-top: 1px dashed #64748b;
  border-bottom: 1px dashed #64748b;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: #334155;
  font-weight: 700;
}

.receipt-items-table th.left, .receipt-items-table td.item-desc {
  text-align: left;
}

.receipt-items-table th.center, .receipt-items-table td.item-qty {
  text-align: center;
}

.receipt-items-table th.right, .receipt-items-table td.item-rate, .receipt-items-table td.item-amt {
  text-align: right;
}

.receipt-items-table td {
  padding: 5px 2px;
  vertical-align: top;
  border-bottom: 1px dotted #e2e8f0;
}

.receipt-items-table tr:last-child td {
  border-bottom: none;
}

.item-desc {
  font-weight: 600;
  color: #0f172a;
}

.item-amt {
  font-weight: 700;
  color: #0f172a;
}

/* Totals & Summary */
.receipt-summary {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #475569;
}

.summary-line.discount {
  color: #b91c1c;
  font-weight: 600;
}

.summary-line.tax {
  font-size: 10px;
  color: #64748b;
  font-style: italic;
}

.receipt-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  font-weight: 900;
  color: #0f172a;
  padding: 6px 0;
  margin-top: 4px;
  border-top: 2px solid #0f172a;
  border-bottom: 2px solid #0f172a;
}

.receipt-slip.width-58mm .receipt-total-row {
  font-size: 13.5px;
}

/* Payment Allocations */
.receipt-allocations {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.alloc-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 800;
  color: #475569;
  margin-bottom: 2px;
}

.alloc-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  font-size: 11px;
}

.alloc-row.is-adce {
  background: #f0fdf4;
  border-left: 3px solid #16a34a;
  padding: 3px 6px;
  border-radius: 2px;
  margin: 2px 0;
}

.adce-note {
  display: block;
  font-size: 9.5px;
  color: #15803d;
  font-style: italic;
  font-weight: 500;
}

.alloc-val {
  font-weight: 700;
  color: #0f172a;
}

/* Barcode */
.receipt-barcode {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 4px 0 2px;
}

.receipt-barcode-lines {
  height: 36px;
  width: 180px;
  background: repeating-linear-gradient(
    90deg,
    #0f172a 0px,
    #0f172a 2px,
    transparent 2px,
    transparent 4px,
    #0f172a 4px,
    #0f172a 7px,
    transparent 7px,
    transparent 8px,
    #0f172a 8px,
    #0f172a 11px,
    transparent 11px,
    transparent 13px,
    #0f172a 13px,
    #0f172a 15px,
    transparent 15px,
    transparent 18px
  );
  border-radius: 1px;
}

.receipt-barcode-code {
  font-family: ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 2px;
  margin-top: 3px;
  font-weight: 700;
  color: #334155;
}

/* Footer */
.receipt-footer {
  text-align: center;
}

.receipt-thankyou {
  font-size: 11px;
  font-weight: 600;
  color: #0f172a;
  margin: 0 0 6px;
  line-height: 1.35;
}

.receipt-terms {
  font-size: 9px;
  color: #64748b;
  text-align: left;
  line-height: 1.35;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: #f8fafc;
  padding: 6px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
}

.receipt-os-mark {
  font-size: 9px;
  color: #94a3b8;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 700;
}

/* Print Optimization */
@media print {
  @page {
    margin: 0;
    size: 80mm auto;
  }
  body.printing-receipt {
    background: #fff !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  body.printing-receipt .shell,
  body.printing-receipt aside,
  body.printing-receipt main,
  body.printing-receipt dialog::backdrop,
  body.printing-receipt .modal-actions {
    display: none !important;
  }
  body.printing-receipt #receipt-dialog {
    display: block !important;
    position: static !important;
    border: 0 !important;
    box-shadow: none !important;
    width: 100% !important;
    max-width: 80mm !important;
    margin: 0 auto !important;
    padding: 0 !important;
    background: #fff !important;
  }
  body.printing-receipt .receipt-slip {
    box-shadow: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 3mm 1mm !important;
    max-width: 100% !important;
    width: 100% !important;
  }
  body.printing-receipt .receipt-slip::before,
  body.printing-receipt .receipt-slip::after {
    display: none !important;
  }
}


/* ==========================================================================
   Redesigned Transaction Dialog (Sale, Service, Expense, Advance)
   ========================================================================== */

#transaction-dialog {
  width: min(780px, calc(100% - 24px));
  max-height: 94vh;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(16, 34, 24, 0.28);
  border: 1px solid var(--line);
  padding: 0;
  background: #f7f9f7;
}

.tx-modal {
  padding: 0;
  display: flex;
  flex-direction: column;
  max-height: 94vh;
  height: 100%;
  margin: 0;
}

/* Modal Header */
.tx-modal-header {
  padding: 16px 22px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.tx-modal-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tx-badge-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 20px;
  background: #eaf6ef;
  border: 1px solid #b7dfc6;
  color: #13633d;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.tx-modal-title-group h2 {
  font-size: 18px;
  margin: 0 0 2px;
  font-weight: 750;
  color: var(--ink);
}

.tx-modal-title-group p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

/* Segmented Type Switcher Bar */
.tx-type-tabs-wrap {
  padding: 10px 22px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.tx-type-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: #eef3ef;
  padding: 4px;
  border-radius: 11px;
}

.tx-tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.tx-tab-btn:hover {
  background: #e1eae3;
  color: var(--ink);
}

.tx-tab-icon {
  font-size: 18px;
  line-height: 1;
}

.tx-tab-label {
  display: flex;
  flex-direction: column;
}

.tx-tab-label strong {
  font-size: 12.5px;
  line-height: 1.2;
}

.tx-tab-label small {
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.2;
}

/* Tab Colors & Theme Accents */
.tx-tab-btn.active[data-type="Sale"] {
  background: #fff;
  color: #13633d;
  border-color: #a3d9b5;
  box-shadow: 0 2px 7px rgba(19, 99, 61, 0.12);
}
.tx-tab-btn.active[data-type="Sale"] .tx-tab-label small {
  color: #157347;
}

.tx-tab-btn.active[data-type="Service"] {
  background: #fff;
  color: #0b57d0;
  border-color: #91caff;
  box-shadow: 0 2px 7px rgba(11, 87, 208, 0.12);
}
.tx-tab-btn.active[data-type="Service"] .tx-tab-label small {
  color: #0b57d0;
}

.tx-tab-btn.active[data-type="Expense"] {
  background: #fff;
  color: #b54708;
  border-color: #ffbb96;
  box-shadow: 0 2px 7px rgba(181, 71, 8, 0.12);
}
.tx-tab-btn.active[data-type="Expense"] .tx-tab-label small {
  color: #b54708;
}

.tx-tab-btn.active[data-type="Advance"] {
  background: #fff;
  color: #6929c4;
  border-color: #d3adf7;
  box-shadow: 0 2px 7px rgba(105, 41, 196, 0.12);
}
.tx-tab-btn.active[data-type="Advance"] .tx-tab-label small {
  color: #6929c4;
}

/* Modal Body */
.tx-modal-body {
  overflow-y: auto;
  padding: 16px 22px;
  flex: 1;
}

/* Visual Section Cards */
.tx-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.tx-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f2f5f2;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.tx-badge-sub {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: #f0f4f1;
  color: var(--muted);
}

/* Form Grids */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

/* Redesigned Pricing & Charges Calculator Card */
.pricing-input-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: flex-start;
}

.pricing-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.pricing-label {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  letter-spacing: -0.2px;
}

.input-prefix-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-prefix-icon {
  position: absolute;
  left: 11px;
  font-size: 13.5px;
  font-weight: 800;
  color: #64748b;
  pointer-events: none;
  user-select: none;
  z-index: 1;
}

.input-prefix-wrap.is-discount .input-prefix-icon {
  color: #dc2626;
  left: 9px;
}

.pricing-input {
  width: 100%;
  height: 42px;
  min-height: 42px;
  line-height: 42px;
  padding: 0 10px 0 26px !important;
  font-size: 14.5px;
  font-weight: 700;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-prefix-wrap.is-discount .pricing-input {
  padding-left: 30px !important;
  color: #b91c1c;
}

.pricing-input:focus {
  border-color: var(--green);
  outline: none;
  box-shadow: 0 0 0 3px rgba(21, 115, 71, 0.12);
}

.pricing-select {
  width: 100%;
  height: 42px;
  min-height: 42px;
  line-height: normal;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  box-sizing: border-box;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pricing-select:focus {
  border-color: var(--green);
  outline: none;
  box-shadow: 0 0 0 3px rgba(21, 115, 71, 0.12);
}

/* Quick Discount Presets Toolbar */
.discount-presets-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 6px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  flex-wrap: wrap;
}

.discount-presets-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: #64748b;
  margin-right: 2px;
  white-space: nowrap;
}

.preset-discount-chip {
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  font-size: 11.5px;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-discount-chip:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.preset-discount-chip.active {
  background: #fee2e2;
  border-color: #f87171;
  color: #991b1b;
}

.label-with-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.field-hint {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}

.btn-text-action {
  background: none;
  border: none;
  color: var(--green);
  font-size: 11.5px;
  font-weight: 650;
  padding: 0 4px;
  cursor: pointer;
  border-radius: 4px;
}
.btn-text-action:hover {
  text-decoration: underline;
  background: #eaf6ef;
}

/* Category Chips */
.chip-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  padding: 5px 11px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #f9fbf9;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip:hover {
  background: #eef5f0;
  border-color: #b7dfc6;
}

.chip.active {
  background: #eaf6ef;
  border-color: #157347;
  color: #157347;
  font-weight: 700;
}

/* Mini Preset Chips for Discount */
.preset-chips-mini {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}

.chip-mini {
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: #f7f9f7;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.1s ease;
}

.chip-mini:hover {
  background: #eaf6ef;
  color: #157347;
  border-color: #a3d9b5;
}

/* Advance Purpose Cards */
.advance-purpose-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.advance-purpose-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  background: #fdfdfd;
  cursor: pointer;
  transition: all 0.15s ease;
}

.advance-purpose-card:hover {
  background: #f8f6fc;
  border-color: #d3adf7;
}

.advance-purpose-card.active {
  background: #f9f0ff;
  border-color: #6929c4;
  box-shadow: 0 2px 7px rgba(105, 41, 196, 0.08);
}

.adv-icon {
  font-size: 20px;
  line-height: 1.2;
}

.advance-purpose-card strong {
  display: block;
  font-size: 12.5px;
  color: var(--ink);
}

.advance-purpose-card p {
  font-size: 11px;
  color: var(--muted);
  margin: 2px 0 0;
  line-height: 1.3;
}

/* Invariant 4 Expense Classification Cards */
.expense-class-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.expense-class-card {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 10px 11px;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  background: #fdfdfd;
  cursor: pointer;
  transition: all 0.15s ease;
}

.expense-class-card:hover {
  background: #fff8f5;
  border-color: #ffbb96;
}

.expense-class-card.active {
  background: #fff4ed;
  border-color: #b54708;
  box-shadow: 0 2px 7px rgba(181, 71, 8, 0.08);
}

.exp-icon {
  font-size: 20px;
  line-height: 1.2;
}

.expense-class-card strong {
  display: block;
  font-size: 12.5px;
  color: var(--ink);
}

.expense-class-card p {
  font-size: 10.5px;
  color: var(--muted);
  margin: 2px 0 0;
  line-height: 1.25;
}

.exp-badge {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  margin-top: 4px;
  letter-spacing: 0.2px;
}

.exp-badge.op {
  background: #eaf6ef;
  color: #157347;
}

.exp-badge.eq {
  background: #fff4dc;
  color: #a15c00;
}

.exp-badge.st {
  background: #e6f4ff;
  color: #0958d9;
}

/* Staff Advance Info Box */
.staff-advance-info-box {
  background: #f0f7ff;
  border: 1px solid #c8e1ff;
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-size: 12px;
  color: #0958d9;
  font-weight: 600;
}

.staff-advance-info-box small {
  font-size: 11px;
  font-weight: 400;
  color: #4b6b94;
  margin-top: 2px;
}

/* Redesigned Dynamic Calculation Strip */
.calc-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #f8faf8 0%, #f1f8f3 100%);
  border: 1px solid #c2e5d0;
  border-radius: 10px;
  padding: 10px 14px;
  margin-top: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.calc-formula-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #475569;
}

.calc-token {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  font-size: 11.5px;
  font-weight: 600;
  color: #1e293b;
}

.calc-token strong {
  font-weight: 750;
  color: #0f172a;
}

.calc-token.operator {
  background: none;
  border: none;
  font-size: 13px;
  font-weight: 800;
  color: #64748b;
  padding: 0 2px;
}

.calc-token.discount {
  color: #b91c1c;
  background: #fff1f2;
  border-color: #fecdd3;
}

.calc-token.discount strong {
  color: #991b1b;
}

.calc-token.tax {
  color: #0369a1;
  background: #f0f9ff;
  border-color: #bae6fd;
}

.calc-token.tax strong {
  color: #075985;
}

.calc-net-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #15803d;
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 6px rgba(21, 128, 61, 0.25);
  white-space: nowrap;
  flex-shrink: 0;
}

.calc-net-badge strong {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

/* Large Input */
.input-large {
  font-size: 16px !important;
  font-weight: 700 !important;
  color: var(--ink) !important;
  padding: 10px 12px !important;
  border: 1.5px solid #b7dfc6 !important;
  border-radius: 8px !important;
  background: #fff !important;
}

.input-large:focus {
  border-color: var(--green) !important;
  outline: none;
  box-shadow: 0 0 0 3px rgba(21, 115, 71, 0.15) !important;
}

/* Fast Tender Presets */
.tender-presets-container {
  margin-bottom: 12px;
}

.presets-label {
  font-size: 11.5px;
  font-weight: 650;
  color: var(--muted);
  margin-bottom: 6px;
  display: block;
}

.tender-presets-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-tender-preset {
  font-size: 11.5px;
  font-weight: 650;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-tender-preset:hover {
  background: #eef5f0;
  border-color: #a3d9b5;
  color: #13633d;
}

/* Allocation Builder Row Controls */
.allocation-row-extended {
  display: grid;
  grid-template-columns: 1.5fr 1fr auto auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.btn-fill-remaining {
  font-size: 11px;
  font-weight: 600;
  padding: 0 8px;
  height: 36px;
  border: 1px solid var(--line);
  background: #f7f9f7;
  border-radius: 7px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.1s ease;
}

.btn-fill-remaining:hover {
  background: #eaf6ef;
  color: var(--green);
  border-color: #a3d9b5;
}

/* Sticky Modal Footer Actions */
.tx-modal-footer {
  padding: 14px 22px;
  background: #fff;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.tx-footer-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-total-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.footer-total-amount {
  font-size: 18px;
  color: var(--ink);
  font-weight: 750;
}

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

.btn-save-tx {
  min-width: 130px;
  font-weight: 700;
}

/* Responsive Rules for Transaction Modal */
@media (max-width: 720px) {
  #transaction-dialog {
    width: calc(100% - 16px);
    max-height: 96vh;
    border-radius: 12px;
  }
  .tx-modal-header {
    padding: 12px 16px;
  }
  .tx-type-tabs-wrap {
    padding: 8px 16px;
  }
  .tx-type-tabs {
    grid-template-columns: repeat(2, 1fr);
  }
  .tx-modal-body {
    padding: 12px 16px;
  }
  .form-grid-2, .form-grid-3, .pricing-input-grid {
    grid-template-columns: 1fr;
  }
  .expense-class-grid {
    grid-template-columns: 1fr;
  }
  .advance-purpose-grid {
    grid-template-columns: 1fr;
  }
  .calc-strip {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .tx-modal-footer {
    padding: 12px 16px;
  }
}

/* ==========================================================================
   Cloud & Data Resilience Hub Styles
   ========================================================================== */

.settings-data-hub {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
}

/* Hero Panel & Telemetry */
.cloud-hero-panel {
  margin-top: 0;
  margin-bottom: 0;
  background: linear-gradient(180deg, #ffffff 0%, #f7faf7 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
}

.cloud-hero-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.cloud-hero-identity {
  flex: 1;
}

.cloud-hero-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eaf6ef;
  border: 1px solid #c2e5d0;
  font-size: 12px;
  color: #12633d;
  margin-bottom: 8px;
}

.cloud-hero-status-pill.offline {
  background: #fff4dc;
  border-color: #f6db9b;
  color: #8f5300;
}

.cloud-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #157347;
  display: inline-block;
  animation: pulse-dot 2s infinite ease-in-out;
}

.cloud-hero-status-pill.offline .cloud-status-dot {
  background: #d97706;
  animation: none;
}

@keyframes pulse-dot {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.cloud-hero-title {
  margin: 0 0 4px;
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -0.4px;
  color: var(--ink);
}

.cloud-hero-sub {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.cloud-hero-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.btn-cloud-account {
  font-weight: 600;
}

/* 4-Stat Telemetry Strip */
.cloud-telemetry-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 18px;
  box-sizing: border-box;
}

.cloud-telemetry-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.telemetry-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.telemetry-value {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.telemetry-sub {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* KPI Cards Grid */
.cloud-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
  box-sizing: border-box;
  margin-top: 0;
  margin-bottom: 0;
}

.cloud-kpi-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cloud-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.kpi-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 19px;
  flex-shrink: 0;
}

.kpi-icon-wrap.tx-icon {
  background: #eaf6ef;
}

.kpi-icon-wrap.adv-icon {
  background: #f4ecfb;
}

.kpi-icon-wrap.staff-icon {
  background: #edf4fe;
}

.kpi-icon-wrap.days-icon {
  background: #fff5e5;
}

.kpi-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.kpi-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px;
  flex-wrap: wrap;
}

.kpi-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.35px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.25;
  flex: 1 1 auto;
  min-width: 80px;
}

.kpi-stat {
  font-size: 18px;
  font-weight: 750;
  color: var(--ink);
  margin-top: 4px;
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Badge Status Styles */
.badge-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
  flex-shrink: 0;
  align-self: flex-start;
}

.badge-status.ok {
  background: #eaf6ef;
  color: #12633d;
  border: 1px solid #c2e5d0;
}

.badge-status.warn {
  background: #fff4dc;
  color: #8f5300;
  border: 1px solid #f6db9b;
}

.badge-status.offline {
  background: #f0f2ef;
  color: #5a665d;
  border: 1px solid #d4ded3;
}

/* Master Operations Panel */
.master-ops-panel {
  margin-top: 0;
}

.master-ops-btns {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* Domain Synchronization Matrix Table */
.domain-matrix-panel {
  margin-top: 0;
}

.domain-table {
  width: 100%;
  border-collapse: collapse;
}

.domain-table th {
  background: #fafbfa;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}

.domain-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.domain-table tr:last-child td {
  border-bottom: none;
}

.domain-name-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.domain-icon {
  font-size: 20px;
  line-height: 1;
}

.domain-desc {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

.domain-table code {
  font-size: 11.5px;
  padding: 2px 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* 3-Tier Resilience Section */
.resilience-panel {
  margin-top: 0;
}

.resilience-tiers-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

.tier-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
}

.tier-badge {
  display: inline-block;
  align-self: flex-start;
  padding: 2px 8px;
  border-radius: 4px;
  background: #e2ebe1;
  color: #3b503f;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.tier-badge.active {
  background: #d7f1e1;
  color: #12633d;
  border: 1px solid #b7e7c8;
}

.tier-card h4 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 750;
  color: var(--ink);
}

.tier-card p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.backup-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 6px;
}

.backup-btns {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.btn-restore {
  border: 1px solid var(--line);
  background: #fff;
}

.backup-tip {
  font-size: 12px;
  color: var(--muted);
}

/* Danger Zone */
.danger-zone-panel {
  margin-top: 0;
  border: 1px solid #f8c2be;
  background: #fff9f9;
  border-radius: 12px;
  padding: 18px 20px;
}

.danger-zone-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.danger-zone-icon {
  font-size: 32px;
  line-height: 1;
  flex-shrink: 0;
}

.danger-zone-text {
  flex: 1;
}

.danger-zone-text h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 750;
  color: #b42318;
}

.danger-zone-text p {
  margin: 0;
  font-size: 12.5px;
  color: #7a271a;
  line-height: 1.45;
}

.btn-danger-reset {
  background: #b42318;
  color: #ffffff;
  border: 1px solid #911c13;
  font-weight: 700;
  padding: 9px 16px;
  border-radius: 8px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s ease;
}

.btn-danger-reset:hover {
  background: #911c13;
}

/* Responsive Rules for Cloud & Data Resilience */
@media (max-width: 1400px) {
  .cloud-telemetry-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cloud-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1080px) {
  .resilience-tiers-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .cloud-hero-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .cloud-hero-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .cloud-telemetry-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .cloud-kpi-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .danger-zone-content {
    flex-direction: column;
    align-items: flex-start;
  }
  .btn-danger-reset {
    width: 100%;
  }
  .master-ops-btns {
    width: 100%;
  }
  .master-ops-btns button {
    width: 100%;
  }

  /* Mobile Ergonomics & Tap Targets (WCAG 2.5.5 / 2.5.8 Target Size) */
  button.btn,
  .quick-action,
  .nav-btn,
  .chip,
  .tx-tab-btn,
  .login-tab-btn,
  .modal-close-btn {
    min-height: 44px;
    min-width: 44px;
  }

  .preset-chips-mini .chip-mini {
    min-height: 38px;
    padding: 6px 10px;
    font-size: 12px;
  }

  input, select, textarea {
    min-height: 44px;
    font-size: 16px; /* Prevents iOS auto-zoom on form inputs */
  }
}

/* ==========================================================================
   Saved Button State & Toast Notification System
   ========================================================================== */

/* Workstation Terminal Presets */
.terminal-presets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.terminal-presets .chip-mini {
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 550;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.terminal-presets .chip-mini:hover {
  background: #e2ebe1;
  border-color: #a9caa5;
  color: #12633d;
  transform: translateY(-1px);
}

.terminal-presets .chip-mini:active {
  transform: scale(0.97);
}

.btn-saved {
  background: #157347 !important;
  border-color: #12633d !important;
  color: #ffffff !important;
  transition: all 0.2s ease;
}

.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 8px;
  background: #111827;
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  opacity: 0;
  transform: translateY(-12px) scale(0.97);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: auto;
  max-width: 420px;
}

.toast-item.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast-item.toast-ok {
  background: #0f5132;
  border-left: 4px solid #20c997;
  color: #ffffff;
}

.toast-item.toast-error {
  background: #842029;
  border-left: 4px solid #ea868f;
  color: #ffffff;
}

.toast-item.toast-info {
  background: #055160;
  border-left: 4px solid #6edff6;
  color: #ffffff;
}

.toast-icon {
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}

.toast-text {
  flex: 1;
  line-height: 1.4;
}
