:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --bg: #f8f9fc;
  --surface: #ffffff;
  --border: #e5e7eb;
  --text: #1f2937;
  --text-muted: #6b7280;
  --sidebar-w: 240px;
  --bottom-h: 64px;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.06);
}
.badge-admin { background: var(--primary); color: #fff; }

.badge-user { background: #6b7280; color: #fff; }

.verified-badge { color:#1d9bf0; font-size:.9em; margin-left:4px; vertical-align:middle; }

*, *::before, *::after { box-sizing: border-box; }

html { overflow-x: hidden; width: 100%; max-width: 100vw; }

img, canvas, table, input, select, textarea { max-width: 100%; }
img { height: auto; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

/* ===== GUEST LAYOUT ===== */
.guest-layout {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.guest-layout .main-content {
  margin-left: 0;
  padding-bottom: 0;
  width: 100%;
}
.guest-layout .main-content .container {
  max-width: 100%;
  padding: 0;
  margin: 0;
  width: 100%;
}

.hero-section {
  text-align: center;
  padding: 2rem;
  max-width: 520px;
  margin: 0 auto;
}
.hero-icon {
  font-size: 3rem;
  color: var(--primary);
  margin-bottom: 1rem;
}
.hero-section h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: .5rem;
}
.hero-sub {
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 1.05rem;
}
.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

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

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform .2s;
}
.sidebar-brand {
  padding: 1.25rem 1.25rem;
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: .625rem;
  border-bottom: 1px solid var(--border);
  color: var(--primary);
}
.sidebar-nav {
  flex: 1;
  padding: .75rem;
  overflow-y: auto;
}
.sidebar-nav .nav-section-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  padding: .75rem .75rem .375rem;
}
.sidebar-nav .nav-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .625rem .75rem;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  font-size: .9rem;
  font-weight: 500;
  margin-bottom: 2px;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
}
.sidebar-nav .nav-item i {
  width: 1.25rem;
  text-align: center;
  font-size: 1rem;
  color: var(--text-muted);
}
.sidebar-nav .nav-item.active {
  background: var(--primary);
  color: #fff;
}
.sidebar-nav .nav-item.active i {
  color: #fff;
}
.sidebar-nav .nav-item .nav-badge {
  margin-left: auto;
  font-size: .6rem;
  font-weight: 600;
  background: var(--accent, #f59e0b);
  color: #fff;
  padding: 1px 6px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: .03em;
}
@keyframes packet-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,.35); }
  50%      { box-shadow: 0 0 0 8px rgba(239,68,68,.05); }
}
@keyframes packet-pulse-text {
  0%, 100% { color: #fca5a5; }
  50%      { color: #ef4444; }
}
.sidebar-nav .nav-item:has(.fa-envelope) i {
  color: #fca5a5;
  animation: packet-pulse-text 2s ease-in-out infinite;
}
.sidebar-nav .nav-item:has(.fa-envelope) span {
  color: #fca5a5;
  animation: packet-pulse-text 2s ease-in-out infinite;
}
.sidebar-nav .nav-item:has(.fa-envelope) .nav-badge {
  background: #ef4444;
  animation: packet-pulse 2s ease-in-out infinite;
}
.sidebar-user {
  padding: .75rem 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: .625rem;
}
.sidebar-user .avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: .8rem;
  flex-shrink: 0;
}
.sidebar-user .user-info {
  flex: 1;
  min-width: 0;
}
.sidebar-user .name {
  font-size: .85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user .bal {
  font-size: .75rem;
  color: var(--text-muted);
}
.logout-btn {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 1rem;
  padding: .375rem;
  border-radius: var(--radius);
}

/* Main Content */
.main-content {
  flex: 1 1 0%;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  padding-bottom: 80px;
  width: 100%;
  max-width: 100%;
}
.main-content .container {
  max-width: 100%;
  padding: 1.5rem 1rem;
}

/* Mobile Top Bar */
.mobile-topbar {
  display: none;
  align-items: center;
  padding: .75rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  gap: .75rem;
  position: sticky;
  top: 0;
  z-index: 100;
}
.menu-btn {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text);
  padding: .25rem;
  cursor: pointer;
}
.mobile-topbar .brand {
  font-weight: 700;
  flex: 1;
}
.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: .75rem;
}
.bal-pill {
  font-size: .8rem;
  font-weight: 600;
  color: var(--primary);
  background: #eef2ff;
  padding: .25rem .625rem;
  border-radius: 1rem;
}
.avatar-sm {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: .75rem;
  text-decoration: none;
}

