:root {
  --bg-page: #050608;
  --bg-surface: #0b0d10;
  --bg-surface-soft: #101318;
  --border-subtle: rgba(148, 163, 184, 0.2);
  --accent: #22c55e;
  --accent-soft: rgba(34, 197, 94, 0.12);
  --accent-glow: rgba(34, 197, 94, 0.25);
  --danger: #f97373;
  --text-main: #f9fafb;
  --text-muted: #9ca3b8;
  --radius-lg: 16px;
  --radius-md: 12px;
  --shadow-soft: 0 18px 50px rgba(0, 0, 0, 0.7);
  --transition-fast: 150ms ease-out;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at top, #020617 0%, #020617 40%, #020319 100%);
  color: var(--text-main);
}

body { min-height: 100vh; }

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 16px 12px 32px;
}

/* HEADER */
.header { 
  position: sticky; 
  top: 0; 
  z-index: 10; 
  margin-bottom: 20px; 
}

.header-content {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(15,23,42,0.98), rgba(11,13,16,0.98));
  border: 1px solid rgba(34,197,94,0.2);
  box-shadow: var(--shadow-soft), 0 0 0 1px rgba(34,197,94,0.1);
  transition:
    transform 200ms ease,
    box-shadow 200ms ease;
}

.header-content::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(
    120px 40px at 20% 50%,
    rgba(34,197,94,0.12),
    transparent 70%
  );
  opacity: 0.8;
}

.header h1 {
  position: relative;
  margin: 0;
  padding-left: 14px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #f9fafb, #e2e8f0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header h1::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  transform: translateY(-50%);
  box-shadow: 0 0 8px rgba(34,197,94,0.6);
}

.header-content:hover {
  transform: translateY(-1px);
  box-shadow:
    var(--shadow-soft),
    0 0 20px rgba(34,197,94,0.25);
}

.header-right { display: flex; align-items: center; gap: 10px; }

.env-badge {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  background: var(--bg-surface-soft);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.env-badge:hover {
  color: #e5fbe8;
  border-color: rgba(34,197,94,0.4);
  box-shadow: 0 0 10px rgba(34,197,94,0.25);
}

.refresh-btn {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: none;
  background: var(--bg-surface-soft);
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all var(--transition-fast);
}

.refresh-btn:hover {
  background: #111827;
  transform: translateY(-2px) scale(1.05);
  box-shadow:
    0 0 12px rgba(34,197,94,0.35),
    0 6px 16px rgba(0,0,0,0.45);
}

/* SERVER BAR */
.server-bar{
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 12px;
  margin: 0 0 18px;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(11,13,16,0.97), rgba(16,19,24,0.97));
  border: 1px solid rgba(34,197,94,0.14);
  box-shadow: var(--shadow-soft);
}

.server-item{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(15,23,42,0.55);
  border: 1px solid rgba(148,163,184,0.16);
}

.server-icon{
  width: 18px;
  height: 18px;
  color: var(--accent);
  flex-shrink:0;
  opacity: 0.95;
}

.server-label{
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.3px;
}

.server-value{
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  text-align: right;
}

/* responsive: jadi 4 kolom pas lebar */
@media (min-width: 720px){
  .server-bar{ grid-template-columns: repeat(4, 1fr); }
  .server-item{ padding: 12px 14px; }
}

/* STATS - FIXED */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  position: relative;
  border-radius: var(--radius-md);
  padding: 18px 14px;
  background: linear-gradient(145deg, var(--bg-surface) 0%, rgba(15,23,42,0.95) 100%);
  border: 1px solid rgba(34,197,94,0.15);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  transition: all var(--transition-fast);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, var(--accent-glow) 50%, transparent 100%);
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-soft);
  box-shadow: 0 28px 70px rgba(0,0,0,0.85), 0 0 25px rgba(34,197,94,0.2);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(34,197,94,0.22), rgba(59,130,246,0.18));
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(34,197,94,0.35);
  box-shadow: 0 4px 16px rgba(34,197,94,0.12);
}

.stat-icon svg {
  width: 22px;
  height: 22px;
  color: var(--accent);
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.1;
}

.stat-value.rating { font-size: 22px; }
.stat-sub {
  font-size: 11px;
  color: var(--text-muted);
}

/* QUICK ACTIONS */
.quick-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

