/* ═══════════════════════════════════════════════════════
   INEXOPAY ENTERPRISE — PURE WHITE GLASSMORPHISM THEME
   ═══════════════════════════════════════════════════════ */

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

:root {
  --radius: 0.625rem;
  --inexo-primary:       #DC2626;
  --inexo-primary-hover: #B91C1C;
  --inexo-accent:        #1E40AF;
  --inexo-accent-hover:  #1E3A8A;
  --inexo-alert:         #EF4444;
  --inexo-success:       #10B981;
  --inexo-warning:       #F59E0B;
  --inexo-glass:         rgba(255,255,255,0.72);
  --inexo-glass-border:  rgba(0,0,0,0.06);
  --background:          #FFFFFF;
  --foreground:          #0A1128;
  --muted:               #F8FAFC;
  --muted-foreground:    #64748B;
  --border:              rgba(0,0,0,0.07);
  --input:               rgba(0,0,0,0.06);
  --ring:                #DC2626;
  --sidebar-w:           256px;
}

/* ───── Reset ───── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #F0F4F8;
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
  font-size: 13px;
  line-height: 1.5;
  height: 100%;
}

/* ═══════════════════════════════════════════════════════
   APP LAYOUT — Sidebar + Main
   ═══════════════════════════════════════════════════════ */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ─── SIDEBAR ─── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: rgba(255,255,255,0.97);
  border-right: 1px solid rgba(0,0,0,0.07);
  box-shadow: 2px 0 16px rgba(0,0,0,0.04);
  z-index: 40;
  transition: transform 0.3s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}

/* Logo */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  flex-shrink: 0;
}
.logo-icon {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--inexo-primary), var(--inexo-accent));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(14,165,233,.25);
  flex-shrink: 0;
}
.logo-icon i { color: #fff; width: 18px; height: 18px; }
.logo-name { display: block; font-size: 14px; font-weight: 800; letter-spacing: -0.03em; color: var(--foreground); }
.logo-sub  { display: block; font-size: 9px; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 1px; }

/* Profile */
.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.75rem;
  padding: 0.65rem 0.75rem;
  background: rgba(14,165,233,0.05);
  border: 1px solid rgba(14,165,233,0.12);
  border-radius: calc(var(--radius) + 2px);
  flex-shrink: 0;
}
.profile-avatar {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--inexo-primary), var(--inexo-accent));
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.profile-avatar.sm { width: 28px; height: 28px; font-size: 12px; border-radius: 7px; }
.profile-name { font-size: 12px; font-weight: 600; color: var(--foreground); }
.profile-role { font-size: 9px; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 1px; }

/* Wallet chips */
.sidebar-wallets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 0 0.75rem 0.75rem;
  flex-shrink: 0;
}
.wallet-chip {
  background: rgba(0,0,0,0.03);
  border-radius: 6px;
  padding: 5px 4px;
  text-align: center;
}
.wallet-chip-label { display: block; font-size: 8px; color: var(--muted-foreground); text-transform: uppercase; }
.wallet-chip-amount { display: block; font-size: 9px; font-weight: 700; color: var(--foreground); margin-top: 1px; }

/* Nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.5rem 0.65rem;
}
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.08); border-radius: 10px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.7rem;
  border-radius: calc(var(--radius));
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted-foreground);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 1px;
  position: relative;
  white-space: nowrap;
}
.nav-item:hover {
  color: var(--foreground);
  background: rgba(14,165,233,0.06);
}
.nav-active {
  background: linear-gradient(135deg, var(--inexo-primary) 0%, #0284C7 100%);
  color: #fff !important;
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(14,165,233,.3);
}
.nav-active:hover { background: linear-gradient(135deg, var(--inexo-primary) 0%, #0284C7 100%); }
.nav-icon { width: 16px; height: 16px; flex-shrink: 0; }
.nav-label { flex: 1; }
.nav-active-bar { display: none; }

.nav-logout { color: var(--inexo-alert) !important; }
.nav-logout:hover { background: rgba(239,68,68,0.06) !important; }

/* Sidebar footer */
.sidebar-footer {
  padding: 0.5rem 0.65rem;
  border-top: 1px solid rgba(0,0,0,0.05);
  flex-shrink: 0;
}

