/* ==========================================================================
   742 SHOOTGUN — PROFESSIONAL WAR DASHBOARD STYLESHEET
   Theme: Refined Dark Glassmorphism | Premium Cyberpunk
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@500;700;800&display=swap');

:root {
  /* Core Background System */
  --bg-app:        #050810;
  --bg-primary:    #080c18;
  --bg-secondary:  #0d1225;
  --bg-card:       rgba(13, 19, 37, 0.92);
  --bg-card-hover: rgba(20, 29, 55, 0.97);
  --bg-input:      rgba(10, 15, 28, 0.9);
  --bg-glass:      rgba(255, 255, 255, 0.035);

  /* Border System */
  --border-subtle:  rgba(255, 255, 255, 0.06);
  --border-color:   rgba(255, 255, 255, 0.09);
  --border-active:  rgba(59, 130, 246, 0.55);
  --border-cyan:    rgba(0, 212, 255, 0.35);

  /* Text Hierarchy */
  --text-primary: #f0f4ff;
  --text-main:    #cbd5e8;
  --text-muted:   #64748b;
  --text-dim:     #3d4f6a;
  --text-bright:  #ffffff;

  /* Brand Accents */
  --cyan:      #00d4ff;
  --blue:      #3b82f6;
  --violet:    #8b5cf6;
  --emerald:   #10b981;
  --amber:     #f59e0b;
  --rose:      #f43f5e;
  --orange:    #fb923c;

  /* Gradients */
  --grad-brand:    linear-gradient(135deg, #00d4ff 0%, #3b82f6 100%);
  --grad-trigger:  linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  --grad-kibas:    linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
  --grad-emerald:  linear-gradient(135deg, #10b981 0%, #047857 100%);
  --grad-blue:     linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  --grad-header:   linear-gradient(180deg, #0d1326 0%, #08101e 100%);

  /* Glows */
  --glow-cyan:     0 0 16px rgba(0, 212, 255, 0.22);
  --glow-blue:     0 0 16px rgba(59, 130, 246, 0.3);
  --glow-violet:   0 0 16px rgba(139, 92, 246, 0.35);
  --glow-emerald:  0 0 14px rgba(16, 185, 129, 0.3);
  --glow-rose:     0 0 16px rgba(244, 63, 94, 0.35);
  --shadow-card:   0 4px 24px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(255,255,255,0.04) inset;
  --shadow-deep:   0 20px 60px rgba(0, 0, 0, 0.8);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  /* Radius */
  --radius-sm: 5px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* Heights */
  --topbar-h: 40px;
}

/* ─── Reset ─────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

body {
  background: var(--bg-app);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.4;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ─── Scrollbars ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ==========================================================================
   TOP CONTROL BAR
   ========================================================================== */
.top-bar {
  height: var(--topbar-h);
  background: var(--grad-header);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  gap: 10px;
  flex-wrap: nowrap;
  overflow: hidden;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(255,255,255,0.04), 0 4px 24px rgba(0,0,0,0.6);
  flex-shrink: 0;
}

/* ── Brand Section ─────────────────────────────────── */
.brand-section {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.brand-logo-mini {
  height: 24px;
  min-width: 28px;
  padding: 0 7px;
  background: var(--grad-brand);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #020812;
  font-weight: 700;
  font-size: 11px;
  font-family: var(--font-mono);
  box-shadow: var(--glow-cyan);
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.brand-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--cyan);
  letter-spacing: 1.5px;
  white-space: nowrap;
  text-transform: uppercase;
  opacity: 0.95;
}

.clock-mini {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 550;
  color: var(--cyan);
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: var(--radius-sm);
  padding: 2px 7px;
  white-space: nowrap;
  letter-spacing: 0.3px;
}

/* ── Master Actions ────────────────────────────────── */
.master-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

/* Kibas Timer Box */
.kibas-timer-box-mini {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: var(--radius-md);
  padding: 0 7px;
  height: 27px;
  flex-shrink: 0;
}

.timer-label { font-size: 12px; }

.kibas-input-mini {
  background: transparent;
  border: none;
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  outline: none;
  width: 66px;
  letter-spacing: 0.5px;
}

.btn-kibas-mini {
  background: var(--grad-kibas);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 2px 9px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.8px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  text-transform: uppercase;
}
.btn-kibas-mini:hover { opacity: 0.85; }
.btn-kibas-mini.armed {
  background: var(--grad-emerald);
  box-shadow: var(--glow-emerald);
}

/* Global URL Bar */
.global-url-mini {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 3px 0 8px;
  width: 150px;
  height: 27px;
  transition: border-color 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}
.global-url-mini:focus-within {
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 0 0 2px rgba(59,130,246,0.12);
}
.global-url-mini input {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 10px;
  font-family: var(--font-mono);
  outline: none;
  width: 100%;
  min-width: 0;
}

/* Mini Buttons */
.btn-mini {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0 9px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.6px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  height: 27px;
  transition: all 0.15s ease;
  text-transform: uppercase;
}

.btn-go-mini {
  background: var(--grad-blue);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0 8px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.6px;
  cursor: pointer;
  height: 21px;
  transition: opacity 0.15s;
  text-transform: uppercase;
  white-space: nowrap;
}
.btn-go-mini:hover { opacity: 0.85; }

.btn-warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.btn-warning:hover {
  background: rgba(245, 158, 11, 0.2);
  box-shadow: 0 0 10px rgba(245,158,11,0.2);
}

.btn-nav-quick {
  background: rgba(56, 189, 248, 0.08);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
}
.btn-nav-quick:hover {
  background: rgba(56, 189, 248, 0.18);
}

.btn-violet {
  background: rgba(139, 92, 246, 0.1);
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.btn-trigger-mini {
  background: var(--grad-trigger);
  color: #fff;
  font-weight: 900;
  box-shadow: var(--glow-rose);
}

/* ── Status Badges (Right) ─────────────────────────── */
.status-badges {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.mini-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 8px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text-main);
  height: 27px;
  white-space: nowrap;
  text-transform: uppercase;
}

.zoom-select-mini {
  background: transparent;
  border: none;
  color: var(--cyan);
  font-size: 9px;
  font-weight: 800;
  font-family: var(--font-mono);
  outline: none;
  cursor: pointer;
  max-width: 72px;
}
.zoom-select-mini option {
  background: #0f172a;
  color: #38bdf8;
}

/* View Switcher */
.view-switcher-mini {
  display: flex;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2px;
  gap: 2px;
  height: 27px;
  align-items: center;
}

.view-btn-mini {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.6px;
  padding: 2px 8px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
  height: 21px;
  display: flex;
  align-items: center;
  white-space: nowrap;
  text-transform: uppercase;
}
.view-btn-mini:hover { color: var(--text-primary); background: rgba(255,255,255,0.06); }
.view-btn-mini.active {
  background: var(--grad-blue);
  color: #fff;
  box-shadow: var(--glow-blue);
}

/* Badge Dot */
.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 6px var(--emerald);
  flex-shrink: 0;
}
.badge-dot.warning {
  background: var(--amber);
  box-shadow: 0 0 6px var(--amber);
}

/* ==========================================================================
   DASHBOARD CONTAINER
   ========================================================================== */
.dashboard-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: var(--bg-app);
}

