/* System settings & 2FA verify */
.settings-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.25rem;
  align-items: start;
}

.settings-nav {
  padding: 1rem;
  position: sticky;
  top: 1rem;
}

.settings-nav-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9a8b70;
  margin-bottom: 0.75rem;
  font-weight: 700;
}

.settings-nav-btn {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  font-size: 0.86rem;
  color: #5c4f3a;
  margin-bottom: 0.15rem;
  transition: background 0.15s;
}

.settings-nav-btn:hover { background: var(--gold-muted); }
.settings-nav-btn.active {
  background: var(--gold);
  color: #1a1408;
  font-weight: 600;
}

.settings-panel { display: none; padding: 1.5rem; }
.settings-panel.active { display: block; }

.settings-panel-head {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f0ebe0;
}

.settings-panel-head h5 {
  color: var(--gold-dark);
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.settings-panel-head p {
  color: #8a7350;
  font-size: 0.88rem;
  margin: 0;
}

.settings-toggle-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.15rem;
  background: #faf8f3;
  border: 1px solid var(--gold-border);
  border-radius: 12px;
}

.currency-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}

.currency-option input { position: absolute; opacity: 0; pointer-events: none; }

.currency-option-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.25rem 1rem;
  border: 2px solid var(--gold-border);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  transition: all 0.15s;
}

