/* ============================================================
   I-Yantra Reports - Modern Mobile-App Style Dashboard
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

* { margin:0; padding:0; box-sizing:border-box; }
body {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  background: #f5f7fa;
  color: #1a202c;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: 260px;
  height: 100vh;
  background: linear-gradient(180deg, #1a1f3e 0%, #0a1229 100%);
  color: #fff;
  z-index: 200;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 24px rgba(0,0,0,0.1);
}
.sidebar-header {
  padding: 24px 22px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-header .logo {
  font-size: 26px;
  font-weight: 900;
  color: #FFD700;
  letter-spacing: 1.5px;
}
.sidebar-header .tagline {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  margin-top: 2px;
  letter-spacing: 0.5px;
}
.sidebar-user {
  padding: 16px 22px;
  background: rgba(255,255,255,0.03);
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-user .avatar {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, #00CED1, #0097A7);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 19px; color: #fff;
}
.sidebar-user .info { flex: 1; min-width: 0; }
.sidebar-user .name { font-weight: 700; font-size: 16px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .role { font-size: 12px; color: #00CED1; text-transform: uppercase; letter-spacing: 0.5px; }

.sidebar-balance {
  margin: 14px 22px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(255,215,0,0.15), rgba(255,215,0,0.05));
  border: 1px solid rgba(255,215,0,0.2);
  border-radius: 12px;
}
.sidebar-balance .label { font-size: 12px; color: rgba(255,215,0,0.7); text-transform: uppercase; letter-spacing: 1px; }
.sidebar-balance .amount { font-size: 26px; font-weight: 900; color: #FFD700; margin-top: 2px; }

.sidebar-nav {
  flex: 1;
  padding: 8px 12px;
  overflow-y: auto;
}
.sidebar-nav .nav-section { margin: 14px 0 6px; padding: 0 10px; font-size: 12px; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: 1.5px; font-weight: 700; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  margin: 2px 0;
  border-radius: 10px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 17px;
  font-weight: 500;
  transition: all 0.2s;
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.05); color: #fff; }
.sidebar-nav a.active {
  background: linear-gradient(135deg, #00CED1, #0097A7);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0,206,209,0.3);
}
.sidebar-nav a .nav-icon { font-size: 22px; width: 22px; text-align: center; }
.sidebar-nav a .nav-badge { margin-left: auto; background: #FF4444; color: #fff; padding: 1px 7px; border-radius: 10px; font-size: 12px; font-weight: 700; }

.sidebar-footer {
  padding: 14px 22px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.sidebar-footer button {
  width: 100%;
  padding: 10px;
  background: rgba(255,68,68,0.15);
  border: 1px solid rgba(255,68,68,0.3);
  color: #FF6B6B;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  font-size: 16px;
}
.sidebar-footer button:hover { background: rgba(255,68,68,0.25); }

/* Main content */
.main {
  margin-left: 260px;
  min-height: 100vh;
  transition: margin-left 0.3s;
}