/* ==========================================================================
   GRID MODE
   ========================================================================== */
.grid-view {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 8px;
  padding: 8px;
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
}

.grid-view.layout-3x4 {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(4, 1fr);
}

/* ── Slot Card ─────────────────────────────────────── */
.slot-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative;
}

.slot-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
  pointer-events: none;
}

.slot-card:hover {
  border-color: rgba(59, 130, 246, 0.3);
  box-shadow: 0 4px 28px rgba(0,0,0,0.6), 0 0 0 1px rgba(59,130,246,0.12);
}

.slot-card.focused-slot {
  border-color: rgba(0, 212, 255, 0.5);
  box-shadow: var(--glow-cyan), var(--shadow-card);
}

/* Slot Header */
.slot-header {
  height: 28px;
  background: rgba(5, 8, 20, 0.7);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 7px;
  gap: 4px;
  white-space: nowrap;
  overflow: hidden;
  flex-shrink: 0;
}

.profile-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--cyan);
  background: rgba(0, 212, 255, 0.07);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 212, 255, 0.18);
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.15s;
}
.profile-tag:hover { background: rgba(0,212,255,0.12); }

/* Login Badge */
.login-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.login-badge.not-logged-in {
  background: rgba(244, 63, 94, 0.1);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
  animation: pulse-warn 2s infinite ease-in-out;
}

.login-badge.logged-in {
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

@keyframes pulse-warn {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; box-shadow: 0 0 8px rgba(244,63,94,0.4); }
}

/* Inline Param Chips */
.slot-params-inline {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.param-chip {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  white-space: nowrap;
  font-family: var(--font-mono);
  flex-shrink: 0;
}

.chip-purple {
  background: rgba(139, 92, 246, 0.12);
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.22);
}

