* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  background-color: #f1f5f9;
  color: #1e293b;
  min-height: 100vh;
}

.app-layout {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  padding: 18px 24px;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
}

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

.brand-icon {
  font-size: 32px;
}

.brand h1 {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
}

.brand p {
  font-size: 13px;
  color: #64748b;
}

.badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
}

.badge-pulse {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

/* Tab Control */
.tab-control {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 8px;
  overflow-x: auto;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: transparent;
  border: none;
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  border-radius: 8px;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.tab-btn.active {
  background: #2563eb;
  color: #ffffff;
}

.btn-highlight.active {
  background: #0f172a !important;
  color: #38bdf8 !important;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* Cards */
.card {
  background: #ffffff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
}

.card-header {
  margin-bottom: 20px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 12px;
}

.card-header h2, .card-header h3 {
  color: #0f172a;
}

.card-header p {
  font-size: 13px;
  color: #64748b;
  margin-top: 4px;
}

/* Forms */
.form-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: #2563eb;
  letter-spacing: 0.5px;
  margin: 18px 0 10px 0;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group.full-width {
  grid-column: 1 / -1;
}

.input-group label {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.required {
  color: #ef4444;
}

.input-group input,
.input-group select,
.filter-group input {
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  color: #1e293b;
  outline: none;
}

.input-group input:focus,
.input-group select:focus,
.filter-group input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-action-group {
  display: flex;
  gap: 8px;
}

.input-action-group input {
  flex: 1;
}

.help-text {
  font-size: 11px;
  color: #64748b;
}

/* Buttons */
.form-actions {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
}

.btn {
  padding: 12px 22px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary { background: #2563eb; color: #ffffff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-success { background: #059669; color: #ffffff; }
.btn-success:hover { background: #047857; }
.btn-secondary { background: #f1f5f9; color: #334155; border: 1px solid #cbd5e1; }
.btn-secondary:hover { background: #e2e8f0; }

/* Filter Card Laporan */
.filter-card {
  background: #ffffff;
  padding: 16px 20px;
  border-radius: 10px;
  margin-bottom: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  border: 1px solid #e2e8f0;
}

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

.filter-group label {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
}

.store-badge-indicator {
  font-size: 13px;
  padding: 6px 14px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  color: #1e40af;
}

/* KPI Dashboard Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

@media (max-width: 900px) {
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.kpi-card {
  background: #ffffff;
  border-radius: 10px;
  padding: 18px;
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kpi-title {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.5px;
}

.kpi-val {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
}

.kpi-sub {
  font-size: 11px;
  color: #94a3b8;
}

.text-primary { color: #2563eb !important; }
.text-success { color: #059669 !important; }
.text-danger { color: #dc2626 !important; }

/* Sub Tabs */
.subtab-control {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  overflow-x: auto;
}

.subtab-btn {
  padding: 10px 16px;
  background: #e2e8f0;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  white-space: nowrap;
}

.subtab-btn.active {
  background: #1e293b;
  color: #ffffff;
}

/* Report Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.report-table th, .report-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}

.report-table th {
  background: #1e3a8a;
  color: #ffffff;
  font-weight: 600;
  font-size: 12px;
}

.report-table tr:nth-child(even) {
  background: #f8fafc;
}

.report-table tfoot td {
  font-weight: bold;
  background: #e2e8f0;
  border-top: 1px solid #94a3b8;
}

.status-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: bold;
}

.status-safe {
  background: #dcfce7;
  color: #166534;
}

.status-alert {
  background: #fee2e2;
  color: #991b1b;
}

/* Financial Tables (Laba Rugi & Neraca) */
.financial-table td {
  padding: 8px 12px;
}

.fin-head {
  font-weight: 700;
  color: #1e3a8a;
  background: #f1f5f9 !important;
}

.fin-subtotal {
  font-weight: 700;
  border-top: 1px solid #cbd5e1;
  background: #f8fafc;
}

.fin-grand {
  font-weight: 800;
  font-size: 14px;
  background: #e2e8f0 !important;
  border-top: 1px solid #1e293b;
  border-bottom: 2px double #1e293b;
}

.balance-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 800px) {
  .balance-grid {
    grid-template-columns: 1fr;
  }
}

.balance-title {
  background: #1e3a8a;
  color: #ffffff;
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 6px 6px 0 0;
}

/* Result Box */
.result-box {
  margin-top: 20px;
  padding: 16px;
  border-radius: 8px;
}

.result-box.hidden { display: none; }
.result-success { background: #f0fdf4; border: 1px solid #86efac; color: #166534; }
.result-error { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }

.code-highlight {
  font-family: monospace;
  font-size: 16px;
  font-weight: 700;
  background: #ffffff;
  padding: 4px 10px;
  border: 1px dashed #059669;
  border-radius: 6px;
  color: #059669;
  display: inline-block;
}

.summary-container { display: flex; flex-direction: column; gap: 14px; }
.store-card { border: 1px solid #e2e8f0; border-radius: 10px; padding: 16px; background: #f8fafc; }
.store-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #e2e8f0; padding-bottom: 10px; margin-bottom: 10px; }

.footer { text-align: center; font-size: 12px; color: #94a3b8; margin-top: 30px; }


/* ========================================================================= */
/* TAMBAHAN STYLE: KELOLA USER TOKO, MODAL & LAPORAN HARIAN/BULANAN/TAHUNAN  */
/* ========================================================================= */

.user-filter-bar {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  background: #f8fafc;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.btn-sm:hover { opacity: 0.85; }
.btn-sm-edit { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.btn-sm-del { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 16px;
}

.modal-card {
  background: #ffffff;
  width: 100%;
  max-width: 460px;
  border-radius: 12px;
  padding: 22px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15);
}

.btn-icon-close {
  background: #f1f5f9;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  color: #475569;
}

/* Periodic Reports Toolbar */
.periodic-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.period-mode-pills {
  display: flex;
  gap: 6px;
  background: #f1f5f9;
  padding: 5px;
  border-radius: 10px;
}

.period-pill {
  padding: 9px 14px;
  border: none;
  background: transparent;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}

.period-pill.active {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.25);
}

.period-date-inputs {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.period-input-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.period-input-group label {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.period-input-group input,
.period-input-group select {
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 13px;
  color: #0f172a;
}

/* Split Grid Payment & Top Products */
.periodic-split-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 16px;
}

@media (max-width: 820px) {
  .periodic-split-grid {
    grid-template-columns: 1fr;
  }
}

.payment-method-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pay-method-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
}

/* Bar Chart CSS */
.bar-chart-container {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 190px;
  padding: 24px 8px 8px 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow-x: auto;
}

.bar-col {
  flex: 1;
  min-width: 24px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
}

.bar-val-tip {
  font-size: 10px;
  color: #475569;
  font-weight: 600;
}

.bar-fill {
  width: 100%;
  max-width: 34px;
  background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
  border-radius: 4px 4px 0 0;
  transition: height 0.3s ease;
}

.bar-label {
  font-size: 11px;
  font-weight: 700;
  color: #334155;
}

@media print {
  .navbar, .tab-control, .filter-card, .subtab-control, .periodic-toolbar, .footer {
    display: none !important;
  }
  body {
    background: #ffffff;
  }
  .app-layout {
    max-width: 100%;
    padding: 0;
  }
  .card {
    box-shadow: none;
    border: 1px solid #cbd5e1;
  }
}


/* ========================================================================= */
/* STYLE PEMBAYARAN AKTIVASI TOKO BARU & LISENSI CABANG                      */
/* ========================================================================= */
.plan-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 768px) {
  .plan-cards-grid {
    grid-template-columns: 1fr;
  }
}

.plan-card {
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.plan-card:hover {
  border-color: #93c5fd;
  background: #f8fafc;
}

.plan-card.active {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.12);
}

.plan-badge {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  margin-bottom: 4px;
}

.badge-popular {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge-best {
  background: #dcfce7;
  color: #15803d;
}

.plan-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.plan-price {
  font-size: 18px;
  font-weight: 800;
  color: #2563eb;
}

.plan-desc {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

.billing-summary-box {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bill-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #334155;
}

.bill-total {
  border-top: 1px dashed #94a3b8;
  padding-top: 6px;
  margin-top: 2px;
  font-size: 15px;
  color: #0f172a;
}

.pg-invoice-banner {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px;
}

.pg-pay-instruction {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 14px;
  text-align: center;
}

.qris-mock-frame {
  display: inline-flex;
  padding: 10px;
  border: 2px solid #0f172a;
  border-radius: 10px;
  background: #ffffff;
  margin: 4px auto;
}

.va-number-display {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f1f5f9;
  border: 1px dashed #64748b;
  padding: 10px 14px;
  border-radius: 8px;
  font-family: monospace;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.receipt-paid-box {
  text-align: center;
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 10px;
  padding: 16px;
}

.receipt-detail-card {
  background: #ffffff;
  border: 1px solid #dcfce7;
  border-radius: 8px;
  padding: 12px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
}


/* ========================================================================= */
/* LOGIN GATEWAY & SEPARATED ROLE DASHBOARD STYLES (ADMIN vs CUSTOMER)       */
/* ========================================================================= */
.login-body {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.login-wrapper {
  width: 100%;
  max-width: 480px;
}
.login-header {
  text-align: center;
  color: #f8fafc;
  margin-bottom: 20px;
}
.login-logo {
  width: 56px;
  height: 56px;
  background: #2563eb;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 10px;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}
.login-header h1 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 4px;
}
.login-header p {
  font-size: 13px;
  color: #94a3b8;
}
.login-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 20px 35px rgba(0, 0, 0, 0.25);
}
.role-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: #f1f5f9;
  padding: 5px;
  border-radius: 10px;
  margin-bottom: 16px;
}
.role-tab-btn {
  padding: 10px 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 12.5px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s;
}
.role-tab-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}
.role-info-banner {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
  margin-bottom: 14px;
  line-height: 1.45;
}
.role-customer-banner {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}
.role-admin-banner {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #0f172a;
}
.btn-dark-admin {
  background: #0f172a;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}
.btn-dark-admin:hover {
  background: #1e293b;
}
.login-error-box {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #dc2626;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 12px;
}
.register-cta {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
  text-align: center;
  font-size: 12.5px;
  color: #64748b;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.link-btn {
  background: none;
  border: none;
  color: #2563eb;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
}
.login-footer {
  text-align: center;
  color: #64748b;
  font-size: 12px;
  margin-top: 16px;
}
.navbar-admin {
  border-top: 4px solid #0f172a;
}
.navbar-customer {
  border-top: 4px solid #2563eb;
}
.role-pill {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.pill-admin {
  background: #0f172a;
  color: #f8fafc;
}
.pill-customer {
  background: #dbeafe;
  color: #1d4ed8;
}
.sub-status-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 18px;
  border-radius: 10px;
  margin-bottom: 18px;
}
.sub-active {
  background: #dcfce7;
  border: 1px solid #86efac;
  color: #166534;
}
.sub-suspended {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
}
