/* ============================================================
   DESAIN APLIKASI ROBOT TRADING SPOT (DARK MODE - TAB MENU)
   ============================================================ */
:root {
  --bg-color: #0b0f19;
  --panel-bg: #151d2e;
  --panel-bg-darker: #0d1424;
  --panel-card: #182337;
  --text-color: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --success: #16a34a;
  --success-hover: #15803d;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --border: #24324a;
  --border-light: #334464;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 16px 20px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  min-height: 100vh;
}

h1, h2, h3, h4 {
  margin-top: 0;
  color: #fff;
}

/* Layout Kontainer Utama */
.app-layout {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ============================================================
   TOP STICKY HEADER (BRAND, STATUS, ACTION BUTTONS)
   ============================================================ */
.top-header {
  background-color: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  position: sticky;
  top: 10px;
  z-index: 100;
}

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

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #1e40af, #2563eb);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.brand-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.3px;
  margin: 0;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* Status Badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  background-color: #1e293b;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot-stopped {
  background-color: var(--danger);
}

.status-dot-running {
  background-color: var(--success);
  box-shadow: 0 0 10px var(--success);
  animation: pulse-dot 1.8s infinite;
}

@keyframes pulse-dot {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(1.25); }
  100% { opacity: 1; transform: scale(1); }
}

/* Tombol Header */
.btn-header-group {
  display: flex;
  gap: 10px;
}

button {
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  color: white;
  transition: all 0.2s ease;
  font-size: 13px;
  padding: 8px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

button:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  background-color: #334155 !important;
  color: #64748b !important;
  cursor: not-allowed !important;
  opacity: 0.6;
  transform: none;
  box-shadow: none;
}

.btn-start {
  background-color: var(--success);
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.3);
}

.btn-start:hover {
  background-color: var(--success-hover);
}

.btn-stop {
  background-color: var(--danger);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.btn-stop:hover {
  background-color: var(--danger-hover);
}

/* ============================================================
   TOP HORIZONTAL TAB NAVIGATION (PUSAT MENU NAVIGASI PRESISI)
   ============================================================ */
.tab-nav-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-bottom: 20px;
}

.tab-navigation {
  background-color: #0b1329;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 5px;
  display: inline-flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.tab-navigation::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.tab-btn:hover {
  background-color: rgba(51, 65, 85, 0.45);
  color: #f8fafc;
}

.tab-btn.active {
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: #ffffff;
  border-color: #3b82f6;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.4);
}

/* ============================================================
   TAB CONTENT PANES
   ============================================================ */
.tab-pane {
  display: none;
  animation: fadeIn 0.25s ease;
}

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

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   DASHBOARD TAB STYLES (METRICS, OPEN POSITIONS, & LOG)
   ============================================================ */
.dashboard-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric-card-dash {
  background-color: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.metric-card-dash:hover {
  border-color: #3b82f6;
  transform: translateY(-2px);
}

.metric-head-dash {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.metric-label-dash {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.metric-val-dash {
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  font-family: 'Consolas', monospace, sans-serif;
  letter-spacing: -0.5px;
}

.metric-sub-dash {
  font-size: 11.5px;
  color: #94a3b8;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Sinyal Badge */
.signal-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.signal-pill-buy {
  background: rgba(37, 99, 235, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.5);
}

.signal-pill-sell {
  background: rgba(22, 163, 74, 0.2);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.5);
}

.signal-pill-hold {
  background: rgba(100, 116, 139, 0.2);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.4);
}

/* Card untuk Tabel Posisi Terbuka */
.positions-wrapper {
  background-color: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  margin-bottom: 20px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.positions-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 12px;
}

.positions-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  color: #f8fafc;
}

.positions-badges-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Indikator Pantau Candlestick DCA */
.candle-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  user-select: none;
  transition: all 0.2s ease;
}

.candle-pill-counting {
  background: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.candle-pill-ready {
  background: rgba(34, 197, 94, 0.16);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.5);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.2);
}

