/* =====================================================
   FIGHTCRM — Premium Design System v2.0
   ===================================================== */

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

/* =====================================================
   DESIGN TOKENS
   ===================================================== */
:root {
  /* Backgrounds */
  --bg:        #08080d;
  --bg-2:      #0f0f17;
  --bg-3:      #15151f;
  --bg-4:      #1c1c28;

  /* Surfaces (glass) */
  --surface:        rgba(255,255,255,0.04);
  --surface-hover:  rgba(255,255,255,0.07);
  --surface-2:      rgba(255,255,255,0.02);

  /* Borders */
  --border:       rgba(255,255,255,0.07);
  --border-hover: rgba(255,255,255,0.18);
  --border-focus: rgba(230,0,0,0.5);

  /* Brand */
  --primary:      #e60000;
  --primary-dark: #b00000;
  --primary-light: #ff3333;
  --primary-glow: rgba(230,0,0,0.2);
  --primary-glow-sm: rgba(230,0,0,0.12);

  /* Semantic */
  --success: #00c48c;
  --success-glow: rgba(0,196,140,0.15);
  --warning: #f5a623;
  --warning-glow: rgba(245,166,35,0.15);
  --info:    #4a90e2;
  --info-glow: rgba(74,144,226,0.15);
  --danger:  #e60000;

  /* Text */
  --text:   #f0f0f8;
  --text-2: #8888a0;
  --text-3: #44445a;
  --text-muted: #5a5a72;

  /* Radii */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius:    14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  /* Shadows */
  --shadow-sm: 0 2px 12px rgba(0,0,0,0.3);
  --shadow:    0 4px 24px rgba(0,0,0,0.5);
  --shadow-lg: 0 12px 48px rgba(0,0,0,0.7);
  --shadow-xl: 0 24px 80px rgba(0,0,0,0.8);
  --glow-red:  0 0 24px rgba(230,0,0,0.25);
  --glow-red-lg: 0 0 48px rgba(230,0,0,0.2);

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =====================================================
   RESET & BASE
   ===================================================== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(230,0,0,0.06) 0%, transparent 60%);
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; border: none; outline: none; }
input, textarea, select { font-family: inherit; outline: none; }

/* =====================================================
   LAYOUT
   ===================================================== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* =====================================================
   SIDEBAR
   ===================================================== */
.sidebar {
  width: 252px;
  flex-shrink: 0;
  background: rgba(10,10,18,0.92);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-right: 1px solid rgba(255,255,255,0.05);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform var(--transition-slow);
  box-shadow: 4px 0 40px rgba(0,0,0,0.6);
}

/* Subtle red gradient at top of sidebar */
.sidebar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 200px;
  background: radial-gradient(ellipse 100% 80% at 30% -10%, rgba(230,0,0,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.sidebar-logo {
  padding: 26px 22px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

.sidebar-logo-text {
  font-weight: 900;
  font-size: 1.3rem;
  letter-spacing: -0.04em;
  color: #fff;
}

.sidebar-logo-text span {
  background: linear-gradient(135deg, #ff4444, #cc0000);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Live indicator dot */
.sidebar-logo::after {
  content: '';
  position: absolute;
  top: 26px; right: 22px;
  width: 8px; height: 8px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(0,196,140,0.6);
  animation: livePulse 2s infinite;
}

@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0 rgba(0,196,140,0.6); }
  70%  { box-shadow: 0 0 0 8px rgba(0,196,140,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,196,140,0); }
}

.sidebar-nav {
  padding: 14px 10px;
  flex: 1;
  overflow-y: auto;
}
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }

.nav-section-title {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(255,255,255,0.22);
  padding: 14px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.22s var(--ease);
  cursor: pointer;
  margin-bottom: 2px;
  border: 1px solid transparent;
  position: relative;
}

.nav-item:hover {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
  transform: translateX(3px);
}

.nav-item.active {
  background: linear-gradient(110deg, rgba(230,0,0,0.14) 0%, rgba(230,0,0,0.03) 100%);
  color: #fff;
  font-weight: 600;
  border-color: rgba(230,0,0,0.18);
  border-left: 2px solid var(--primary);
  box-shadow: inset 0 0 20px rgba(230,0,0,0.05);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: -1px; top: 25%; bottom: 25%;
  width: 3px;
  background: linear-gradient(180deg, #ff4444, #cc0000);
  border-radius: 0 3px 3px 0;
  box-shadow: 2px 0 12px rgba(230,0,0,0.5);
}

.nav-item svg {
  width: 18px; height: 18px;
  flex-shrink: 0;
  transition: color 0.2s;
}

.nav-item.active svg { color: var(--primary); }

.sidebar-bottom {
  padding: 14px 10px;
  border-top: 1px solid rgba(255,255,255,0.04);
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
}
.user-pill:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
}

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #800000);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(230,0,0,0.35);
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 0.82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 0.7rem; color: var(--text-3); margin-top: 1px; }

/* =====================================================
   MAIN CONTENT
   ===================================================== */
.main-content {
  margin-left: 252px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* =====================================================
   TOPBAR
   ===================================================== */
.topbar {
  height: 62px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: rgba(8,8,13,0.8);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 0 rgba(255,255,255,0.04);
}

.topbar-left { display: flex; align-items: center; gap: 14px; }

.menu-toggle {
  display: none;
  background: transparent;
  color: var(--text);
  border: none;
  padding: 4px;
}
.menu-toggle svg { width: 22px; height: 22px; }

.topbar-left h1 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.topbar-left p {
  font-size: 0.75rem;
  color: var(--text-3);
  margin-top: 1px;
}

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

.page-body {
  padding: 28px;
  flex: 1;
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 600;
  transition: all var(--transition);
  letter-spacing: -0.01em;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.07) 0%, transparent 50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition);
}
.btn:hover::after { opacity: 1; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 2px 8px rgba(230,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.1);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(230,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.1);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
}
.btn-ghost:hover { background: var(--surface); color: var(--text); }

