/* ==========================================================================
   KARDBASE POS - VIEWS & DASHBOARD STYLES (Admin & Sales Rep)
   Matching Figma Design Tokens (Geist font, minimalistic monochromatic accents)
   ========================================================================== */

/* VIEW CONTAINER */
.view-panel {
  display: none;
  flex: 1;
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
  background: #fafafa;
  padding: 24px 32px 48px;
  box-sizing: border-box;
}
.view-panel.active {
  display: block;
}

.startup-recovery {
  min-height: 100vh;
  padding: 24px;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  background: #0d0c0d;
  color: #ffffff;
  text-align: center;
}
.startup-recovery > div { max-width: 320px; }
.startup-recovery strong { display: block; font-size: 20px; }
.startup-recovery p { margin: 10px 0 20px; color: #d4d4d8; line-height: 1.5; }
.startup-recovery button {
  border: 0;
  border-radius: 7px;
  padding: 12px 18px;
  background: #ffffff;
  color: #0d0c0d;
  font: inherit;
  font-weight: 700;
}

.sale-receipt-overlay { padding: 0; background: rgba(17, 24, 39, 0.54); backdrop-filter: blur(4px); }
.sale-receipt-sheet { position: relative; width: min(100%, 520px); min-height: min(100dvh, 760px); display: flex; flex-direction: column; background: #ffffff; color: #172424; overflow: auto; }
.sale-receipt-close { position: absolute; top: 24px; right: 24px; width: 34px; height: 34px; display: grid; place-items: center; border: 0; background: transparent; color: #172424; }
.sale-receipt-close svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.sale-receipt-hero { padding: 48px 32px 38px; text-align: center; border-bottom: 1px solid #e5e7eb; }
.sale-receipt-check { width: 84px; height: 84px; display: grid; place-items: center; margin: 0 auto 20px; border-radius: 50%; background: #2f7528; color: #ffffff; }
.sale-receipt-check svg { width: 48px; height: 48px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.sale-receipt-kicker, .sale-receipt-section-label { margin: 0; color: #263031; font-size: 14px; font-weight: 800; letter-spacing: 0; text-transform: uppercase; }
.sale-receipt-amount { display: block; margin: 14px 0 8px; font-size: 42px; line-height: 1; font-variant-numeric: tabular-nums; }
.sale-receipt-meta { margin: 0; color: #4b5563; font-size: 17px; }
.sale-receipt-details { display: flex; flex: 1; flex-direction: column; gap: 28px; padding: 28px 32px; }
.sale-receipt-customer { display: grid; gap: 14px; }
.sale-receipt-customer span, .sale-receipt-totals span { color: #263031; font-size: 14px; font-weight: 800; letter-spacing: 0; text-transform: uppercase; }
.sale-receipt-customer strong { font-size: 20px; font-weight: 500; }
.sale-receipt-totals { display: grid; gap: 17px; }
.sale-receipt-totals > div { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; }
.sale-receipt-totals strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.sale-receipt-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.sale-receipt-action { min-height: 100px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 11px; border: 1px solid #d7dadd; border-radius: 12px; background: #ffffff; color: #172424; font: inherit; font-size: 14px; font-weight: 700; }
.sale-receipt-action svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sale-receipt-action.whatsapp { border-color: #3a7436; color: #34742d; background: #fbfdfb; }
.sale-receipt-footer { padding: 24px 32px 32px; border-top: 1px solid #e5e7eb; }
.sale-receipt-new-sale { width: 100%; min-height: 64px; border: 0; border-radius: 14px; background: #172b2b; color: #ffffff; font: inherit; font-size: 18px; font-weight: 800; }
.sale-receipt-action:active, .sale-receipt-new-sale:active { transform: scale(0.98); }

@media (min-width: 851px) {
  .sale-receipt-overlay { padding: 28px; }
  .sale-receipt-sheet { min-height: 0; max-height: 90vh; border-radius: 12px; box-shadow: 0 24px 60px rgba(0,0,0,0.24); }
}
@media (max-width: 390px) {
  .sale-receipt-hero { padding: 42px 24px 32px; }
  .sale-receipt-details { padding: 25px 24px; }
  .sale-receipt-footer { padding: 20px 24px 24px; }
  .sale-receipt-actions { gap: 8px; }
  .sale-receipt-action { min-height: 94px; font-size: 12px; }
}

/* TOPBAR */
.view-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eaeaea;
  margin-bottom: 24px;
}
.view-topbar-title h1 {
  margin: 0;
  font-family: var(--font-heading), 'Geist', sans-serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #0f0e0e;
}
.view-topbar-title p {
  margin: 4px 0 0;
  font-size: 12px;
  color: #71717a;
}

.view-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.search-input-wrap {
  position: relative;
  width: 260px;
}
.search-input-wrap input {
  width: 100%;
  height: 38px;
  background: #ffffff;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  padding: 0 12px 0 34px;
  font-size: 13px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.search-input-wrap input:focus {
  border-color: #000;
}
.search-input-wrap .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: #a1a1aa;
  pointer-events: none;
}

.btn-dark {
  height: 38px;
  background: #000000;
  color: #ffffff;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  font-family: var(--font-sans), 'Geist', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s;
  white-space: nowrap;
}
.btn-dark:hover {
  background: #27272a;
}

.btn-outline {
  height: 38px;
  background: #ffffff;
  color: #18181b;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  padding: 0 14px;
  font-family: var(--font-sans), 'Geist', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}
.btn-outline:hover {
  background: #f4f4f5;
  border-color: #d4d4d8;
}

/* STAT STRIP */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: #ffffff;
  border: 1px solid #eaeaea;
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
.stat-card-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #71717a;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.stat-card-val {
  font-family: var(--font-heading), 'Geist', sans-serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #09090b;
}
.stat-card-sub {
  font-size: 11px;
  color: #a1a1aa;
}

/* TABS */
.filter-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #eaeaea;
  margin-bottom: 20px;
  padding-bottom: 4px;
}
.filter-tab {
  border: 0;
  background: transparent;
  padding: 8px 14px;
  font-family: var(--font-sans), 'Geist', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #71717a;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.filter-tab:hover {
  color: #09090b;
  background: #f4f4f5;
}
.filter-tab.active {
  color: #000000;
  font-weight: 600;
  background: #e4e4e7;
}

/* DATA TABLE */
.data-table-card {
  background: #ffffff;
  border: 1px solid #eaeaea;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}
.data-table thead {
  background: #f9f9fb;
  border-bottom: 1px solid #eaeaea;
}
.data-table th {
  padding: 12px 18px;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #71717a;
}
.data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid #f4f4f5;
  color: #18181b;
  vertical-align: middle;
}
.data-table tbody tr:hover {
  background: #fafafa;
}
.data-table tbody tr.is-voided {
  opacity: 0.6;
  background: #fff5f5;
}

/* STATUS BADGES */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.status-pill.active,
.status-pill.completed {
  background: #ecfdf5;
  color: #059669;
}
.status-pill.low-stock,
.status-pill.pending {
  background: #fffbeb;
  color: #d97706;
}
.status-pill.out-of-stock,
.status-pill.voided {
  background: #fef2f2;
  color: #dc2626;
}

/* ROLE BADGE IN PROFILE */
.role-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
  margin-top: 2px;
}
.role-badge.admin {
  background: #18181b;
  color: #ffffff;
}
.role-badge.sales {
  background: #e0e7ff;
  color: #3730a3;
}

/* THUMBNAIL IN TABLE */
.product-cell-thumb {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  background: #f4f4f5;
  border: 1px solid #e4e4e7;
  flex-shrink: 0;
}

/* ANALYTICS CHARTS & RANKINGS */
.analytics-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-top: 20px;
}
.analytics-card {
  background: #ffffff;
  border: 1px solid #eaeaea;
  border-radius: 12px;
  padding: 22px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
.analytics-card h3 {
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 600;
  color: #18181b;
}

.bar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 13px;
}
.bar-track {
  flex: 1;
  height: 8px;
  background: #f4f4f5;
  border-radius: 999px;
  margin: 0 14px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: #000000;
  border-radius: 999px;
}

/* SETTINGS FORM */
.settings-section-card {
  background: #ffffff;
  border: 1px solid #eaeaea;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}
.settings-section-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
  color: #18181b;
}
.settings-section-card p {
  margin: 0 0 18px;
  font-size: 12px;
  color: #71717a;
}
.settings-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.settings-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.settings-field label {
  font-size: 12px;
  font-weight: 500;
  color: #3f3f46;
}
.settings-field input,
.settings-field select,
.settings-field textarea {
  height: 40px;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 13px;
  outline: none;
  background: #fff;
  box-sizing: border-box;
}
.settings-field textarea {
  height: 80px;
  padding: 8px 12px;
  resize: vertical;
}
.settings-field input:focus,
.settings-field select:focus,
.settings-field textarea:focus {
  border-color: #000;
}

/* INVOICE MODAL DETAILS */
.invoice-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: #f8fafc;
  padding: 14px;
  border-radius: 8px;
  font-size: 12px;
}
.invoice-detail-grid strong {
  display: block;
  font-size: 13px;
  color: #0f172a;
}
.invoice-detail-grid span {
  color: #64748b;
}

/* ==========================================================================
   FIGMA NODE 136-587: MODE SELECTION & ROLE STARTUP SCREEN
   ========================================================================== */
.mode-selection-screen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: #ffffff;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-family: var(--font-sans), 'Geist', sans-serif;
}

/* Ambient glow ellipses */
.ambient-glow {
  position: absolute;
  pointer-events: none;
  z-index: 1;
  opacity: 0.85;
}
.glow-top-right {
  top: -242px;
  right: -200px;
  width: 660px;
  height: 660px;
}
.glow-bottom-left {
  bottom: -240px;
  left: -200px;
  width: 660px;
  height: 660px;
}
.ambient-glow img {
  width: 100%;
  height: 100%;
  display: block;
}

.mode-selection-content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px;
  box-sizing: border-box;
}

.mode-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 42px;
}
.mode-brand-icon {
  width: 35px;
  height: 35px;
  object-fit: contain;
}
.mode-brand-text {
  font-size: 20px;
  color: #000000;
  letter-spacing: -0.3px;
}
.mode-brand-text .kard {
  font-weight: 400;
}
.mode-brand-text .base {
  font-weight: 700;
}

.mode-heading {
  font-family: var(--font-heading), 'Geist', sans-serif;
  font-size: 32px;
  font-weight: 600;
  line-height: 1.25;
  color: #000000;
  margin: 0 0 54px;
  letter-spacing: -0.6px;
}

.mode-cards-container {
  display: flex;
  gap: 29px;
  justify-content: center;
  align-items: center;
}

/* Individual Mode Selection Card */
.mode-card {
  width: 250px;
  height: 282px;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 24px;
  box-sizing: border-box;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
  user-select: none;
}
.mode-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(0,0,0,0.07);
}
.mode-card.admin-card:hover {
  border-color: #00a42c;
}
.mode-card.sales-card:hover {
  border-color: #9c007f;
}

.mode-card-icon-wrap {
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.mode-card-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}
.mode-card-title {
  margin: 0;
  font-family: var(--font-heading), 'Geist', sans-serif;
  font-size: 20px;
  font-weight: 500;
  color: #000000;
  letter-spacing: -0.3px;
}
.mode-card-desc {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
  color: #494949;
  font-weight: 400;
  max-width: 202px;
}

/* LOGOUT BUTTON IN SIDEBAR */
.btn-logout {
  width: 100%;
  height: 34px;
  background: #ffffff;
  border: 1px solid #dedede;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #4b5563;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  box-sizing: border-box;
}
.btn-logout:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}

/* Modals Overlay Global Elevation */
.modal-overlay {
  z-index: 100000 !important;
}

/* ==========================================================================
   CLIENT ONBOARDING SCREEN & SOFTWARE OVERVIEW
   ========================================================================== */
.onboarding-screen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: #ffffff;
  z-index: 100001;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  font-family: var(--font-sans), 'Geist', sans-serif;
  box-sizing: border-box;
}

.onboarding-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 540px;
  margin: auto;
  padding: 32px 24px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.onboard-step-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
  margin-bottom: 12px;
  align-self: center;
}

