/* Vyapar AI — Styles for Mehta Traders demo */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f1ea;
  color: #1a1f2e;
  padding-bottom: 80px;
  -webkit-font-smoothing: antialiased;
}

/* ===== HEADER ===== */
.app-header {
  background: #0f1729;
  color: #fff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.brand-logo {
  background: #c9a76b;
  color: #0f1729;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 1px;
}

.brand-text h1 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 2px;
}

.brand-text p {
  font-size: 11px;
  letter-spacing: 1.2px;
  color: #a8b0c2;
  text-transform: uppercase;
}

.sync-badge {
  background: rgba(255,255,255,0.08);
  color: #6dd87a;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.8px;
}

.sync-badge .dot {
  width: 8px;
  height: 8px;
  background: #6dd87a;
  border-radius: 50%;
}

/* ===== MAIN ===== */
.app-main {
  padding: 24px 20px;
}

.greeting h2 {
  font-size: 26px;
  font-weight: 700;
  font-family: Georgia, serif;
  margin-bottom: 6px;
}

.greeting .subtitle {
  color: #6a7080;
  font-size: 14px;
  margin-bottom: 20px;
}

/* ===== URGENT BANNER ===== */
.urgent-banner {
  background: #0f1729;
  color: #fff;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.urgent-icon {
  background: rgba(255,255,255,0.08);
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.urgent-text strong {
  display: block;
  font-size: 11px;
  letter-spacing: 1.5px;
  color: #c9a76b;
  margin-bottom: 4px;
}

.urgent-text p {
  font-size: 15px;
  font-weight: 500;
}

/* ===== STATS ===== */
.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 28px;
}

.stat-card {
  padding: 18px;
  border-radius: 12px;
}

.stat-due {
  background: #0f1729;
  color: #fff;
}

.stat-collected {
  background: #fff;
  color: #0f1729;
  border: 1px solid #e8e2d4;
}

.stat-label {
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #a8b0c2;
  margin-bottom: 6px;
}

.stat-collected .stat-label {
  color: #6a7080;
}

.stat-card h3 {
  font-size: 28px;
  font-weight: 700;
  font-family: Georgia, serif;
  margin-bottom: 4px;
}

.stat-sublabel {
  font-size: 11px;
  font-family: 'Courier New', monospace;
  color: #c9a76b;
}

.stat-collected .stat-sublabel {
  color: #6a7080;
}

/* ===== SECTIONS ===== */
.section {
  margin-bottom: 24px;
}

.section-title {
  font-size: 18px;
  font-family: Georgia, serif;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge {
  background: #c9a76b;
  color: #fff;
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 12px;
  font-family: -apple-system, sans-serif;
  font-weight: 600;
}

.badge-red {
  background: #c44545;
}

/* ===== ORDER CARDS ===== */
.order-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 10px;
  border-left: 4px solid #c9a76b;
}

.order-card.card-overdue {
  background: #fdf0f0;
  border-left-color: #c44545;
}

.order-card.card-urgent {
  background: #fdf6e8;
  border-left-color: #e89c3a;
}

.order-card.card-today {
  background: #fdf0f0;
  border-left-color: #c44545;
}

.order-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 8px;
}

.order-customer {
  font-size: 16px;
  font-weight: 600;
  font-family: Georgia, serif;
}

.order-amount {
  font-size: 18px;
  font-weight: 700;
  color: #c44545;
}

.card-urgent .order-amount {
  color: #1a1f2e;
}

.order-amount small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: #6a7080;
  text-align: right;
  font-family: 'Courier New', monospace;
}

.order-product {
  font-size: 14px;
  color: #6a7080;
  margin-bottom: 8px;
}

.order-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: #6a7080;
  margin-bottom: 12px;
}

.order-status {
  background: rgba(196,69,69,0.1);
  color: #c44545;
  font-size: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-weight: 500;
}

.card-urgent .order-status {
  background: rgba(232,156,58,0.15);
  color: #b8740d;
}

.order-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn {
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.btn-primary {
  background: #2c6e5d;
  color: #fff;
}

.btn-success {
  background: #d4ead4;
  color: #2c6e5d;
}

.empty-state {
  text-align: center;
  color: #a8b0c2;
  font-size: 13px;
  padding: 20px;
  font-style: italic;
}

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid #e8e2d4;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 8px 0;
  z-index: 100;
}