/* Sidebar Overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 999;
}

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--bottom-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 1000;
  justify-content: space-around;
  align-items: center;
  padding: 0 .5rem;
}
.bottom-nav .nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: .65rem;
  font-weight: 500;
  padding: .375rem .5rem;
  border-radius: var(--radius);
  min-width: 56px;
  background: none;
  border: none;
  cursor: pointer;
}
.bottom-nav .nav-item i {
  font-size: 1.2rem;
}
.bottom-nav .nav-item.active {
  color: var(--primary);
}
.bottom-nav .nav-item.active i {
  color: var(--primary);
}

/* ===== CARDS ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-body {
  padding: 1.25rem;
}
.card-title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: .375rem;
}
.card-text {
  color: var(--text-muted);
  font-size: .875rem;
}

/* ===== STATS GRID ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow);
}
.stat-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.stat-info {
  min-width: 0;
  overflow: hidden;
}
.stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-label {
  font-size: .8rem;
  color: var(--text-muted);
  word-break: break-word;
}

/* ===== QUICK LINKS ===== */
.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: .75rem;
}
.ql-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  text-align: center;
  box-shadow: var(--shadow);
}
.ql-card i {
  font-size: 1.5rem;
  color: var(--primary);
}
.ql-card span {
  font-weight: 500;
  font-size: .85rem;
}

/* ===== FORMS ===== */
.form-group {
  margin-bottom: 1rem;
}
.form-group label {
  display: block;
  font-size: .85rem;
  font-weight: 500;
  margin-bottom: .375rem;
  color: var(--text);
}
.form-control {
  width: 100%;
  padding: .625rem .875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .9rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  transition: none;
}
.form-control:focus {
  outline: 2px solid var(--primary);
  outline-offset: -1px;
  border-color: transparent;
}
.form-control:disabled {
  background: var(--bg);
  color: var(--text-muted);
}
textarea.form-control {
  resize: vertical;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .375rem;
  padding: .625rem 1.25rem;
  font-size: .9rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition: none;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-sm {
  padding: .375rem .75rem;
  font-size: .8rem;
}
.btn-success {
  background: #16a34a;
  color: #fff;
}
.btn-danger {
  background: #dc2626;
  color: #fff;
}
.btn-secondary {
  background: var(--border);
  color: var(--text);
}
.w-100 { width: 100%; }
.ms-auto { margin-left: auto; }
.d-inline { display: inline; }

/* ===== ALERTS ===== */
.alert {
  padding: .75rem 1rem;
  border-radius: var(--radius);
  font-size: .875rem;
  margin-bottom: 1rem;
}
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-danger  { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fefce8; color: #854d0e; border: 1px solid #fde68a; }
.alert-info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* ===== AUTH PAGES ===== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.auth-brand {
  display: none;
}
.auth-form-wrap {
  width: 100%;
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  margin: 0 auto;
}
.auth-header {
  text-align: center;
  margin-bottom: 1.5rem;
}
.auth-logo {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: .5rem;
}
.auth-header h2 {
  font-weight: 700;
  font-size: 1.5rem;
  margin-bottom: .25rem;
  color: #0f172a;
}
.auth-header p {
  color: #64748b;
  font-size: .9rem;
}
.input-wrap {
  position: relative;
}
.input-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: .85rem;
  pointer-events: none;
  transition: color .2s;
  z-index: 2;
}
.input-wrap:focus-within .input-icon {
  color: var(--primary);
}
.input-wrap .form-control {
  padding-left: 2.5rem;
}
.auth-footer {
  text-align: center;
  margin-top: 1.25rem;
  font-size: .875rem;
  color: #64748b;
}
.auth-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}
.btn-auth {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: .75rem 1.25rem;
  font-weight: 600;
  font-size: .95rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
  transition: background .2s, transform .2s;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .375rem;
  text-decoration: none;
}
.btn-auth:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