.chip-cyan {
  background: rgba(0, 212, 255, 0.1);
  color: var(--cyan);
  border: 1px solid rgba(0, 212, 255, 0.2);
}

/* Slot Action Buttons */
.slot-actions {
  display: flex;
  align-items: center;
  gap: 3px;
}

.btn-icon {
  width: 22px;
  height: 22px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 10px;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.btn-icon:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
  border-color: var(--border-color);
}

/* Webview Wrapper */
.webview-wrapper {
  flex: 1;
  position: relative;
  background: #fff;
  overflow: hidden;
}

webview {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ==========================================================================
   FOCUS / TABBED MODE
   ========================================================================== */
.focus-view {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--topbar-h));
  background: var(--bg-primary);
}

.tab-switcher-bar {
  height: 38px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  padding: 0 8px;
  gap: 3px;
  overflow-x: auto;
  flex-shrink: 0;
}

.tab-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  height: 30px;
}
.tab-chip:hover { background: rgba(255,255,255,0.06); color: var(--text-main); }
.tab-chip.active {
  background: var(--bg-card);
  border-color: var(--cyan);
  border-bottom-color: transparent;
  color: var(--cyan);
}

.focus-stage {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.focus-webview-container {
  flex: 1;
  height: 100%;
  position: relative;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: #080c18;
}

.focus-webview-container iframe,
.focus-webview-container webview {
  width: 100% !important;
  height: 100% !important;
  min-height: 540px !important;
  border: none !important;
  display: block !important;
}

.focus-sidebar {
  width: 268px;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-subtle);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  flex-shrink: 0;
}

.focus-view.expanded-webview .focus-stage {
  flex-direction: column !important;
}
.focus-view.expanded-webview .focus-webview-container {
  height: calc(100vh - 120px) !important;
  min-height: calc(100vh - 120px) !important;
  width: 100% !important;
  flex: 1 !important;
}
.focus-view.expanded-webview .focus-sidebar {
  display: none !important;
}

/* ==========================================================================
   FORM CONTROLS
   ========================================================================== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group label {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.7px;
}

.form-control {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 6px 8px;
  font-size: 11px;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus {
  border-color: rgba(0, 212, 255, 0.4);
  box-shadow: 0 0 0 2px rgba(0,212,255,0.08);
}

textarea.form-control {
  font-family: var(--font-mono);
  font-size: 10px;
  resize: vertical;
  min-height: 80px;
  line-height: 1.6;
}

/* ==========================================================================
   FOCUS SIDEBAR COMPONENTS
   ========================================================================== */

/* Session Slider Bar */
.session-slider-bar {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 3px;
  display: flex;
  gap: 3px;
  align-items: center;
}

.btn-nav-slider {
  outline: none;
  height: 23px;
  border-radius: var(--radius-sm);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
}

.btn-nav-prev {
  background: rgba(245, 158, 11, 0.1) !important;
  border: 1px solid rgba(245, 158, 11, 0.3) !important;
  color: var(--amber) !important;
}
.btn-nav-prev:hover {
  background: rgba(245, 158, 11, 0.2) !important;
  box-shadow: 0 0 8px rgba(245,158,11,0.25) !important;
}

.btn-nav-next {
  background: rgba(59, 130, 246, 0.1) !important;
  border: 1px solid rgba(59, 130, 246, 0.3) !important;
  color: #60a5fa !important;
}
.btn-nav-next:hover {
  background: rgba(59, 130, 246, 0.2) !important;
  box-shadow: 0 0 8px rgba(59,130,246,0.25) !important;
}