.candle-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.candle-pill-counting .candle-dot {
  background-color: #fbbf24;
  box-shadow: 0 0 5px #fbbf24;
}

.candle-pill-ready .candle-dot {
  background-color: #22c55e;
  box-shadow: 0 0 6px #22c55e;
}

/* Kontainer Scrollabel Tabel Posisi Terbuka (Diperbesar & Scrollable) */
.positions-scroll-container {
  width: 100%;
  max-height: 420px;
  min-height: auto;
  overflow-y: auto;
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #080d1a;
  position: relative;
}

.positions-scroll-container table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  text-align: left;
}

.positions-scroll-container table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background-color: #0d1527;
  color: var(--text-muted);
  font-weight: 600;
  padding: 11px 13px;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  white-space: nowrap;
}

.positions-scroll-container table tbody td {
  padding: 11px 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#barisKosongPosisi td {
  border-bottom: none !important;
  padding: 42px 20px !important;
}

.positions-scroll-container::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

.positions-scroll-container::-webkit-scrollbar-track {
  background: #080d1a;
}

.positions-scroll-container::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 4px;
}

.positions-scroll-container::-webkit-scrollbar-thumb:hover {
  background: #3b82f6;
}

/* Dedicated Chart View Tab */
.chart-fullscreen-card {
  background-color: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.chart-fullscreen-container {
  width: 100%;
  height: 640px;
  min-height: 520px;
  background-color: #0f172a;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}

#smartChartWrapper {
  width: 100%;
  height: 100%;
  position: relative;
  min-height: 520px;
  touch-action: pan-y pinch-zoom;
  user-select: none;
  -webkit-user-select: none;
}

#smartChartBox {
  width: 100%;
  height: 100%;
  min-height: 520px;
  touch-action: pan-y pinch-zoom;
  user-select: none;
  -webkit-user-select: none;
}

#smartChartBox canvas {
  cursor: grab;
}

#smartChartBox canvas:active {
  cursor: grabbing;
}

/* ============================================================
   TOGGLE MODE GRAFIK (SMART ROBOT CHART vs TRADINGVIEW WIDGET)
   ============================================================ */
.chart-mode-pill-group {
  display: inline-flex;
  align-items: center;
  background: #0f172a;
  border: 1px solid #24324a;
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.chart-mode-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.chart-mode-btn:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.05);
}

.chart-mode-btn.active {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.4);
}

/* Floating OHLC Legend on Native Smart Chart */
.smart-chart-legend {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 10;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 11.5px;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(4px);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(51, 65, 85, 0.4);
}

.scl-symbol {
  font-weight: 700;
  color: #60a5fa;
}

.scl-ohlc {
  color: #cbd5e1;
}

.terminal-wrapper {
  background-color: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.terminal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.terminal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}

.log-area {
  background-color: #050811;
  color: #22c55e;
  font-family: 'Consolas', 'Courier New', Courier, monospace;
  padding: 14px;
  border-radius: var(--radius-sm);
  height: 220px;
  overflow-y: auto;
  font-size: 12.5px;
  border: 1px solid var(--border);
  line-height: 1.5;
}

.log-entry {
  margin-bottom: 4px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
  padding-bottom: 3px;
  word-break: break-word;
}