.currency-option-card strong { font-size: 1.1rem; color: var(--gold-dark); }
.currency-option-card small { color: #9a8b70; }

.currency-option input:checked + .currency-option-card {
  border-color: var(--gold);
  background: var(--gold-muted);
  box-shadow: 0 4px 16px rgba(201, 162, 39, 0.2);
}

.totp-setup-card {
  padding: 1rem;
  background: #faf8f3;
  border: 1px dashed var(--gold-border);
  border-radius: 12px;
}

.totp-qr {
  border-radius: 10px;
  border: 1px solid var(--gold-border);
  background: #fff;
  padding: 0.5rem;
}

.totp-secret-display {
  display: inline-block;
  padding: 0.35rem 0.6rem;
  background: #fff;
  border: 1px solid var(--gold-border);
  border-radius: 6px;
  font-size: 0.78rem;
  word-break: break-all;
}

.cash-currency-toggle {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.cash-currency-btn {
  border: 1px solid var(--gold-border);
  background: #fff;
  color: #5c4f3a;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
}

.cash-currency-btn.active {
  background: var(--gold);
  border-color: var(--gold-dark);
  color: #1a1408;
}

.dashboard-hero-cash-values {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.dashboard-hero-cash-kes {
  font-size: 1.1rem;
  opacity: 0.85;
}

.login-main-centered { flex: 1; width: 100%; }
.login-shell-verify { min-height: 100vh; display: flex; }

.verify-card { max-width: 420px; margin: 0 auto; }

.verify-icon-wrap {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: rgba(201, 162, 39, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: var(--gold-dark);
}

.verify-method-tabs {
  display: flex;
  gap: 0.5rem;
}

.verify-tab {
  flex: 1;
  border: 1px solid var(--gold-border);
  background: #fff;
  border-radius: 10px;
  padding: 0.55rem 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #5c4f3a;
  text-decoration: none;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.verify-tab:hover {
  color: var(--gold-dark);
  border-color: var(--gold);
}

.verify-tab.active {
  background: var(--gold-muted);
  border-color: var(--gold);
  color: var(--gold-dark);
}

.verify-code-input {
  letter-spacing: 0.35em;
  font-weight: 700;
}

.verify-card-advanced { max-width: 460px; }
.verify-form-wrap { max-width: 480px; }
.verify-icon-wrap-lg { width: 72px; height: 72px; font-size: 2rem; }
.verify-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.75rem;
  padding: 0.35rem 0.75rem;
  background: var(--gold-muted);
  border-radius: 999px;
  font-size: 0.82rem;
  color: var(--gold-dark);
}
.verify-step-hint {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: #6b5c45;
  margin-bottom: 0.75rem;
}
.verify-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gold);
  color: #1a1408;
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.verify-footer-links {
  display: flex;
  justify-content: space-between;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid #f0ebe0;
  font-size: 0.78rem;
}
.verify-footer-links a { color: #8a7350; text-decoration: none; }
.verify-footer-links a:hover { color: var(--gold-dark); }

.setup-method-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}
.setup-method-card input { position: absolute; opacity: 0; pointer-events: none; }
.setup-method-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1rem 0.75rem;
  border: 2px solid var(--gold-border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s;
  height: 100%;
}
.setup-method-inner i { font-size: 1.5rem; color: var(--gold); margin-bottom: 0.35rem; }
.setup-method-inner strong { font-size: 0.85rem; }
.setup-method-inner small { color: #9a8b70; font-size: 0.72rem; }
.setup-method-card input:checked + .setup-method-inner {
  border-color: var(--gold);
  background: var(--gold-muted);
  box-shadow: 0 4px 12px rgba(201, 162, 39, 0.2);
}

.twofa-status-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.twofa-status-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--gold-border);
  border-radius: 12px;
  background: #faf8f3;
}
.twofa-status-card.active { border-color: #2d6a4f; background: rgba(45, 106, 79, 0.08); }
.twofa-status-card i { font-size: 1.75rem; color: var(--gold); }
.twofa-status-card.active i { color: #2d6a4f; }
.twofa-status-card small { display: block; color: #8a7350; }

.settings-subsection {
  padding-top: 1rem;
  border-top: 1px dashed var(--gold-border);
}
.settings-subsection h6 { color: var(--gold-dark); margin-bottom: 0.75rem; }

.main-content.users-page,
.main-content.entity-crud-page {
  padding-bottom: 2rem;
}

/* Shop profile logo upload */
.shop-logo-upload {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem;
  background: #faf8f3;
  border: 1px dashed var(--gold-border);
  border-radius: 12px;
}

.shop-logo-preview {
  flex: 0 0 120px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1c1914 0%, #14120e 100%);
  border-radius: 10px;
  padding: 0.5rem;
}

.shop-logo-preview-img {
  max-width: 100%;
  max-height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.shop-logo-preview-empty {
  color: rgba(255, 255, 255, 0.35);
  font-size: 1.75rem;
}

.shop-logo-fields {
  flex: 1 1 200px;
  min-width: 0;
}

/* CRUD datatable pages */
.crud-page {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: clip;
}

.crud-page .crud-panel {
  padding: 1.25rem;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

.main-content.crud-page {
  padding-left: 1.25rem;
  padding-right: 1.25rem;
  width: calc(100vw - 272px);
  max-width: calc(100vw - 272px);
  overflow-x: hidden;
  box-sizing: border-box;
}

.crud-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f0ebe0;
}

.crud-toolbar-title {
  min-width: 0;
}

.crud-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  min-width: 0;
}

.crud-search-wrap {
  position: relative;
  min-width: 0;
  flex: 1 1 180px;
  max-width: 280px;
}

.crud-toolbar-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold-dark);
}

.crud-table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  margin: 0;
  padding: 0;
  border: 1px solid #f0ebe0;
  border-radius: 12px;
  background: linear-gradient(180deg, #fff 0%, #fdfbf7 100%);
}

.crud-table-wrap::after {
  content: '';
  display: block;
  height: 0;
}

.crud-search-wrap i {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9a8b70;
  pointer-events: none;
}

.crud-search {
  padding-left: 2.25rem;
  border-radius: 8px;
  border: 1px solid var(--gold-border);
  font-size: 0.88rem;
}

.crud-search:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 0.2rem rgba(201, 162, 39, 0.15);
}

.crud-count {
  font-size: 0.75rem;
  color: #8a7350;
  white-space: nowrap;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: #faf8f3;
  border: 1px solid var(--gold-border);
  font-weight: 600;
}

.crud-count.is-filtered {
  background: rgba(201, 162, 39, 0.14);
  color: var(--gold-dark);
  border-color: rgba(201, 162, 39, 0.35);
}

.crud-search-wrap.has-value .crud-search {
  padding-right: 2.25rem;
}

.crud-search-clear {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: #9a8b70;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.crud-search-clear:hover {
  background: var(--gold-muted);
  color: var(--gold-dark);
}

.table-crud thead th {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #9a8b70;
  font-weight: 700;
  border-bottom-width: 1px;
  white-space: normal;
  word-break: break-word;
  line-height: 1.25;
  background: #faf8f3;
  padding: 0.65rem 0.45rem;
  vertical-align: middle;
}

.table-crud thead th:first-child {
  border-top-left-radius: 11px;
}

.table-crud thead th:last-child {
  border-top-right-radius: 11px;
}

.table-crud tbody td {
  vertical-align: middle;
  font-size: 0.82rem;
  border-color: #f5f0e6;
  padding: 0.65rem 0.45rem;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.35;
  color: #2c2416;
}

.table-crud tbody td .crud-truncate {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  max-width: none;
}

.table-crud {
  width: 100%;
  margin-bottom: 0;
  table-layout: fixed;
}

.table-crud-users th:nth-child(1),
.table-crud-users td:nth-child(1) { width: 24%; }
.table-crud-users th:nth-child(2),
.table-crud-users td:nth-child(2) { width: 10%; }
.table-crud-users th:nth-child(3),
.table-crud-users td:nth-child(3) { width: 12%; }
.table-crud-users th:nth-child(4),
.table-crud-users td:nth-child(4) { width: 18%; }
.table-crud-users th:nth-child(5),
.table-crud-users td:nth-child(5) { width: 12%; }
.table-crud-users th:nth-child(6),
.table-crud-users td:nth-child(6) { width: 24%; }

.crud-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.22rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crud-pill-2fa.bg-secondary { background: #ece8e0 !important; color: #6b5c45 !important; }
.crud-pill-2fa.bg-info { background: #dbeafe !important; color: #1e4f7a !important; }
.crud-pill-2fa.bg-primary { background: #dbeafe !important; color: #1e4f7a !important; }
.crud-pill-2fa.bg-success { background: #d8f3e4 !important; color: #2d6a4f !important; }
.crud-pill-2fa.bg-warning { background: #fff3cd !important; color: #856404 !important; }

@media (min-width: 1200px) {
  .table-crud .crud-actions .action-label {
    display: none;
  }

  .table-crud .crud-actions .btn {
    padding: 0.28rem 0.42rem;
  }
}

.table-crud-branches th:nth-child(1),
.table-crud-branches td:nth-child(1) { width: 22%; }
.table-crud-branches th:nth-child(2),
.table-crud-branches td:nth-child(2) { width: 10%; }
.table-crud-branches th:nth-child(3),
.table-crud-branches td:nth-child(3) { width: 14%; }
.table-crud-branches th:nth-child(4),
.table-crud-branches td:nth-child(4) { width: 28%; }
.table-crud-branches th:nth-child(5),
.table-crud-branches td:nth-child(5) { width: 10%; }
.table-crud-branches th:nth-child(6),
.table-crud-branches td:nth-child(6) { width: 16%; }

.table-crud-customers th:nth-child(1),
.table-crud-customers td:nth-child(1) { width: 28%; }
.table-crud-customers th:nth-child(2),
.table-crud-customers td:nth-child(2) { width: 18%; }
.table-crud-customers th:nth-child(3),
.table-crud-customers td:nth-child(3) { width: 34%; }
.table-crud-customers th:nth-child(4),
.table-crud-customers td:nth-child(4) { width: 20%; }

.crud-truncate {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.crud-cell-primary {
  gap: 0.5rem;
}

.crud-avatar {
  flex: 0 0 1.9rem;
  width: 1.9rem;
  height: 1.9rem;
  font-size: 0.68rem;
  border-radius: 8px;
}

.crud-cell-text strong,
.crud-cell-text small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.table-crud tbody tr[data-crud-row] {
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
  cursor: pointer;
}

.table-crud tbody tr[data-crud-row]:hover {
  background: rgba(201, 162, 39, 0.06);
}

.table-crud tbody tr[data-crud-row]:focus-visible {
  outline: 2px solid rgba(201, 162, 39, 0.45);
  outline-offset: -2px;
}

.table-crud tbody tr[data-crud-row].crud-row-match {
  background: rgba(201, 162, 39, 0.08);
}

.table-crud tbody tr[data-crud-row]:nth-child(even) {
  background: rgba(248, 246, 241, 0.65);
}

.table-crud tbody tr[data-crud-row]:nth-child(even):hover,
.table-crud tbody tr[data-crud-row].crud-row-match:nth-child(even) {
  background: rgba(201, 162, 39, 0.09);
}

.crud-cell-primary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.crud-avatar {
  flex: 0 0 2.25rem;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--gold-dark);
  background: linear-gradient(135deg, rgba(201, 162, 39, 0.22) 0%, rgba(201, 162, 39, 0.08) 100%);
  border: 1px solid rgba(201, 162, 39, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.crud-avatar-branch {
  background: linear-gradient(135deg, rgba(45, 106, 79, 0.16) 0%, rgba(45, 106, 79, 0.06) 100%);
  border-color: rgba(45, 106, 79, 0.22);
  color: #2d6a4f;
}

.crud-avatar-customer {
  background: linear-gradient(135deg, rgba(91, 110, 140, 0.16) 0%, rgba(91, 110, 140, 0.06) 100%);
  border-color: rgba(91, 110, 140, 0.22);
  color: #4a5d78;
}

.crud-cell-text {
  min-width: 0;
}

.crud-cell-text strong {
  display: block;
  color: #2c2416;
}

.crud-cell-text small {
  display: block;
  font-size: 0.76rem;
  color: #9a8b70;
  margin-top: 0.1rem;
}

.crud-code {
  display: inline-block;
  padding: 0.18rem 0.45rem;
  border-radius: 6px;
  background: #f5f0e6;
  border: 1px solid #ebe4d6;
  font-size: 0.8rem;
  color: #6b5c45;
}

.crud-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1;
}

.crud-status::before {
  content: '';
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}

.crud-status-active {
  color: #2d6a4f;
  background: rgba(45, 106, 79, 0.12);
}

.crud-status-inactive {
  color: #7a7060;
  background: rgba(122, 112, 96, 0.12);
}

.crud-role-badge,
.crud-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  background: #f0ebe0;
  color: #6b5c45;
}

.crud-role-admin {
  background: rgba(201, 162, 39, 0.18);
  color: var(--gold-dark);
}

.crud-empty-state,
.crud-zero-state {
  text-align: center;
  padding: 2.5rem 1.25rem;
}

.crud-empty-state {
  border: 1px dashed var(--gold-border);
  border-radius: 12px;
  background: #faf8f3;
  margin-top: 0.5rem;
}

.crud-empty-icon,
.crud-zero-icon {
  width: 3.25rem;
  height: 3.25rem;
  margin: 0 auto 0.85rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  color: var(--gold-dark);
  background: rgba(201, 162, 39, 0.14);
}

.crud-empty-state strong,
.crud-zero-state strong {
  display: block;
  color: var(--gold-dark);
  margin-bottom: 0.35rem;
}

.crud-empty-state p,
.crud-zero-state p {
  color: #9a8b70;
  font-size: 0.88rem;
  margin-bottom: 1rem;
}

.table-crud .crud-actions,
.table-crud .crud-actions-col {
  white-space: nowrap;
}

.table-crud .crud-actions-col {
  width: 1%;
  position: static;
  box-shadow: none;
  background: transparent;
}

.table-crud tbody tr:hover .crud-actions-col {
  background: transparent;
}

.crud-actions .btn {
  padding: 0.3rem 0.55rem;
  border-radius: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.crud-actions .btn:hover {
  transform: translateY(-1px);
}

.crud-actions .btn-outline-gold:hover {
  box-shadow: 0 3px 10px rgba(201, 162, 39, 0.22);
}

.crud-actions .dropdown-menu {
  font-size: 0.85rem;
  min-width: 11rem;
  border: 1px solid var(--gold-border);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(44, 36, 22, 0.12);
  padding: 0.35rem;
}

.crud-actions .dropdown-item {
  border-radius: 7px;
  padding: 0.45rem 0.65rem;
}

.crud-actions .dropdown-item:hover {
  background: var(--gold-muted);
}

.crud-modal .modal-content {
  border: 1px solid var(--gold-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(44, 36, 22, 0.18);
}

.crud-modal .modal-header {
  background: linear-gradient(135deg, #faf8f3 0%, #f5f0e6 100%);
  border-bottom: 1px solid var(--gold-border);
  padding: 1.1rem 1.25rem;
}

.crud-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
}

.crud-modal-head-main {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.crud-modal-icon {
  flex: 0 0 2.75rem;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: var(--gold-dark);
  background: linear-gradient(135deg, rgba(201, 162, 39, 0.24) 0%, rgba(201, 162, 39, 0.08) 100%);
  border: 1px solid rgba(201, 162, 39, 0.28);
  box-shadow: 0 4px 14px rgba(201, 162, 39, 0.14);
}

.crud-modal-edit .crud-modal-icon {
  background: linear-gradient(135deg, rgba(91, 110, 140, 0.18) 0%, rgba(91, 110, 140, 0.06) 100%);
  border-color: rgba(91, 110, 140, 0.22);
  color: #4a5d78;
  box-shadow: 0 4px 14px rgba(91, 110, 140, 0.12);
}

.crud-modal .modal-title {
  color: var(--gold-dark);
  font-weight: 700;
  font-size: 1.05rem;
}

.crud-modal-subtitle {
  font-size: 0.82rem;
  color: #8a7350;
  margin-top: 0.15rem;
}

.crud-modal-preview {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  margin-bottom: 1.15rem;
  border-radius: 12px;
  background: linear-gradient(135deg, #fff 0%, #faf8f3 100%);
  border: 1px solid var(--gold-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.crud-preview-avatar {
  flex: 0 0 2.85rem;
  width: 2.85rem;
  height: 2.85rem;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gold-dark);
  background: linear-gradient(135deg, rgba(201, 162, 39, 0.22) 0%, rgba(201, 162, 39, 0.08) 100%);
  border: 1px solid rgba(201, 162, 39, 0.28);
}

.crud-modal-edit .crud-preview-avatar {
  background: linear-gradient(135deg, rgba(91, 110, 140, 0.16) 0%, rgba(91, 110, 140, 0.06) 100%);
  border-color: rgba(91, 110, 140, 0.22);
  color: #4a5d78;
}

.crud-preview-body {
  min-width: 0;
}

.crud-preview-body strong {
  display: block;
  color: #2c2416;
  font-size: 0.98rem;
}

.crud-preview-body span {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.8rem;
  color: #8a7350;
}

.crud-form-section {
  padding: 1rem;
  border: 1px solid #f0ebe0;
  border-radius: 12px;
  background: #fff;
  margin-bottom: 1rem;
}

.crud-form-section:last-child {
  margin-bottom: 0;
}

.crud-form-section-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9a8b70;
  margin-bottom: 0.85rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px dashed #f0ebe0;
}

.crud-field-icon {
  position: relative;
}

.crud-field-icon > i {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: #b8a88a;
  pointer-events: none;
  z-index: 2;
}

.crud-field-icon .form-control,
.crud-field-icon .form-select {
  padding-left: 2.35rem;
}

.crud-modal .modal-footer {
  border-top: 1px solid #f0ebe0;
  background: #faf8f3;
  padding: 0.85rem 1.25rem;
}

.crud-modal .modal-dialog {
  margin: 0.75rem auto;
}

@media (max-width: 575px) {
  .crud-modal .modal-body {
    padding: 1rem;
  }

  .crud-modal .modal-header {
    padding: 0.9rem 1rem;
  }

  .crud-modal-head {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .crud-modal-head .btn-close {
    align-self: flex-end;
    margin: -0.25rem -0.25rem 0 0;
  }

  .crud-modal-head-main {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }

  .crud-modal-preview {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0.85rem 0.75rem;
  }

  .crud-preview-body strong,
  .crud-preview-body span {
    word-break: break-word;
  }

  .crud-modal .modal-footer {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .crud-modal .modal-footer .btn {
    flex: 1 1 calc(50% - 0.25rem);
  }

  .crud-form-section {
    padding: 0.85rem;
  }

  .cash-currency-toggle {
    flex-wrap: wrap;
    justify-content: stretch;
    gap: 0.4rem;
  }

  .cash-currency-btn {
    flex: 1 1 calc(33.333% - 0.35rem);
    min-width: 0;
    padding: 0.4rem 0.35rem;
    font-size: 0.72rem;
    text-align: center;
  }
}

.branch-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem;
}

.branch-check-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--gold-border);
  border-radius: 10px;
  font-size: 0.82rem;
  cursor: pointer;
  margin: 0;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.branch-check-item:hover {
  background: rgba(201, 162, 39, 0.06);
  transform: translateY(-1px);
}

.branch-check-item:has(input:checked) {
  background: var(--gold-muted);
  border-color: var(--gold);
  box-shadow: 0 4px 12px rgba(201, 162, 39, 0.12);
}

@media (max-width: 991px) {
  .main-content.crud-page {
    padding: 1rem 1rem 1.5rem;
    width: 100%;
    max-width: 100%;
  }

  .crud-page .top-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .crud-page .top-bar-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 1199px) {
  .main-content.crud-page {
    width: 100%;
    max-width: 100%;
  }

  .crud-toolbar {
    grid-template-columns: 1fr;
  }

  .crud-toolbar-actions {
    width: 100%;
    justify-content: stretch;
  }

  .crud-search-wrap {
    flex: 1 1 100%;
    max-width: none;
  }

  .crud-table-wrap {
    overflow-x: visible;
    border: none;
    background: transparent;
  }

  .table-crud {
    table-layout: auto;
  }

  .table-crud-users th,
  .table-crud-users td,
  .table-crud-branches th,
  .table-crud-branches td,
  .table-crud-customers th,
  .table-crud-customers td {
    width: auto !important;
  }

  .table-crud thead {
    display: none;
  }

  .table-crud tbody tr[data-crud-row] {
    display: block;
    margin-bottom: 0.85rem;
    padding: 0.95rem 1rem 0.85rem;
    border: 1px solid var(--gold-border);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 4px 16px rgba(139, 105, 20, 0.08);
    cursor: pointer;
  }

  .table-crud tbody tr[data-crud-row]:active {
    transform: scale(0.995);
  }

  .table-crud tbody tr[data-crud-row]:hover {
    background: #fff;
  }

  .table-crud tbody tr[data-crud-row][style*='display: none'] {
    display: none !important;
  }

  .table-crud tbody td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.45rem 0;
    border: none;
    font-size: 0.84rem;
    text-align: right;
  }

  .table-crud tbody td::before {
    content: attr(data-label);
    flex: 0 0 38%;
    max-width: 42%;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #9a8b70;
    padding-top: 0.1rem;
    text-align: left;
  }

  .table-crud tbody td > * {
    max-width: 58%;
  }

  .table-crud tbody td .crud-status {
    margin-left: auto;
    flex-shrink: 0;
  }

  .table-crud tbody td .crud-cell-primary {
    margin-left: auto;
    max-width: 58%;
    justify-content: flex-end;
  }

  .table-crud tbody td.crud-actions-col {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.35rem;
    margin-top: 0.35rem;
    padding-top: 0.65rem;
    border-top: 1px dashed #f0ebe0;
    position: static;
    box-shadow: none;
    background: transparent !important;
  }

  .table-crud tbody td.crud-actions-col::before {
    flex: 1 1 100%;
    max-width: none;
    margin-bottom: 0.15rem;
  }

  .table-crud .crud-actions .btn span.action-label {
    display: inline;
  }
}

@media (max-width: 767px) {
  .crud-toolbar-title {
    font-size: 1rem;
  }

  .crud-toolbar-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      'search search'
      'count add';
    align-items: center;
  }

  .crud-search-wrap {
    grid-area: search;
  }

  .crud-count {
    grid-area: count;
    justify-self: start;
  }

  .crud-toolbar-actions .btn-gold {
    grid-area: add;
    justify-self: end;
  }
}

@media (max-width: 575px) {
  .main-content.crud-page {
    padding: 0.75rem 0.65rem 1.25rem;
  }

  .crud-page .crud-panel {
    padding: 0.85rem 0.75rem;
  }

  .crud-toolbar-actions {
    grid-template-columns: 1fr;
    grid-template-areas:
      'search'
      'add'
      'count';
  }

  .crud-toolbar-actions .btn-gold {
    justify-self: stretch;
    width: 100%;
  }

  .crud-count {
    justify-self: start;
  }

  .crud-search {
    font-size: 16px;
  }

  .branch-check-grid {
    grid-template-columns: 1fr;
  }
}

/* Legacy entity cards - hidden when using datatable layout */
.crud-page .entity-crud-grid {
  display: block;
}

@media (max-width: 991px) {
  .main-content.settings-page {
    padding: 1rem 1rem 1.25rem;
    width: 100%;
    max-width: 100%;
  }

  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav {
    position: static;
    display: flex;
    flex-wrap: nowrap;
    gap: 0.35rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
    scrollbar-width: thin;
  }
  .settings-nav-btn {
    width: auto;
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
  }
  .settings-panel { padding: 1rem; }
  .settings-toggle-card {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 991px) {
  .shareholder-modal .shareholder-modal-dialog {
    width: 100%;
    max-width: 100%;
    margin: 0;
  }

  .verify-page {
    padding: 1rem 0.75rem;
  }

  .verify-card,
  .verify-card-advanced,
  .verify-form-wrap {
    max-width: 100%;
  }
}

@media (max-width: 575px) {
  .shop-logo-upload {
    flex-direction: column;
  }
  .shop-logo-preview {
    width: 100%;
    flex-basis: auto;
  }

  .shareholders-search-wrap {
    min-width: 0;
    max-width: none;
    width: 100%;
  }

  .shareholders-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Shareholders (system settings) */
.shareholders-summary .share-summary-card {
  padding: 0.85rem 1rem;
  background: #faf8f3;
  border: 1px solid var(--gold-border);
  border-radius: 10px;
  height: 100%;
}

.share-summary-label {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #8a7350;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.share-summary-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gold-dark);
}

.share-summary-hint {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.72rem;
  color: #9a8b70;
}

.shareholder-branch-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.84rem;
  color: #5c4f3a;
}

.shareholder-branch-badge i {
  color: var(--gold);
}

.share-summary-card.share-summary-ok .share-summary-value {
  color: #2d6a4f;
}

.share-summary-card.share-summary-warn .share-summary-value {
  color: #b45309;
}

.shareholders-search-wrap {
  min-width: 200px;
  flex: 1;
  max-width: 280px;
}

.shareholder-name-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.share-pct-cell {
  min-width: 4.5rem;
}

.share-pct-cell strong {
  display: block;
  font-size: 0.88rem;
  color: var(--gold-dark);
}

.share-pct-bar {
  height: 4px;
  border-radius: 999px;
  background: #f0ebe0;
  margin-top: 0.25rem;
  overflow: hidden;
}

.share-pct-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--gold-dark));
}

.shareholders-table tbody tr[hidden] {
  display: none;
}

/* Shareholder add/edit modal — compact, fits content */
.shareholder-modal .shareholder-modal-dialog {
  width: fit-content;
  max-width: min(32rem, calc(100vw - 1.5rem));
  margin: 1rem auto;
}

.shareholder-modal .modal-content {
  width: 100%;
}

.shareholder-modal .modal-header,
.shareholder-modal .modal-body,
.shareholder-modal .modal-footer {
  padding-left: 1.15rem;
  padding-right: 1.15rem;
}

.shareholder-modal .modal-body {
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.shareholder-modal .modal-title {
  font-size: 1rem;
  line-height: 1.35;
}

.shareholder-modal .form-label {
  font-size: 0.82rem;
  margin-bottom: 0.25rem;
}

.shareholder-modal .form-text {
  font-size: 0.75rem;
  line-height: 1.4;
  max-width: 28rem;
}

.shareholder-modal .form-control,
.shareholder-modal .form-select {
  font-size: 0.88rem;
}

.shareholder-modal .modal-footer {
  padding-top: 0.65rem;
  padding-bottom: 0.75rem;
  gap: 0.5rem;
}

@media (max-width: 575px) {
  .shareholder-modal .shareholder-modal-dialog {
    width: calc(100vw - 1rem);
    max-width: none;
  }

  .shareholder-modal .form-text {
    max-width: none;
  }
}