.session-label-display {
  background: rgba(0, 212, 255, 0.06);
  border: 1px solid rgba(0, 212, 255, 0.25);
  color: var(--cyan);
  text-align: center;
  font-weight: 800;
  font-size: 9px;
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
  border-radius: var(--radius-sm);
  padding: 2px 4px;
  height: 23px;
  flex: 1.2;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Deteksi Container */
.deteksi-container {
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.deteksi-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  gap: 6px;
  font-size: 10px;
  font-family: var(--font-mono);
  transition: background 0.1s;
}
.deteksi-item-row:hover { background: rgba(255,255,255,0.04); }

.deteksi-item-row .slot-num { color: var(--cyan); font-weight: 700; flex-shrink: 0; }
.deteksi-item-row .item-motif { color: var(--text-primary); font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deteksi-item-row .item-badge {
  background: rgba(59, 130, 246, 0.12);
  color: #93c5fd;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 9px;
  flex-shrink: 0;
  border: 1px solid rgba(59,130,246,0.2);
}

/* ==========================================================================
   ACTION BUTTONS
   ========================================================================== */
.btn-focus-primary {
  width: 100%;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 10px;
  letter-spacing: 0.8px;
  border-radius: var(--radius-md);
  padding: 9px 12px;
  border: none;
  box-shadow: 0 4px 14px rgba(139,92,246,0.28);
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.btn-focus-primary:hover {
  background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
  box-shadow: 0 6px 20px rgba(139,92,246,0.45);
  transform: translateY(-1px);
}
.btn-focus-primary:active { transform: translateY(1px); }

.btn-save, #modal-save-btn {
  background: var(--grad-emerald) !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  font-size: 11px !important;
  letter-spacing: 0.5px !important;
  border-radius: var(--radius-md) !important;
  padding: 9px 16px !important;
  border: none !important;
  box-shadow: 0 4px 14px rgba(16,185,129,0.25) !important;
  text-transform: uppercase !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}
.btn-save:hover, #modal-save-btn:hover {
  opacity: 0.88 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 20px rgba(16,185,129,0.4) !important;
}

#focus-sync-ext-btn {
  background: var(--grad-kibas) !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  font-size: 10px !important;
  letter-spacing: 0.6px !important;
  border-radius: var(--radius-md) !important;
  padding: 9px 12px !important;
  border: none !important;
  box-shadow: 0 4px 14px rgba(139,92,246,0.25) !important;
  text-transform: uppercase !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
#focus-sync-ext-btn:hover {
  opacity: 0.88 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 20px rgba(139,92,246,0.45) !important;
}

.btn-clear {
  background: rgba(244, 63, 94, 0.08) !important;
  color: #fb7185 !important;
  border: 1px solid rgba(244, 63, 94, 0.25) !important;
  border-radius: var(--radius-sm) !important;
  padding: 4px 10px !important;
  font-size: 10px !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}
.btn-clear:hover {
  background: rgba(244, 63, 94, 0.18) !important;
  box-shadow: 0 0 8px rgba(244,63,94,0.3) !important;
}

/* Auto Kibas / Kibas Timer Components (used in Focus Sidebar) */
.kibas-timer-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: var(--radius-md);
  padding: 4px 10px;
}
.kibas-input {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  padding: 4px 8px;
  outline: none;
}
.btn-kibas {
  background: var(--grad-kibas);
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn-kibas:hover { opacity: 0.85; }
.btn-kibas.armed {
  background: var(--grad-emerald);
  box-shadow: var(--glow-emerald);
}

/* ==========================================================================
   LOG CONSOLE (HIDDEN)
   ========================================================================== */
.log-console-bar { display: none !important; }

.log-latest {
  color: #a3e635;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80%;
}
.log-timestamp { color: var(--text-muted); margin-right: 6px; }

/* ==========================================================================
   MODAL
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 520px;
  background: linear-gradient(160deg, #0d1525 0%, #0a1020 100%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-deep), 0 0 0 1px rgba(255,255,255,0.04) inset;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}
.modal-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 30px;
  right: 30px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
}
.modal-header h3 {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ==========================================================================
   GENERIC BTN
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.5px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  text-transform: uppercase;
  padding: 7px 16px;
}
.btn.btn-primary {
  background: var(--grad-emerald);
  color: #fff;
  box-shadow: 0 3px 12px rgba(16,185,129,0.22);
}
.btn.btn-primary:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}
.btn.btn-warning {
  background: rgba(244,63,94,0.1);
  color: #fb7185;
  border: 1px solid rgba(244,63,94,0.3);
}
.btn.btn-warning:hover { background: rgba(244,63,94,0.2); }

/* ==========================================================================
   UTILS
   ========================================================================== */
.hidden { display: none !important; }

/* Slot params bar (legacy, kept for compat) */
.slot-params-bar {
  height: 22px;
  background: rgba(0,0,0,0.35);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  padding: 0 8px;
  gap: 6px;
  font-size: 9px;
  color: var(--text-muted);
}

/* ==========================================================================
   MOBILE FLOATING BOTTOM NAVBAR (Facebook / Modern App Style)
   ========================================================================== */
.mobile-bottom-navbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(8, 12, 22, 0.82);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 4px 10px calc(4px + env(safe-area-inset-bottom, 0px)) 10px;
  z-index: 9999;
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.5);
}

.mobile-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 2px;
  transition: all 0.18s ease;
  position: relative;
  text-decoration: none;
  outline: none;
  border-radius: var(--radius-md);
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav-item .mob-icon {
  font-size: 19px;
  line-height: 1.2;
  margin-bottom: 2px;
  transition: transform 0.18s ease;
}

