@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=Noto+Sans:wght@300;400;500;600&display=swap');

:root {
  --primary: #1a3a6b;
  --primary-light: #2556a8;
  --accent: #e8961e;
  --accent-light: #f5b942;
  --success: #1e8a4a;
  --danger: #c0392b;
  --warning: #d68910;
  --info: #1a6fa8;
  --dark: #0f1923;
  --sidebar-bg: #0d2340;
  --sidebar-width: 260px;
  --header-height: 60px;
  --card-bg: #ffffff;
  --body-bg: #f0f4f8;
  --text-main: #1c2b3a;
  --text-muted: #6b7e91;
  --border: #d1dbe6;
  --shadow: 0 2px 12px rgba(26,58,107,0.10);
  --radius: 10px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: 'Noto Sans', sans-serif;
  background: var(--body-bg);
  color: var(--text-main);
  min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  z-index: 100;
  display: flex; flex-direction: column;
  overflow-y: auto;
  transition: transform 0.3s;
}
.sidebar-logo {
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; gap: 12px;
}
.sidebar-logo .logo-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--primary-light));
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.sidebar-logo .logo-text { color: #fff; }
.sidebar-logo .logo-text strong { display: block; font-family: 'Rajdhani', sans-serif; font-size: 1.15rem; font-weight: 700; }
.sidebar-logo .logo-text span { font-size: 0.72rem; color: rgba(255,255,255,0.5); }

.sidebar-section { padding: 10px 0; }
.sidebar-section-title {
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.12em;
  color: rgba(255,255,255,0.3); padding: 8px 20px 4px;
  text-transform: uppercase;
}
.sidebar-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px; color: rgba(255,255,255,0.68);
  text-decoration: none; font-size: 0.88rem; font-weight: 500;
  transition: all 0.2s; border-left: 3px solid transparent;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
  background: rgba(255,255,255,0.07);
  color: #fff; border-left-color: var(--accent);
}
.sidebar-nav a .nav-icon { font-size: 1.1rem; width: 20px; text-align: center; }
.sidebar-nav a .badge {
  margin-left: auto; background: var(--accent); color: #fff;
  font-size: 0.68rem; padding: 2px 7px; border-radius: 20px;
}

/* ===== MAIN ===== */
.main-wrapper { margin-left: var(--sidebar-width); min-height: 100vh; }
.topbar {
  height: var(--header-height);
  background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 24px;
  position: sticky; top: 0; z-index: 90;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}