@media (min-width: 768px) {
  .auth-page {
    padding: 0;
    align-items: stretch;
    justify-content: flex-start;
  }
  .auth-brand {
    display: flex;
    flex: 1 1 0;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #4f46e5, #7c3aed, #6366f1);
    background-size: 200% 200%;
    animation: authGradient 12s ease infinite;
    position: relative;
    overflow: hidden;
  }
  @keyframes authGradient {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
  }
  .auth-brand::before {
    content: '';
    position: absolute;
    width: 600px; height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,.07) 0%, transparent 70%);
    top: -200px; right: -150px;
    animation: authFloat1 15s ease-in-out infinite;
  }
  .auth-brand::after {
    content: '';
    position: absolute;
    width: 420px; height: 420px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,.07) 0%, transparent 70%);
    bottom: -120px; left: -100px;
    animation: authFloat2 12s ease-in-out infinite;
  }
  @keyframes authFloat1 {
    0%, 100% { transform: translate(0, 0); }
    50%      { transform: translate(-60px, 50px); }
  }
  @keyframes authFloat2 {
    0%, 100% { transform: translate(0, 0); }
    50%      { transform: translate(60px, -50px); }
  }
  .auth-brand-content {
    text-align: center;
    color: #fff;
    position: relative;
    z-index: 1;
    padding: 3rem;
    max-width: 480px;
  }
  .auth-brand-content .brand-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    display: block;
    opacity: .95;
  }
  .auth-brand-content h1 {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1rem;
    letter-spacing: -.03em;
  }
  .auth-brand-content .tagline {
    font-size: 1.05rem;
    line-height: 1.7;
    opacity: .8;
    margin-bottom: 2.5rem;
  }
  .auth-brand-content .trust {
    display: inline-flex;
    align-items: center;
    gap: .625rem;
    padding: .5rem 1.25rem;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 100px;
    font-size: .8rem;
    opacity: .7;
  }
  .auth-brand-content .trust i {
    font-size: .8rem;
  }
  .auth-form-wrap {
    width: 520px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    background: #f8fafc;
    flex-shrink: 0;
  }
  .auth-form-wrap .auth-card {
    max-width: 400px;
    background: #fff;
    border: 1px solid #eef2f6;
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 4px 24px rgba(0,0,0,.06);
    animation: authFadeIn .5s ease;
  }
  @keyframes authFadeIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .auth-form-wrap .auth-header {
    text-align: left;
    margin-bottom: 2rem;
  }
  .auth-form-wrap .auth-header .auth-logo {
    display: none;
  }
  .auth-form-wrap .auth-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: .25rem;
    color: #0f172a;
  }
  .auth-form-wrap .auth-header p {
    font-size: .925rem;
    color: #94a3b8;
  }
  .auth-form-wrap .form-group {
    margin-bottom: 1.25rem;
  }
  .auth-form-wrap .form-group label {
    display: block;
    font-size: .75rem;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: .5rem;
  }
  .auth-form-wrap .form-control {
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: .7rem .875rem .7rem 2.5rem;
    font-size: .9rem;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
  }
  .auth-form-wrap .form-control:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79,70,229,.1);
    outline: none;
  }
  .auth-form-wrap .input-icon {
    left: 14px;
    font-size: .8rem;
    color: #94a3b8;
  }
  .auth-form-wrap .input-wrap:focus-within .input-icon {
    color: #4f46e5;
  }
  .auth-form-wrap .btn-auth {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    border-radius: 10px;
    padding: .85rem 1.25rem;
    font-size: .95rem;
    font-weight: 600;
    transition: transform .2s, box-shadow .2s;
    margin-top: .25rem;
  }
  .auth-form-wrap .btn-auth:hover {
    background: linear-gradient(135deg, #4338ca, #4f46e5);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(79,70,229,.25);
  }
  .auth-form-wrap .auth-footer {
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f1f5f9;
    font-size: .85rem;
    color: #94a3b8;
  }
  .auth-form-wrap .auth-footer a {
    color: #4f46e5;
    font-weight: 600;
  }
}