.mobile-nav-item .mob-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2px;
  line-height: 1;
  white-space: nowrap;
}

.mobile-nav-item:hover,
.mobile-nav-item:focus {
  color: var(--text-primary);
}

.mobile-nav-item.active {
  color: var(--cyan);
}

.mobile-nav-item.active .mob-icon {
  transform: translateY(-1px) scale(1.1);
}

.mobile-nav-item.active .mob-label {
  font-weight: 600;
  color: var(--cyan);
}

.mobile-nav-item.active::after {
  content: '';
  position: absolute;
  top: 1px;
  width: 16px;
  height: 2px;
  background: var(--cyan);
  border-radius: 2px;
  box-shadow: 0 0 6px var(--cyan);
}

/* Center Highlighted Action (Kibas War Circle) */
.mobile-nav-item.mob-action-center {
  flex: 1.2;
  position: relative;
  top: -10px;
}

.mob-fire-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  box-shadow: 0 4px 18px rgba(239, 68, 68, 0.55), 0 0 0 3px rgba(8, 12, 22, 0.85);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  margin-bottom: 3px;
}

.mobile-nav-item.mob-action-center:active .mob-fire-circle {
  transform: scale(0.92);
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.4);
}

.mobile-nav-item.mob-action-center .mob-label {
  color: #f87171;
  font-weight: 600;
}

/* Header Top Controls for Mobile */
.btn-app-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 15px;
  transition: background 0.15s ease;
  flex-shrink: 0;
}
.btn-app-icon:hover {
  background: rgba(255, 255, 255, 0.1);
}

.brand-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-badge-mini {
  background: var(--grad-brand);
  color: #040814;
  font-weight: 700;
  font-size: 10px;
  font-family: var(--font-mono);
  padding: 1px 5px;
  border-radius: 4px;
}

.mobile-war-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-fire-mobile {
  background: var(--grad-trigger);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 0 12px;
  height: 28px;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-shadow: var(--glow-rose);
  transition: transform 0.15s ease, opacity 0.15s ease;
  white-space: nowrap;
}
.btn-fire-mobile:active {
  transform: scale(0.95);
  opacity: 0.9;
}

/* ==========================================================================
   MOBILE RESPONSIVE OVERRIDES (Handphone Focus: max-width: 768px)
   ========================================================================== */
@media (max-width: 768px) {
  body {
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 0;
  }

  /* Top Control Bar */
  .top-bar {
    height: auto;
    min-height: 52px;
    padding: 8px 10px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.5);
  }

  .brand-section {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 120px;
  }

  .mobile-war-bar {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .status-badges {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .mini-pill {
    height: 28px;
    padding: 0 8px;
    font-size: 9px;
    font-weight: 600;
  }

  /* Dashboard Container — reserve space for floating bottom navbar */
  .dashboard-container {
    height: auto;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 74px !important;
  }

  /* Grid View on Mobile: 1 Column Full Width Cards */
  .grid-view, .grid-view.layout-3x4 {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 8px;
    height: auto;
    min-height: auto;
    overflow-y: visible;
    padding-bottom: 12px;
  }

  .slot-card {
    height: 480px;
    min-height: 420px;
    width: 100%;
    border-radius: var(--radius-md);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  }

  .slot-header {
    height: 34px;
    padding: 0 8px;
  }

  .profile-tag {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
  }

  .login-badge {
    font-size: 9px;
    font-weight: 600;
  }

  .slot-actions .btn-icon {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  /* Focus Mode on Mobile: Stack Webview and Tabs */
  .focus-view {
    height: auto;
    min-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    padding-bottom: 74px;
  }

  .tab-switcher-bar {
    overflow-x: auto;
    flex-wrap: nowrap;
    height: 40px;
    padding: 0 6px;
    -webkit-overflow-scrolling: touch;
  }

  .tab-chip {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 500;
    padding: 0 12px;
    height: 32px;
  }

  .tab-chip.active {
    font-weight: 600;
  }

  .focus-stage {
    flex-direction: column;
    height: auto;
    overflow-y: visible;
  }

  .focus-webview-container {
    height: calc(100vh - 170px);
    min-height: 460px;
    width: 100%;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .focus-sidebar {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--border-subtle);
    padding: 12px;
  }

  /* Modal on Mobile: Fit viewport cleanly */
  .modal-overlay {
    padding: 10px;
    align-items: flex-end;
  }

  .modal-card {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 85vh !important;
    overflow-y: auto;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 18px 14px;
  }
}