/* BASE BUTTON — WAJIB */
.quick-actions .pill-btn {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(34,197,94,0.22);

  background: rgba(15,23,42,0.85);
  color: var(--text-muted);

  font-size: 12px;
  font-weight: 500;
  cursor: pointer;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

/* TENGAH — ACTIVE (GLOW TIPIS) */
.quick-actions .pill-btn.active {
  background: rgba(34,197,94,0.22);
  color: #eafff3;
  border-color: rgba(34,197,94,0.45);

  box-shadow:
    0 0 0 1px rgba(34,197,94,0.25),
    0 0 12px rgba(34,197,94,0.3);
}

/* ATAS / BAWAH — DIM (GLOW LEBIH TIPIS) */
.quick-actions .pill-btn.dim {
  box-shadow:
    0 0 6px rgba(34,197,94,0.18);
}

/* EFEK TIMBUL SAAT HOVER */
.quick-actions .pill-btn:hover {
  transform: translateY(-2px);
  color: #fff;
}

/* hover active dikit lebih hidup */
.quick-actions .pill-btn.active:hover {
  box-shadow:
    0 0 0 1px rgba(34,197,94,0.35),
    0 0 16px rgba(34,197,94,0.45),
    0 6px 14px rgba(0,0,0,0.45);
}

/* hover dim */
.quick-actions .pill-btn.dim:hover {
  box-shadow:
    0 0 10px rgba(34,197,94,0.25),
    0 4px 12px rgba(0,0,0,0.4);
}

/* TABS */
.tab-buttons {
  display: inline-flex;
  gap: 4px;
  padding: 6px;
  border-radius: 999px;
  background: linear-gradient(145deg, rgba(15,23,42,0.95), rgba(11,13,16,0.95));
  border: 1px solid rgba(34,197,94,0.25);
  box-shadow: 0 10px 40px rgba(0,0,0,0.7), 0 0 0 1px rgba(34,197,94,0.15);
  margin-bottom: 18px;
  backdrop-filter: blur(12px);
}

.tab-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  padding: 10px 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.tab-btn svg {
  width: 18px !important;
  height: 18px !important;
  flex-shrink: 0;
}

.tab-btn:hover { 
  background: rgba(34,197,94,0.18);
  color: var(--text-main);
  transform: translateY(-1px);
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--accent-soft), rgba(34,197,94,0.22));
  color: var(--text-main);
  box-shadow: 0 6px 20px rgba(34,197,94,0.25);
  transform: translateY(-2px);
}

.tab-content { margin-top: 4px; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* SEARCH */
.search-filter {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px;
  background: var(--bg-surface-soft);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.search-input, .filter-select {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid rgba(34,197,94,0.2);
  border-radius: var(--radius-md);
  background: rgba(15,23,42,0.8);
  color: var(--text-main);
  font-size: 13px;
}

.search-input::placeholder { color: var(--text-muted); }
.search-input:focus, .filter-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34,197,94,0.15);
}

/* SECTION & LISTS */
.section {
  margin-bottom: 20px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(11,13,16,0.97), rgba(16,19,24,0.97));
  border: 1px solid rgba(34,197,94,0.12);
  box-shadow: 0 20px 60px rgba(0,0,0,0.9);
}

.section h2 {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
}

/* ORDER LIST */
.order-list, .product-list { max-height: 380px; overflow-y: auto; }

.order-card {
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(16,19,24,0.95), rgba(11,13,16,0.95));
  border: 1px solid rgba(34,197,94,0.15);
}

.order-item {
  display: grid;
  grid-template-columns: 1.4fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(31,41,55,0.8);
  transition: background var(--transition-fast);
}

.order-item:hover {
  background: rgba(34,197,94,0.08);
}

.order-item:last-child { border-bottom: none; }

.order-id {
  font-size: 11px;
  color: var(--text-muted);
  font-family: "JetBrains Mono", monospace;
}

.order-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

.order-time {
  font-size: 11px;
  color: var(--text-muted);
}

.order-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  text-align: right;
}

.method-badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: linear-gradient(135deg, #15803d, #22c55e);
  color: white;
  box-shadow: 0 2px 12px rgba(16,185,129,0.4);
}

.method-badge.pending{
  background: rgba(250,204,21,.12);
  border: 1px solid rgba(250,204,21,.35);
  color: #ffe28a;
}

.method-badge.expired{
  background: rgba(249,115,115,.12);
  border: 1px solid rgba(249,115,115,.35);
  color: #ff9b9b;
}

.order-dialog {
  width: min(560px, calc(100vw - 24px));
  border: 1px solid rgba(34,197,94,0.2);
  border-radius: 16px;
  padding: 0;
  background: linear-gradient(145deg, rgba(11,13,16,0.98), rgba(16,19,24,0.98));
  color: var(--text-main);
  box-shadow: 0 30px 80px rgba(0,0,0,0.85);
}

.order-dialog::backdrop {
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
}

.order-dialog__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(148,163,184,0.15);
}

.order-dialog__title {
  font-size: 14px;
  font-weight: 700;
}

.order-dialog__sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.icon-close {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.2);
  background: rgba(15,23,42,0.6);
  color: var(--text-main);
  cursor: pointer;
}

.order-dialog__body {
  padding: 14px 16px 6px;
  display: grid;
  gap: 10px;
}

.kv {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
  padding: 10px 10px;
  border: 1px solid rgba(148,163,184,0.12);
  border-radius: 12px;
  background: rgba(15,23,42,0.35);
}

