/* ===== TELEGRAM QRIS PANEL - STYLE v2 ===== */
:root {
  --tg-blue: #2AABEE;
  --tg-dark: #1E88C8;
  --tg-light: #E8F4FD;
  --tg-bg: #F0F4F8;
  --white: #FFFFFF;
  --text: #1a2940;
  --text-muted: #6B7B8F;
  --border: #D5E8F5;
  --success: #27AE60;
  --danger: #E74C3C;
  --warning: #F39C12;
  --purple: #9B59B6;
  --orange: #E67E22;
  --shadow: 0 2px 12px rgba(42,171,238,0.10);
  --shadow-hover: 0 6px 24px rgba(42,171,238,0.18);
  --radius: 16px;
  --radius-sm: 10px;
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--tg-bg);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: 40px;
  overflow-x: hidden;
  word-wrap: break-word;
  word-break: break-word;
}

/* ===== NAVBAR ===== */
.navbar {
  background: var(--white);
  border-bottom: 2px solid var(--tg-light);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(42,171,238,0.08);
  min-height: 60px;
  gap: 4px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.nav-logo { font-size: 24px; line-height: 1; }

.nav-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--tg-blue);
  letter-spacing: -0.3px;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  transition: all 0.2s;
  gap: 2px;
  min-width: 42px;
  min-height: 44px;
  justify-content: center;
}

.nav-icon { font-size: 18px; line-height: 1; }
.nav-text { font-size: 10px; line-height: 1; }

.nav-link:hover, .nav-link.active {
  background: var(--tg-light);
  color: var(--tg-blue);
}

/* ===== LAYOUT ===== */
.page-wrapper {
  max-width: 800px;
  margin: 0 auto;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ===== HERO ===== */
.hero-section {
  background: linear-gradient(135deg, var(--tg-blue) 0%, var(--tg-dark) 100%);
  border-radius: var(--radius);
  padding: 28px 20px 24px;
  text-align: center;
  color: white;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  pointer-events: none;
}

.hero-section::after {
  content: '';
  position: absolute;
  bottom: -60px; left: -20px;
  width: 150px; height: 150px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  pointer-events: none;
}

.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 12px;
  backdrop-filter: blur(4px);
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}

.gradient-text {
  background: linear-gradient(90deg, #fff 0%, #b3e5ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 13px;
  opacity: 0.85;
  position: relative;
  z-index: 1;
  line-height: 1.5;
}

/* ===== STATS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
  border-left: 4px solid;
  transition: transform 0.2s;
  min-width: 0; /* prevent overflow */
}

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.stat-card.blue   { border-color: var(--tg-blue); }
.stat-card.green  { border-color: var(--success); }
.stat-card.orange { border-color: var(--orange); }
.stat-card.purple { border-color: var(--purple); }

.stat-icon  { font-size: 26px; flex-shrink: 0; line-height: 1; }
.stat-info  { min-width: 0; }
.stat-number { font-size: 22px; font-weight: 800; color: var(--text); line-height: 1; }
.stat-label  { font-size: 10px; color: var(--text-muted); margin-top: 3px; font-weight: 600; line-height: 1.3; }

/* ===== QUICK ACTIONS ===== */
.section-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 10px;
}

.actions-grid { display: flex; flex-direction: column; gap: 10px; }

.action-card {
  display: flex;
  align-items: center;
  background: var(--white);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: all 0.2s;
  border: 2px solid transparent;
  gap: 14px;
  min-width: 0;
}

.action-card:hover {
  border-color: var(--tg-blue);
  background: var(--tg-light);
  transform: translateX(4px);
}

.action-icon  { font-size: 24px; flex-shrink: 0; line-height: 1; }
.action-text  { flex: 1; min-width: 0; }
.action-title { font-size: 14px; font-weight: 700; }
.action-desc  { font-size: 11px; color: var(--text-muted); margin-top: 2px; line-height: 1.4; }
.action-arrow { font-size: 18px; color: var(--tg-blue); font-weight: 800; flex-shrink: 0; }

