/* ============================================================
   PIYOPAY - Global Stylesheet
   Company: PIYOCHI SOLUTION
   ============================================================ */

:root {
  --primary:       #2563eb;
  --primary-dark:  #1d4ed8;
  --primary-light: #eff6ff;
  --secondary:     #7c3aed;
  --success:       #059669;
  --warning:       #d97706;
  --danger:        #dc2626;
  --info:          #0891b2;
  --dark:          #0f172a;
  --text-muted:    #64748b;
  --border:        #e2e8f0;
  --bg-body:       #f1f5f9;
  --sidebar-bg:    #0f172a;
  --sidebar-width: 260px;
  --topbar-height: 60px;
  --card-radius:   12px;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:     0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
  --shadow-lg:     0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
  --transition:    all .2s ease;
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-body);
  color: var(--dark);
  font-size: .9rem;
  line-height: 1.6;
}

/* ── AUTH PAGES ─────────────────────────────────────────── */

.auth-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 50%, #1e1b4b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.auth-wrapper {
  width: 100%;
  max-width: 440px;
}

.logo-circle {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(37,99,235,.4);
}

.brand-name { color: #fff; font-size: 1.8rem; letter-spacing: -0.5px; }
.brand-tagline { color: rgba(255,255,255,.6) !important; }

.auth-card {
  border-radius: var(--card-radius) !important;
  border: 1px solid rgba(255,255,255,.08) !important;
  background: #fff;
}

/* ── LAYOUT: SIDEBAR + CONTENT ──────────────────────────── */

.app-wrapper { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform .3s ease;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
}

.sidebar-brand-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}

.sidebar-brand-text { color: #fff; font-weight: 700; font-size: 1.1rem; }
.sidebar-brand-sub { color: rgba(255,255,255,.4); font-size: .65rem; display: block; margin-top: -2px; }

.sidebar-nav { padding: .75rem 0; flex: 1; }

.nav-section-title {
  padding: .5rem 1.5rem .25rem;
  color: rgba(255,255,255,.3);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem 1.5rem;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  transition: var(--transition);
  border-left: 3px solid transparent;
  position: relative;
}

.sidebar-link:hover, .sidebar-link.active {
  background: rgba(255,255,255,.06);
  color: #fff;
  border-left-color: var(--primary);
}

.sidebar-link.active { background: rgba(37,99,235,.15); }

.sidebar-link i { font-size: 1rem; width: 20px; text-align: center; opacity: .85; }

.sidebar-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: .65rem;
  padding: .1rem .4rem;
  border-radius: 10px;
  font-weight: 700;
}

/* Content Area */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Top Bar */
.topbar {
  height: var(--topbar-height);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.topbar-search {
  flex: 1;
  max-width: 320px;
}

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }

.topbar-btn {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-body);
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.topbar-btn:hover { background: var(--border); color: var(--dark); }

.notif-dot {
  position: absolute;
  top: 4px; right: 4px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid #fff;
}

.user-avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: .8rem;
  cursor: pointer;
}

/* Page Content */
.page-content { padding: 1.5rem; flex: 1; }

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: .75rem;
}

.page-title { font-size: 1.25rem; font-weight: 700; margin: 0; color: var(--dark); }
.page-subtitle { color: var(--text-muted); font-size: .85rem; margin: .15rem 0 0; }

/* ── CARDS ──────────────────────────────────────────────── */

.card {
  border: 1px solid var(--border) !important;
  border-radius: var(--card-radius) !important;
  box-shadow: var(--shadow-sm);
}

.card-header {
  background: #fff !important;
  border-bottom: 1px solid var(--border) !important;
  padding: 1rem 1.25rem !important;
  font-weight: 600;
}

/* Stat Cards */
.stat-card {
  border-radius: var(--card-radius);
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  border: none !important;
}