.topbar .page-title { font-family: 'Rajdhani',sans-serif; font-size: 1.25rem; font-weight: 700; color: var(--primary); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.topbar-right .user-info { text-align: right; }
.topbar-right .user-info strong { display: block; font-size: 0.88rem; }
.topbar-right .user-info span { font-size: 0.75rem; color: var(--text-muted); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff; font-weight: 700; font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.notif-btn {
  position: relative; background: none; border: none; cursor: pointer;
  font-size: 1.2rem; color: var(--text-muted);
}
.notif-btn .dot {
  position: absolute; top: 0; right: 0; width: 8px; height: 8px;
  background: var(--danger); border-radius: 50%; border: 2px solid #fff;
}

/* ===== CONTENT ===== */
.content { padding: 24px; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.page-header h1 { font-family: 'Rajdhani',sans-serif; font-size: 1.6rem; font-weight: 700; color: var(--primary); }
.page-header p { color: var(--text-muted); font-size: 0.85rem; margin-top: 2px; }

/* ===== CARDS ===== */
.card {
  background: var(--card-bg); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid var(--border);
  margin-bottom: 20px;
}
.card-header {
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-header h3 { font-family: 'Rajdhani',sans-serif; font-size: 1.05rem; font-weight: 700; }
.card-body { padding: 20px; }

/* STAT CARDS */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat-card {
  background: #fff; border-radius: var(--radius); padding: 18px 20px;
  box-shadow: var(--shadow); border: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px; position: relative; overflow: hidden;
}
.stat-card::after {
  content: ''; position: absolute; right: -16px; top: -16px;
  width: 80px; height: 80px; border-radius: 50%;
  opacity: 0.08;
}
.stat-card.blue::after { background: var(--primary); }
.stat-card.orange::after { background: var(--accent); }
.stat-card.green::after { background: var(--success); }
.stat-card.red::after { background: var(--danger); }

.stat-icon {
  width: 50px; height: 50px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 1.4rem;
  flex-shrink: 0;
}
.stat-icon.blue { background: rgba(26,58,107,0.12); color: var(--primary); }
.stat-icon.orange { background: rgba(232,150,30,0.14); color: var(--accent); }
.stat-icon.green { background: rgba(30,138,74,0.12); color: var(--success); }
.stat-icon.red { background: rgba(192,57,43,0.12); color: var(--danger); }

.stat-info .stat-value { font-family: 'Rajdhani',sans-serif; font-size: 1.8rem; font-weight: 700; line-height: 1; }
.stat-info .stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 3px; }
.stat-info .stat-change { font-size: 0.78rem; margin-top: 4px; }
.stat-info .stat-change.up { color: var(--success); }
.stat-info .stat-change.down { color: var(--danger); }

/* ===== TABLE ===== */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
thead th {
  background: #f5f8fb; padding: 11px 14px;
  text-align: left; font-weight: 600; color: var(--text-muted);
  font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em;
  border-bottom: 2px solid var(--border);
}
tbody tr { border-bottom: 1px solid #edf2f7; transition: background 0.15s; }
tbody tr:hover { background: #f8fafc; }
tbody td { padding: 11px 14px; }
.table-actions { display: flex; gap: 6px; }

/* ===== BADGES ===== */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600;
}
.badge-success { background: #e8f5ee; color: var(--success); }
.badge-danger { background: #fdecea; color: var(--danger); }
.badge-warning { background: #fef3dc; color: var(--warning); }
.badge-info { background: #e3f0fb; color: var(--info); }
.badge-primary { background: #e3ecf8; color: var(--primary); }
.badge-secondary { background: #f0f4f8; color: var(--text-muted); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 7px; font-size: 0.85rem;
  font-weight: 600; cursor: pointer; border: none; transition: all 0.2s;
  font-family: 'Noto Sans', sans-serif; text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-light); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text-main); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 5px 10px; font-size: 0.8rem; }
.btn-icon { width: 32px; height: 32px; padding: 0; justify-content: center; border-radius: 7px; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 0.83rem; font-weight: 600; margin-bottom: 5px; color: var(--text-main); }
.form-control {
  width: 100%; padding: 9px 12px; border: 1.5px solid var(--border);
  border-radius: 7px; font-size: 0.88rem; font-family: 'Noto Sans',sans-serif;
  color: var(--text-main); transition: border 0.2s; background: #fff;
}
.form-control:focus { outline: none; border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(37,86,168,0.08); }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7e91' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 30px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.form-hint { font-size: 0.76rem; color: var(--text-muted); margin-top: 4px; }

/* ===== SEARCH BAR ===== */
.search-bar { position: relative; }
.search-bar input { padding-left: 36px; }
.search-bar .search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }

/* ===== FILTER ROW ===== */
.filter-row { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.filter-row .search-bar { flex: 1; min-width: 200px; }

/* ===== PAGINATION ===== */
.pagination { display: flex; align-items: center; gap: 4px; justify-content: flex-end; margin-top: 16px; }
.pagination a, .pagination span {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 7px; font-size: 0.85rem;
  text-decoration: none; border: 1.5px solid var(--border); color: var(--text-main);
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===== ALERTS ===== */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 0.88rem; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.alert-success { background: #e8f5ee; color: #155a2e; border-left: 4px solid var(--success); }
.alert-danger { background: #fdecea; color: #7b1f1f; border-left: 4px solid var(--danger); }
.alert-warning { background: #fef3dc; color: #7a4f00; border-left: 4px solid var(--warning); }
.alert-info { background: #e3f0fb; color: #0e4472; border-left: 4px solid var(--info); }

/* ===== PROGRESS ===== */
.progress { height: 8px; background: #e9eef5; border-radius: 4px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 4px; transition: width 0.6s; }
.progress-bar.primary { background: var(--primary); }
.progress-bar.success { background: var(--success); }
.progress-bar.danger { background: var(--danger); }
.progress-bar.warning { background: var(--warning); }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,25,35,0.5);
  z-index: 200; display: flex; align-items: center; justify-content: center;
  display: none;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #fff; border-radius: 12px; width: 90%; max-width: 560px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18); overflow: hidden;
}
.modal-header { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-header h4 { font-family: 'Rajdhani',sans-serif; font-size: 1.1rem; font-weight: 700; }
.modal-body { padding: 22px; }
.modal-footer { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }
.btn-close { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--text-muted); }

/* ===== CHART CONTAINER ===== */
.chart-container { position: relative; width: 100%; }

/* ===== PROFILE CARD ===== */
.profile-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  padding: 28px; border-radius: var(--radius) var(--radius) 0 0;
  color: #fff; display: flex; align-items: center; gap: 20px;
}
.profile-avatar {
  width: 72px; height: 72px; border-radius: 50%; background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center; font-size: 2rem;
  border: 3px solid rgba(255,255,255,0.4);
}
.profile-info h2 { font-family: 'Rajdhani',sans-serif; font-size: 1.5rem; font-weight: 700; }
.profile-info p { opacity: 0.8; font-size: 0.9rem; }

/* ===== TABS ===== */
.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.tab {
  padding: 10px 18px; font-size: 0.88rem; font-weight: 600; cursor: pointer;
  color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: all 0.2s;
}
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ===== TIMELINE ===== */
.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.timeline-item { position: relative; margin-bottom: 20px; }
.timeline-item::before {
  content: ''; position: absolute; left: -24px; top: 4px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--primary); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--primary);
}
.timeline-time { font-size: 0.75rem; color: var(--text-muted); }
.timeline-content { font-size: 0.88rem; margin-top: 4px; }

/* ===== DROPDOWN ===== */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 6px);
  background: #fff; border: 1px solid var(--border); border-radius: 9px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1); min-width: 180px;
  z-index: 150; display: none;
}
.dropdown-menu.open { display: block; }
.dropdown-menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; color: var(--text-main); font-size: 0.88rem;
  text-decoration: none; transition: background 0.15s;
}
.dropdown-menu a:hover { background: #f5f8fb; }
.dropdown-menu hr { border: none; border-top: 1px solid var(--border); margin: 4px 0; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-wrapper { margin-left: 0; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}

/* ===== LOGIN PAGE ===== */
.auth-page {
  min-height: 100vh; background: linear-gradient(135deg, var(--dark) 0%, var(--primary) 60%, var(--primary-light) 100%);
  display: flex; align-items: center; justify-content: center;
}
.auth-card { background: #fff; border-radius: 16px; width: 400px; overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,0.25); }
.auth-header { background: var(--primary); padding: 28px; text-align: center; }
.auth-header .logo-wrap { width: 60px; height: 60px; border-radius: 14px; background: rgba(255,255,255,0.15); margin: 0 auto 12px; display: flex; align-items: center; justify-content: center; font-size: 2rem; }
.auth-header h2 { color: #fff; font-family: 'Rajdhani',sans-serif; font-size: 1.4rem; font-weight: 700; }
.auth-header p { color: rgba(255,255,255,0.65); font-size: 0.82rem; }
.auth-body { padding: 28px; }
.auth-footer { padding: 16px 28px; background: #f8fafc; border-top: 1px solid var(--border); text-align: center; font-size: 0.82rem; color: var(--text-muted); }

/* ===== MISC ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.d-flex { display: flex; } .align-center { align-items: center; } .gap-2 { gap: 16px; }
.flex-wrap { flex-wrap: wrap; } .justify-between { justify-content: space-between; }
.row { display: grid; gap: 20px; }
.col-2 { grid-template-columns: 1fr 1fr; }
.col-3 { grid-template-columns: 1fr 1fr 1fr; }
.col-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
.w-100 { width: 100%; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }

/* Tag colors */
.tag-supporter { background: #e8f5ee; color: #155a2e; }
.tag-neutral { background: #fef3dc; color: #7a4f00; }
.tag-opponent { background: #fdecea; color: #7b1f1f; }

/* Sidebar collapsed */
.sidebar-footer {
  padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.4); font-size: 0.75rem; text-align: center;
}
