﻿@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --bg: #06080f;
  --surface: rgba(13, 17, 28, 0.75);
  --surface-elevated: rgba(22, 28, 45, 0.85);
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(59, 130, 246, 0.5);
  --accent: #3b82f6;
  --accent-rgb: 59, 130, 246;
  --accent2: #06b6d4;
  --accent2-rgb: 6, 182, 212;
  --green: #10b981;
  --orange: #f59e0b;
  --red: #ef4444;
  --purple: #8b5cf6;
  --text: #f1f5f9;
  --muted: #64748b;
  --muted2: #94a3b8;
  --font: 'Outfit', sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --card-shadow: 0 12px 30px 0 rgba(0, 0, 0, 0.4);
  --glass-blur: blur(16px);
}

:root.light-mode {
  --bg: #f4f6f8;
  --surface: rgba(255, 255, 255, 0.85);
  --surface-elevated: rgba(255, 255, 255, 0.98);
  --border: rgba(0, 0, 0, 0.1);
  --text: #0f172a;
  --muted: #64748b;
  --muted2: #475569;
  --card-shadow: 0 12px 30px 0 rgba(0, 0, 0, 0.05);
}
body.light-mode {
  background-image: 
    radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.08) 0px, transparent 40%),
    radial-gradient(at 50% 0%, rgba(6, 182, 212, 0.08) 0px, transparent 40%),
    radial-gradient(at 100% 0%, rgba(139, 92, 246, 0.08) 0px, transparent 40%);
}
.light-mode input, .light-mode select, .light-mode textarea {
  background: rgba(255, 255, 255, 0.6);
  color: var(--text);
}
.light-mode .wizard-input, .light-mode .lf input, .light-mode .search-input {
  background: rgba(255, 255, 255, 0.7);
}
.light-mode .step-item {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.05);
}
.light-mode .user-chip, .light-mode .header-btn, .light-mode .filter-btn, .light-mode .export-btn {
  background: rgba(0, 0, 0, 0.04);
  color: var(--muted2);
  border-color: rgba(0, 0, 0, 0.1);
}
.light-mode .user-chip:hover, .light-mode .header-btn:hover, .light-mode .filter-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--text);
}
.light-mode .filter-btn.active {
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent);
  border-color: var(--accent);
}
.light-mode header, .light-mode .card, .light-mode .wizard-box, .light-mode .login-box, .light-mode .modal {
  background: var(--surface);
}
.light-mode .tbl-wrap {
  background: rgba(255, 255, 255, 0.5);
}
.light-mode thead th {
  background: rgba(0, 0, 0, 0.03);
}
.light-mode tbody tr:hover {
  background: rgba(0, 0, 0, 0.03);
}
.light-mode .team-tile, .light-mode .lb-row:hover, .light-mode .pill {
  background: rgba(0, 0, 0, 0.02);
}
.light-mode .team-tile:hover, .light-mode .pill:hover {
  background: rgba(0, 0, 0, 0.06);
}
.light-mode .pill.active {
  background: linear-gradient(135deg, var(--accent), #2563eb);
  color: #fff;
}
.light-mode .analysis-body {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.05);
}
.light-mode select option {
  background: #fff;
  color: var(--text);
}
.light-mode .lb-bar-wrap, .light-mode .team-tile-bar {
  background: rgba(0, 0, 0, 0.08);
}
.light-mode .lb-rank.g2 { color: #94a3b8; }
.light-mode .lb-btn.active {
  background: rgba(0,0,0,0.05);
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.light-mode .fun-award {
  background: rgba(0,0,0,0.02);
}
.light-mode .missing-chip {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #dc2626;
}
.light-mode .missing-chip .tt {
  background: rgba(0, 0, 0, 0.05);
  color: #991b1b;
}
.light-mode .hero h1 {
  background: linear-gradient(135deg, #0f172a 30%, var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.light-mode .wizard-title, .light-mode .login-title {
  background: linear-gradient(135deg, #0f172a 40%, var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.pagination-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 4px 0;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg);
  background-image: 
    radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.12) 0px, transparent 40%),
    radial-gradient(at 50% 0%, rgba(6, 182, 212, 0.1) 0px, transparent 40%),
    radial-gradient(at 100% 0%, rgba(139, 92, 246, 0.12) 0px, transparent 40%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.95); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 5px rgba(59, 130, 246, 0.2); }
  50% { box-shadow: 0 0 15px rgba(59, 130, 246, 0.5); }
}

/* Utility Layouts */
.animate-fade {
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Setup/Wizard Overlay */
#setupWizard {
  display: none;
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% 0%, rgba(30, 42, 64, 0.4) 0%, transparent 70%);
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
}
.wizard-box {
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 40px;
  width: 100%;
  max-width: 650px;
  box-shadow: var(--card-shadow);
  position: relative;
  overflow: hidden;
}
.wizard-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent2), var(--purple));
}
.wizard-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff 40%, var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}
.wizard-subtitle {
  font-size: 14px;
  color: var(--muted2);
  margin-bottom: 24px;
}
.steps-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 28px;
}
.step-item {
  display: flex;
  gap: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 16px;
}
.step-num {
  width: 28px;
  height: 28px;
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.step-text {
  font-size: 13px;
  color: var(--muted2);
  line-height: 1.5;
}
.step-text strong {
  color: var(--text);
}
.wizard-input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wizard-input-group label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent2);
}
.wizard-input-wrapper {
  display: flex;
  gap: 10px;
}
.wizard-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  font-family: var(--mono);
}
.wizard-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.wizard-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.wizard-btn:hover {
  background: #2563eb;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}
.wizard-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Login Screen */
#loginScreen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(ellipse at 50% 0%, rgba(30, 42, 64, 0.25) 0%, transparent 65%);
}
.login-box {
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 44px 38px;
  width: 100%;
  max-width: 440px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  text-align: center;
}
.login-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}
.login-logo {
  margin-bottom: 32px;
}
.login-icon {
  width: 68px;
  height: 68px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 16px;
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.35);
}
.login-title {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #f1f5f9 40%, var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.login-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
  font-family: var(--mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.lf {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}
.lf label {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted2);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 6px;
}
.lf input {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  width: 100%;
  transition: all 0.2s;
  font-family: var(--font);
}
.lf input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.login-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--accent), #2563eb);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}
.login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.45);
}
.login-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  display: none;
}
.login-note {
  font-size: 11px;
  color: var(--muted);
  margin-top: 20px;
  line-height: 1.6;
}