/* Mobile overlay */
.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(3px);
  z-index: 35;
}

/* ─── MAIN CONTENT ─── */
.main-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Top Header */
.top-header {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  background: rgba(255,255,255,0.95);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  flex-shrink: 0;
  gap: 1rem;
  backdrop-filter: blur(20px);
}
.header-left { display: flex; align-items: center; gap: 0.75rem; }
.header-title { display: flex; align-items: center; gap: 0.5rem; }
.header-title h2 { font-size: 15px; font-weight: 600; color: var(--foreground); }
.header-right { display: flex; align-items: center; gap: 0.75rem; position: relative; }

.mobile-menu-btn {
  background: none; border: none; cursor: pointer;
  padding: 4px; border-radius: 6px;
  display: none;
}
.mobile-menu-btn:hover { background: rgba(0,0,0,0.04); }
.mobile-menu-btn i { width: 20px; height: 20px; color: var(--foreground); }

/* Icon button */
.icon-btn {
  background: none; border: none; cursor: pointer;
  padding: 6px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  position: relative; transition: background 0.15s;
}
.icon-btn:hover { background: rgba(0,0,0,0.04); }
.icon-btn i { width: 18px; height: 18px; color: var(--foreground); }

.notif-badge {
  position: absolute; top: 4px; right: 4px;
  min-width: 16px; height: 16px;
  background: var(--inexo-alert); color: #fff;
  border-radius: 999px; font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
}

.profile-btn {
  background: none; border: none; cursor: pointer;
  display: flex; align-items: center; gap: 0.35rem;
  padding: 4px 8px; border-radius: 8px;
  transition: background 0.15s;
}
.profile-btn:hover { background: rgba(0,0,0,0.04); }
.chevron { width: 13px; height: 13px; color: var(--muted-foreground); }

/* Dropdown panel */
.header-notif-wrap, .header-profile-wrap { position: relative; }

.dropdown-panel {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: rgba(255,255,255,0.98);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  z-index: 200;
  min-width: 220px;
  overflow: hidden;
}

.dropdown-header {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  display: flex; justify-content: space-between; align-items: center;
}
.dd-name { font-size: 12px; font-weight: 600; color: var(--foreground); }
.dd-email { font-size: 10px; color: var(--muted-foreground); margin-top: 1px; }

.link-btn { background: none; border: none; cursor: pointer; font-size: 10px; color: var(--inexo-primary); }

.dropdown-link {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  text-decoration: none;
  font-size: 12px; color: var(--foreground);
  transition: background 0.15s;
}
.dropdown-link:hover { background: rgba(0,0,0,0.03); }
.dropdown-link i { width: 14px; height: 14px; }
.dropdown-link.danger { color: var(--inexo-alert); border-top: 1px solid rgba(0,0,0,0.05); }

/* Notif items */
.notif-item { padding: 0.6rem 0.85rem; border-bottom: 1px solid rgba(0,0,0,0.04); font-size: 11px; }
.notif-item.unread { background: rgba(14,165,233,0.04); }
.notif-title { font-weight: 600; color: var(--foreground); }
.notif-msg { color: var(--muted-foreground); margin-top: 2px; }
.empty-msg { padding: 1rem; text-align: center; font-size: 11px; color: var(--muted-foreground); }

/* Page content */
.page-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  background: #F0F4F8;
}
.page-content::-webkit-scrollbar { width: 4px; }
.page-content::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 10px; }

/* Footer */
.app-footer {
  height: 38px;
  border-top: 1px solid rgba(0,0,0,0.06);
  padding: 0 1.25rem;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 10px; color: var(--muted-foreground);
  flex-shrink: 0;
  background: rgba(255,255,255,0.8);
}