.kv .k {
  font-size: 11px;
  color: var(--text-muted);
}

.kv .v {
  font-size: 12px;
  color: var(--text-main);
  overflow-wrap: anywhere;
}

.order-dialog__foot {
  padding: 12px 16px 14px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ===== PRODUCTS LIST (FIX UI) ===== */
.product-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;

  padding: 12px 14px;
  border-radius: var(--radius-md);

  background: linear-gradient(145deg, rgba(16,19,24,0.95), rgba(11,13,16,0.95));
  border: 1px solid rgba(34,197,94,0.15);
  box-shadow: 0 12px 34px rgba(0,0,0,0.55);

  transition: transform var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.list-item:hover {
  background: rgba(34,197,94,0.08);
  transform: translateY(-1px);
  box-shadow: 0 18px 46px rgba(0,0,0,0.65);
}

.list-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.list-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.list-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.list-badge {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;

  border: 1px solid rgba(34,197,94,0.35);
  background: rgba(34,197,94,0.14);
  color: #eafff3;
}

.list-badge.habis {
  border-color: rgba(249,115,115,0.40);
  background: rgba(249,115,115,0.14);
  color: #ffecec;
}
/* ===== END PRODUCTS LIST ===== */

/* ===== MODAL ===== */
.modal-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 18px;
}

.modal{
  width: min(560px, 100%);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(11,13,16,0.98), rgba(16,19,24,0.98));
  border: 1px solid rgba(34,197,94,0.18);
  box-shadow: 0 24px 70px rgba(0,0,0,0.85);
  padding: 14px;
}

.modal-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom: 10px;
}

.modal-title{
  font-size: 14px;
  font-weight: 800;
}

.modal-sub{
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  font-family: "JetBrains Mono", monospace;
}

.modal-close{
  border: none;
  background: rgba(15,23,42,0.8);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: 12px;
  cursor: pointer;
}

.modal-textarea{
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid rgba(34,197,94,0.2);
  background: rgba(15,23,42,0.8);
  color: var(--text-main);
  padding: 12px;
  font-size: 13px;
  resize: vertical;
  outline: none;
  margin-bottom: 12px;
}

.modal-textarea:focus{
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34,197,94,0.15);
}

.modal-actions{
  display:flex;
  gap:10px;
  justify-content:flex-end;
}

/* =========================
   FIX FINAL BUTTON PUTIH
   ========================= */

/* SEMUA pill button (termasuk + Stok, Simpan, Batal) */
.pill-btn {
  background: rgba(15,23,42,0.85) !important;
  color: #e5fbe8 !important;
  border: 1px solid rgba(34,197,94,0.35) !important;
  font-weight: 600;
}

/* hover umum */
.pill-btn:hover {
  background: rgba(34,197,94,0.22) !important;
  color: #ffffff !important;
  box-shadow:
    0 0 14px rgba(34,197,94,0.45),
    0 4px 12px rgba(0,0,0,0.4);
  transform: translateY(-1px);
}

/* SIMPAN (ACTIVE) */
.pill-btn.active {
  background: linear-gradient(135deg, #15803d, #22c55e) !important;
  border-color: rgba(34,197,94,0.6) !important;
  color: #ffffff !important;
  box-shadow:
    0 0 18px rgba(34,197,94,0.55),
    0 6px 16px rgba(0,0,0,0.5);
}

/* BATAL (DIM) */
.pill-btn.dim {
  background: rgba(15,23,42,0.75) !important;
  color: #cbd5e1 !important;
  border-color: rgba(148,163,184,0.25) !important;
  box-shadow: none;
}

.pill-btn.dim:hover {
  background: rgba(249,115,115,0.18) !important;
  border-color: rgba(249,115,115,0.45) !important;
  color: #ffecec !important;
}

/* ===== Animations (dialog + modal) ===== */
@keyframes popIn {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes popOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(10px) scale(0.98); }
}

/* dialog open anim */
.order-dialog[open] {
  animation: popIn 180ms ease-out;
}

/* dialog close anim */
.order-dialog.closing {
  animation: popOut 140ms ease-in forwards;
}

/* backdrop anim */
@keyframes backdropIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes backdropOut { from { opacity: 1; } to { opacity: 0; } }

.order-dialog[open]::backdrop { animation: backdropIn 180ms ease-out; }
.order-dialog.closing::backdrop { animation: backdropOut 140ms ease-in forwards; }

/* stock modal anim (div overlay) */
.modal-overlay {
  animation: backdropIn 180ms ease-out;
}

.modal {
  animation: popIn 180ms ease-out;
}

/* Responsive */
@media (min-width: 720px) {
  .container { padding: 24px 20px 48px; }
  .stats-grid { grid-template-columns: repeat(4, 1fr); gap: 18px; }
  .order-item { grid-template-columns: 1.6fr auto auto; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .quick-actions { flex-direction: column; }
}