/* ===== ALERT BANNER ===== */
.alert-banner {
  background: linear-gradient(135deg, #FF6B35 0%, #FF4444 100%);
  color: white;
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.alert-icon { font-size: 20px; flex-shrink: 0; }
.alert-banner > span { flex: 1; font-size: 13px; font-weight: 500; min-width: 120px; }

.alert-btn {
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.4);
  color: white;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ===== PAGE HEADER ===== */
.page-header {
  padding: 4px 0 8px;
}
.page-header h1 { font-size: 20px; font-weight: 800; }
.page-header p  { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ===== CARD ===== */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  padding: 14px 18px;
  font-weight: 700;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--tg-light);
  color: var(--tg-dark);
  gap: 8px;
  flex-wrap: wrap;
}

/* ===== FORM ===== */
.form-grid {
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full-width { grid-column: 1 / -1; }

.form-group label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
}

.form-group input[type=text],
.form-group input[type=number],
.form-group input[type=password],
.form-group input[type=file],
.form-group select,
.form-group textarea {
  padding: 11px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--tg-bg);
  transition: border-color 0.2s;
  outline: none;
  width: 100%;
  max-width: 100%;
  -webkit-appearance: none;
  appearance: none;
}

.form-group input[type=file] {
  padding: 10px 12px;
  cursor: pointer;
}

.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236B7B8F' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--tg-blue);
  background: var(--white);
}

.form-group textarea { resize: vertical; min-height: 80px; }

