/* Suzuki Sales Hub */
/* ============================================================
   Suzuki Sales Hub v2.1 — Internal Dealer Application
   Engineered by Heru Prasetyo, SIT Semarang
   ============================================================ */

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #F4F6FA;
  color: #1E293B;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ---------- HEADER ---------- */
.header {
  background: linear-gradient(135deg, #001a33 0%, #003366 30%, #005BAC 100%);
  color: white;
  padding: 0 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  height: 66px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  z-index: 100;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.header-back {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.header-icon {
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.header-text {
  flex: 1;
}

.header-title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.header-subtitle {
  font-size: 0.7rem;
  opacity: 0.85;
}

/* ---------- CONTAINER ---------- */
.container {
  flex: 1;
  padding: 1rem 1rem 5rem 1rem;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* ---------- FOOTER ---------- */
.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid #E2E8F0;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
  z-index: 99;
  padding: 0.6rem 1rem;
  text-align: center;
  font-size: 0.65rem;
  color: #64748B;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding-bottom: max(0.6rem, env(safe-area-inset-bottom));
}

/* ---------- CARD ---------- */
.card {
  background: white;
  border: 1px solid #E8ECF1;
  border-radius: 18px;
  padding: 1rem;
  margin-bottom: 0.7rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 18px 18px 0 0;
}

.card.accent-blue::before {
  background: linear-gradient(90deg, #005BAC, #3B82F6);
}

.card.accent-green::before {
  background: linear-gradient(90deg, #059669, #10B981);
}

.card.accent-orange::before {
  background: linear-gradient(90deg, #D97706, #F59E0B);
}

.card.accent-gray::before {
  background: linear-gradient(90deg, #64748B, #94A3B8);
}

/* ---------- BUTTON ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  height: 46px;
  padding: 0 1.4rem;
  border-radius: 14px;
  font-weight: 600;
  font-size: 0.88rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-primary {
  background: #005BAC;
  color: white;
}

.btn-outline {
  background: white;
  color: #005BAC;
  border: 1.5px solid #005BAC;
}

.btn-sm {
  height: 34px;
  padding: 0 0.9rem;
  font-size: 0.75rem;
  border-radius: 10px;
}

.btn-block {
  width: 100%;
}

/* ---------- FORM ---------- */
select,
input[type="file"],
input[type="text"],
input[type="search"],
input[type="number"] {
  width: 100%;
  height: 46px;
  padding: 0 0.9rem;
  border: 1.5px solid #E2E8F0;
  border-radius: 14px;
  font-size: 0.88rem;
  background: white;
  color: #1E293B;
  outline: none;
  font-family: inherit;
}

select {
  appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="%2394A3B8" stroke-width="2.5"><polyline points="6 9 12 15 18 9"/></svg>');
  background-repeat: no-repeat;
  background-position: right 1rem center;
}

label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  margin-top: 0.5rem;
}

label:first-of-type {
  margin-top: 0;
}

/* ---------- UTILITY ---------- */
.flex-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.flex-row > * {
  flex: 1;
  min-width: 110px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.2rem 1rem;
  align-items: center;
}

.hidden {
  display: none;
}

/* ---------- MENU ---------- */
.menu-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  width: 100%;
}

.menu-card {
  background: white;
  border-radius: 20px;
  padding: 1.1rem 1.3rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border: 1px solid #E8ECF1;
}

.menu-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}

.menu-icon.blue {
  background: #EFF6FF;
  color: #005BAC;
}

.menu-icon.green {
  background: #ECFDF5;
  color: #059669;
}

.menu-icon.orange {
  background: #FFF7ED;
  color: #D97706;
}

.menu-icon.gray {
  background: #F1F5F9;
  color: #475569;
}

.menu-info {
  flex: 1;
}

.menu-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.menu-sub {
  font-size: 0.78rem;
  color: #64748B;
}

/* ---------- PRICELIST ---------- */
.price-nett {
  background: linear-gradient(135deg, #EFF6FF, #DBEAFE);
  border-radius: 14px;
  padding: 0.6rem 1rem;
  text-align: right;
  font-size: 1.6rem;
  font-weight: 700;
  color: #005BAC;
  margin-top: 0.4rem;
}

/* ---------- BADGE ---------- */
.badge {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
}

.badge-ready {
  background: #DCFCE7;
  color: #15803D;
}

.badge-nik25 {
  background: #F1F5F9;
  color: #475569;
}

.badge-nik26 {
  background: #EFF6FF;
  color: #005BAC;
}

.badge-discount {
  background: #FEE2E2;
  color: #B91C1C;
}

/* ---------- LEASING ---------- */
.leasing-card {
  background: white;
  border: 1px solid #E8ECF1;
  border-radius: 16px;
  padding: 0.8rem;
  margin-bottom: 0.5rem;
}

.leasing-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: #005BAC;
  margin-bottom: 0.4rem;
}

.highlight {
  border-radius: 10px;
  padding: 0.5rem;
  margin: 0.3rem 0;
}

.highlight-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.highlight-label {
  font-size: 0.8rem;
  font-weight: 600;
}

.highlight-value {
  font-size: 1rem;
  font-weight: 700;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  padding: 0.15rem 0;
}

.best-badge {
  display: inline-block;
  background: #DCFCE7;
  color: #15803D;
  padding: 0.1rem 0.5rem;
  border-radius: 8px;
  font-size: 0.65rem;
  font-weight: 600;
  margin-left: 0.5rem;
}

/* ---------- STOCK ---------- */
.upload-zone {
  border: 2px dashed #CBD5E1;
  border-radius: 16px;
  padding: 1.2rem;
  text-align: center;
  cursor: pointer;
  background: #FAFBFC;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.stat-card {
  background: white;
  border: 1px solid #E8ECF1;
  border-radius: 14px;
  padding: 0.7rem;
  text-align: center;
}

.stat-number {
  font-size: 1.3rem;
  font-weight: 700;
}

.progress-container {
  margin-top: 0.8rem;
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.3rem;
  font-size: 0.7rem;
  color: #64748B;
}

.progress-step {
  flex: 1;
  text-align: center;
  position: relative;
}

.progress-step::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #E2E8F0;
  z-index: 1;
}

.progress-step.active::after {
  background: #005BAC;
}

.progress-step.done::after {
  background: #16A34A;
}

.progress-bar {
  height: 6px;
  background: #E2E8F0;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0.3rem;
}

.progress-fill {
  height: 100%;
  background: #005BAC;
  width: 0%;
  transition: width 0.4s;
}

.import-summary {
  margin-top: 0.8rem;
  background: #F8FAFC;
  border-radius: 12px;
  padding: 0.8rem;
  font-size: 0.8rem;
}

.import-summary .row {
  display: flex;
  justify-content: space-between;
  padding: 0.2rem 0;
}

/* ---------- MODAL ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(6px);
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: white;
  border-radius: 22px;
  padding: 1.5rem;
  max-width: 480px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  background: #F1F5F9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  color: #64748B;
}

/* ---------- TOAST ---------- */
.toast-container {
  position: fixed;
  top: 75px;
  right: 0.75rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  pointer-events: none;
}

.toast {
  background: white;
  border-radius: 12px;
  padding: 0.6rem 1rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  font-size: 0.8rem;
  font-weight: 500;
  animation: slideIn 0.3s ease;
  border-left: 4px solid #16A34A;
  pointer-events: auto;
  max-width: 280px;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

/* ---------- TAB ---------- */
.tab-nav {
  display: flex;
  gap: 0;
  margin-bottom: 1rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #E2E8F0;
}

.tab-btn {
  flex: 1;
  padding: 0.7rem;
  text-align: center;
  background: #F8FAFC;
  color: #64748B;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  border: none;
  outline: none;
}

.tab-btn.active {
  background: #005BAC;
  color: white;
}

/* ---------- MISC ---------- */
.divider {
  height: 1px;
  background: #E2E8F0;
  margin: 0.8rem 0;
}

.color-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

.color-dot.black { background: #111; }
.color-dot.ivory { background: #F5F5DC; border: 1px solid #ccc; }
.color-dot.silver { background: #C0C0C0; }
.color-dot.red { background: #DC2626; }
.color-dot.blue { background: #2563EB; }

.fav-star {
  cursor: pointer;
  font-size: 1.2rem;
  color: #F59E0B;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 500px) {
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