.log-error { color: #f87171; }
.log-info { color: #60a5fa; }
.log-success { color: #4ade80; }

/* ============================================================
   CONFIG CARDS & FORM ELEMENTS (FOR MENU TABS)
   ============================================================ */
.config-container {
  width: 100%;
  margin: 0 auto;
}

.config-container.narrow {
  max-width: 920px;
}

.config-card {
  background-color: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  margin-bottom: 20px;
  width: 100%;
}

.card-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
  margin-bottom: 18px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 4px 0;
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

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

.form-group {
  margin-bottom: 16px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #cbd5e1;
}

input, select {
  width: 100%;
  padding: 10px 12px;
  background-color: var(--panel-bg-darker);
  border: 1px solid var(--border);
  color: white;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  transition: border-color 0.2s ease;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.helper-text {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 5px;
  line-height: 1.4;
}

.parameter-box {
  background-color: var(--panel-bg-darker);
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-top: 10px;
}

.divider {
  border: none;
  height: 1px;
  background-color: var(--border);
  margin: 20px 0;
}

/* ============================================================
   TABLE STYLES (RIWAYAT TRANSAKSI)
   ============================================================ */
.table-responsive {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  text-align: left;
}

th {
  background-color: var(--panel-bg-darker);
  color: var(--text-muted);
  font-weight: 600;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
}

tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

/* Kotak Rekap & Badge Status Riwayat */
.trade-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat-box {
  background-color: var(--panel-bg-darker);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
}

.stat-value.profit {
  color: #4ade80;
}

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.badge-buy {
  background: rgba(37, 99, 235, 0.18);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.badge-sell {
  background: rgba(22, 163, 74, 0.18);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.4);
}

.badge-loss {
  background: rgba(220, 38, 38, 0.18);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

/* ============================================================
   ICONS & UTILITIES
   ============================================================ */
.icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.btn-with-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.title-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ============================================================
   RESPONSIVE DESIGN (TABLET & SMARTPHONE HP)
   ============================================================ */
@media (max-width: 900px) {
  body {
    padding: 12px 14px;
  }

  .top-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .brand-section {
    justify-content: space-between;
  }

  .header-actions {
    justify-content: space-between;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .chart-fullscreen-container {
    height: 480px;
    min-height: 400px;
  }

  .log-area {
    height: 190px;
  }

  .tab-btn {
    padding: 8px 14px;
    font-size: 12.5px;
  }
}

/* KHUSUS SMARTPHONE / BROWSER HP (LAYAR <= 640px) */
@media (max-width: 640px) {
  body {
    padding: 8px 10px 24px 10px;
  }

  .app-layout {
    gap: 10px;
  }

  /* 1. TOP HEADER PRESISI DI HP */
  .top-header {
    padding: 10px 12px;
    gap: 10px;
    position: sticky;
    top: 0;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  }

  .brand-section {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .brand-icon {
    width: 32px;
    height: 32px;
  }

  .brand-title {
    font-size: 15px;
    letter-spacing: 0.2px;
  }

  .brand-subtitle {
    font-size: 10.5px;
  }

  /* Header Actions: Baris 1 Status & Profil Akun, Baris 2 Tombol Eksekusi */
  .header-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  .status-badge {
    order: 1;
    padding: 5px 10px;
    font-size: 11px;
    border-radius: 14px;
  }

  .user-header-profile {
    order: 2;
    margin-left: auto;
    border-left: none;
    padding-left: 0;
  }

  .btn-profile-trigger {
    height: 32px;
    padding: 2px 8px 2px 4px;
    gap: 6px;
    border-radius: 6px;
  }

  .profile-avatar-icon {
    width: 22px;
    height: 22px;
  }

  .profile-avatar-icon svg {
    width: 12px;
    height: 12px;
  }

  .user-name-label {
    font-size: 11.5px;
    max-width: 105px;
  }

  .user-role-label {
    font-size: 8px;
    padding: 1px 4px;
  }

  /* Tombol Mulai & Hentikan Bot Berdampingan 50% - 50% Touch-Friendly */
  .btn-header-group {
    order: 3;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 2px;
  }

  .btn-header-group button {
    width: 100%;
    height: 40px;
    padding: 8px 10px;
    font-size: 13px;
    justify-content: center;
    border-radius: 8px;
  }

  /* 2. TAB NAVIGASI HORIZONTAL SWIPEABLE DI HP */
  .tab-nav-wrapper {
    margin-bottom: 10px;
    justify-content: flex-start;
  }

  .tab-navigation {
    width: 100%;
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 3px;
    gap: 4px;
    border-radius: 10px;
    background-color: #0b1329;
  }

  .tab-navigation::-webkit-scrollbar {
    display: none;
  }

  .tab-btn {
    flex: 0 0 auto;
    padding: 7px 11px;
    font-size: 11.5px;
    gap: 6px;
    border-radius: 7px;
  }

  .tab-btn svg {
    width: 13px;
    height: 13px;
  }

  /* 3. GRID KARTU METRIK DASHBOARD (2 KOLOM KOMPAK & RAPI) */
  .dashboard-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 12px;
  }

  .metric-card-dash {
    padding: 10px 12px;
    gap: 4px;
    border-radius: 10px;
  }

  .metric-label-dash {
    font-size: 9.5px;
    letter-spacing: 0.3px;
  }

  .metric-val-dash {
    font-size: 16px;
    letter-spacing: -0.3px;
  }

  .metric-sub-dash {
    font-size: 9.5px;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .signal-pill {
    font-size: 9px;
    padding: 2px 6px;
  }

  /* 4. POSISI TERBUKA PADA HP */
  .positions-wrapper {
    padding: 12px 10px;
    margin-bottom: 12px;
    border-radius: 10px;
  }

  .positions-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
  }

  .positions-title {
    font-size: 13.5px;
  }

  .positions-badges-group {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
  }

  .candle-pill, #badgeJumlahPosisiAktif {
    font-size: 10px;
    padding: 3px 8px;
  }

  .positions-scroll-container {
    display: none !important;
  }

  .positions-mobile-cards {
    display: flex !important;
    flex-direction: column;
    gap: 10px;
    margin-top: 6px;
  }

  /* 5. TERMINAL LOG PADA HP */
  .terminal-wrapper {
    padding: 12px 10px;
    border-radius: 10px;
  }

  .terminal-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
  }

  .terminal-header > div {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .terminal-title {
    font-size: 13px;
  }

  .log-area {
    height: 160px;
    font-size: 10.5px;
    padding: 10px;
    line-height: 1.4;
    border-radius: 8px;
  }

  /* 6. GRAFIK LIVE PADA HP */
  .chart-fullscreen-card {
    padding: 10px;
    border-radius: 10px;
  }

  .chart-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
  }

  .chart-header > div {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .chart-fullscreen-container {
    height: 380px;
    min-height: 300px;
    border-radius: 8px;
  }

  #smartChartWrapper,
  #smartChartBox {
    min-height: 340px;
  }

  .chart-mode-pill-group {
    width: 100%;
    justify-content: space-between;
    margin-bottom: 4px;
  }

  .chart-mode-btn {
    flex: 1;
    text-align: center;
    font-size: 10.5px;
    padding: 3.5px 6px;
  }

  .smart-chart-legend {
    top: 6px;
    left: 8px;
    font-size: 10px;
    gap: 4px;
    padding: 2px 6px;
  }

  /* 7. FORMULIR STRATEGI & PENGATURAN PADA HP */
  .config-card {
    padding: 16px 12px;
    margin-bottom: 12px;
    border-radius: 10px;
  }

  .card-title {
    font-size: 14.5px;
  }

  .card-subtitle {
    font-size: 11px;
  }

  .form-row {
    grid-template-columns: 1fr !important;
    gap: 0;
  }

  .form-group {
    margin-bottom: 12px;
  }

  input, select {
    padding: 10px 12px;
    font-size: 14px;
    border-radius: 8px;
  }

  #btnTerapkanStrategi,
  #btnSimpanPengaturan,
  #btnTesKoneksi,
  #btnResetPosisi {
    width: 100% !important;
    height: 42px !important;
    font-size: 13px !important;
    justify-content: center !important;
    border-radius: 8px !important;
    margin-top: 6px !important;
  }

  /* 8. RIWAYAT TRANSAKSI PADA HP */
  #tab-history .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  #tab-history .card-header > div:last-child {
    width: 100%;
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px !important;
  }

  #btnHapusRiwayat,
  #btnDownloadCSV {
    width: 100% !important;
    height: 38px !important;
    justify-content: center !important;
    padding: 6px 8px !important;
    font-size: 11px !important;
    border-radius: 6px !important;
  }

  .trade-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 12px;
  }

  .stat-box {
    padding: 10px 12px;
    border-radius: 8px;
  }

  .stat-label {
    font-size: 9.5px;
  }

  .stat-value {
    font-size: 16px;
  }

  .table-responsive {
    border-radius: 8px;
    -webkit-overflow-scrolling: touch;
  }

  .table-responsive th,
  .table-responsive td {
    padding: 8px 10px;
    font-size: 11px;
    white-space: nowrap;
  }

  /* 9. KELOLA PENGGUNA PADA HP */
  .form-add-user-grid {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }

  .btn-create-user {
    width: 100%;
    height: 42px;
    font-size: 13px;
    border-radius: 8px;
  }

  .btn-action-reset,
  .btn-action-del {
    padding: 5px 8px;
    font-size: 11px;
  }

  /* 10. POPUP MODAL PENGATURAN AKUN PADA HP */
  .account-modal-overlay {
    padding: 10px;
    align-items: center;
    justify-content: center;
  }

  .account-modal-card {
    max-width: 100%;
    width: 100%;
    max-height: 90vh;
    border-radius: 12px;
  }

  .account-modal-header {
    padding: 12px 14px;
  }

  .account-modal-body {
    padding: 12px 14px;
    gap: 12px;
  }

  .account-section-card {
    padding: 10px 12px;
  }

  .account-modal-uname {
    font-size: 14px;
  }

  /* 11. MODAL LOGIN PADA HP */
  .login-overlay {
    padding: 12px;
  }

  .login-card {
    padding: 24px 18px;
    max-width: 100%;
    border-radius: 12px;
  }

  .login-title {
    font-size: 18px;
  }

  .btn-login-submit {
    height: 44px;
    font-size: 14px;
  }
}