.onboard-title {
  font-family: var(--font-heading), 'Geist', sans-serif;
  font-size: 26px;
  font-weight: 700;
  color: #09090b;
  text-align: center;
  margin: 0 0 8px;
  letter-spacing: -0.4px;
}

.onboard-subtitle {
  font-size: 13px;
  color: #64748b;
  text-align: center;
  margin: 0 0 24px;
  line-height: 1.5;
}

.onboard-form-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.04), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.onboard-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.onboard-field label {
  font-size: 12px;
  font-weight: 600;
  color: #1e293b;
}

.onboard-input-wrap {
  position: relative;
  width: 100%;
}

.onboard-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  font-size: 14px;
  color: #0f172a;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  outline: none;
  box-sizing: border-box;
  font-family: inherit;
  transition: all 0.15s ease;
}

.onboard-input:focus {
  background: #ffffff;
  border-color: #0f172a;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

.onboard-toggle-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.onboard-error-msg {
  display: none;
  padding: 10px 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #dc2626;
  font-size: 12px;
  line-height: 1.4;
}

.onboard-btn-primary {
  width: 100%;
  height: 46px;
  background: #0f172a;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
  margin-top: 8px;
}

.onboard-btn-primary:hover {
  background: #1e293b;
  transform: translateY(-1px);
}

.onboard-btn-primary:active {
  transform: translateY(0);
}

/* Feature overview pillar cards */
.pillar-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.pillar-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  transition: all 0.15s ease;
}

.pillar-card:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.pillar-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #0f172a;
}

.pillar-content h4 {
  margin: 0 0 3px;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}

.pillar-content p {
  margin: 0;
  font-size: 12px;
  color: #64748b;
  line-height: 1.45;
}

.install-callout {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 12px;
  color: #1e40af;
  line-height: 1.45;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.btn-secondary-link {
  background: none;
  border: none;
  color: #64748b;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  margin-top: 14px;
  text-align: center;
}



