/* ============================================================
   DANGUN 금융플랫폼 - 공통 테마 CSS
   다크 / 화이트 테마 + 애니메이션
   ============================================================ */

/* --- Google Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;600;700;900&family=Orbitron:wght@400;700;900&display=swap');

/* ============================================================
   CSS Variables - Light Theme (Default)
   ============================================================ */
:root,
[data-theme="light"] {
  --bg-primary: #f0f2f8;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-sidebar: #1a1a2e;
  --bg-sidebar-active: #16213e;
  --bg-input: #f5f7ff;
  --bg-table-head: #f0f4ff;
  --bg-table-row: #ffffff;
  --bg-table-row-alt: #f8f9ff;
  --bg-overlay: rgba(255,255,255,0.92);
  --bg-modal: #ffffff;

  --text-primary: #1a1a2e;
  --text-secondary: #4a4a6a;
  --text-muted: #8888aa;
  --text-sidebar: #c8cce8;
  --text-sidebar-active: #ffffff;
  --text-on-dark: #ffffff;
  --text-on-accent: #ffffff;

  --accent-gold: #d4a017;
  --accent-gold-light: #f0c040;
  --accent-gold-dark: #a07010;
  --accent-blue: #3a5bd9;
  --accent-blue-light: #5a7bff;
  --accent-green: #27ae60;
  --accent-red: #e74c3c;
  --accent-orange: #f39c12;
  --accent-purple: #8e44ad;

  --border-color: #e0e4f0;
  --border-accent: #d4a017;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.15);
  --shadow-gold: 0 4px 20px rgba(212,160,23,0.3);
  --shadow-blue: 0 4px 20px rgba(58,91,217,0.3);

  --gradient-gold: linear-gradient(135deg, #d4a017 0%, #f0c040 50%, #d4a017 100%);
  --gradient-dark: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  --gradient-blue: linear-gradient(135deg, #3a5bd9 0%, #5a7bff 100%);
  --gradient-card: linear-gradient(145deg, #ffffff 0%, #f5f7ff 100%);
  --gradient-sidebar: linear-gradient(180deg, #1a1a2e 0%, #16213e 60%, #0f3460 100%);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 30px;

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;
  --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   CSS Variables - Dark Theme
   ============================================================ */
[data-theme="dark"] {
  --bg-primary: #0a0a1a;
  --bg-secondary: #12122a;
  --bg-card: #1a1a35;
  --bg-sidebar: #0d0d20;
  --bg-sidebar-active: #1a1a35;
  --bg-input: #12122a;
  --bg-table-head: #1a1a35;
  --bg-table-row: #12122a;
  --bg-table-row-alt: #1a1a35;
  --bg-overlay: rgba(10,10,26,0.95);
  --bg-modal: #1a1a35;

  --text-primary: #e8e8ff;
  --text-secondary: #a0a0cc;
  --text-muted: #606090;
  --text-sidebar: #c8cce8;
  --text-sidebar-active: #ffffff;
  --text-on-dark: #ffffff;
  --text-on-accent: #ffffff;

  --accent-gold: #d4a017;
  --accent-gold-light: #f0c040;
  --accent-gold-dark: #a07010;
  --accent-blue: #5a7bff;
  --accent-blue-light: #7a9bff;
  --accent-green: #2ecc71;
  --accent-red: #e74c3c;
  --accent-orange: #f39c12;
  --accent-purple: #9b59b6;

  --border-color: #2a2a4a;
  --border-accent: #d4a017;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.6);
  --shadow-gold: 0 4px 20px rgba(212,160,23,0.4);
  --shadow-blue: 0 4px 20px rgba(90,123,255,0.4);

  --gradient-gold: linear-gradient(135deg, #d4a017 0%, #f0c040 50%, #d4a017 100%);
  --gradient-dark: linear-gradient(135deg, #0a0a1a 0%, #12122a 50%, #1a1a35 100%);
  --gradient-blue: linear-gradient(135deg, #5a7bff 0%, #7a9bff 100%);
  --gradient-card: linear-gradient(145deg, #1a1a35 0%, #12122a 100%);
  --gradient-sidebar: linear-gradient(180deg, #0d0d20 0%, #12122a 60%, #1a1a35 100%);
}

/* ============================================================
   Global Reset & Base Styles
   ============================================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 14px;
}

body {
  font-family: 'Noto Sans KR', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: var(--transition-slow);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ============================================================
   Scrollbar Styling
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb {
  background: var(--accent-gold);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--accent-gold-light); }

/* ============================================================
   Typography
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
}

.brand-font {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.gold-text {
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================================
   Layout Structure
   ============================================================ */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar {
  width: 260px;
  min-height: 100vh;
  background: var(--gradient-sidebar);
  border-right: 1px solid rgba(212,160,23,0.2);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1000;
  transition: var(--transition-slow);
  overflow: hidden;
}

.sidebar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23d4a017' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.sidebar-header {
  padding: 28px 24px 20px;
  border-bottom: 1px solid rgba(212,160,23,0.2);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo-icon {
  width: 44px;
  height: 44px;
  background: var(--gradient-gold);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 900;
  color: #1a1a2e;
  font-family: 'Orbitron', sans-serif;
  box-shadow: var(--shadow-gold);
  animation: logoGlow 3s ease-in-out infinite;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-name {
  font-family: 'Orbitron', sans-serif;
  font-size: 18px;
  font-weight: 900;
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.1em;
}

.logo-sub {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
  overflow-y: auto;
}

.nav-section {
  padding: 8px 16px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(200,204,232,0.4);
  margin-top: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: var(--text-sidebar);
  text-decoration: none;
  transition: var(--transition);
  border-left: 3px solid transparent;
  position: relative;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}

.nav-item:hover {
  background: rgba(212,160,23,0.1);
  color: var(--accent-gold-light);
  border-left-color: var(--accent-gold);
}

.nav-item.active {
  background: rgba(212,160,23,0.15);
  color: var(--accent-gold-light);
  border-left-color: var(--accent-gold);
}

.nav-item .nav-icon {
  width: 20px;
  text-align: center;
  font-size: 15px;
  flex-shrink: 0;
}

.nav-item .nav-badge {
  margin-left: auto;
  background: var(--accent-red);
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 700;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(212,160,23,0.2);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #1a1a2e;
  flex-shrink: 0;
}

.user-info .user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sidebar-active);
}

.user-info .user-rank {
  font-size: 11px;
  color: var(--accent-gold);
}

/* ============================================================
   Main Content Area
   ============================================================ */
.main-content {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: var(--transition-slow);
}

.topbar {
  height: 64px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.topbar-title {
  flex: 1;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-content {
  flex: 1;
  padding: 28px;
  overflow-y: auto;
}

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title .icon {
  color: var(--accent-gold);
}

.card-body {
  padding: 24px;
}

/* Stat Cards */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gradient-gold);
}

.stat-card:hover {
  box-shadow: var(--shadow-gold);
  transform: translateY(-3px);
  border-color: rgba(212,160,23,0.3);
}

.stat-card.blue::before { background: var(--gradient-blue); }
.stat-card.blue:hover { box-shadow: var(--shadow-blue); border-color: rgba(90,123,255,0.3); }
.stat-card.green::before { background: linear-gradient(135deg, #27ae60, #2ecc71); }
.stat-card.red::before { background: linear-gradient(135deg, #e74c3c, #c0392b); }

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: rgba(212,160,23,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 16px;
  color: var(--accent-gold);
}

.stat-card.blue .stat-icon { background: rgba(90,123,255,0.1); color: var(--accent-blue); }
.stat-card.green .stat-icon { background: rgba(39,174,96,0.1); color: var(--accent-green); }
.stat-card.red .stat-icon { background: rgba(231,76,60,0.1); color: var(--accent-red); }

.stat-value {
  font-size: 28px;
  font-weight: 900;
  font-family: 'Orbitron', sans-serif;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-change {
  font-size: 12px;
  font-weight: 600;
  margin-top: 8px;
}

.stat-change.up { color: var(--accent-green); }
.stat-change.down { color: var(--accent-red); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.4s, height 0.4s;
}

.btn:active::after {
  width: 200px;
  height: 200px;
}

.btn-gold {
  background: var(--gradient-gold);
  color: #1a1a2e;
  box-shadow: var(--shadow-gold);
}

.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(212,160,23,0.5);
  filter: brightness(1.1);
}

.btn-primary {
  background: var(--gradient-blue);
  color: white;
  box-shadow: var(--shadow-blue);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(90,123,255,0.5);
  filter: brightness(1.1);
}

.btn-success {
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  color: white;
  box-shadow: 0 4px 15px rgba(39,174,96,0.3);
}

.btn-danger {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: white;
  box-shadow: 0 4px 15px rgba(231,76,60,0.3);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  background: var(--bg-primary);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
}

.btn-lg {
  padding: 14px 32px;
  font-size: 15px;
  border-radius: var(--radius-lg);
}

/* ============================================================
   Form Elements
   ============================================================ */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 13px;
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(212,160,23,0.15);
  background: var(--bg-secondary);
}

.form-control::placeholder { color: var(--text-muted); }

select.form-control {
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23888' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* ============================================================
   Tables
   ============================================================ */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead tr {
  background: var(--bg-table-head);
}

thead th {
  padding: 14px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--border-color);
}

tbody tr {
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition-fast);
}

tbody tr:last-child { border-bottom: none; }

tbody tr:nth-child(even) { background: var(--bg-table-row-alt); }
tbody tr:nth-child(odd) { background: var(--bg-table-row); }

tbody tr:hover {
  background: rgba(212,160,23,0.05);
}

tbody td {
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  vertical-align: middle;
}

/* ============================================================
   Badges / Tags
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.badge-gold { background: rgba(212,160,23,0.15); color: var(--accent-gold); border: 1px solid rgba(212,160,23,0.3); }
.badge-blue { background: rgba(90,123,255,0.15); color: var(--accent-blue); border: 1px solid rgba(90,123,255,0.3); }
.badge-green { background: rgba(39,174,96,0.15); color: var(--accent-green); border: 1px solid rgba(39,174,96,0.3); }
.badge-red { background: rgba(231,76,60,0.15); color: var(--accent-red); border: 1px solid rgba(231,76,60,0.3); }
.badge-orange { background: rgba(243,156,18,0.15); color: var(--accent-orange); border: 1px solid rgba(243,156,18,0.3); }
.badge-purple { background: rgba(142,68,173,0.15); color: var(--accent-purple); border: 1px solid rgba(142,68,173,0.3); }

/* ============================================================
   Theme Toggle Button
   ============================================================ */
.theme-toggle {
  width: 44px;
  height: 24px;
  background: var(--border-color);
  border-radius: 12px;
  border: none;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
  flex-shrink: 0;
}

.theme-toggle.active { background: var(--accent-gold); }

.theme-toggle::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.theme-toggle.active::after { left: 22px; }

.theme-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  transition: var(--transition);
}

.theme-btn:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

/* ============================================================
   Modal
   ============================================================ */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-modal);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  transform: scale(0.9) translateY(20px);
  transition: var(--transition);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-overlay.open .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 24px 28px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  width: 32px; height: 32px;
  border: none;
  background: var(--bg-primary);
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close:hover {
  background: rgba(231,76,60,0.1);
  color: var(--accent-red);
}

.modal-body { padding: 24px 28px; }
.modal-footer {
  padding: 16px 28px 24px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ============================================================
   Pagination
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  padding: 16px 0 8px;
}

.page-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.page-btn:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.page-btn.active {
  background: var(--gradient-gold);
  color: #1a1a2e;
  border-color: transparent;
  box-shadow: var(--shadow-gold);
}

/* ============================================================
   Alerts / Notifications
   ============================================================ */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}

.alert-success { background: rgba(39,174,96,0.1); color: var(--accent-green); border-left: 3px solid var(--accent-green); }
.alert-danger { background: rgba(231,76,60,0.1); color: var(--accent-red); border-left: 3px solid var(--accent-red); }
.alert-warning { background: rgba(243,156,18,0.1); color: var(--accent-orange); border-left: 3px solid var(--accent-orange); }
.alert-info { background: rgba(90,123,255,0.1); color: var(--accent-blue); border-left: 3px solid var(--accent-blue); }

/* ============================================================
   Grid System
   ============================================================ */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }

@media (max-width: 1400px) { .grid-5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1200px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
}

/* ============================================================
   Loading / Spinner
   ============================================================ */
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-overlay);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.loading-text {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
  animation: pulse 1.5s ease-in-out infinite;
}

/* ============================================================
   Progress Bar
   ============================================================ */
.progress-bar-wrapper {
  background: var(--border-color);
  border-radius: 99px;
  height: 8px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--gradient-gold);
  border-radius: 99px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0; left: -100%; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shimmer 2s infinite;
}

/* ============================================================
   Toast Notifications
   ============================================================ */
#toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  min-width: 280px;
  pointer-events: all;
  transform: translateX(120%);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-left: 4px solid var(--accent-gold);
}

.toast.show { transform: translateX(0); }
.toast.success { border-left-color: var(--accent-green); }
.toast.error { border-left-color: var(--accent-red); }
.toast.warning { border-left-color: var(--accent-orange); }

/* ============================================================
   Animations
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@keyframes shimmer {
  to { left: 200%; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes logoGlow {
  0%, 100% { box-shadow: 0 4px 20px rgba(212,160,23,0.3); }
  50% { box-shadow: 0 4px 30px rgba(212,160,23,0.7), 0 0 60px rgba(212,160,23,0.2); }
}

@keyframes gradientMove {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes borderGlow {
  0%, 100% { border-color: rgba(212,160,23,0.3); }
  50% { border-color: rgba(212,160,23,0.8); }
}

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

@keyframes ripple {
  to { transform: scale(4); opacity: 0; }
}

/* Animation Utility Classes */
.anim-fadeIn { animation: fadeIn 0.5s ease forwards; }
.anim-fadeInUp { animation: fadeInUp 0.5s ease forwards; }
.anim-fadeInDown { animation: fadeInDown 0.5s ease forwards; }
.anim-slideInLeft { animation: slideInLeft 0.4s ease forwards; }
.anim-scaleIn { animation: scaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.anim-float { animation: float 3s ease-in-out infinite; }
.anim-pulse { animation: pulse 2s ease-in-out infinite; }

/* Stagger animation delays */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* ============================================================
   Particle Background
   ============================================================ */
.particle-bg {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 3px; height: 3px;
  background: var(--accent-gold);
  border-radius: 50%;
  opacity: 0.2;
  animation: particleFloat linear infinite;
}

@keyframes particleFloat {
  0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
  10% { opacity: 0.3; }
  90% { opacity: 0.1; }
  100% { transform: translateY(-100px) rotate(720deg); opacity: 0; }
}

/* ============================================================
   Glowing Elements
   ============================================================ */
.glow-gold {
  box-shadow: 0 0 20px rgba(212,160,23,0.4), 0 0 40px rgba(212,160,23,0.1);
}

.glow-blue {
  box-shadow: 0 0 20px rgba(90,123,255,0.4), 0 0 40px rgba(90,123,255,0.1);
}

.text-glow-gold {
  text-shadow: 0 0 20px rgba(212,160,23,0.5);
}

/* ============================================================
   Dividers
   ============================================================ */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-color), transparent);
  margin: 16px 0;
}

.divider-gold {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
  margin: 16px 0;
}

/* ============================================================
   Responsive - Mobile
   ============================================================ */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .page-content {
    padding: 16px;
  }

  .topbar {
    padding: 0 16px;
  }

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

/* ============================================================
   Misc Utilities
   ============================================================ */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }

.text-right { text-align: right; }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.font-mono { font-family: 'Orbitron', monospace; }

.text-gold { color: var(--accent-gold); }
.text-blue { color: var(--accent-blue); }
.text-green { color: var(--accent-green); }
.text-red { color: var(--accent-red); }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }

.w-full { width: 100%; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.overflow-hidden { overflow: hidden; }

.cursor-pointer { cursor: pointer; }
.select-none { user-select: none; }

.hidden { display: none !important; }
.visible { display: block !important; }