.btn-sm { padding: 6px 12px; font-size: 0.78rem; }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); }

/* =====================================================
   CARDS
   ===================================================== */
.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color var(--transition);
}
.card:hover { border-color: rgba(255,255,255,0.1); }

.card-title {
  font-size: 0.88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--text);
}
.card-title svg { width: 16px; height: 16px; color: var(--text-3); }

/* =====================================================
   STAT CARDS
   ===================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.28s var(--ease);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.02) 0%, transparent 60%);
  pointer-events: none;
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255,255,255,0.13);
  box-shadow: var(--shadow);
}

.stat-icon {
  width: 50px; height: 50px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}

.stat-icon.red   { background: rgba(230,0,0,0.1);   color: #ff4444; box-shadow: 0 0 20px rgba(230,0,0,0.12); }
.stat-icon.green { background: rgba(0,196,140,0.1); color: var(--success); box-shadow: 0 0 20px rgba(0,196,140,0.12); }
.stat-icon.yellow{ background: rgba(245,166,35,0.1);color: var(--warning); box-shadow: 0 0 20px rgba(245,166,35,0.12); }
.stat-icon.blue  { background: rgba(74,144,226,0.1); color: var(--info); box-shadow: 0 0 20px rgba(74,144,226,0.12); }

.stat-info { flex: 1; }
.stat-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 5px;
  letter-spacing: -0.04em;
}
.stat-label { font-size: 0.76rem; color: var(--text-3); font-weight: 500; letter-spacing: 0.02em; }

/* =====================================================
   DASHBOARD GRID
   ===================================================== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
  align-items: start;
}

.main-grid {
  display: grid;
  gap: 20px;
}

@media (max-width: 1024px) {
  .dashboard-grid { grid-template-columns: 1fr; }
}

.chart-card {
  background: var(--bg-2);
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

/* =====================================================
   BADGES
   ===================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge-new        { background: rgba(74,144,226,0.12);  color: #6aaff5; border: 1px solid rgba(74,144,226,0.22); }
.badge-contacted  { background: rgba(245,166,35,0.12);  color: #f5a623; border: 1px solid rgba(245,166,35,0.22); }
.badge-appointment{ background: rgba(138,43,226,0.12);  color: #c084fc; border: 1px solid rgba(138,43,226,0.22); }
.badge-in_progress{ background: rgba(138,43,226,0.12);  color: #c084fc; border: 1px solid rgba(138,43,226,0.22); }
.badge-won        { background: rgba(0,196,140,0.12);   color: #00c48c; border: 1px solid rgba(0,196,140,0.22); }
.badge-lost       { background: rgba(230,0,0,0.1);      color: #ff5555; border: 1px solid rgba(230,0,0,0.2); }

/* =====================================================
   TABLE
   ===================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  min-height: 250px;
}

.table-wrapper {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
  background: rgba(255,255,255,0.01);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  flex: 1;
  max-width: 320px;
  transition: all var(--transition);
}
.search-box:focus-within {
  border-color: rgba(230,0,0,0.4);
  background: var(--surface-hover);
  box-shadow: 0 0 0 3px rgba(230,0,0,0.08);
}
.search-box input {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 0.84rem;
  width: 100%;
}
.search-box input::placeholder { color: var(--text-3); }

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

thead th {
  padding: 11px 20px;
  text-align: left;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
  background: rgba(255,255,255,0.015);
  border-bottom: 1px solid var(--border);
}

tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.03);
  transition: all 0.18s var(--ease);
  cursor: pointer;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover {
  background: rgba(255,255,255,0.025);
  position: relative;
  z-index: 20;
}

tbody td {
  padding: 13px 20px;
  font-size: 0.84rem;
}

.lead-name-cell { display: flex; align-items: center; gap: 10px; }
.lead-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(230,0,0,0.1);
  border: 1px solid rgba(230,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
  position: relative;
}
.lead-name { font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 8px; font-size: 0.875rem; }
.lead-source { font-size: 0.72rem; color: var(--text-3); margin-top: 2px; }

.action-btns { display: flex; gap: 6px; }

/* =====================================================
   PULSE ANIMATION
   ===================================================== */