.nav-btn {
  background: none;
  border: none;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: #6a7080;
  font-family: inherit;
}

.nav-btn.active {
  color: #c9a76b;
}

.nav-icon {
  font-size: 20px;
}

.nav-label {
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 600;
}

.nav-btn-ai .nav-icon {
  background: linear-gradient(135deg, #c9a76b 0%, #e89c3a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== RESPONSIVE — DESKTOP ===== */
@media (min-width: 600px) {
  body {
    max-width: 480px;
    margin: 0 auto;
    box-shadow: 0 0 40px rgba(0,0,0,0.05);
    min-height: 100vh;
  }
  .bottom-nav {
    max-width: 480px;
    margin: 0 auto;
  }
}

/* ========== SCREEN SWITCHING ========== */
.screen {
  display: none;
}

.screen.active {
  display: block;
}

/* ========== CUSTOMERS SCREEN ========== */
.search-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 15px;
  border: 1px solid #e8e2d4;
  border-radius: 10px;
  background: #fff;
  margin-bottom: 20px;
  font-family: inherit;
  outline: none;
}

.search-input:focus {
  border-color: #c9a76b;
}

.customer-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
  display: flex;
  align-items: center;
  gap: 14px;
  border-left: 4px solid #c9a76b;
}

.customer-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.customer-card.has-dues {
  border-left-color: #c44545;
}

.customer-card.paid-up {
  border-left-color: #2c6e5d;
}

.customer-avatar {
  background: #0f1729;
  color: #c9a76b;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  font-family: Georgia, serif;
  flex-shrink: 0;
}

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

.customer-name {
  font-size: 15px;
  font-weight: 600;
  font-family: Georgia, serif;
  margin-bottom: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-sub {
  font-size: 12px;
  color: #6a7080;
  display: flex;
  gap: 10px;
}

.customer-amount {
  text-align: right;
  flex-shrink: 0;
}

.customer-amount .amount-due {
  font-size: 15px;
  font-weight: 700;
  color: #c44545;
}

.customer-amount .amount-paid {
  font-size: 13px;
  font-weight: 600;
  color: #2c6e5d;
}

.customer-amount small {
  display: block;
  font-size: 10px;
  color: #6a7080;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-top: 2px;
}

/* ========== CUSTOMER DETAIL SCREEN ========== */
.back-btn {
  background: none;
  border: none;
  color: #c9a76b;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 0;
  margin-bottom: 16px;
  font-family: inherit;
}

.detail-header {
  background: #0f1729;
  color: #fff;
  border-radius: 14px;
  padding: 24px 20px;
  margin-bottom: 20px;
}

.detail-header h2 {
  font-family: Georgia, serif;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}

.detail-header .tag {
  color: #c9a76b;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.detail-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.detail-stat .label {
  font-size: 10px;
  letter-spacing: 1px;
  color: #a8b0c2;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.detail-stat .value {
  font-family: Georgia, serif;
  font-size: 18px;
  font-weight: 700;
}

.detail-stat .value.due { color: #ff9b9b; }
.detail-stat .value.paid { color: #6dd87a; }

.contact-row {
  background: #fff;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #e8e2d4;
}

.contact-row .icon {
  font-size: 18px;
}

.contact-row .text {
  flex: 1;
  font-size: 14px;
  color: #1a1f2e;
}

.contact-row .call-btn {
  background: #2c6e5d;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.order-history-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 10px;
  border-left: 4px solid #c9a76b;
}

.order-history-card.overdue { border-left-color: #c44545; }
.order-history-card.paid { border-left-color: #2c6e5d; }

.order-history-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 6px;
}

.order-history-product {
  font-size: 15px;
  font-weight: 600;
  font-family: Georgia, serif;
}

.order-history-status {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 12px;
}

.status-overdue {
  background: rgba(196,69,69,0.1);
  color: #c44545;
}

.status-pending {
  background: rgba(232,156,58,0.15);
  color: #b8740d;
}

.status-paid {
  background: rgba(44,110,93,0.1);
  color: #2c6e5d;
}

.order-history-meta {
  font-size: 12px;
  color: #6a7080;
  margin-bottom: 6px;
  font-family: 'Courier New', monospace;
}

.order-history-amount {
  display: flex;
  gap: 18px;
  font-size: 13px;
}

.order-history-amount span {
  color: #6a7080;
}

.order-history-amount strong {
  color: #1a1f2e;
}