/* HP DENGAN LAYAR SANGAT KECIL (LEBAR <= 380px) */
@media (max-width: 380px) {
  .brand-title {
    font-size: 13.5px;
  }

  .brand-subtitle {
    display: none;
  }

  .user-name-label {
    max-width: 60px;
  }

  .metric-val-dash {
    font-size: 14.5px;
  }
}

/* ============================================================
   MULTI-USER & AUTHENTICATION STYLES
   ============================================================ */
.user-header-profile {
  display: flex;
  align-items: center;
  margin-left: 6px;
  padding-left: 10px;
  border-left: 1px solid var(--border);
}

.btn-profile-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 4px 10px 4px 6px;
  height: 38px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #f8fafc;
  max-width: 220px;
}

.btn-profile-trigger:hover {
  background: #273549;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.profile-avatar-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.user-badge-container {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}

.user-name-label {
  font-size: 13px;
  font-weight: 600;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
  line-height: 1;
}

.user-role-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  vertical-align: middle;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2.5px 6px;
  border-radius: 4px;
  background: #334155;
  color: #94a3b8;
  flex-shrink: 0;
  line-height: 1.2;
  box-sizing: border-box;
  white-space: nowrap;
}

.user-role-label.role-super-admin {
  background: #1e3a8a;
  color: #dbeafe;
  border: 1px solid #3b82f6;
  box-shadow: 0 1px 4px rgba(30, 58, 138, 0.4);
  font-weight: 800;
}