/* App Screen */
#appScreen {
  display: none;
}
header {
  padding: 16px 36px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(13, 17, 28, 0.8);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 16px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.logo-text-short {
  display: none;
}
.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}
.live-badge {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--green);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: 0.08em;
  animation: pulse 2.5s infinite;
  margin-left: 4px;
}
.hright {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted2);
  white-space: nowrap;
}
.udot {
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--green);
}
.header-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  color: var(--muted2);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.header-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--muted);
  color: var(--text);
}
.logout-btn:hover {
  border-color: var(--red);
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.05);
}
.hdate {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

/* Dashboard Content */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
}
.hero {
  text-align: center;
  padding: 24px 0 36px;
}
.hero-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent2);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 12px;
  font-weight: 600;
}
.hero h1 {
  font-size: clamp(28px, 4.5vw, 44px);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.15;
  background: linear-gradient(135deg, #fff 30%, var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
}
.hero p {
  color: var(--muted2);
  font-size: 15px;
  max-width: 520px;
  margin: 0 auto;
}

/* Stats Bar */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 16px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.stat-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.08);
  transform: translateY(-1px);
}
.stat-num {
  font-size: 32px;
  font-weight: 800;
  font-family: var(--mono);
  color: var(--accent);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.stat-num.green { color: var(--green); }
.stat-num.red { color: var(--red); }
.stat-num.orange { color: var(--orange); }
.stat-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 6px;
  font-weight: 700;
}
.stat-sub {
  font-size: 11px;
  color: var(--muted2);
  margin-top: 4px;
}