/* ═══════════════════════════════════════════════════════
   DASHBOARD SPECIFIC
   ═══════════════════════════════════════════════════════ */
.dashboard-page { display: flex; flex-direction: column; gap: 1.25rem; }

/* Welcome banner */
.welcome-banner {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  background: linear-gradient(135deg, var(--inexo-primary) 0%, #0369A1 100%);
  color: #fff;
  border-radius: calc(var(--radius) + 4px);
  padding: 1.25rem 1.5rem;
  box-shadow: 0 4px 20px rgba(14,165,233,.35);
}
.welcome-title { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.welcome-sub { font-size: 12px; opacity: 0.85; margin-top: 3px; }
.welcome-badge {
  display: flex; align-items: center; gap: 0.4rem;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 11px; font-weight: 600;
}

/* KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
}
.kpi-card {
  display: flex; align-items: center; gap: 0.85rem;
  background: rgba(255,255,255,0.95);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: calc(var(--radius) + 2px);
  padding: 1rem 1.15rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  transition: box-shadow 0.2s, transform 0.2s;
}
.kpi-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); transform: translateY(-1px); }
.kpi-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.kpi-icon i { width: 20px; height: 20px; }
.kpi-label { font-size: 10px; font-weight: 600; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: 0.05em; }
.kpi-value { font-size: 20px; font-weight: 800; color: var(--foreground); margin-top: 3px; letter-spacing: -0.03em; }

/* Charts grid */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
}
.chart-card { display: flex; flex-direction: column; gap: 0.75rem; }

/* Card header row */
.card-header-row {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
}
.card-title { font-size: 13px; font-weight: 600; color: var(--foreground); }

/* ═══════════════════════════════════════════════════════
   GLASSMORPHISM
   ═══════════════════════════════════════════════════════ */
.glass-card {
  background: rgba(255,255,255,0.95);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.02);
  padding: 1.1rem 1.25rem;
  transition: box-shadow 0.2s;
}
.glass-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.07); }

/* ═══════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════ */
.form-group { margin-bottom: 0.7rem; }
.form-label {
  display: block; font-size: 10px; font-weight: 700;
  color: var(--muted-foreground); margin-bottom: 0.2rem;
  text-transform: uppercase; letter-spacing: 0.06em;
}
input, select {
  width: 100%;
  height: 32px;
  padding: 0 0.55rem;
  border-radius: var(--radius);
  border: 1px solid rgba(0,0,0,0.12);
  background: #FFFFFF;
  color: var(--foreground);
  font-family: inherit;
  font-size: 12.5px;
  transition: all 0.15s ease;
}
textarea {
  width: 100%;
  padding: 0.35rem 0.55rem;
  border-radius: var(--radius);
  border: 1px solid rgba(0,0,0,0.12);
  background: #FFFFFF;
  color: var(--foreground);
  font-family: inherit;
  font-size: 12.5px;
  transition: all 0.15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--inexo-primary) !important;
  box-shadow: 0 0 0 3px rgba(14,165,233,0.12);
}
input[type="color"] { padding: 2px 4px; height: 32px; }