.user-role-label.role-admin {
  background: rgba(37, 99, 235, 0.25);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.user-role-label.role-user {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

#tableUsers th,
#tableUsers td {
  vertical-align: middle;
}

.profile-chevron {
  color: #94a3b8;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.btn-profile-trigger:hover .profile-chevron {
  color: #f8fafc;
  transform: translateY(1px);
}

/* ============================================================
   OVERLAY & POPUP PENGATURAN AKUN (MODAL POJOK KANAN ATAS)
   ============================================================ */
.account-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 29, 0.65);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 65px 24px 24px 24px;
}

.account-modal-card {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 12px;
  width: 100%;
  max-width: 400px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05);
  animation: fadeInAccountModal 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInAccountModal {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.account-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #1e293b;
  background: #131d35;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.account-modal-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.account-modal-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
  flex-shrink: 0;
}

.account-modal-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.account-modal-uname {
  font-size: 15px;
  font-weight: 700;
  color: #f8fafc;
}

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

.btn-modal-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-modal-close:hover {
  background: #334155;
  color: #f8fafc;
}

.account-modal-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.account-section-card {
  background: #172033;
  border: 1px solid #293548;
  border-radius: 8px;
  padding: 14px;
}

.account-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 12px;
}

.account-section-title svg {
  color: #60a5fa;
}