/* ===== PAGE HEADER ===== */
.page-header {
  margin-bottom: 1.5rem;
}
.page-header h2 {
  font-weight: 700;
  font-size: 1.35rem;
}
.page-header p {
  color: var(--text-muted);
  font-size: .9rem;
  margin-top: .25rem;
}

/* ===== TABLES ===== */
.table-responsive {
  overflow-x: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.table th, .table td {
  padding: .625rem .75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.table th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .03em;
}

/* ===== BADGE ===== */
.badge {
  display: inline-block;
  padding: .2rem .5rem;
  font-size: .7rem;
  font-weight: 600;
  border-radius: 1rem;
}
.bg-success { background: #dcfce7; color: #166534; }
.bg-danger  { background: #fee2e2; color: #991b1b; }
.bg-warning { background: #fef9c3; color: #854d0e; }
.bg-primary { background: #eef2ff; color: #4338ca; }
.bg-secondary { background: #f3f4f6; color: #4b5563; }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.empty-state i {
  font-size: 2.5rem;
  margin-bottom: .75rem;
  color: var(--border);
}
.empty-state h3 {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: .375rem;
}

/* ===== TASK GRID & CARD ===== */
.tasks-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 767px) {
  .tasks-grid { grid-template-columns: 1fr; }
}
.task-card {
  transition: box-shadow .2s;
}
.task-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,.06);
}
.task-card .card-body {
  padding: 1.25rem 1.5rem;
}
.task-card .card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: .35rem;
  color: var(--text);
}
.task-card .card-text {
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: .75rem;
  line-height: 1.45;
}
.task-card .task-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: .75rem;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
  gap: .75rem;
}
.task-card .reward {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
  white-space: nowrap;
}
.task-card .task-form {
  display: flex;
  gap: .5rem;
  align-items: center;
  flex: 1;
  justify-content: flex-end;
}
.task-card .task-proof {
  width: 160px;
  max-width: 100%;
  flex: 1 1 auto;
  font-size: .85rem;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
}
.task-card .task-proof:focus {
  outline: none;
  border-color: var(--primary);
}
.task-card .btn-sm {
  padding: 6px 14px;
  font-size: .8rem;
  border-radius: 6px;
  white-space: nowrap;
}
.task-card .task-action-area {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.task-section { margin-bottom: 2rem; }
.task-section-title {
  font-size: 1.05rem; font-weight: 700; margin-bottom: 1rem; display: flex; align-items: center; gap: .5rem;
}
.task-section-title .count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; border-radius: 11px;
  font-size: .75rem; font-weight: 700; padding: 0 6px;
  background: var(--border); color: var(--text-muted);
}