.field-hint, .file-hint {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ===== BUTTONS ===== */
.btn {
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 48px;
  text-decoration: none;
  -webkit-appearance: none;
  appearance: none;
}

.btn-primary  { background: var(--tg-blue); color: white; }
.btn-primary:hover { background: var(--tg-dark); }

.btn-secondary { background: var(--tg-light); color: var(--tg-dark); border: 2px solid var(--border); }
.btn-secondary:hover { background: var(--border); }

.btn-success  { background: var(--success); color: white; }
.btn-success:hover { background: #219a52; }

.btn-danger   { background: var(--danger); color: white; }
.btn-danger:hover { background: #c0392b; }

.btn-sm {
  padding: 7px 12px;
  font-size: 12px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 36px;
  white-space: nowrap;
  -webkit-appearance: none;
  appearance: none;
}

.btn-edit    { background: var(--tg-light); color: var(--tg-dark); }
.btn-outline { background: transparent; color: var(--tg-blue); border: 2px solid var(--tg-blue); }
.btn-sm.btn-danger { background: #fef0f0; color: var(--danger); }

/* ===== ALERT MSG ===== */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}
.alert-success { background: #edfbf3; color: #1a7a46; border: 1px solid #a7e9c3; }
.alert-error   { background: #fef0f0; color: #c0392b; border: 1px solid #f5b7b1; }

/* ===== TABLE ===== */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 420px; }
.data-table th {
  padding: 10px 12px;
  background: var(--tg-light);
  text-align: left;
  font-weight: 700;
  color: var(--tg-dark);
  font-size: 11px;
  white-space: nowrap;
}
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:hover td { background: var(--tg-light); }

.prod-name { font-weight: 700; font-size: 13px; }
.prod-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; line-height: 1.3; }
.price-badge {
  background: var(--tg-light);
  color: var(--tg-dark);
  padding: 3px 8px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 12px;
  white-space: nowrap;
}

.action-btns { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* ===== STATUS BADGE ===== */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.status-badge.active          { background: #edfbf3; color: var(--success); }
.status-badge.inactive        { background: #fef0f0; color: var(--danger); }
.status-badge.pending         { background: #fef9e7; color: var(--warning); }
.status-badge.waiting_confirm { background: #eaf3ff; color: var(--tg-blue); }
.status-badge.completed       { background: #edfbf3; color: var(--success); }
.status-badge.rejected        { background: #fef0f0; color: var(--danger); }

/* ===== STOCK BADGES ===== */
.stock-summary {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.stock-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.stock-badge.available { background: #d4edda; color: #155724; }
.stock-badge.used      { background: #f8d7da; color: #721c24; }
.stock-badge.total     { background: #cce5ff; color: #004085; }

/* ===== FILE LIST ===== */
.file-list { margin-top: 12px; }
.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 12px;
  gap: 8px;
  flex-wrap: wrap;
  word-break: break-all;
}
.file-item .file-status-used   { color: #e74c3c; font-weight: 600; }
.file-item .file-status-unused { color: #27ae60; font-weight: 600; }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ===== FILTER TABS ===== */
.filter-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 7px 12px;
  border-radius: 20px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--white);
  border: 2px solid var(--border);
  transition: all 0.2s;
  white-space: nowrap;
}

.filter-tab:hover, .filter-tab.active {
  background: var(--tg-blue);
  color: white;
  border-color: var(--tg-blue);
}

/* ===== ORDERS LIST ===== */
.orders-list { display: flex; flex-direction: column; }

.order-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  transition: background 0.15s;
}
.order-row:hover { background: var(--tg-light); }
.order-row:last-child { border-bottom: none; }

.order-meta { flex: 1.2; min-width: 110px; }
.order-code { font-weight: 800; font-size: 12px; color: var(--tg-dark); font-family: monospace; word-break: break-all; }
.order-user { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.order-date { font-size: 10px; color: var(--text-muted); }

.order-info { flex: 1.5; min-width: 110px; }
.order-product { font-size: 12px; font-weight: 600; }
.order-amount  { font-size: 13px; font-weight: 800; color: var(--success); margin-top: 2px; }

.order-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }

/* ===== DETAIL CARD ===== */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 0 18px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.detail-label { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.detail-val   { font-size: 13px; font-weight: 700; word-break: break-word; }

.bukti-section { padding: 16px; }
.bukti-title { font-weight: 700; margin-bottom: 10px; }
.bukti-img {
  max-width: 100%;
  max-height: 280px;
  border-radius: 12px;
  border: 2px solid var(--border);
  cursor: pointer;
  display: block;
}

.order-actions {
  padding: 14px 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
}

.order-actions .btn { width: auto; min-width: 120px; }

.reject-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; width: 100%; }
.reject-input {
  padding: 9px 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  flex: 1;
  min-width: 140px;
  -webkit-appearance: none;
  appearance: none;
}
.reject-input:focus { border-color: var(--danger); }

/* ===== SETTINGS ===== */
.bot-actions {
  padding: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.bot-actions .btn { width: auto; }

.webhook-info {
  background: var(--tg-light);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 11px;
  word-break: break-all;
  line-height: 1.5;
}

.webhook-info code {
  background: var(--border);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
}

.current-qris { margin-bottom: 12px; }
.qris-preview {
  max-width: 150px;
  border-radius: 10px;
  border: 2px solid var(--tg-blue);
  display: block;
  margin-bottom: 6px;
}

/* ===== INFO CARD ===== */
.info-card .info-list { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.info-item { display: flex; gap: 12px; align-items: flex-start; font-size: 13px; line-height: 1.5; }
.info-num {
  min-width: 26px; height: 26px;
  background: var(--tg-blue); color: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ===== QUICK ACTIONS SECTION ===== */
.quick-actions { display: flex; flex-direction: column; gap: 0; }

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .page-wrapper { padding: 12px 10px; gap: 12px; }
  .form-grid { grid-template-columns: 1fr; padding: 14px; gap: 12px; }
  .detail-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 20px; }
  .stat-number { font-size: 20px; }
  .stat-label { font-size: 9px; }
  .order-row { gap: 8px; }
  .reject-input { width: 100%; }
  .hero-section { padding: 22px 16px 20px; }
  .card-header { padding: 12px 14px; font-size: 13px; }
  .btn { font-size: 13px; padding: 11px 18px; }
}

@media (max-width: 400px) {
  .navbar { min-height: 56px; padding: 0 6px; gap: 2px; }
  .nav-brand { gap: 4px; }
  .nav-logo { font-size: 18px; }
  .nav-title { font-size: 11px; letter-spacing: -0.5px; }
  .nav-links { gap: 0px; }
  .nav-link { padding: 4px 5px; min-width: 36px; min-height: 44px; gap: 1px; }
  .nav-icon { font-size: 15px; }
  .nav-text { font-size: 8px; }
  .stats-grid { gap: 8px; }
  .stat-card { padding: 12px 10px; gap: 8px; }
  .stat-icon { font-size: 22px; }
  .hero-title { font-size: 18px; }
  .hero-badge { font-size: 11px; padding: 3px 10px; }
  .action-card { padding: 12px 12px; }
  .data-table { font-size: 12px; }
}

@media (min-width: 600px) {
  .form-grid { padding: 20px; }
  .btn { width: auto; }
}
.status-badge.canceled        { background: #f4f6f8; color: #7f8c8d; }