.pulse-anim::after {
  content: '';
  position: absolute;
  top: -2px; right: -2px;
  width: 10px; height: 10px;
  background-color: var(--info);
  border-radius: 50%;
  border: 2px solid var(--bg-2);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%   { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(74,144,226,0.7); }
  70%  { transform: scale(1);    box-shadow: 0 0 0 6px rgba(74,144,226,0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(74,144,226,0); }
}

/* =====================================================
   TOOLTIP
   ===================================================== */
.note-tooltip-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: help;
  color: var(--warning);
  vertical-align: middle;
  margin-left: 4px;
}
.note-tooltip-wrapper svg { width: 14px; height: 14px; }
.note-tooltip-wrapper::before {
  content: attr(data-note);
  position: absolute;
  top: calc(100% + 8px);
  left: -8px;
  transform: translateY(-4px);
  background: var(--bg-2, #161622);
  color: var(--text, #f0f0f5);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.45;
  white-space: normal;
  word-break: break-word;
  width: max-content;
  max-width: 320px;
  min-width: 200px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.85);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 99999;
  pointer-events: none;
}
.note-tooltip-wrapper::after {
  content: '';
  position: absolute;
  top: calc(100% + 1px);
  left: 3px;
  border-width: 6px;
  border-style: solid;
  border-color: transparent transparent rgba(255, 255, 255, 0.18) transparent;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
  z-index: 100000;
  pointer-events: none;
}
.note-tooltip-wrapper:hover::before {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.note-tooltip-wrapper:hover::after {
  opacity: 1;
  visibility: visible;
  border-color: transparent transparent var(--bg-2, #161622) transparent;
}

/* =====================================================
   MODAL
   ===================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: rgba(14, 14, 22, 0.95);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255,255,255,0.04) inset;
  animation: slideUp 0.28s cubic-bezier(0.34,1.56,0.64,1);
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.modal-title { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.02em; }
.modal-close {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  transition: all var(--transition);
}
.modal-close:hover { background: var(--surface-hover); color: var(--text); border-color: var(--border-hover); }

/* =====================================================
   FORM ELEMENTS
   ===================================================== */
.form-group { margin-bottom: 16px; }
.form-label { font-size: 0.78rem; font-weight: 600; color: var(--text-2); margin-bottom: 7px; display: block; letter-spacing: 0.02em; }

.form-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text);
  font-size: 0.875rem;
  transition: all var(--transition);
}
.form-input:focus {
  border-color: var(--border-focus);
  background: var(--surface-hover);
  box-shadow: 0 0 0 3px rgba(230,0,0,0.08);
}
.form-input::placeholder { color: var(--text-3); }
select.form-input { appearance: none; cursor: pointer; }
textarea.form-input { resize: vertical; min-height: 80px; line-height: 1.5; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* =====================================================
   TOAST
   ===================================================== */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: rgba(14,14,22,0.96);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s cubic-bezier(0.34,1.56,0.64,1);
  backdrop-filter: blur(20px);
}
@keyframes slideInRight { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--primary); }
.toast-msg { font-size: 0.84rem; font-weight: 500; }

/* =====================================================
   EMPTY STATE
   ===================================================== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}
.empty-state svg { color: var(--text-3); margin-bottom: 16px; }
.empty-state h3 { font-size: 1rem; margin-bottom: 8px; font-weight: 600; }
.empty-state p { color: var(--text-2); font-size: 0.84rem; }

/* =====================================================
   PAGINATION
   ===================================================== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 20px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-3);
  background: rgba(255,255,255,0.01);
}
.pagination-btns { display: flex; gap: 6px; }
.page-btn {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}
.page-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); background: rgba(230,0,0,0.06); }
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 0 12px rgba(230,0,0,0.35); }

/* =====================================================
   SCROLLBAR
   ===================================================== */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