/* Main Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  width: 100%;
  min-width: 0;
}
.col-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}
.col-side {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

/* Cards */
.card {
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: all 0.25s;
}
.card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}
.card.green-accent::before {
  background: linear-gradient(90deg, var(--accent2), var(--green));
}
.card.purple-accent::before {
  background: linear-gradient(90deg, var(--purple), var(--accent));
}

.card-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted2);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-title-icon {
  font-size: 16px;
}

/* Connection Bar */
.conn-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 20px;
  transition: all 0.3s;
}
.conn-bar.online {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--green);
}
.conn-bar.offline {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: var(--orange);
}
.conn-bar.error {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: var(--red);
}
.conn-bar.checking {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: var(--accent);
}
.cdot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.conn-bar.online .cdot {
  box-shadow: 0 0 8px var(--green);
}
.conn-bar.checking .cdot {
  animation: pulse 1.5s infinite;
}

/* Form Styles */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.fg {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.fg label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
input, select, textarea {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  background: rgba(0, 0, 0, 0.4);
}
select option {
  background: #0f1322;
  color: var(--text);
}
textarea {
  resize: vertical;
  min-height: 100px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
}
.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.pill {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted2);
  display: flex;
  align-items: center;
  gap: 6px;
}
.pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(59, 130, 246, 0.05);
}
.pill.active {
  background: linear-gradient(135deg, var(--accent), #2563eb);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}
.submit-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--accent), #2563eb);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}
.submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.45);
}
.submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Team Grid Dashboard */
.team-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.team-tile {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  transition: all 0.2s;
}
.team-tile:hover {
  background: rgba(255, 255, 255, 0.04);
}
.team-tile-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted2);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.team-tile-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}
.team-tile-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.fill-green { background: linear-gradient(90deg, var(--green), var(--accent2)); }
.fill-orange { background: linear-gradient(90deg, var(--orange), var(--red)); }
.fill-blue { background: linear-gradient(90deg, var(--accent), var(--purple)); }
.team-tile-stat {
  font-size: 12px;
  color: var(--muted2);
  display: flex;
  justify-content: space-between;
}
.team-tile-stat strong {
  color: var(--text);
}

