/* ============================================
   LemburKu - Main Stylesheet
   Industrial Minimal Aesthetic
   ============================================ */

:root {
  --bg:          #0d0f12;
  --bg2:         #13161b;
  --bg3:         #1a1e26;
  --border:      #252a35;
  --border2:     #2e3545;
  --text:        #e8eaf0;
  --text2:       #8892a4;
  --text3:       #5a6478;
  --accent:      #4f8ef7;
  --accent2:     #6fa3ff;
  --success:     #3ecf8e;
  --warning:     #f5c842;
  --danger:      #f2545b;
  --sidebar-w:   240px;
  --topbar-h:    60px;
  --radius:      8px;
  --radius-lg:   14px;
  --mono:        'JetBrains Mono', monospace;
  --sans:        'Plus Jakarta Sans', sans-serif;
  --shadow:      0 4px 24px rgba(0,0,0,0.4);
  --shadow-sm:   0 2px 8px rgba(0,0,0,0.25);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: var(--sans); }
input, select, textarea { font-family: var(--sans); }

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ============ SIDEBAR ============ */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(.4,0,.2,1);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.logo-icon {
  width: 36px; height: 36px;
  background: var(--accent);
  border-radius: 8px;
  display: grid; place-items: center;
  font-size: 18px;
}

.logo-name { display: block; font-weight: 700; font-size: 15px; letter-spacing: -.3px; }
.logo-sub  { display: block; font-size: 10px; color: var(--text3); letter-spacing: .5px; text-transform: uppercase; }

.sidebar-nav {
  flex: 1;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text2);
  transition: all 0.15s;
}
.nav-item:hover { background: var(--bg3); color: var(--text); }
.nav-item.active { background: rgba(79,142,247,.15); color: var(--accent2); }
.nav-item.active .nav-icon { color: var(--accent); }
.nav-icon { font-size: 12px; width: 18px; text-align: center; opacity: .7; }
.nav-divider { height: 1px; background: var(--border); margin: 10px 0; }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-info { flex: 1; min-width: 0; }
.user-name  { display: block; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { display: block; font-size: 10.5px; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logout-btn { font-size: 18px; color: var(--text3); opacity: .6; transition: opacity .15s; }
.logout-btn:hover { opacity: 1; color: var(--danger); }

/* ============ MAIN CONTENT ============ */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============ TOPBAR ============ */
.topbar {
  height: var(--topbar-h);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.menu-btn { display: none; background: none; border: none; color: var(--text2); font-size: 20px; padding: 4px; }
.topbar-title { font-size: 15px; font-weight: 700; flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.currency-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--warning);
  font-family: var(--mono);
}

/* ============ PAGE BODY ============ */
.page-body { padding: 28px 28px; flex: 1; }

/* ============ CARDS ============ */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.card-title { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--text2); }

/* ============ STATS GRID ============ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: border-color .2s, transform .2s;
}
.stat-card:hover { border-color: var(--border2); transform: translateY(-2px); }
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
}
.stat-card.green::before  { background: var(--success); }
.stat-card.yellow::before { background: var(--warning); }
.stat-card.red::before    { background: var(--danger); }

.stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--text3); margin-bottom: 10px; }
.stat-value { font-size: 28px; font-weight: 800; font-family: var(--mono); letter-spacing: -1px; line-height: 1; }
.stat-sub   { font-size: 11.5px; color: var(--text3); margin-top: 6px; }
.stat-icon  { position: absolute; top: 16px; right: 16px; font-size: 22px; opacity: .15; }

/* ============ TABLES ============ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead { background: var(--bg3); }
th {
  text-align: left;
  padding: 10px 16px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--text3);
  font-weight: 600;
  white-space: nowrap;
}
td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,.02); }

.mono { font-family: var(--mono); font-size: 13px; }

/* ============ BADGES ============ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
}
.badge-blue    { background: rgba(79,142,247,.15); color: var(--accent2); }
.badge-green   { background: rgba(62,207,142,.15); color: var(--success); }
.badge-yellow  { background: rgba(245,200,66,.15);  color: var(--warning); }
.badge-red     { background: rgba(242,84,91,.15);   color: var(--danger); }
.badge-gray    { background: var(--bg3); color: var(--text3); }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: all .15s;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary   { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent2); }
.btn-success   { background: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(1.1); }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.1); }
.btn-outline   { background: transparent; border-color: var(--border2); color: var(--text2); }
.btn-outline:hover { background: var(--bg3); color: var(--text); }
.btn-ghost     { background: var(--bg3); color: var(--text2); border-color: var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--border2); }
.btn-sm        { padding: 6px 14px; font-size: 12.5px; }
.btn-lg        { padding: 12px 24px; font-size: 15px; }
.btn-full      { width: 100%; justify-content: center; }
.btn-google    { background: #fff; color: #333; border-color: #ddd; }
.btn-google:hover { background: #f5f5f5; }
.btn-google img { width: 18px; }

/* ============ FORMS ============ */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text3);
  margin-bottom: 7px;
}
.form-control {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 10px 14px;
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79,142,247,.15);
}
.form-control::placeholder { color: var(--text3); }
select.form-control { appearance: none; cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-hint { font-size: 11.5px; color: var(--text3); margin-top: 5px; }
.form-error { font-size: 11.5px; color: var(--danger); margin-top: 5px; }

.form-grid { display: grid; gap: 18px; }
.form-grid-2 { grid-template-columns: 1fr 1fr; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }

/* ============ ALERTS ============ */
.alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-radius: var(--radius);
  margin: 0 28px 16px;
  font-size: 13.5px;
  font-weight: 500;
}
.alert button { background: none; border: none; color: inherit; font-size: 18px; opacity: .6; padding: 0 0 0 12px; }
.alert-success { background: rgba(62,207,142,.1); border: 1px solid rgba(62,207,142,.3); color: var(--success); }
.alert-error   { background: rgba(242,84,91,.1);  border: 1px solid rgba(242,84,91,.3);  color: var(--danger); }
.alert-warning { background: rgba(245,200,66,.1); border: 1px solid rgba(245,200,66,.3); color: var(--warning); }
.alert-info    { background: rgba(79,142,247,.1);  border: 1px solid rgba(79,142,247,.3);  color: var(--accent2); }

