/* ===== RESET & BASE ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: #f0f2f5;
  color: #1a1a2e;
  min-height: 100vh;
}

/* ===== SCREENS ===== */
.screen { display: none; }
.screen.active { display: block; }

/* ===== LANDING ===== */
#landingScreen { display: block; }
.landing-nav {
  background: #1a1a2e;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.landing-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.landing-nav-links { display: flex; align-items: center; gap: 12px; }
.landing-nav-links a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 14px;
  margin-right: 8px;
}
.landing-nav-links a:hover { color: #fff; }

.hero {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  padding: 80px 24px 60px;
  text-align: center;
  color: #fff;
}
.hero-content { max-width: 700px; margin: 0 auto; }
.hero-logo { margin-bottom: 12px; }
.hero h1 { font-size: 32px; margin-bottom: 16px; letter-spacing: 0.5px; }
.hero p { font-size: 16px; color: rgba(255,255,255,0.8); margin-bottom: 28px; line-height: 1.6; }

.rc-badge {
  margin-top: 8px;
  font-size: 12px;
  letter-spacing: 1px;
  font-weight: 600;
  color: #888;
}
.rc-badge-light { color: rgba(255,255,255,0.85); }

.btn-lg { padding: 14px 40px; font-size: 16px; }

/* ===== PRICING ===== */
.pricing-section {
  padding: 60px 24px;
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}
.pricing-section h2 { font-size: 28px; margin-bottom: 8px; }
.pricing-subtitle { color: #666; margin-bottom: 40px; font-size: 15px; }
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.pricing-card {
  background: #fff;
  border-radius: 16px;
  padding: 32px 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  border: 2px solid transparent;
  transition: border-color 0.2s, transform 0.2s;
  position: relative;
  display: flex;
  flex-direction: column;
}
.pricing-card:hover { transform: translateY(-4px); border-color: #ddd; }
.pricing-card.popular { border-color: #0f3460; }
.pricing-card.popular .pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f3460;
  color: #fff;
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.pricing-card h3 { font-size: 18px; margin-bottom: 8px; }
.pricing-card .pricing-dur { font-size: 13px; color: #888; margin-bottom: 16px; }
.pricing-card .pricing-price { font-size: 32px; font-weight: 700; color: #1a1a2e; margin-bottom: 4px; }
.pricing-card .pricing-price span { font-size: 16px; font-weight: 400; color: #888; }
.pricing-card .pricing-free { font-size: 32px; font-weight: 700; color: #27ae60; margin-bottom: 4px; }
.pricing-card .pricing-desc { font-size: 13px; color: #888; margin-bottom: 20px; flex: 1; }
.pricing-card .btn { width: 100%; }

.landing-footer {
  text-align: center;
  padding: 32px 24px;
  color: #888;
  font-size: 13px;
  border-top: 1px solid #eee;
}

/* ===== AUTH ===== */
.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}
.auth-container { width: 100%; max-width: 640px; padding: 20px; }
.auth-box {
  background: #fff;
  border-radius: 16px;
  padding: 36px 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  position: relative;
}
.auth-back-btn {
  position: absolute;
  top: 16px;
  left: 16px;
  background: none;
  border: none;
  font-size: 16px;
  color: #666;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.auth-back-btn:hover { background: #f0f0f0; color: #333; }
.auth-header { text-align: center; margin-bottom: 20px; }
.auth-logo { margin-bottom: 12px; }
.auth-header h1 { font-size: 18px; color: #1a1a2e; letter-spacing: 0.5px; line-height: 1.3; }
.auth-header p { color: #666; font-size: 13px; margin-top: 4px; }
.auth-plan-badge {
  text-align: center;
  margin-bottom: 16px;
}
.auth-plan-badge span {
  display: inline-block;
  background: #e8f0fe;
  color: #0f3460;
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}
.auth-tabs { display: flex; margin-bottom: 20px; border-bottom: 2px solid #eee; }
.auth-tab {
  flex: 1; padding: 10px; border: none; background: none; font-size: 15px;
  font-weight: 600; color: #999; cursor: pointer; transition: color 0.2s, border-color 0.2s;
}
.auth-tab.active { color: #1a1a2e; border-bottom: 2px solid #0f3460; margin-bottom: -2px; }
.auth-form { display: none; }
.auth-form.active { display: block; }

.register-header { text-align: center; margin-bottom: 20px; }
.register-header h2 { font-size: 22px; color: #1a1a2e; margin-bottom: 4px; }
.register-header p { color: #888; font-size: 14px; }
.form-section { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid #eee; }
.form-section:last-of-type { border-bottom: none; }
.form-section-title {
  font-size: 14px; font-weight: 700; color: #0f3460; margin-bottom: 14px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.form-row { display: flex; gap: 14px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 180px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: #333; margin-bottom: 5px; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 10px 12px; border: 1.5px solid #ddd; border-radius: 8px;
  font-size: 14px; transition: border-color 0.2s; outline: none; font-family: inherit; background: #fff;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: #0f3460; }
.form-group textarea { resize: vertical; }
.form-group input[type="file"] { padding: 8px; border: 1.5px dashed #ccc; background: #fafafa; cursor: pointer; }
.form-group input[type="date"] { padding: 9px 12px; }
.form-hint { display: block; font-size: 12px; color: #888; margin-top: 4px; }
.form-error { color: #e74c3c; font-size: 13px; margin-top: 8px; text-align: center; }
.form-message { color: #27ae60; font-size: 13px; margin-top: 12px; }

.form-checkbox { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 18px; }
.form-checkbox input[type="checkbox"] { width: 18px; height: 18px; margin-top: 2px; flex-shrink: 0; accent-color: #0f3460; }
.form-checkbox label { font-size: 13px; color: #555; font-weight: 400; margin-bottom: 0; }
.form-checkbox label a { color: #0f3460; text-decoration: underline; }

.password-wrapper { position: relative; }
.password-wrapper input { padding-right: 44px; }
.password-toggle {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 18px; padding: 4px 6px;
  line-height: 1; color: #666; border-radius: 6px;
}
.password-toggle:hover { background: #f0f0f5; }

/* ===== PAYMENT ===== */
.payment-details { max-width: 500px; margin: 0 auto; }
.payment-plan-info { text-align: center; margin-bottom: 20px; }
.payment-plan-info h3 { font-size: 20px; color: #1a1a2e; }
.payment-plan-info p { color: #888; font-size: 14px; }
.payment-bank {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 24px;
}
.payment-bank h3 { font-size: 15px; margin-bottom: 14px; color: #0f3460; }
.bank-detail { padding: 6px 0; font-size: 14px; color: #333; border-bottom: 1px solid #eee; }
.bank-detail:last-child { border-bottom: none; }
.bank-detail span { color: #888; margin-right: 8px; }

/* ===== NAVBAR ===== */
.navbar {
  background: #1a1a2e; padding: 0 20px; display: flex; align-items: center;
  height: 60px; position: sticky; top: 0; z-index: 100; gap: 16px;
}
.nav-brand {
  color: #fff; font-size: 14px; font-weight: 700; letter-spacing: 0.5px;
  white-space: nowrap; display: flex; align-items: center; flex-shrink: 0;
}
.nav-links { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.nav-btn {
  background: none; border: none; color: rgba(255,255,255,0.6); padding: 8px 12px;
  font-size: 13px; cursor: pointer; border-radius: 8px; transition: background 0.2s, color 0.2s; white-space: nowrap;
}
.nav-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.nav-btn.active { background: rgba(255,255,255,0.15); color: #fff; }
.nav-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.nav-status { font-size: 11px; padding: 3px 10px; border-radius: 12px; font-weight: 600; }
.nav-company {
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: rgba(15,52,96,0.9);
  padding: 4px 12px;
  border-radius: 12px;
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-status.active { background: rgba(39,174,96,0.2); color: #27ae60; }
.nav-status.pending { background: rgba(243,156,18,0.2); color: #f39c12; }
.nav-status.expired { background: rgba(231,76,60,0.2); color: #e74c3c; }
.btn-logout {
  background: rgba(255,255,255,0.1); color: #fff; border: 1px solid rgba(255,255,255,0.2);
  padding: 6px 16px; border-radius: 8px; cursor: pointer; font-size: 13px; white-space: nowrap;
}
.btn-logout:hover { background: rgba(255,255,255,0.2); }

/* ===== MAIN ===== */
.main-content { max-width: 1200px; margin: 0 auto; padding: 28px 20px; }
.section { display: none; }
.section.active { display: block; }
.section h2 { font-size: 22px; margin-bottom: 20px; color: #1a1a2e; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.section-header h2 { margin-bottom: 0; }
.recent-section h3 { font-size: 16px; margin-bottom: 10px; color: #333; }

/* ===== STATS ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 28px; }
.stat-card { background: #fff; border-radius: 12px; padding: 18px; display: flex; align-items: center; gap: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.stat-icon { font-size: 24px; }
.stat-info { display: flex; flex-direction: column; }
.stat-label { font-size: 11px; color: #666; }
.stat-value { font-size: 20px; font-weight: 700; color: #1a1a2e; }

/* ===== FORMS ===== */
.product-form { background: #fff; border-radius: 12px; padding: 24px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); max-width: 700px; }

/* ===== IMAGE ===== */
.image-preview { margin-top: 8px; }
.image-preview img { max-width: 120px; max-height: 120px; border-radius: 8px; border: 1px solid #eee; }
.product-thumb { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; border: 1px solid #eee; }
.product-thumb-placeholder { width: 44px; height: 44px; border-radius: 6px; background: #f0f0f0; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; color: #ccc; }

/* ===== BUTTONS ===== */
.btn {
  padding: 10px 22px; border: none; border-radius: 8px; font-size: 14px;
  font-weight: 600; cursor: pointer; transition: background 0.2s, transform 0.1s;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: #0f3460; color: #fff; }
.btn-primary:hover { background: #1a4a7a; }
.btn-outline-light { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,0.4); }
.btn-outline-light:hover { border-color: #fff; }
.btn-full { width: 100%; }
.btn-danger { background: #e74c3c; color: #fff; padding: 6px 14px; font-size: 12px; }
.btn-danger:hover { background: #c0392b; }
.btn-edit { background: #f39c12; color: #fff; padding: 6px 14px; font-size: 12px; margin-right: 4px; }
.btn-edit:hover { background: #d68910; }
.btn-success { background: #27ae60; color: #fff; padding: 6px 14px; font-size: 12px; margin-right: 4px; }
.btn-success:hover { background: #1e8449; }

/* ===== TABLE ===== */
.table-responsive { overflow-x: auto; background: #fff; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
table { width: 100%; border-collapse: collapse; min-width: 600px; }
th, td { padding: 10px 12px; text-align: left; font-size: 13px; }
th { background: #f8f9fa; font-weight: 600; color: #555; border-bottom: 2px solid #eee; }
td { border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8f9fa; }
td .actions { display: flex; gap: 4px; flex-wrap: wrap; }

/* ===== SEARCH ===== */
.search-bar { display: flex; gap: 12px; margin-bottom: 18px; max-width: 450px; }
.search-bar input { flex: 1; padding: 10px 14px; border: 1.5px solid #ddd; border-radius: 8px; font-size: 14px; outline: none; }
.search-bar input:focus { border-color: #0f3460; }

/* ===== MODAL ===== */
.modal {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5); display: flex; align-items: center;
  justify-content: center; z-index: 200;
}
.modal-content {
  background: #fff; border-radius: 16px; padding: 28px; width: 90%;
  max-width: 600px; max-height: 90vh; overflow-y: auto; position: relative;
}
.modal-close { position: absolute; top: 14px; right: 18px; font-size: 26px; cursor: pointer; color: #999; }
.modal-close:hover { color: #333; }
.modal-content h2 { margin-bottom: 18px; }

/* ===== STATUS BADGE ===== */
.status-badge { display: inline-block; padding: 3px 12px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.status-badge.active { background: #d4edda; color: #155724; }
.status-badge.pending { background: #fff3cd; color: #856404; }
.status-badge.expired { background: #f8d7da; color: #721c24; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .navbar { flex-wrap: wrap; height: auto; padding: 10px 14px; gap: 6px; }
  .nav-links { order: 3; width: 100%; }
  .nav-brand { margin-right: auto; }
  .hero h1 { font-size: 24px; }
  .hero { padding: 50px 20px 40px; }
  .pricing-grid { grid-template-columns: 1fr; max-width: 350px; margin: 0 auto; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row { flex-direction: column; }
  .form-row .form-group { min-width: unset; }
  .main-content { padding: 16px 12px; }
  .landing-nav-inner { flex-wrap: wrap; height: auto; gap: 8px; padding: 10px 0; }
  .section-header { flex-direction: column; align-items: flex-start; gap: 10px; }
}

/* ===== SECTION TOOLBAR ===== */
.section-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ===== SMALL / OUTLINE BUTTONS ===== */
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-outline { background: transparent; color: #333; border: 1.5px solid #ccc; }
.btn-outline:hover { border-color: #0f3460; color: #0f3460; background: #f0f4ff; }

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.pagination-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border: 1.5px solid #ddd;
  background: #fff;
  color: #333;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.pagination-btn:hover { border-color: #0f3460; color: #0f3460; }
.pagination-btn.active { background: #0f3460; border-color: #0f3460; color: #fff; }
.pagination-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination-info { font-size: 12px; color: #888; margin-right: 10px; }

/* ===== RECEIPT ===== */
.receipt {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  padding: 28px 24px;
  color: #1a1a2e;
  background: #fff;
  border-radius: 16px 16px 0 0;
}
.receipt-header { text-align: center; margin-bottom: 16px; }
.receipt-header img { border-radius: 4px; margin-bottom: 6px; }
.receipt-header h2 { font-size: 18px; margin-bottom: 2px; color: #1a1a2e; }
.receipt-header .rc-badge { font-size: 11px; color: #888; letter-spacing: 1px; font-weight: 600; }
.receipt-header p { font-size: 11px; color: #888; margin-top: 2px; }
.receipt-divider { border-top: 1.5px dashed #ccc; margin: 12px 0; }
.receipt-meta { font-size: 12px; }
.receipt-meta div { display: flex; justify-content: space-between; padding: 2px 0; }
.receipt-meta span { color: #888; }
.receipt table { width: 100%; border-collapse: collapse; font-size: 12px; margin: 8px 0; }
.receipt table th { background: #f8f9fa; font-weight: 600; color: #333; border-bottom: 1.5px solid #ddd; padding: 6px 4px; }
.receipt table td { padding: 6px 4px; border-bottom: 1px solid #f0f0f0; }
.receipt-total {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 700;
  color: #1a1a2e;
  padding: 10px 4px;
  border-top: 1.5px dashed #ccc;
  margin-top: 8px;
}
.receipt-notes { font-size: 11px; color: #888; margin-top: 8px; }
.receipt-thanks { text-align: center; font-size: 12px; color: #555; margin-top: 16px; font-style: italic; }
.receipt-actions { padding: 14px 24px; background: #f8f9fa; border-radius: 0 0 16px 16px; display: flex; gap: 10px; justify-content: center; }
.receipt-actions .btn { flex: 1; }

@media print {
  .receipt { box-shadow: none; border-radius: 0; }
  .receipt-actions { display: none !important; }
}

/* ===== POS ===== */
.pos-content { max-width: 720px; width: 94%; }
.pos-picker { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.pos-picker input[type="text"] { flex: 1 1 220px; padding: 10px; border: 1px solid #d4d4e4; border-radius: 8px; font-size: 14px; }
.pos-picker .pos-product-select { flex: 1 1 240px; padding: 10px; border: 1px solid #d4d4e4; border-radius: 8px; font-size: 14px; }
.pos-picker input[type="number"] { width: 84px; padding: 10px; border: 1px solid #d4d4e4; border-radius: 8px; font-size: 14px; }
.pos-picker .btn { align-self: center; }
.pos-cart-table { max-height: 260px; overflow-y: auto; margin-bottom: 12px; }
.pos-cart-table .pos-qty-input { width: 64px; padding: 6px; border: 1px solid #d4d4e4; border-radius: 6px; text-align: center; }
.pos-cart-table .pos-empty { text-align: center; color: #888; padding: 16px; }
.pos-totals { border: 1px solid #e3e3f0; border-radius: 10px; padding: 12px 16px; margin-bottom: 12px; background: #fafbfe; }
.pos-total-row { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; font-size: 14px; }
.pos-total-row input[type="number"] { width: 140px; padding: 8px; border: 1px solid #d4d4e4; border-radius: 8px; font-size: 14px; text-align: right; }
.btn-full { width: 100%; }
.btn-success { background: #27ae60; color: #fff; }
.btn-success:hover { background: #1e8449; }
.btn-success:disabled { background: #a8d5b8; cursor: not-allowed; }
.btn-danger.btn-sm { padding: 5px 9px; font-size: 12px; }

/* ===== THERMAL RECEIPT ===== */
.thermal {
  font-family: 'Courier New', Courier, monospace;
  width: 302px;
  margin: 0 auto;
  padding: 22px 20px;
  color: #000;
  background: #fff;
  font-size: 12px;
  line-height: 1.45;
}
.th-header { text-align: center; }
.th-store { font-size: 15px; font-weight: 700; letter-spacing: 1px; }
.th-address { font-size: 11px; font-weight: 600; }
.th-line { font-size: 11px; }
.th-center { text-align: center; }
.th-bold { font-weight: 700; }
.th-divider { letter-spacing: 1px; font-size: 12px; white-space: pre; color: #000; }
.th-row { display: flex; justify-content: space-between; font-size: 12px; }
.th-row span:last-child { text-align: right; max-width: 65%; }
.th-cols { display: flex; font-size: 12px; }
.th-cols .th-name { flex: 1 1 auto; overflow: hidden; white-space: nowrap; }
.th-cols .th-qty, .th-cols .th-price, .th-cols .th-total { flex: 0 0 64px; text-align: right; }
.th-sku { font-size: 10px; color: #555; margin-bottom: 4px; }
.th-thanks { font-size: 12px; margin-top: 8px; }
.th-policy { font-size: 9px; margin-top: 8px; text-align: justify; color: #333; }

@media print {
  .thermal { padding: 0; }
}

/* ===== PRINT ===== */
@media print {
  .navbar, .landing-nav, .hero, .pricing-section, .landing-footer,
  .auth-screen, #paymentScreen, .modal, .section-header h2 + .section-toolbar,
  .search-bar, nav, .nav-right, .btn, .btn-logout, #logoutBtn,
  .nav-links, .section-header .btn-primary { display: none !important; }
  body, .screen, .section, .section.active { background: #fff !important; }
  .table-responsive { box-shadow: none !important; border-radius: 0 !important; }
  table { min-width: auto !important; }
  th, td { padding: 6px 8px !important; font-size: 11px !important; }
  .stats-grid { break-inside: avoid; }
  .main-content { max-width: 100%; padding: 10px; }
  .product-thumb, .product-thumb-placeholder { display: none; }
  .section-header { flex-direction: row !important; }
}

/* ===== DOWNLOAD / PRINT UTILITY ===== */
@media print {
  .section-toolbar .btn-outline { display: none !important; }
}