/* Missing List */
.missing-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.missing-chip {
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.missing-chip .tt {
  opacity: 0.5;
  font-weight: 400;
  font-size: 10px;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 6px;
  border-radius: 4px;
}

/* Leaderboard */
.lb-row {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  gap: 14px;
  transition: all 0.15s;
}
.lb-row:last-child {
  border-bottom: none;
}
.lb-row:hover {
  background: rgba(255, 255, 255, 0.01);
}
.lb-rank {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  width: 28px;
  flex-shrink: 0;
  text-align: center;
}
.lb-rank.g1 { color: var(--orange); font-size: 16px; }
.lb-rank.g2 { color: #cbd5e1; font-size: 15px; }
.lb-rank.g3 { color: #b45309; font-size: 14px; }
.lb-name-group {
  flex: 1;
}
.lb-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}
.lb-team {
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
}
.lb-bar-wrap {
  flex: 1;
  max-width: 120px;
  min-width: 30px;
  height: 5px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 3px;
  overflow: hidden;
  margin-right: 8px;
}
.lb-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 3px;
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.lb-count {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent2);
  font-weight: 700;
  min-width: 32px;
  text-align: right;
}
.lb-btn {
  background: transparent;
  color: var(--muted2);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.lb-btn:hover {
  color: var(--text);
}
.lb-btn.active {
  background: rgba(255,255,255,0.06);
  color: var(--text);
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.fun-award {
  padding: 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  margin-bottom: 10px;
}
.fun-award-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--accent2);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.fun-award-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}
.fun-award-desc {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

/* AI Analysis & Telegram Preview */
.analysis-body {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 22px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--muted2);
  min-height: 100px;
  border: 1px solid rgba(255, 255, 255, 0.02);
}
.analysis-body h3 {
  color: var(--accent2);
  font-size: 14px;
  font-weight: 700;
  margin: 20px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.analysis-body h3:first-child {
  margin-top: 0;
}
.analysis-body strong {
  color: var(--text);
  font-weight: 600;
}
.analysis-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 12px;
  font-family: var(--mono);
}


/* History Logs */
.section-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 10px;
}
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}
.search-input {
  padding: 6px 14px;
  font-size: 12px;
  border-radius: 20px;
  width: 160px;
  min-height: 0;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  color: var(--text);
  outline: none;
  transition: all 0.2s;
  margin-left: auto;
}
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.filter-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  color: var(--muted2);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.filter-btn.active, .filter-btn:hover {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(59, 130, 246, 0.08);
}
.export-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  color: var(--muted2);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.export-btn:hover {
  border-color: var(--accent2);
  color: var(--accent2);
  background: rgba(6, 182, 212, 0.05);
}
.tbl-wrap {
  overflow-x: auto;
  width: 100%;
  max-width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.15);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 720px;
}
thead th {
  background: rgba(255, 255, 255, 0.02);
  padding: 14px 18px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
tbody tr:last-child {
  border-bottom: none;
}
tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}
tbody td {
  padding: 14px 18px;
  vertical-align: middle;
}
.nc {
  font-weight: 700;
  color: var(--text);
}
.tbadge {
  font-size: 10px;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.t-Operator { background: rgba(59, 130, 246, 0.12); color: #93c5fd; border: 1px solid rgba(59, 130, 246, 0.2); }
.t-Customer { background: rgba(16, 185, 129, 0.12); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.2); }
.t-Recon { background: rgba(139, 92, 246, 0.12); color: #c084fc; border: 1px solid rgba(139, 92, 246, 0.2); }
.t-Logistik { background: rgba(245, 158, 11, 0.12); color: #fde047; border: 1px solid rgba(245, 158, 11, 0.2); }
.ttag {
  display: inline-block;
  background: rgba(59, 130, 246, 0.08);
  color: var(--accent2);
  border: 1px solid rgba(6, 182, 212, 0.25);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--mono);
}
.ptxt {
  color: var(--muted2);
  font-size: 12px;
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}
.ptxt:hover {
  text-decoration: underline;
  cursor: help;
}
.scell {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--orange);
  font-size: 12px;
  white-space: nowrap;
}
.tcell {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  line-height: 1.4;
}
.empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
}
.empty .eicon {
  font-size: 36px;
  margin-bottom: 12px;
}

/* Spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.05);
  border-top-color: var(--accent2);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
.loading-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  justify-content: center;
  padding: 10px 0;
}

/* Toasts */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 14px 20px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 13px;
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 999;
  max-width: 360px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 10px;
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Settings Modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(6, 8, 15, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 900;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  width: 100%;
  max-width: 500px;
  box-shadow: var(--card-shadow);
  position: relative;
  overflow: hidden;
}
.modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}
.modal-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal-close {
  position: absolute;
  top: 24px;
  right: 24px;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 20px;
  transition: color 0.15s;
}
.modal-close:hover {
  color: var(--text);
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

/* Responsiveness */
@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 700px) {
  .stats-bar {
    grid-template-columns: 1fr 1fr;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .team-grid {
    grid-template-columns: 1fr;
  }
  header {
    padding: 12px 20px;
  }
  main {
    padding: 20px 16px;
  }
  .hdate {
    display: none;
  }
  .card {
    padding: 18px;
  }
  .wizard-box {
    padding: 24px;
  }
  .wizard-input-wrapper {
    flex-direction: column;
  }
}
@media (max-width: 480px) {
  header {
    padding: 10px 14px;
    gap: 8px;
  }
  .logo {
    font-size: 15px;
    gap: 6px;
  }
  .logo-icon {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }
  .live-badge {
    font-size: 8px;
    padding: 1px 5px;
    letter-spacing: 0.02em;
  }
  .hright {
    gap: 6px;
  }
  .user-chip {
    padding: 4px 8px;
    font-size: 11px;
    gap: 4px;
  }
  .udot {
    width: 6px;
    height: 6px;
  }
  .header-btn {
    padding: 4px 6px;
    font-size: 11px;
  }
  main {
    padding: 12px 8px;
  }
  .hero {
    padding: 12px 0 20px;
  }
  .hero h1 {
    font-size: 24px;
    line-height: 1.2;
  }
  .hero p {
    font-size: 13px;
  }
  .stats-bar {
    gap: 8px;
  }
  .stat-card {
    padding: 12px 6px;
  }
  .stat-num {
    font-size: 20px;
  }
  .stat-label {
    font-size: 9px;
    letter-spacing: 0.02em;
    margin-top: 4px;
  }
  .stat-sub {
    font-size: 9px;
  }
  .card {
    padding: 16px 12px;
    border-radius: 14px;
    margin-bottom: 16px;
  }
  .missing-chip {
    padding: 4px 10px;
    font-size: 11px;
  }
  .login-box {
    padding: 32px 24px;
  }
  .login-icon {
    width: 58px;
    height: 58px;
    font-size: 28px;
  }
  .login-title {
    font-size: 20px;
  }
  .lf input, .lf label {
    font-size: 13px;
  }
  .tbl-wrap table {
    font-size: 12px;
  }
  tbody td, thead th {
    padding: 10px 12px;
  }
  .user-chip span {
    display: none;
  }
}
@media (max-width: 600px) {
  .logo-text-full {
    display: none;
  }
  .logo-text-short {
    display: inline;
  }
  .live-badge {
    display: none;
  }
}

/* --- UI/UX IMPROVEMENTS --- */

/* 1. Tombol Bouncy */
.wizard-btn, .login-btn {
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}
.wizard-btn:hover, .login-btn:hover {
  transform: translateY(-2px) scale(1.02) !important;
  box-shadow: 0 10px 25px rgba(59, 130, 246, 0.5) !important;
}
.wizard-btn:active, .login-btn:active {
  transform: translateY(1px) scale(0.95) !important;
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3) !important;
}

/* 2. Skeleton Loading Shimmer */
@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}
.skeleton {
  background: var(--surface-elevated);
  background-image: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.05) 50%, rgba(255, 255, 255, 0) 100%);
  background-size: 1000px 100%;
  animation: shimmer 2s infinite linear forwards;
  border-radius: 8px;
}
.light-mode .skeleton {
  background-image: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.05) 50%, rgba(0,0,0,0) 100%);
}
.skeleton-text { height: 16px; width: 80%; margin-bottom: 12px; border-radius: 6px; }
.skeleton-title { height: 28px; width: 50%; margin-bottom: 24px; border-radius: 8px; }
.skeleton-card { height: 100%; min-height: 150px; border-radius: 24px; }

/* 3. Bento Box Aesthetics */
.card {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 28px !important;
  padding: 28px !important;
  box-shadow: 0 12px 30px 0 rgba(0, 0, 0, 0.4), inset 0 1px 0 0 rgba(255, 255, 255, 0.05) !important;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}
.card:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 20px 40px 0 rgba(0, 0, 0, 0.2), inset 0 1px 0 0 rgba(255, 255, 255, 0.1) !important;
}
.stat-card {
  border-radius: 24px !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1), inset 0 1px 0 0 rgba(255, 255, 255, 0.05) !important;
}