/* =====================================================
   KANBAN
   ===================================================== */
.kanban-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.kanban-col {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.kanban-col-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.015);
}

.kanban-col-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-2);
}

.kanban-count {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 0.7rem;
  font-weight: 700;
}

.kanban-cards { padding: 12px; display: flex; flex-direction: column; gap: 8px; min-height: 100px; }

.kanban-card {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  cursor: pointer;
  transition: all var(--transition);
}
.kanban-card:hover { border-color: var(--border-hover); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.kanban-card-name { font-weight: 600; font-size: 0.875rem; margin-bottom: 5px; }
.kanban-card-meta { font-size: 0.74rem; color: var(--text-2); display: flex; gap: 10px; }

/* =====================================================
   LOGIN PAGE
   ===================================================== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 60% at 50% -20%, rgba(230,0,0,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(74,144,226,0.05) 0%, transparent 60%);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: rgba(14,14,22,0.9);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-xl);
  padding: 44px 40px;
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255,255,255,0.04) inset;
  backdrop-filter: blur(40px);
}

.login-logo {
  text-align: center;
  margin-bottom: 36px;
}
.login-logo h1 { font-size: 1.5rem; font-weight: 900; letter-spacing: -0.04em; }
.login-logo h1 span { background: linear-gradient(135deg, #ff4444, #cc0000); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.login-logo p { color: var(--text-3); font-size: 0.85rem; margin-top: 6px; }

.login-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  margin-top: 8px;
  box-shadow: 0 4px 16px rgba(230,0,0,0.3);
}
.login-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(230,0,0,0.45); }
.login-divider { text-align: center; color: var(--text-3); font-size: 0.8rem; margin: 16px 0; }

/* =====================================================
   FINANCE MODULE
   ===================================================== */
.finance-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.fin-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: all 0.28s var(--ease);
}
.fin-card:hover { transform: translateY(-4px); border-color: rgba(255,255,255,0.12); box-shadow: var(--shadow); }
.fin-card.income { border-top: 2px solid var(--success); }
.fin-card.income::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 60px; background: linear-gradient(180deg, rgba(0,196,140,0.06) 0%, transparent 100%); pointer-events: none; }
.fin-card.expense { border-top: 2px solid var(--primary); }
.fin-card.expense::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 60px; background: linear-gradient(180deg, rgba(230,0,0,0.06) 0%, transparent 100%); pointer-events: none; }
.fin-card.net { border-top: 2px solid var(--info); }
.fin-card.net::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 60px; background: linear-gradient(180deg, rgba(74,144,226,0.06) 0%, transparent 100%); pointer-events: none; }

.fin-label { font-size: 0.76rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); margin-bottom: 10px; }
.fin-amount { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.04em; }
.fin-amount.positive { color: var(--success); }
.fin-amount.negative { color: var(--primary); }

.tx-list { display: flex; flex-direction: column; gap: 2px; }
.tx-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.tx-item:hover { background: var(--surface); }
.tx-left { display: flex; align-items: center; gap: 12px; }
.tx-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.tx-icon svg { width: 16px; height: 16px; }
.tx-icon.income  { background: rgba(0,196,140,0.1); color: var(--success); }
.tx-icon.expense { background: rgba(230,0,0,0.1);   color: var(--primary); }
.tx-info h4 { font-size: 0.875rem; font-weight: 600; }
.tx-info p  { font-size: 0.75rem; color: var(--text-3); margin-top: 2px; }
.tx-right { display: flex; align-items: center; gap: 12px; }
.tx-amount { font-size: 0.9rem; font-weight: 700; }
.tx-amount.income  { color: var(--success); }
.tx-amount.expense { color: var(--primary); }
.tx-actions button { background: transparent; border: none; color: var(--text-3); cursor: pointer; padding: 4px; border-radius: 6px; transition: all var(--transition); display: flex; }
.tx-actions button:hover { color: var(--primary); background: rgba(230,0,0,0.08); }

/* =====================================================
   MOBILE RESPONSIVE
   ===================================================== */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 90;
}
.sidebar-overlay.show { display: block; }

@media (max-width: 768px) {
  .modal { width: 95%; max-height: 90vh; overflow-y: auto; }
  .data-table th, .data-table td { padding: 10px; font-size: 0.75rem; }
  .sidebar {
    transform: translateX(-100%);
    width: 260px;
  }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .menu-toggle { display: flex; }
  .topbar { padding: 0 16px; }
  .page-body { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .topbar-actions .btn span { display: none; }
}

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


/* Select Dropdown Fix */
select option {
  background-color: #0f0f17;
  color: #f0f0f8;
  font-weight: 500;
  padding: 8px;
}