/* ═══════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.5rem 1.1rem;
  font-weight: 600; font-family: inherit; font-size: 12.5px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
  gap: 0.4rem;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--inexo-primary); color: #fff; }
.btn-primary:hover { background: var(--inexo-primary-hover); box-shadow: 0 2px 14px rgba(14,165,233,.3); transform: translateY(-0.5px); }
.btn-secondary { background: #fff; border-color: rgba(0,0,0,0.1); color: var(--foreground); }
.btn-secondary:hover { background: #F8FAFC; }
.btn-alert { background: var(--inexo-alert); color: #fff; }
.btn-alert:hover { opacity: 0.9; box-shadow: 0 2px 12px rgba(239,68,68,.25); }
.btn-sm { padding: 0.3rem 0.65rem; font-size: 11px; }
.btn-xs { padding: 0.2rem 0.5rem; font-size: 10px; }
.w-full { width: 100%; }

/* ═══════════════════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
  white-space: nowrap;
}
.badge-success { background: #DCFCE7; color: #15803D; }
.badge-warning { background: #FEF3C7; color: #B45309; }
.badge-error   { background: #FEE2E2; color: #B91C1C; }
.badge-info    { background: #E0F2FE; color: #0369A1; }
.badge-pending { background: #F1F5F9; color: #475569; }

/* ═══════════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════════ */
.table-wrapper { overflow-x: auto; border-radius: var(--radius); }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th {
  text-align: left; padding: 0.75rem 1rem;
  background: #F8FAFC; color: var(--muted-foreground);
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  border-bottom: 1px solid rgba(0,0,0,0.07);
}
td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  color: var(--foreground); font-size: 12.5px;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(14,165,233,0.025); }
.table-loading, .table-empty { text-align: center; color: var(--muted-foreground); padding: 2rem !important; }
.text-muted { color: var(--muted-foreground) !important; }

/* ═══════════════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal {
  width: 100%; max-width: 520px;
  background: #fff;
  border-radius: calc(var(--radius) + 4px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.12);
  display: flex; flex-direction: column;
  max-height: 90vh; overflow: hidden;
  border: 1px solid rgba(0,0,0,0.07);
}
.modal-header { padding: 1rem 1.25rem; border-bottom: 1px solid rgba(0,0,0,0.06); display: flex; align-items: center; justify-content: space-between; }
.modal-body   { padding: 1.25rem; overflow-y: auto; }
.modal-footer { padding: 1rem 1.25rem; border-top: 1px solid rgba(0,0,0,0.06); display: flex; justify-content: flex-end; gap: 0.75rem; }

/* ═══════════════════════════════════════════════════════
   INSTALLER
   ═══════════════════════════════════════════════════════ */
.install-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; background: #F0F4F8; position: relative; }
.install-card { width: 100%; max-width: 840px; background: #fff; border-radius: calc(var(--radius) + 6px); box-shadow: 0 10px 40px rgba(0,0,0,0.07); padding: 2.25rem 2.5rem; border: 1px solid rgba(0,0,0,0.07); }
.badge-success-light { background: rgba(34,197,94,0.12); color: #15803D; border: 1px solid rgba(34,197,94,0.2); padding: 0.35rem 0.75rem; border-radius: 999px; font-size: 11px; font-weight: 600; }
.badge-pending-light { background: rgba(100,116,139,0.08); color: var(--muted-foreground); border: 1px solid rgba(0,0,0,0.08); padding: 0.35rem 0.75rem; border-radius: 999px; font-size: 11px; font-weight: 600; }

/* ═══════════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════════ */
.hidden { display: none !important; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.grid { display: grid; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-xs { font-size: 10px; }
.text-sm { font-size: 12px; }
.text-muted { color: var(--muted-foreground); }
.text-right { text-align: right; }
.text-center { text-align: center; }

/* Pulse animation */
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }
.pulse-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; animation: pulse 2s infinite; }
.pulse-dot-primary { background-color: var(--inexo-primary); }

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */
@media (max-width: 1280px) {
  .kpi-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 1024px) {
  .sidebar { position: fixed; top:0; bottom:0; left:0; transform: translateX(-100%); }
  .sidebar.sidebar-open { transform: translateX(0); }
  .mobile-menu-btn { display: flex !important; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .welcome-banner { flex-direction: column; align-items: flex-start; }
  .install-card { padding: 1.5rem 1.25rem; }
}
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
}

/* Grid System Utilities */
.grid { display: grid !important; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)) !important; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
.grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; }

.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 0.75rem !important; }
.gap-4 { gap: 1rem !important; }
.gap-6 { gap: 1.5rem !important; }

/* Responsive adjustments */
@media (max-width: 768px) {
  .grid-cols-2, .grid-cols-3, .grid-cols-4, .grid-cols-5 {
    grid-template-columns: 1fr !important;
  }
}

/* Spin animation for loader icons */
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.spin {
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