.stat-card-primary   { background: linear-gradient(135deg, #2563eb, #3b82f6); color: #fff; }
.stat-card-success   { background: linear-gradient(135deg, #059669, #10b981); color: #fff; }
.stat-card-warning   { background: linear-gradient(135deg, #d97706, #f59e0b); color: #fff; }
.stat-card-danger    { background: linear-gradient(135deg, #dc2626, #ef4444); color: #fff; }
.stat-card-info      { background: linear-gradient(135deg, #0891b2, #06b6d4); color: #fff; }
.stat-card-purple    { background: linear-gradient(135deg, #7c3aed, #8b5cf6); color: #fff; }
.stat-card-dark      { background: linear-gradient(135deg, #0f172a, #1e293b); color: #fff; }

.stat-icon {
  width: 48px; height: 48px;
  background: rgba(255,255,255,.2);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

.stat-value { font-size: 1.75rem; font-weight: 800; line-height: 1.2; }
.stat-label { font-size: .8rem; opacity: .85; margin-top: .25rem; }
.stat-change { font-size: .75rem; opacity: .9; margin-top: .5rem; }

.stat-card::after {
  content: '';
  position: absolute;
  right: -20px; bottom: -20px;
  width: 100px; height: 100px;
  background: rgba(255,255,255,.07);
  border-radius: 50%;
}

/* ── WALLET WIDGET ──────────────────────────────────────── */

.wallet-card {
  background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
  color: #fff;
  border-radius: 16px;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  border: none !important;
}

.wallet-card::before {
  content: '';
  position: absolute;
  top: -50px; right: -50px;
  width: 200px; height: 200px;
  background: rgba(37,99,235,.15);
  border-radius: 50%;
}

.wallet-balance { font-size: 2rem; font-weight: 800; }
.wallet-label { font-size: .8rem; opacity: .7; text-transform: uppercase; letter-spacing: 1px; }

/* ── TABLES ─────────────────────────────────────────────── */

.table-card { border-radius: var(--card-radius); overflow: hidden; }

.table > :not(caption) > * > * {
  padding: .75rem 1rem;
  vertical-align: middle;
}

.table thead th {
  background: var(--bg-body);
  color: var(--text-muted);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.table tbody tr:hover { background: rgba(37,99,235,.03); }
.table-striped tbody tr:nth-of-type(odd) { background: rgba(0,0,0,.02); }

/* ── FORMS ──────────────────────────────────────────────── */

.form-control, .form-select {
  border-color: var(--border);
  border-radius: 8px;
  padding: .55rem .85rem;
  font-size: .9rem;
  transition: var(--transition);
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.form-label { font-weight: 600; font-size: .875rem; color: #374151; margin-bottom: .35rem; }

.input-group-text { background: var(--bg-body); border-color: var(--border); }

/* ── BUTTONS ────────────────────────────────────────────── */

.btn { font-weight: 500; border-radius: 8px; font-size: .875rem; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-sm { padding: .3rem .75rem; font-size: .8rem; }

/* ── BADGES ─────────────────────────────────────────────── */

.badge { font-size: .72rem; padding: .3em .6em; border-radius: 6px; font-weight: 600; }

/* ── MISC ───────────────────────────────────────────────── */

.divider { border-color: var(--border); }
.text-rupee::before { content: '₹'; }

.loader-overlay {
  position: fixed; inset: 0;
  background: rgba(255,255,255,.85);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  display: none;
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── RESPONSIVE ─────────────────────────────────────────── */

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .main-content { margin-left: 0 !important; }
  .sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 999; display: none; }
  .sidebar-overlay.show { display: block; }
}

@media (max-width: 575.98px) {
  .page-content { padding: 1rem; }
  .stat-value { font-size: 1.4rem; }
}

/* ── NOTIFICATIONS ──────────────────────────────────────── */
.notification-item {
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
  cursor: pointer;
}
.notification-item:hover { background: var(--bg-body); }
.notification-item.unread { background: var(--primary-light); }
.notification-icon { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .875rem; }