.btn-account-action {
  border: none;
  border-radius: 6px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-account-action.btn-blue {
  background: #2563eb;
  color: white;
}

.btn-account-action.btn-blue:hover {
  background: #1d4ed8;
}

.btn-account-action.btn-green {
  background: #059669;
  color: white;
}

.btn-account-action.btn-green:hover {
  background: #047857;
}

.account-logout-section {
  padding-top: 4px;
  border-top: 1px solid #1e293b;
}

.btn-account-logout {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #7f1d1d;
  color: #fecaca;
  border: 1px solid #991b1b;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-account-logout:hover {
  background: #991b1b;
  color: white;
  box-shadow: 0 4px 12px rgba(185, 28, 28, 0.4);
}

@media (max-width: 768px) {
  .account-modal-overlay {
    align-items: center;
    justify-content: center;
    padding: 16px;
  }
}

/* MODAL / OVERLAY LOGIN */
.login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 29, 0.95);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 32px 28px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  animation: fadeInModal 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInModal {
  from { opacity: 0; transform: translateY(-12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-header {
  text-align: center;
  margin-bottom: 24px;
}

.login-icon-box {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.3);
}

.login-title {
  font-size: 20px;
  font-weight: 700;
  color: #f8fafc;
  margin: 0 0 6px 0;
}

.login-subtitle {
  font-size: 13px;
  color: #94a3b8;
  margin: 0;
}

.login-alert {
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 12.5px;
  line-height: 1.4;
  margin-bottom: 16px;
  background: rgba(220, 38, 38, 0.15);
  border: 1px solid rgba(220, 38, 38, 0.4);
  color: #fca5a5;
}

.btn-login-submit {
  width: 100%;
  padding: 12px;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
  margin-top: 6px;
}

.btn-login-submit:hover {
  background: #1d4ed8;
}

.login-footer {
  text-align: center;
  font-size: 11px;
  color: #64748b;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #1e293b;
}

/* ============================================================
   STIL TABEL & FORM KELOLA PENGGUNA (ADMIN)
   ============================================================ */
.form-add-user-grid {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 1.2fr 160px;
  gap: 16px;
  align-items: flex-end;
  margin-top: 14px;
}

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

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

.btn-create-user {
  background: #2563eb;
  color: white;
  width: 100%;
  height: 40px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
  border: none;
}

.btn-create-user:hover {
  background: #1d4ed8;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}

.btn-refresh-users {
  background: #1e293b;
  color: #94a3b8;
  border: 1px solid #334155;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-refresh-users:hover {
  background: #334155;
  color: #f8fafc;
  border-color: #475569;
}

.table-user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e293b, #334155);
  border: 1px solid #475569;
  color: #60a5fa;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  line-height: 1;
}

.status-pill-active {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-pill-inactive {
  background: rgba(148, 163, 184, 0.1);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.status-pill .pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
}

.status-pill .inactive-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #64748b;
}

.badge-own-account {
  font-size: 11.5px;
  color: #64748b;
  font-style: italic;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 4px;
}

/* ACTION BUTTONS FOR USERS TABLE */
.btn-action-del {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
}

.btn-action-del:hover {
  background: #dc2626;
  color: white;
  border-color: #dc2626;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.4);
}

.btn-action-reset {
  background: #1e293b;
  color: #94a3b8;
  border: 1px solid #334155;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  margin-right: 6px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
}

.btn-action-reset:hover {
  background: #334155;
  color: #f8fafc;
  border-color: #60a5fa;
}

/* ============================================================
   PROGRESS BAR TARGET TAKE PROFIT (KARTU 4 DASHBOARD)
   ============================================================ */
.tp-progress-container {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.tp-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 5px;
}

.tp-progress-val {
  font-weight: 700;
  color: #34d399;
  font-size: 11px;
}

.tp-progress-track {
  width: 100%;
  height: 6px;
  background: #0f172a;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid #334155;
}

.tp-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #10b981, #34d399);
  border-radius: 999px;
  transition: width 0.4s ease-out, background 0.3s ease;
}

.tp-progress-bar.reached {
  background: linear-gradient(90deg, #059669, #10b981);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

/* ============================================================
   KARTU POSISI TERBUKA KHUSUS LAYAR HP (MOBILE CARDS)
   ============================================================ */
.positions-mobile-cards {
  display: none;
  width: 100%;
}

.position-mobile-card {
  background: #161f30;
  border: 1px solid #27354f;
  border-radius: 9px;
  padding: 12px 14px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s ease;
}

.position-mobile-card:hover {
  border-color: #3b82f6;
}

.pmc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.pmc-symbol-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pmc-symbol {
  font-size: 13.5px;
  font-weight: 700;
  color: #f8fafc;
}

.pmc-badge-step {
  font-size: 10px;
  font-weight: 600;
  background: #1e293b;
  color: #94a3b8;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #334155;
}

.pmc-pnl-pill {
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 5px;
}

.pmc-pnl-pill.profit {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.pmc-pnl-pill.loss {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.pmc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}

.pmc-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pmc-cell-label {
  font-size: 10.5px;
  color: #94a3b8;
}

.pmc-cell-val {
  font-size: 12.5px;
  font-weight: 600;
  color: #e2e8f0;
}

.pmc-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #64748b;
  padding-top: 6px;
  border-top: 1px dashed rgba(255, 255, 255, 0.05);
}

.pmc-empty {
  text-align: center;
  padding: 30px 16px;
  background: #111827;
  border: 1px dashed #24324a;
  border-radius: 8px;
  color: #64748b;
  font-size: 12.5px;
}

/* ============================================================
   TOAST NOTIFICATION (NOTIFIKASI MELAYANG MODERN)
   ============================================================ */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 380px;
  background: #1e293b;
  color: #f8fafc;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #334155;
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.hide {
  opacity: 0;
  transform: translateY(-12px) scale(0.96);
}

.toast-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}

.toast-content {
  flex-grow: 1;
  line-height: 1.4;
}

.toast-success {
  border-color: rgba(34, 197, 94, 0.5);
  background: #0f241a;
}
.toast-success .toast-icon {
  color: #22c55e;
}

.toast-error {
  border-color: rgba(239, 68, 68, 0.5);
  background: #2a1215;
}
.toast-error .toast-icon {
  color: #ef4444;
}

.toast-warning {
  border-color: rgba(245, 158, 11, 0.5);
  background: #261c0c;
}
.toast-warning .toast-icon {
  color: #f59e0b;
}

.toast-info {
  border-color: rgba(59, 130, 246, 0.5);
  background: #111d33;
}
.toast-info .toast-icon {
  color: #60a5fa;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 600px) {
  .toast-container {
    top: 14px;
    left: 14px;
    right: 14px;
  }
  .toast {
    min-width: 0;
    max-width: 100%;
    width: 100%;
  }
}

/* REKAPITULASI HARIAN & MODAL RINCIAN JAM */
.baris-rekap-hari {
  transition: background-color 0.2s ease;
}

.baris-rekap-hari:hover {
  background: rgba(56, 189, 248, 0.08) !important;
}

.btn-rincian-jam {
  transition: all 0.2s ease;
}

.btn-rincian-jam:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.45) !important;
}