/* ===== TASK TABS ===== */
.task-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 1.5rem;
  background: var(--surface);
  border-radius: 10px;
  padding: 4px;
  border: 1px solid var(--border);
}
.task-tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  transition: all .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.task-tab:hover { background: #f3f4f6; }
.task-tab.active { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(79,70,229,.25); }
.task-tab .count { font-size: .75rem; opacity: .7; }
.task-tab.active .count { opacity: 1; }
.task-tab-content { display: none; }
.task-tab-content.active { display: block; }
@media (max-width: 767px) {
  .task-tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .task-tab { flex: 0 0 auto; white-space: nowrap; }
}

/* ===== TOAST NOTIFICATION ===== */
.toast-notification {
  position: fixed; top: -60px; left: 0; right: 0; margin: 0 auto; width: fit-content; max-width: 90%;
  z-index: 99999; padding: 14px 28px; border-radius: 10px; font-weight: 600; font-size: .95rem;
  box-shadow: 0 8px 30px rgba(0,0,0,.15); transition: top .35s ease, opacity .35s ease;
  opacity: 0; pointer-events: none; text-align: center;
}
.toast-notification.show { top: 20px; opacity: 1; pointer-events: auto; }
.toast-success { background: #d1fae5; color: #065f46; }
.toast-danger { background: #fee2e2; color: #991b1b; }
.toast-warning { background: #fef3c7; color: #92400e; }

/* ===== REFERRAL LINK BOX ===== */
.ref-link-box {
  display: flex;
  gap: .5rem;
  margin-top: .5rem;
}
.ref-link-box .form-control {
  flex: 1;
}

/* ===== PROFILE ===== */
.profile-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.avatar-lg {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
  flex-shrink: 0;
}

/* ===== CHARTS ===== */
.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}
.chart-card .card-body {
  text-align: center;
}
.chart-card h5 {
  font-size: .9rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .03em;
}
.d-desktop-only {
  display: grid;
}
.d-mobile-only {
  display: none;
}
@media (max-width: 767px) {
  .charts-row { grid-template-columns: 1fr; }
  .d-desktop-only { display: none; }
  .d-mobile-only { display: block; }
}

/* ===== MISC ===== */
.text-muted { color: var(--text-muted); }
.mt-2 { margin-top: .5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.py-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.d-flex { display: flex; }
.align-items-center { align-items: center; }
.gap-3 { gap: 1rem; }

/* ===== RANK SYSTEM ===== */
.rank-bar {
  height: 6px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}
.rank-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #4f46e5, #7c3aed);
  transition: width .5s ease;
}
.rank-label {
  font-size: .7rem;
  color: var(--primary);
  font-weight: 600;
  margin-top: 1px;
}
.rank-progress-card .card-body {
  padding: 1rem 1.25rem;
}
.rank-badge-bronze { background:#fef3c7 !important; color:#b45309 !important; }
.rank-badge-silver { background:#f1f5f9 !important; color:#475569 !important; }
.rank-badge-gold { background:#fef9c3 !important; color:#ca8a04 !important; }
.rank-badge-diamond { background:#e0f2fe !important; color:#0284c7 !important; }
.rank-badge-crown { background:#fae8ff !important; color:#a21caf !important; }
.rank-badge-ace { background:#fce7f3 !important; color:#be185d !important; }
.rank-badge-dominator { background:#fee2e2 !important; color:#b91c1c !important; }
.rank-badge-masterdominator { background:#1e1b4b !important; color:#e0e7ff !important; }
.rank-badge-conqueror { background:#0f172a !important; color:#facc15 !important; }
.rank-badge-ultimatelegend { background:#000 !important; color:#fbbf24 !important; }
.rank-badge-grandmasteroogway { background:#0f172a !important; color:#facc15 !important; }

/* ===== SIDEBAR TASK PROGRESS ===== */
.task-progress-item {
  margin-top: .5rem;
  border-top: 1px solid var(--border);
  padding-top: .25rem;
}
.task-progress-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 .75rem .375rem;
  overflow: hidden;
}
.task-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  transition: width .3s;
}

/* ===== FLASH TOAST ===== */
.flash-toast {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  z-index: 99999;
  padding: 14px 28px;
  border-radius: 0 0 10px 10px;
  font-size: .9rem;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,.12);
  transition: transform .4s cubic-bezier(.22,1,.36,1);
  max-width: 500px;
  text-align: center;
  pointer-events: none;
}
.flash-toast.show {
  transform: translateX(-50%) translateY(0);
}
.flash-toast-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.flash-toast-danger {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.flash-toast-info {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}
.flash-toast-warning {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 767px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .admin-layout .sidebar { display: none; }
  .mobile-topbar { display: flex; }
  .bottom-nav { display: flex; }
  .sidebar-nav .d-hide-mobile { display: none; }
  .main-content {
    margin-left: 0;
    padding-bottom: calc(var(--bottom-h) + 16px);
  }
  .admin-layout .main-content { margin-left: 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .quick-links { grid-template-columns: 1fr 1fr; }
  .task-tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .task-tab { flex: 0 0 auto; white-space: nowrap; }
}

@media (max-width: 480px) {
  .stat-card { padding: .75rem; gap: .625rem; }
  .stat-icon { width: 2.25rem; height: 2.25rem; font-size: 1rem; }
  .stat-value { font-size: 1.05rem; }
  .stat-label { font-size: .7rem; }
  .task-card .task-footer { flex-wrap: wrap; }
  .task-card .task-action-area,
  .task-card .task-form { width: 100%; flex-wrap: wrap; }
  .task-card .task-proof { width: 100%; }
  .task-card .btn-sm { width: 100%; }
  .stats-grid { grid-template-columns: 1fr; }
  .admin-layout .sidebar { display: none; }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .sidebar { width: 64px; }
  .sidebar-brand span,
  .sidebar-nav .nav-item span,
  .sidebar-user .user-info,
  .sidebar-user .logout-btn,
  .nav-section-label { display: none; }
  .sidebar-nav .nav-item { justify-content: center; padding: .75rem; }
  .sidebar-nav .nav-item i { margin: 0; }
  .sidebar-brand { justify-content: center; padding: 1rem; }
  .sidebar-brand span { display: none; }
  .main-content { margin-left: 64px; }
  .bottom-nav { display: none; }
  .mobile-topbar { display: none; }
}

@media (min-width: 1025px) {
  .bottom-nav { display: none; }
  .mobile-topbar { display: none; }
}

/* ===== FUEL CONTROL ===== */
.fuel-control {
    width: 100%;
    padding: .625rem .875rem;
    border: 1px solid #d1d5db;
    border-radius: var(--radius);
    background: #f9fafb;
    transition: border-color .25s, box-shadow .25s;
}
#fuelBox.fuel-ok .fuel-control {
    border-color: #059669;
    box-shadow: 0 0 0 1px #059669;
}
#fuelBox.fuel-over .fuel-control {
    border-color: #dc2626;
    box-shadow: 0 0 0 1px #dc2626;
}
.fuel-bar-track {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: .45rem;
}
.fuel-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: #059669;
    transition: width .2s ease, background .25s;
}
.fuel-over .fuel-bar-fill {
    background: #dc2626;
}
.fuel-meta {
    display: flex;
    align-items: center;
    gap: .25rem;
    font-size: .82rem;
    color: var(--text-muted);
}
.fuel-used {
    font-weight: 700;
    color: var(--text);
}
.fuel-total {
    font-weight: 600;
    color: var(--text);
}
.fuel-status {
    font-weight: 600;
    font-size: .78rem;
    margin-left: auto;
}
.fuel-ok .fuel-status { color: #059669; }
.fuel-over .fuel-status { color: #dc2626; }
#amountGroup.amount-invalid .form-control {
    border-color: #dc2626;
    box-shadow: 0 0 0 1px #dc2626;
}
#amountGroup.amount-invalid .form-control:focus {
    outline: 2px solid #dc2626;
    border-color: #dc2626;
}

/* ===== FOOTER LEGAL ===== */

