.card-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  font-size: 0.95rem;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.card-action-btn--phone {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}
.card-action-btn--wa {
  background: #dcfce7;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}
.card-action-btn:active { opacity: 0.75; }

.status-sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.status-sheet.hidden { display: none; }
.status-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}
.status-sheet__panel {
  position: relative;
  width: 100%;
  max-width: 28rem;
  background: #fff;
  color: #111827;
  color-scheme: light;
  border-radius: 1.25rem 1.25rem 0 0;
  padding: 1rem 1rem 1.5rem;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.15);
}
.status-sheet__panel h3 {
  color: #111827;
}
.status-sheet__handle {
  width: 2.5rem;
  height: 0.25rem;
  background: #d1d5db;
  border-radius: 9999px;
  margin: 0 auto 1rem;
}
.status-pick-btn {
  display: block;
  width: 100%;
  text-align: left;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.875rem 1rem;
  border-radius: 0.75rem;
  border: 2px solid #d1d5db;
  background: #fff;
  color: #111827;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.status-pick-btn[data-status="waiting_parts"] {
  border-color: #fdba74;
  background: #fff7ed;
  color: #9a3412;
}
.status-pick-btn[data-status="in_progress"] {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1e40af;
}
.status-pick-btn[data-status="completed"] {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}
.status-pick-btn[data-status="delivered"] {
  border-color: #6ee7b7;
  background: #ecfdf5;
  color: #047857;
}
.status-pick-btn[data-status="cancelled"] {
  border-color: #d1d5db;
  background: #f9fafb;
  color: #374151;
}
.status-pick-btn.is-active {
  border-width: 2px;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.25);
}
.status-pick-btn[data-status="waiting_parts"].is-active { border-color: #ea580c; background: #ffedd5; color: #7c2d12; }
.status-pick-btn[data-status="in_progress"].is-active { border-color: #2563eb; background: #dbeafe; color: #1e3a8a; }
.status-pick-btn[data-status="completed"].is-active { border-color: #16a34a; background: #dcfce7; color: #14532d; }
.status-pick-btn[data-status="delivered"].is-active { border-color: #059669; background: #d1fae5; color: #065f46; }
.status-pick-btn[data-status="cancelled"].is-active { border-color: #4b5563; background: #e5e7eb; color: #111827; }

.wa-template-btn {
  display: block;
  width: 100%;
  text-align: left;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.875rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}
.wa-template-btn:active { opacity: 0.8; }

.record-mini .line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.report-preview-table {
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}
.report-preview-table th:nth-child(1),
.report-preview-table td:nth-child(1) { width: 5.75rem; padding-right: 0.75rem; }
.report-preview-table th:nth-child(2),
.report-preview-table td:nth-child(2) { padding-left: 0.25rem; padding-right: 0.5rem; }
.report-preview-table th:nth-child(4),
.report-preview-table td:nth-child(4) { width: 4.25rem; }

.receipt-card {
  max-width: 360px;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid #e8e8e8;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: #111827;
}
.receipt-card__body { padding: 18px 16px 14px; }
.receipt-card__brand {
  margin: 0 0 10px;
  text-align: center;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.1;
}
.receipt-card__brand span:first-child { color: #111827; }
.receipt-card__brand span:last-child { color: #dc2626; }
.receipt-card__title {
  margin: 0;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: #111827;
}
.receipt-card__label {
  margin: 12px 0 2px;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #9ca3af;
}
.receipt-card__number {
  margin: 0;
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  color: #dc2626;
  letter-spacing: 0.02em;
}
.receipt-card__divider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 12px;
  color: #d1d5db;
  font-size: 10px;
}
.receipt-card__divider::before,
.receipt-card__divider::after {
  content: "";
  flex: 1;
  border-top: 1px dashed #d1d5db;
}
.receipt-card__divider span {
  color: #dc2626;
  font-size: 12px;
}
.receipt-card__date {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 11px;
}
.receipt-card__date-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #374151;
}
.receipt-card__date-label i { color: #dc2626; }
.receipt-card__date-value {
  font-weight: 700;
  color: #111827;
  text-align: right;
}
.receipt-card__row {
  display: grid;
  grid-template-columns: 34px 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 11px;
}
.receipt-card__icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 14px;
}
.receipt-card__icon--customer { background: #8b5cf6; }
.receipt-card__icon--phone { background: #22c55e; }
.receipt-card__icon--device { background: #3b82f6; }
.receipt-card__icon--fault { background: #f97316; }
.receipt-card__icon--work { background: #14b8a6; }
.receipt-card__row-label {
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #6b7280;
  white-space: nowrap;
}
.receipt-card__row-sep { color: #d1d5db; }
.receipt-card__row-value {
  font-weight: 700;
  color: #111827;
  text-align: right;
  word-break: break-word;
}
.receipt-card__total {
  position: relative;
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #f3f4f6;
  overflow: hidden;
}
.receipt-card__total-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #9ca3af;
}
.receipt-card__total-value {
  margin-top: 4px;
  font-size: 30px;
  font-weight: 800;
  color: #111827;
}
.receipt-card__note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 12px 0;
  font-size: 11px;
  font-weight: 600;
  color: #dc2626;
}
.receipt-card__note i {
  width: 18px;
  height: 18px;
  border-radius: 9999px;
  background: #fee2e2;
  color: #dc2626;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}
.receipt-card__contacts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.receipt-card__contact {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
}
.receipt-card__contact i { font-size: 18px; margin-bottom: 4px; }
.receipt-card__contact i.fa-whatsapp { color: #22c55e; }
.receipt-card__contact i.fa-instagram { color: #e1306c; }
.receipt-card__contact-label {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #9ca3af;
}
.receipt-card__contact-value {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  font-weight: 700;
  color: #111827;
}
.receipt-card__footer-bar {
  height: 8px;
  background: linear-gradient(90deg, #111827 0 58%, #dc2626 58% 100%);
}

.home-body {
  background: #f5f5f5;
  color: #111827;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.home-main {
  max-width: 28rem;
  margin: 0 auto;
  min-height: 100dvh;
  padding: 0;
}
.home-main > .mb-3 {
  margin: 0.75rem 1rem 0;
}
.home-app {
  min-height: 100dvh;
  padding-bottom: 1.5rem;
}
.home-hero {
  position: relative;
  text-align: center;
  color: #fff;
  padding: 2.75rem 1.25rem 3.25rem;
  background: linear-gradient(155deg, #dc2626 0%, #b91c1c 42%, #111827 100%);
  overflow: visible;
}
.home-hero__logout {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.15rem;
  border-radius: 10px;
  background: rgba(0,0,0,.22);
  text-decoration: none;
}
.home-hero__logout:active { background: rgba(0,0,0,.35); }
.home-hero__app {
  font-size: 0.85rem;
  font-weight: 600;
  opacity: .92;
  margin: 0 0 0.35rem;
  letter-spacing: 0.02em;
}
.home-hero__brand {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  margin: 0 0 0.5rem;
  line-height: 1.2;
}
.home-hero__user {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.15rem;
}
.home-hero__role {
  font-size: 0.8rem;
  font-weight: 500;
  margin: 0;
  opacity: .88;
}
.home-hero__wave {
  position: absolute;
  left: -8%;
  right: -8%;
  bottom: -34px;
  height: 70px;
  background: #f5f5f5;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  z-index: 1;
}
.home-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 0 14px;
  margin-top: -8px;
}
.home-tile {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 8px;
  background: #fff;
  border-radius: 18px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 6px 18px rgba(17, 24, 39, 0.08);
  text-decoration: none;
  color: #111827;
  transition: transform .12s ease, box-shadow .12s ease;
}
.home-tile:active {
  transform: scale(0.96);
  box-shadow: 0 3px 10px rgba(17, 24, 39, 0.12);
}
.home-tile__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  font-size: 1.45rem;
  color: #dc2626;
}
.home-tile__label {
  font-size: 0.68rem;
  font-weight: 800;
  text-align: center;
  line-height: 1.25;
  letter-spacing: 0.01em;
  max-width: 100%;
  padding: 0 2px;
}

.app-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(90deg, #dc2626 0%, #b91c1c 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(17, 24, 39, 0.12);
  position: sticky;
  top: 0;
  z-index: 40;
}
.app-header__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}
.app-header__back i { font-size: 13px; }
.app-header__back:active { background: rgba(0, 0, 0, 0.3); }
.app-header__title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 800;
  text-align: center;
  line-height: 1.2;
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-header__logout {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  color: #fff;
  background: rgba(0, 0, 0, 0.18);
  text-decoration: none;
}
.app-header__logout:active { background: rgba(0, 0, 0, 0.3); }

.bottom-tabbar {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  height: 4rem;
  font-size: 9px;
  line-height: 1.1;
}
.bottom-tabbar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 0 2px;
  text-align: center;
}
.bottom-tabbar a i { font-size: 1rem; margin-bottom: 2px; }

.live-search-item.hidden { display: none !important; }
.hidden { display: none !important; }

/* Batarya Stok */
.battery-subnav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}
.battery-subnav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 6px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  background: #f3f4f6;
  color: #4b5563;
  text-align: center;
  line-height: 1.2;
}
.battery-subnav__item i { font-size: 14px; }
.battery-subnav__item.is-active { background: #dc2626; color: #fff; }
.battery-subnav__item--accent { background: #111827; color: #fff; }
.battery-row { border-radius: 12px; border: 1px solid #e5e7eb; background: #fff; padding: 12px; margin-bottom: 8px; }
.battery-row--low { border-color: #fecaca; background: #fef2f2; }
.battery-row--out { border-color: #fca5a5; background: #fee2e2; }
.battery-row--ok { border-color: #bbf7d0; background: #f0fdf4; }
.battery-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}
.battery-badge--warn,
.battery-badge--low { background: #fef3c7; color: #b45309; }
.battery-badge--danger,
.battery-badge--out { background: #fee2e2; color: #b91c1c; }
.battery-badge--ok { background: #dcfce7; color: #15803d; }
.battery-badge--muted { background: #f3f4f6; color: #6b7280; }
.battery-scanner {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #111827;
  min-height: 280px;
}
.battery-scanner #battery-qr-reader { width: 100%; }
.battery-scanner #battery-qr-reader video { object-fit: cover; }
.battery-toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  transform: translateX(-50%);
  z-index: 60;
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
}
.battery-toast--ok { background: #16a34a; }
.battery-toast--err { background: #dc2626; }
.battery-filter-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: #f3f4f6;
  color: #374151;
}
.battery-filter-pill.is-active { background: #dc2626; color: #fff; }
.battery-mov { font-size: 12px; }
.battery-mov--in { color: #15803d; font-weight: 700; }
.battery-mov--out { color: #dc2626; font-weight: 700; }
.battery-mov--correction { color: #b45309; font-weight: 700; }
.battery-stat {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
}
.battery-stat strong { display: block; font-size: 18px; color: #111827; }

.report-date-grid {
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
  gap: 14px;
}

.report-date-field {
  flex: 0 0 calc(50% - 7px);
  width: calc(50% - 7px);
  max-width: calc(50% - 7px);
  min-width: 0;
  overflow: hidden;
}

.report-date-input {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid #d1d5db;
  border-radius: 0.75rem;
  padding: 0.55rem 0.35rem;
  font-size: 0.68rem;
  line-height: 1.2;
  background: #fff;
  -webkit-appearance: none;
  appearance: none;
}

.report-date-input::-webkit-date-and-time-value {
  text-align: left;
  min-width: 0;
}

.report-date-input::-webkit-calendar-picker-indicator {
  margin: 0;
  padding: 0;
  opacity: 0.55;
}

.lbl { display:block; font-size:.75rem; font-weight:700; color:#6b7280; text-transform:uppercase; margin-bottom:.25rem; }
.inp { width:100%; padding:.75rem; border:1px solid #d1d5db; border-radius:.75rem; background:#f9fafb; outline:none; }
.inp:focus { background:#fff; border-color:#dc2626; }
@media print {
  body * { visibility: hidden !important; }
  #receipt-print, #receipt-print *,
  #report-print, #report-print * { visibility: visible !important; }
  #receipt-print {
    position: absolute; left: 0; top: 0;
    width: 80mm; max-width: 80mm;
    box-shadow: none; border: none; border-radius: 0;
  }
  #report-print {
    position: absolute; left: 0; top: 0; width: 100%;
    display: block !important;
    font-family: Arial, sans-serif; font-size: 11px;
    padding: 10mm; background: #ffffff !important; color: #000000 !important;
  }
  .no-print, nav, header, button, .no-print * { display: none !important; }
}