.modal-overlay {
  animation: fadeInModal 0.2s ease forwards;
}

@keyframes fadeInModal {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ============================================================
   SISTEM MANAJEMEN LANGGANAN (SUBSCRIPTION SYSTEM)
   ============================================================ */

/* 1. Header Subscription Badge */
.subscription-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 11.5px;
  font-weight: 600;
  color: #cbd5e1;
  white-space: nowrap;
  transition: all 0.25s ease;
}

.subscription-badge .sub-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  background: #94a3b8;
}

.subscription-badge.sub-badge-active {
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.08);
  color: #86efac;
}

.subscription-badge.sub-badge-active .sub-dot {
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.8);
}

.subscription-badge.sub-badge-warning {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.08);
  color: #fde047;
}

.subscription-badge.sub-badge-warning .sub-dot {
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.8);
}

.subscription-badge.sub-badge-expired {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  animation: pulseExpired 2s infinite ease-in-out;
}

.subscription-badge.sub-badge-expired .sub-dot {
  background: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.8);
}

.subscription-badge.sub-badge-lifetime {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.12);
  color: #6ee7b7;
}

.subscription-badge.sub-badge-lifetime .sub-dot {
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
}

@keyframes pulseExpired {
  0%, 100% { border-color: rgba(239, 68, 68, 0.5); }
  50% { border-color: rgba(239, 68, 68, 0.9); }
}