/* ============ LOGIN PAGE ============ */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  background: var(--bg);
}
.auth-art {
  flex: 1;
  background: linear-gradient(135deg, #0d1b3a 0%, #0a1628 50%, #131b2e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  position: relative;
  overflow: hidden;
}
.auth-art::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(79,142,247,.15) 0%, transparent 70%);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}
.auth-art-content { position: relative; text-align: center; }
.auth-art h1 { font-size: 52px; font-weight: 800; letter-spacing: -2px; line-height: 1.1; margin-bottom: 16px; }
.auth-art h1 span { color: var(--accent); }
.auth-art p { font-size: 16px; color: var(--text2); max-width: 320px; line-height: 1.6; }
.auth-art-features { margin-top: 48px; display: flex; flex-direction: column; gap: 14px; text-align: left; }
.auth-feature { display: flex; align-items: center; gap: 12px; color: var(--text2); font-size: 13.5px; }
.auth-feature-dot { width: 6px; height: 6px; background: var(--accent); border-radius: 50%; flex-shrink: 0; }

.auth-form-wrap {
  width: 440px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background: var(--bg2);
  border-left: 1px solid var(--border);
}
.auth-form-inner { width: 100%; }
.auth-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 40px; }
.auth-logo-icon { width: 42px; height: 42px; background: var(--accent); border-radius: 10px; display: grid; place-items: center; font-size: 22px; }
.auth-logo-name { font-size: 22px; font-weight: 800; letter-spacing: -.5px; }
.auth-title { font-size: 26px; font-weight: 800; letter-spacing: -.5px; margin-bottom: 6px; }
.auth-sub { color: var(--text2); font-size: 14px; margin-bottom: 32px; }
.auth-divider { display: flex; align-items: center; gap: 14px; margin: 24px 0; color: var(--text3); font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-switch { text-align: center; margin-top: 24px; font-size: 13.5px; color: var(--text2); }
.auth-switch a { color: var(--accent); font-weight: 600; }

/* ============ OVERVIEW CHART ============ */
.chart-bar-wrap { display: flex; align-items: flex-end; gap: 4px; height: 80px; }
.chart-bar-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.chart-bar { width: 100%; background: rgba(79,142,247,.25); border-radius: 4px 4px 0 0; min-height: 4px; transition: background .2s; position: relative; cursor: default; }
.chart-bar:hover { background: var(--accent); }
.chart-bar-label { font-size: 9px; color: var(--text3); }

/* ============ MATCH STATUS ============ */
.match-status { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; }
.match-dot { width: 7px; height: 7px; border-radius: 50%; }
.match-yes { color: var(--success); }
.match-yes .match-dot { background: var(--success); }
.match-no  { color: var(--danger); }
.match-no .match-dot { background: var(--danger); }
.match-pending { color: var(--text3); }
.match-pending .match-dot { background: var(--text3); }

/* ============ PAGINATION ============ */
.pagination { display: flex; align-items: center; gap: 4px; justify-content: center; margin-top: 20px; }
.page-link {
  width: 34px; height: 34px;
  border-radius: 6px;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 600;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  transition: all .15s;
}
.page-link:hover { border-color: var(--accent); color: var(--accent); }
.page-link.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.page-link.disabled { opacity: .35; pointer-events: none; }

/* ============ EMPTY STATE ============ */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-icon { font-size: 48px; margin-bottom: 16px; opacity: .4; }
.empty-title { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.empty-desc { color: var(--text2); font-size: 13.5px; margin-bottom: 24px; }

/* ============ MODAL ============ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 200;
  place-items: center;
}
.modal-overlay.show { display: grid; }
.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-title { font-size: 18px; font-weight: 800; margin-bottom: 20px; }

/* ============ SYNC STATUS ============ */
.sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  font-family: var(--mono);
}
.sync-badge.synced   { background: rgba(62,207,142,.1); color: var(--success); }
.sync-badge.unsynced { background: rgba(245,200,66,.1); color: var(--warning); }
.sync-badge.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
  .form-grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 99; }
  .sidebar-overlay.show { display: block; }
  .main-content { margin-left: 0; }
  .menu-btn { display: block; }
  .page-body { padding: 20px 16px; }
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .auth-art { display: none; }
  .auth-form-wrap { width: 100%; }
  .auth-art-features { display: none; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .topbar { padding: 0 16px; }
}