/* Top bar */
.topbar {
  background: #fff;
  padding: 14px 28px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.topbar .hamburger {
  display: none;
  background: transparent;
  border: none;
  font-size: 29px;
  cursor: pointer;
  color: #1a202c;
}
.topbar .page-title {
  font-size: 26px;
  font-weight: 800;
  color: #1a202c;
}
.topbar .topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.topbar .topbar-balance {
  color: #16a34a;
  font-weight: 800;
  font-size: 22px;
  padding: 6px 14px;
  background: #f0fdf4;
  border-radius: 8px;
  border: 1px solid #bbf7d0;
}
.topbar a.game-link {
  color: #FFD700;
  background: #1a1f3e;
  padding: 8px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
}

/* Content */
.content { padding: 24px 28px; max-width: 1500px; margin: 0 auto; }

/* Filter bar */
.filter-bar {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 20px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.filter-bar label { font-size: 14px; color: #64748b; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.filter-bar input, .filter-bar select {
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #1a202c;
  font-size: 17px;
  font-family: inherit;
}
.filter-bar input:focus, .filter-bar select:focus { outline: 2px solid #00CED1; border-color: transparent; }
.filter-bar button {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  font-size: 16px;
}
.filter-bar .btn-primary { background: #00CED1; color: #fff; }
.filter-bar .btn-secondary { background: #f1f5f9; color: #1e293b; }
.filter-bar .btn-preset {
  background: #fff;
  border: 1px solid #e2e8f0;
  color: #475569;
  font-size: 14px;
}
.filter-bar .btn-preset:hover { background: #f8fafc; border-color: #00CED1; color: #0e7490; }
.filter-bar .btn-preset.active { background: #00CED1; color: #fff; border-color: #00CED1; }

/* Stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}
.stat-card .stat-icon {
  position: absolute;
  top: 14px; right: 14px;
  font-size: 34px;
  opacity: 0.25;
}
.stat-card .stat-label {
  font-size: 13px;
  color: #64748b;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.stat-card .stat-value {
  font-size: 31px;
  font-weight: 900;
  color: #1a202c;
  margin-top: 6px;
  letter-spacing: -0.5px;
}
.stat-card .stat-sub {
  font-size: 14px;
  color: #94a3b8;
  margin-top: 4px;
}
.stat-card .stat-value.pos { color: #16a34a; }
.stat-card .stat-value.neg { color: #dc2626; }
.stat-card .stat-value.gold { color: #d97706; }
.stat-card .stat-value.blue { color: #2563eb; }
.stat-card .stat-value.purple { color: #9333ea; }

/* Card */
.card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 20px;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}
.card-title {
  font-size: 19px;
  font-weight: 800;
  color: #1a202c;
}
.card-subtitle {
  font-size: 14px;
  color: #64748b;
  margin-top: 2px;
}

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  padding: 10px 14px;
  background: #f8fafc;
  font-size: 13px;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  border-bottom: 1px solid #e2e8f0;
}
td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 17px;
  color: #1e293b;
}
tr:hover td { background: #f8fafc; }

/* Badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 13px; font-weight: 700; }
.badge.role-admin { background: #fef3c7; color: #92400e; }
.badge.role-area_manager { background: #f3e8ff; color: #6b21a8; }
.badge.role-agent { background: #cffafe; color: #155e75; }
.badge.role-mobile_user { background: #dcfce7; color: #166534; }
.badge.active { background: #dcfce7; color: #166534; }
.badge.blocked { background: #fee2e2; color: #991b1b; }
.badge.won { background: #dcfce7; color: #166534; }
.badge.lost { background: #fee2e2; color: #991b1b; }
.badge.placed { background: #fef3c7; color: #92400e; }
.badge.claimed { background: #fef9c3; color: #854d0e; }

.text-pos { color: #16a34a; font-weight: 700; }
.text-neg { color: #dc2626; font-weight: 700; }
.text-gold { color: #d97706; font-weight: 700; }
.text-muted { color: #94a3b8; }

/* Loading */
.loading { text-align: center; padding: 40px; color: #94a3b8; font-size: 17px; }
.empty { text-align: center; padding: 60px 20px; color: #94a3b8; }
.empty .icon { font-size: 56px; opacity: 0.3; margin-bottom: 8px; }
.empty .msg { font-size: 17px; font-weight: 500; }

/* Bar chart */
.bar-chart { display: flex; align-items: flex-end; gap: 6px; height: 200px; padding: 16px 0; overflow-x: auto; }
.bar-col { flex: 1; min-width: 32px; display: flex; flex-direction: column; align-items: center; gap: 4px; position: relative; }
.bar-col .bar { width: 100%; background: linear-gradient(to top, #00CED1, #67E8F9); border-radius: 6px 6px 0 0; min-height: 4px; transition: 0.2s; }
.bar-col .bar:hover { background: linear-gradient(to top, #FFD700, #FCD34D); }
.bar-col .bar.loss { background: linear-gradient(to top, #FF4444, #FB7185); }
.bar-col .bar-label { font-size: 12px; color: #94a3b8; margin-top: 4px; }
.bar-col .bar-value { font-size: 12px; color: #1e293b; font-weight: 700; position: absolute; top: -16px; }

/* Toast */
.toast-container { position: fixed; top: 16px; right: 16px; z-index: 5000; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 18px; border-radius: 8px; font-size: 17px; font-weight: 600; color: #fff; box-shadow: 0 8px 24px rgba(0,0,0,0.2); transform: translateX(120%); transition: 0.3s; }
.toast.show { transform: translateX(0); }
.toast.success { background: #16a34a; }
.toast.error { background: #dc2626; }
.toast.info { background: #2563eb; }

/* Overlay for mobile sidebar */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 150;
}
.sidebar-overlay.active { display: block; }

/* Mobile responsive */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .topbar .hamburger { display: block; }
  .content { padding: 16px; }
  .stat-card .stat-value { font-size: 26px; }
}
@media (max-width: 640px) {
  .topbar { padding: 12px 16px; }
  .topbar .page-title { font-size: 22px; }
  .topbar .topbar-balance { font-size: 17px; padding: 4px 10px; }
  .topbar a.game-link { font-size: 13px; padding: 6px 10px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-card .stat-value { font-size: 22px; }
  .stat-card .stat-icon { font-size: 24px; }
  .card { padding: 14px; }
  table { font-size: 14px; }
  th, td { padding: 8px; }
  .filter-bar { padding: 12px; }
}