/* 2. Banner Peringatan Langganan Habis */
.sub-expired-banner {
  background: linear-gradient(90deg, #7f1d1d, #991b1b, #7f1d1d);
  color: #fef2f2;
  padding: 10px 20px;
  border-bottom: 1px solid #b91c1c;
  box-shadow: 0 4px 14px rgba(185, 28, 28, 0.25);
  animation: slideDownBanner 0.3s ease;
}

.sub-banner-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  line-height: 1.45;
}

.sub-banner-content svg {
  flex-shrink: 0;
  stroke: #fca5a5;
}

@keyframes slideDownBanner {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 3. Kartu Info Langganan di Modal Profil Akun */
.account-sub-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.25);
  margin-bottom: 16px;
}

.sub-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.sub-info-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: rgba(30, 41, 59, 0.5);
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #1e293b;
}

.sub-info-label {
  font-size: 11px;
  color: #64748b;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.sub-info-val {
  font-size: 12.5px;
  font-weight: 600;
  color: #f1f5f9;
}

/* 4. Pills di Tabel Kelola Pengguna */
.sub-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.sub-pill-active {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.sub-pill-warning {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.sub-pill-expired {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.sub-pill-lifetime {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

/* 5. Tombol Kelola Langganan di Tabel & Modal */
.btn-action-sub {
  background: rgba(56, 189, 248, 0.1);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.btn-action-sub:hover {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
  transform: translateY(-1px);
}

.btn-sub-quick {
  background: #1e293b;
  color: #f1f5f9;
  border: 1px solid #334155;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.btn-sub-quick:hover {
  background: #0284c7;
  border-color: #38bdf8;
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-sub-lifetime {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(5, 150, 105, 0.3));
  border-color: #10b981;
  color: #6ee7b7;
}

.btn-sub-lifetime:hover {
  background: #10b981;
  color: #ffffff;
  border-color: #34d399;
}

.btn-sub-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-sub-danger:hover {
  background: #dc2626;
  color: #ffffff;
  border-color: #ef4444;
}


