:root {
  --primary: #14B8A6;
  --primary-dark: #0D9488;
  --primary-light: #2DD4BF;
  --secondary: #10B981;
  --danger: #EF4444;
  --warning: #F59E0B;
  --info: #3B82F6;
  --dark: #F1F5F9;
  --darker: #FFFFFF;
  --card: #FFFFFF;
  --text: #1E293B;
  --text-muted: #64748B;
  --border: #E2E8F0;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.1);
  --radius: 14px;
  --radius-sm: 9px;
  --transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
  --sidebar-width: 256px;
  --header-height: 64px;
  --sidebar-bg: #0F172A;
  --sidebar-text: #94A3B8;
  --sidebar-active: #14B8A6;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  background: #F1F5F9;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ========== AUTH PAGES ========== */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #F1F5F9 0%, #E0F2FE 50%, #CCFBF1 100%);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.auth-wrapper::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(20,184,166,0.12) 0%, transparent 70%);
  top: -100px; left: -100px;
  animation: pulse 8s ease-in-out infinite;
}

.auth-wrapper::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(59,130,246,0.08) 0%, transparent 70%);
  bottom: -50px; right: -50px;
  animation: pulse 6s ease-in-out infinite reverse;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.2); opacity: 1; }
}

.auth-card {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 44px 40px;
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 1;
  box-shadow: 0 8px 40px rgba(0,0,0,0.1);
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo .logo-icon {
  width: 68px; height: 68px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  margin: 0 auto 14px;
  box-shadow: 0 8px 24px rgba(20,184,166,0.3);
}

.auth-logo h1 { font-size: 26px; font-weight: 800; color: #1E293B; }
.auth-logo p { color: var(--text-muted); font-size: 14px; margin-top: 4px; }

.tabs {
  display: flex;
  background: #F1F5F9;
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 28px;
  gap: 4px;
}

.tab-btn {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 7px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  font-family: inherit;
}

.tab-btn.active {
  background: #FFFFFF;
  color: var(--primary);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

/* ========== FORM ELEMENTS ========== */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.form-control {
  width: 100%;
  padding: 11px 14px;
  background: #F8FAFC;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  transition: var(--transition);
  outline: none;
  font-family: inherit;
}

.form-control:focus {
  border-color: var(--primary);
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(20,184,166,0.12);
}

.form-control::placeholder { color: #CBD5E1; }

select.form-control { cursor: pointer; }
select.form-control option { background: #FFFFFF; color: var(--text); }

textarea.form-control { resize: vertical; }

.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-group .form-control { padding-left: 42px; }

.input-group .input-icon {
  position: absolute;
  left: 12px;
  color: #CBD5E1;
  font-size: 17px;
  pointer-events: none;
}

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.2px;
}

.btn-primary {
  background: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(20,184,166,0.3);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(20,184,166,0.4);
  color: #FFFFFF;
}

.btn-success {
  background: #10B981;
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(16,185,129,0.25);
}

.btn-success:hover { background: #059669; transform: translateY(-1px); color: #FFFFFF; }

.btn-danger {
  background: var(--danger);
  color: #FFFFFF;
}

.btn-danger:hover { background: #DC2626; transform: translateY(-1px); color: #FFFFFF; }

.btn-warning {
  background: var(--warning);
  color: #FFFFFF;
}

.btn-warning:hover { background: #D97706; color: #FFFFFF; }

.btn-outline {
  background: #FFFFFF;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
}

.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: #F0FDFA; }

.btn-sm { padding: 7px 13px; font-size: 12px; border-radius: 7px; }
.btn-lg { padding: 13px 28px; font-size: 15px; }
.btn-full { width: 100%; }
.btn-icon { padding: 8px; border-radius: 8px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

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

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid rgba(255,255,255,0.04);
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: var(--transition);
  overflow: hidden;
}

.sidebar-brand {
  padding: 20px 18px;
  display: flex;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-brand .brand-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.sidebar-brand .brand-text { font-size: 16px; font-weight: 700; color: #FFFFFF; }
.sidebar-brand .brand-sub { font-size: 11px; color: rgba(255,255,255,0.35); margin-top: 1px; }

.sidebar-nav { flex: 1; padding: 14px 10px; overflow-y: auto; }

.nav-section-title {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,0.25);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 14px 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: var(--transition);
  margin-bottom: 2px;
  position: relative;
}

.nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: #FFFFFF;
}

.nav-item.active {
  background: rgba(20,184,166,0.15);
  color: var(--primary-light);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}

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

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  min-width: 18px;
  text-align: center;
}

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

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.user-info:hover { background: rgba(255,255,255,0.06); }

.user-avatar {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.user-avatar img { width: 100%; height: 100%; border-radius: 10px; object-fit: cover; }

.user-name { font-size: 13px; font-weight: 600; color: #FFFFFF; }
.user-role { font-size: 11px; color: rgba(255,255,255,0.4); }

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

.top-header {
  height: var(--header-height);
  background: #FFFFFF;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.header-title { font-size: 18px; font-weight: 700; color: var(--text); }
.header-subtitle { font-size: 12px; color: var(--text-muted); }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.header-btn {
  width: 38px; height: 38px;
  border-radius: 9px;
  background: #F8FAFC;
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 17px;
  text-decoration: none;
  color: var(--text-muted);
  position: relative;
}

.header-btn:hover { background: #F0FDFA; border-color: var(--primary); color: var(--primary); }

.header-btn .badge {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--danger);
  width: 17px; height: 17px;
  border-radius: 50%;
  font-size: 10px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  border: 2px solid #FFFFFF;
}

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

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
}

/* ========== CARDS ========== */
.card {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.card:hover { box-shadow: var(--shadow-md); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.card-title { font-size: 15px; font-weight: 700; color: var(--text); }
.card-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

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

.stat-card {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

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

.stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
}

.stat-card.primary::after { background: var(--primary); }
.stat-card.success::after { background: var(--secondary); }
.stat-card.danger::after { background: var(--danger); }
.stat-card.warning::after { background: var(--warning); }

.stat-icon {
  width: 50px; height: 50px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-card.primary .stat-icon { background: #F0FDFA; }
.stat-card.success .stat-icon { background: #ECFDF5; }
.stat-card.danger .stat-icon { background: #FEF2F2; }
.stat-card.warning .stat-icon { background: #FFFBEB; }

.stat-value { font-size: 22px; font-weight: 800; color: var(--text); line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; font-weight: 500; }
.stat-change { font-size: 11px; margin-top: 5px; font-weight: 500; }
.stat-change.up { color: var(--secondary); }
.stat-change.down { color: var(--danger); }

/* ========== GRID LAYOUTS ========== */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }

/* ========== DEBT ITEMS ========== */
.debt-list { display: flex; flex-direction: column; gap: 10px; }

.debt-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 14px;
  background: #F8FAFC;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.debt-item:hover { background: #F0FDFA; border-color: #99F6E4; }

.debt-avatar {
  width: 42px; height: 42px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.debt-info { flex: 1; min-width: 0; }
.debt-name { font-size: 14px; font-weight: 600; color: var(--text); }
.debt-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.debt-date { font-size: 11px; color: #94A3B8; margin-top: 2px; }

.debt-amount { text-align: right; flex-shrink: 0; }
.debt-amount .amount { font-size: 15px; font-weight: 700; }
.debt-amount .amount.owe { color: var(--danger); }
.debt-amount .amount.lend { color: var(--secondary); }
.debt-amount .label { font-size: 11px; color: var(--text-muted); }

.debt-actions { display: flex; gap: 5px; }

/* PROGRESS BAR */
.progress { height: 5px; background: #E2E8F0; border-radius: 3px; margin-top: 7px; }
.progress-bar { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.progress-bar.success { background: var(--secondary); }
.progress-bar.warning { background: var(--warning); }
.progress-bar.danger { background: var(--danger); }
.progress-bar.primary { background: var(--primary); }

/* ========== BADGES ========== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.badge-primary { background: #F0FDFA; color: var(--primary-dark); border: 1px solid #99F6E4; }
.badge-success { background: #ECFDF5; color: #065F46; border: 1px solid #6EE7B7; }
.badge-danger { background: #FEF2F2; color: #991B1B; border: 1px solid #FCA5A5; }
.badge-warning { background: #FFFBEB; color: #92400E; border: 1px solid #FCD34D; }
.badge-info { background: #EFF6FF; color: #1E40AF; border: 1px solid #93C5FD; }

/* ========== FRIENDS ========== */
.friend-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }

.friend-card {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.friend-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #99F6E4; }

.friend-card .avatar {
  width: 64px; height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  color: white;
  margin: 0 auto 14px;
  box-shadow: 0 4px 14px rgba(20,184,166,0.3);
}

.friend-card .friend-name { font-size: 16px; font-weight: 700; color: var(--text); }
.friend-card .friend-email { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

.balance-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.balance-item {
  background: #F8FAFC;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px;
  text-align: center;
}

.balance-item .bal-val { font-size: 13px; font-weight: 700; }
.balance-item .bal-label { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

/* ========== MODALS ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.4);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.show { display: flex; }

.modal {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 18px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.25s ease;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

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

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

.modal-title { font-size: 18px; font-weight: 700; color: var(--text); }

.modal-close {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: #F1F5F9;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close:hover { background: #FEF2F2; border-color: #FCA5A5; color: var(--danger); }

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

/* ========== ALERTS ========== */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 9px;
  animation: slideDown 0.25s ease;
  font-weight: 500;
}

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

.alert-success { background: #ECFDF5; border: 1px solid #A7F3D0; color: #065F46; }
.alert-danger { background: #FEF2F2; border: 1px solid #FCA5A5; color: #991B1B; }
.alert-warning { background: #FFFBEB; border: 1px solid #FCD34D; color: #92400E; }
.alert-info { background: #F0FDFA; border: 1px solid #99F6E4; color: var(--primary-dark); }

/* ========== TABLES ========== */
.table-wrap { overflow-x: auto; }

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

table th {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  text-align: left;
  background: #F8FAFC;
}

table td {
  padding: 13px 14px;
  border-bottom: 1px solid #F1F5F9;
  font-size: 13.5px;
  color: var(--text);
  vertical-align: middle;
}

table tr:last-child td { border-bottom: none; }
table tr:hover td { background: #F8FAFC; }

/* ========== NOTIFICATIONS ========== */
.notification-item {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  border: 1px solid transparent;
  margin-bottom: 6px;
}

.notification-item.unread {
  background: #F0FDFA;
  border-color: #A7F3D0;
}

.notification-item:hover { background: #F8FAFC; }

.notif-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}

.notif-icon.debt { background: #FEF2F2; }
.notif-icon.payment { background: #ECFDF5; }
.notif-icon.friend { background: #F0FDFA; }
.notif-icon.reminder { background: #FFFBEB; }

.notif-content { flex: 1; }
.notif-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.notif-msg { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; line-height: 1.4; }
.notif-time { font-size: 11px; color: #94A3B8; margin-top: 5px; }

/* ========== QR CODE ========== */
.qr-wrapper { text-align: center; padding: 28px; }

.qr-frame {
  display: inline-block;
  padding: 18px;
  background: white;
  border-radius: 14px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
  border: 1px solid var(--border);
  margin: 18px 0;
}

/* ========== TRUST SCORE ========== */
.trust-display {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #F8FAFC;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}

/* ========== EMPTY STATE ========== */
.empty-state {
  text-align: center;
  padding: 52px 20px;
  color: var(--text-muted);
}

.empty-icon { font-size: 52px; margin-bottom: 14px; opacity: 0.4; }
.empty-title { font-size: 17px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty-desc { font-size: 13px; }

/* ========== PAGE HEADER ========== */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 14px;
}

.page-title { font-size: 26px; font-weight: 800; color: var(--text); }
.page-desc { font-size: 13px; color: var(--text-muted); margin-top: 3px; }

/* ========== SEARCH ========== */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #FFFFFF;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  flex: 1;
  max-width: 340px;
  transition: var(--transition);
}

.search-bar:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(20,184,166,0.1); }

.search-bar input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 13.5px;
  padding: 10px 0;
  width: 100%;
  font-family: inherit;
}

.search-bar input::placeholder { color: #CBD5E1; }
.search-bar .search-icon { color: #CBD5E1; font-size: 16px; flex-shrink: 0; }

/* ========== TOAST ========== */
.toast-container {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text);
  min-width: 260px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  animation: slideInRight 0.25s ease;
  font-weight: 500;
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast.success { border-left: 3px solid var(--secondary); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--primary); }
.toast.warning { border-left: 3px solid var(--warning); }

/* ========== CHART WRAPPER ========== */
.chart-wrap { position: relative; height: 260px; }

/* ========== ADMIN ========== */
.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

/* ========== PAGE TABS ========== */
.page-tabs {
  display: flex;
  gap: 3px;
  background: #F1F5F9;
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 22px;
  width: fit-content;
  border: 1px solid var(--border);
}

.page-tab {
  padding: 8px 18px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 7px;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.page-tab.active {
  background: #FFFFFF;
  color: var(--primary);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* ========== SPLIT ITEMS ========== */
.split-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  background: #F8FAFC;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 7px;
}

.split-item .split-name { flex: 1; font-size: 13.5px; color: var(--text); }
.split-item .split-amount { width: 130px; }
.split-item .split-amount .form-control { padding: 7px 11px; font-size: 13px; }

/* ========== RESPONSIVE ========== */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.5);
  z-index: 99;
}

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

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .main-content { margin-left: 0; }
  .menu-toggle { display: block; }
  .page-content { padding: 18px 14px; }
  .top-header { padding: 0 14px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .page-header { flex-direction: column; }
  .friend-grid { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .friend-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 28px 20px; }
  .modal { border-radius: 16px 16px 0 0; max-height: 80vh; }
  .modal-overlay { align-items: flex-end; padding: 0; }
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

/* ========== UTILITY ========== */
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--secondary) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-white { color: white !important; }
.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.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; } .justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; }
.w-100 { width: 100%; }
.text-center { text-align: center; }

.loading {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid rgba(20,184,166,0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.divider {
  height: 1px;
  background: var(--border);
  margin: 18px 0;
}

.page-tab-content { display: none; }
.page-tab-content.active { display: block; }

.skeleton {
  background: linear-gradient(90deg, #F1F5F9 25%, #E2E8F0 50%, #F1F5F9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

@keyframes shimmer { to { background-position: -200% 0; } }
