/* ===== DESIGN TOKENS ===== */
:root {
  /* Base Colors */
  --bg: #f8fafc;
  --panel: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  
  /* Primary Brand Colors - Harmonious Purple-Blue Palette */
  --primary-50: #f0f9ff;
  --primary-100: #e0f2fe;
  --primary-200: #bae6fd;
  --primary-300: #7dd3fc;
  --primary-400: #38bdf8;
  --primary-500: #0ea5e9;  /* Main brand color */
  --primary-600: #0284c7;
  --primary-700: #0369a1;
  --primary-800: #075985;
  --primary-900: #0c4a6e;
  
  /* Secondary Colors - Complementary Purple */
  --secondary-50: #faf5ff;
  --secondary-100: #f3e8ff;
  --secondary-200: #e9d5ff;
  --secondary-300: #d8b4fe;
  --secondary-400: #c084fc;
  --secondary-500: #a855f7;  /* Secondary brand color */
  --secondary-600: #9333ea;
  --secondary-700: #7e22ce;
  --secondary-800: #6b21a8;
  --secondary-900: #581c87;
  
  /* Accent Colors */
  --accent-1: var(--primary-500);
  --accent-2: var(--secondary-500);
  --accent-3: var(--secondary-600);
  
  /* Semantic Colors */
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --info: var(--primary-500);
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, var(--primary-500), var(--primary-600));
  --gradient-secondary: linear-gradient(135deg, var(--secondary-500), var(--secondary-600));
  --gradient-brand: linear-gradient(135deg, var(--primary-500), var(--secondary-500));
  --gradient-success: linear-gradient(135deg, #10b981, #059669);
  
  /* Spacing */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-6: 48px;
  
  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  
  /* Overlays */
  --overlay-dark: rgba(0, 0, 0, 0.7);
  --overlay-light: rgba(0, 0, 0, 0.3);
}

/* ===== BASE STYLES ===== */
* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
}

/* ===== LAYOUT ===== */
.container {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.header-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px var(--space-3);
  background: var(--panel);
  border-bottom: 1px solid rgba(14,165,164,0.1);
  box-shadow: 0 2px 12px rgba(14,165,164,0.08);
  position: sticky;
  top: 0;
  z-index: 100;
  gap: var(--space-3);
  flex-shrink: 0;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.95);
  margin-top: 10px;
  position: relative;
}

.brand {
  position: absolute;
  left: var(--space-4);
  top: -35px;
  z-index: 100;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.3), transparent);
  padding: 14px 28px;
  border-radius: 16px;
  border: none;
}

/* Brand logo */
.brand-logo {
  height: 140px;
  width: auto;
  display: block;
  object-fit: contain;
}

.navbar {
  display: flex;
  gap: var(--space-1);
  align-items: center;
  flex-wrap: nowrap;
  justify-content: flex-end;
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
}

.hamburger-btn {
  display: none !important;
  flex-direction: column;
  gap: 4px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px 8px;
  z-index: 101;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  position: absolute;
  right: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
}

.hamburger-btn span {
  width: 20px;
  height: 2.5px;
  background: var(--text);
  border-radius: 2px;
  transition: all 300ms ease;
}

.hamburger-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.hamburger-btn.active span:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

@media (max-width: 768px) {
  .hamburger-btn {
    display: flex !important;
  }

  .navbar {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    bottom: auto;
    max-height: calc(100vh - 70px - 60px);
    flex-direction: column;
    gap: 0;
    background: var(--panel);
    border-bottom: 1px solid rgba(15,23,36,0.06);
    box-shadow: var(--shadow-md);
    padding: var(--space-2) 0;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 300ms ease;
    z-index: 100;
    align-items: stretch;
    justify-content: flex-start;
  }

  .navbar.active {
    transform: translateX(0);
  }

  .nav-item {
    width: 100%;
    justify-content: flex-start;
    padding: var(--space-2) var(--space-3);
    border-radius: 0;
    border-bottom: 1px solid rgba(15,23,36,0.06);
    font-size: 14px;
  }

  .nav-item::after {
    display: none;
  }

  .nav-item:hover {
    background: rgba(14,165,164,0.05);
  }

  .nav-item.active {
    background: rgba(14,165,164,0.1);
    border-left: 4px solid var(--accent-1);
    padding-left: calc(var(--space-3) - 4px);
  }

  .user-info {
    padding: var(--space-2) var(--space-3);
    border-left: none;
    border-top: 1px solid rgba(15,23,36,0.06);
    margin-left: 0;
    margin-top: auto;
  }
}

.user-info {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-2);
  border-left: 1px solid rgba(15,23,36,0.1);
  margin-left: var(--space-2);
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0ea5a4, #6d28d9);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(14,165,164,0.25);
}

.user-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-name {
  font-weight: 600;
  font-size: 12px;
  color: var(--text);
}

.user-role {
  font-size: 11px;
  color: var(--muted);
}

.trust-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  background: linear-gradient(135deg, rgba(251,191,36,0.15), rgba(245,158,11,0.15));
  border: 1px solid rgba(251,191,36,0.3);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  color: #d97706;
}

.trust-badge .icon {
  width: 14px;
  height: 14px;
  color: #fbbf24;
}

.nav-item {
  padding: 10px 16px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  border-radius: 10px;
  transition: all 200ms ease;
  min-height: 40px;
  display: flex;
  align-items: center;
  white-space: nowrap;
  position: relative;
  gap: 6px;
}

.nav-item .icon {
  width: 18px;
  height: 18px;
}

.nav-item:hover {
  color: var(--text);
  background: linear-gradient(135deg, rgba(14,165,164,0.08), rgba(109,40,217,0.08));
  transform: translateY(-1px);
}

.nav-item.active {
  color: white;
  background: linear-gradient(135deg, #0ea5a4, #6d28d9);
  box-shadow: 0 4px 12px rgba(14,165,164,0.25);
}

.nav-item.u-hidden {
  display: none !important;
}

/* Main content layout */
.main-wrapper {
  display: flex;
  flex: 1;
  gap: 0;
  padding: var(--space-2);
  max-width: 100%;
  margin: 0 auto;
  width: 100%;
  align-items: flex-start;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}

.sidebar {
  display: none !important;
  width: 320px;
  flex-shrink: 0;
  height: fit-content;
  position: sticky;
  top: calc(var(--space-4) + 120px);
}

.sidebar.u-hidden {
  display: none !important;
}

.main {
  flex: 1;
  min-width: 0;
  width: 100%;
}

/* ===== PAGES ===== */
.page {
  display: none;
  width: 100%;
  animation: fadeIn 300ms ease;
}

.page.active {
  display: block !important;
}

.page.u-hidden {
  display: none !important;
}

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

/* ===== CARDS ===== */
.card {
  background: var(--panel);
  border: 1px solid rgba(15,23,36,0.06);
  border-radius: var(--radius-md);
  padding: var(--space-2);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-2);
  transition: all 200ms ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(15,23,36,0.08);
}

/* ===== BUTTONS ===== */
.btn {
  padding: var(--space-1) var(--space-2);
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 200ms ease;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  font-family: inherit;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent-3), var(--accent-1));
  color: white;
  box-shadow: 0 8px 25px rgba(109,40,217,0.15);
}

.btn.primary:hover {
  box-shadow: 0 12px 35px rgba(109,40,217,0.25);
  transform: translateY(-2px);
}

.btn.primary:active {
  transform: translateY(0);
}

.btn.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px dashed rgba(15,23,36,0.08);
}

.btn.ghost:hover {
  color: var(--text);
  border-style: solid;
  background: rgba(255,255,255,0.5);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

.btn.large {
  padding: var(--space-2) var(--space-3);
  font-size: 14px;
  min-height: 44px;
}

/* ===== FORMS ===== */
.form {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.field {
  position: relative;
  display: flex;
  flex-direction: column;
}

.input,
.textarea,
select.input {
  width: 100%;
  padding: var(--space-1) var(--space-2);
  border: 2px solid rgba(15,23,36,0.08);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
  transition: all 200ms ease;
  min-height: 40px;
  font-family: inherit;
}

.input:focus,
.textarea:focus,
select.input:focus {
  outline: none;
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px rgba(14,165,164,0.1);
}

.input::placeholder {
  color: var(--muted);
}

.textarea {
  min-height: 100px;
  resize: vertical;
}

label {
  font-weight: 600;
  margin-bottom: var(--space-1);
  color: var(--text);
  font-size: 13px;
}

/* ===== OTP INPUT ===== */
.otp-input-container {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: var(--space-2) 0;
  flex-wrap: wrap;
}

.otp-input-container input {
  width: 48px !important;
  height: 48px !important;
  padding: 0 !important;
  text-align: center;
  font-size: 20px !important;
  font-weight: 700;
  border: 2px solid rgba(15,23,36,0.12) !important;
  border-radius: var(--radius-sm) !important;
  transition: all 200ms ease;
  background: var(--panel) !important;
  color: var(--text) !important;
  flex-shrink: 0;
}

.otp-input-container input:focus {
  border-color: var(--accent-1) !important;
  box-shadow: 0 0 0 3px rgba(14,165,164,0.1) !important;
  transform: scale(1.05);
}

.otp-input-container input:hover {
  border-color: var(--accent-1) !important;
}

@media (max-width: 480px) {
  .otp-input-container {
    gap: 8px;
  }

  .otp-input-container input {
    width: 44px !important;
    height: 44px !important;
    font-size: 18px !important;
  }
}

/* ===== UTILITY ===== */
.hidden,
.u-hidden {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== PROFILE SECTION ===== */
.profile {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  padding: var(--space-3) !important;
  background: linear-gradient(135deg, rgba(14,165,164,0.05), rgba(109,40,217,0.05));
  border-radius: var(--radius-md);
}

.avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 28px;
  flex-shrink: 0;
  box-shadow: 0 8px 25px rgba(14,165,164,0.2);
}

.meta {
  flex: 1;
}

.meta .name {
  font-weight: 700;
  color: var(--text);
  font-size: 16px;
}

.meta .role {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

/* ===== TRUST SCORE ===== */
.trust-visual {
  text-align: center;
  padding: var(--space-3) !important;
  background: linear-gradient(135deg, rgba(14,165,164,0.05), rgba(109,40,217,0.05));
}

.trust-ring {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: var(--space-3) auto;
  box-shadow: 0 12px 35px rgba(14,165,164,0.25);
  position: relative;
}

.trust-ring::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
  opacity: 0.1;
  z-index: -1;
}

.score {
  font-size: 40px;
  font-weight: 700;
  color: white;
}

/* ===== REVIEWS ===== */
.review-item {
  padding: var(--space-2);
  border-left: 4px solid var(--accent-1);
  background: rgba(14,165,164,0.05);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-2);
  transition: all 200ms ease;
}

.review-item:hover {
  background: rgba(14,165,164,0.1);
  transform: translateX(4px);
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-1);
}

.review-rating {
  display: flex;
  gap: 4px;
}

.star {
  font-size: 18px;
  color: #fbbf24;
}

.star.empty {
  color: #e5e7eb;
}

.review-comment {
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

/* ===== HOME PAGE ===== */
.hero {
  text-align: center;
  padding: var(--space-1) var(--space-1);
  margin-bottom: var(--space-1);
  width: 100%;
}

.hero h1 {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 var(--space-1) 0;
  line-height: 1.1;
  word-wrap: break-word;
}

.hero h1 span {
  background: linear-gradient(135deg, var(--accent-3), var(--accent-1));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 12px;
  color: var(--muted);
  margin: 0 auto var(--space-1) auto;
  max-width: 600px;
  padding: 0;
  line-height: 1.3;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-1);
  margin: var(--space-1) 0;
  width: 100%;
  padding: 0;
}

.feature-card {
  background: var(--panel);
  border: 1px solid rgba(15,23,36,0.06);
  border-radius: var(--radius-md);
  padding: var(--space-1);
  text-align: center;
  transition: all 300ms ease;
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-3));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 300ms ease;
}

.feature-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  border-color: rgba(15,23,36,0.12);
}

.feature-card:hover::before {
  transform: scaleX(1);
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  font-size: 18px;
  color: white;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
  border-radius: 50%;
  margin-bottom: 4px;
  transition: all 300ms ease;
}

.feature-card:hover .feature-icon {
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(14,165,164,0.2);
}

.feature-card h3 {
  font-size: 12px;
  font-weight: 700;
  margin: 4px 0;
  color: var(--text);
}

.feature-card p {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
  margin: 0;
}

/* ===== FORM VALIDATION STATES ===== */
.input.error,
.textarea.error,
select.input.error {
  border-color: var(--error) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.input.success,
.textarea.success,
select.input.success {
  border-color: var(--success) !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}

.field-error {
  color: var(--error);
  font-size: 12px;
  margin-top: 4px;
  display: none;
  font-weight: 500;
}

.field.has-error .field-error {
  display: block;
}

.field-success {
  color: var(--success);
  font-size: 12px;
  margin-top: 4px;
  display: none;
  font-weight: 500;
}

.field.has-success .field-success {
  display: block;
}

/* ===== LOADING SPINNER ===== */
.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(14, 165, 164, 0.1);
  border-top-color: var(--accent-1);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: inline-block;
}

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

.btn.loading {
  opacity: 0.7;
  pointer-events: none;
}

/* ===== EMPTY STATES ===== */
.empty-state {
  text-align: center;
  padding: var(--space-6);
  color: var(--muted);
  border: 2px dashed rgba(15, 23, 36, 0.1);
  border-radius: var(--radius-md);
  background: rgba(15, 23, 36, 0.02);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: var(--space-3);
  opacity: 0.5;
}

.empty-state-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--space-2);
}

.empty-state-description {
  font-size: 14px;
  margin-bottom: var(--space-4);
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

/* ===== BUTTON VARIANTS ===== */
.btn.secondary {
  background: rgba(14, 165, 164, 0.1);
  color: var(--accent-1);
  border: 1px solid var(--accent-1);
  box-shadow: none;
}

.btn.secondary:hover {
  background: rgba(14, 165, 164, 0.2);
  box-shadow: 0 4px 12px rgba(14, 165, 164, 0.15);
}

.btn.tertiary {
  background: transparent;
  color: var(--accent-1);
  border: none;
  box-shadow: none;
}

.btn.tertiary:hover {
  background: rgba(14, 165, 164, 0.05);
}

.btn.danger {
  background: linear-gradient(135deg, var(--error), #dc2626);
  color: white;
  box-shadow: 0 8px 25px rgba(239, 68, 68, 0.15);
}

.btn.danger:hover {
  box-shadow: 0 12px 35px rgba(239, 68, 68, 0.25);
  transform: translateY(-2px);
}

.btn.small {
  padding: 6px 12px;
  font-size: 12px;
  min-height: 32px;
}

/* ===== CARD VARIANTS ===== */
.card.outlined {
  background: transparent;
  border: 2px solid rgba(14, 165, 164, 0.2);
  box-shadow: none;
}

.card.filled {
  background: rgba(14, 165, 164, 0.05);
  border: 1px solid rgba(14, 165, 164, 0.1);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid rgba(15, 23, 36, 0.06);
}

.card-header h3 {
  margin: 0;
}

.card-body {
  margin-bottom: var(--space-2);
}

.card-footer {
  display: flex;
  gap: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid rgba(15, 23, 36, 0.06);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .main-wrapper {
    gap: var(--space-3);
    padding: var(--space-3);
  }

  .sidebar {
    width: 280px;
    top: calc(var(--space-3) + 100px);
  }

  .header-wrap {
    padding: var(--space-2) var(--space-3);
  }
}

@media (max-width: 768px) {
  .main-wrapper {
    flex-direction: column;
    padding: var(--space-2);
    gap: var(--space-2);
  }

  .sidebar {
    width: 100%;
    position: static;
    top: auto;
  }

  .nav-item {
    padding: var(--space-2) var(--space-3);
    font-size: 14px;
  }

  .header-wrap {
    flex-direction: row;
    gap: var(--space-2);
    align-items: center;
    padding: var(--space-2);
    justify-content: space-between;
  }

  .brand {
    left: var(--space-2);
    top: -35px;
    padding: 12px 22px;
  }

  /* eKYC Verification Grid - Single Column on Mobile */
  #ekycPage > div > div[style*="grid-template-columns: repeat(2, 1fr)"] {
    grid-template-columns: 1fr !important;
  }

  .brand-logo {
    height: 90px;
  }

  .header-wrap {
    margin-top: 50px;
  }

  .pulse-underline {
    width: 150px;
    height: 16px;
  }

  .card {
    padding: var(--space-2);
  }

  .btn {
    width: 100%;
  }

  .btn.large {
    width: 100%;
  }

  .hero {
    padding: var(--space-3) var(--space-2);
  }

  .hero h1 {
    font-size: 32px;
  }

  .hero p {
    font-size: 16px;
    padding: 0;
  }

  .features-grid {
    grid-template-columns: 1fr;
    padding: 0;
  }

  /* eKYC cards - stack on mobile */
  #ekycPage .card > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  /* Listings grid - stack on mobile */
  #listingsGrid {
    grid-template-columns: 1fr !important;
  }

  /* Homepage feature cards - stack on mobile */
  #homePage div[style*="grid-template-columns: repeat(3, 1fr)"] {
    grid-template-columns: 1fr !important;
  }
}

/* Tablet breakpoint for listings */
@media (max-width: 1200px) and (min-width: 769px) {
  #listingsGrid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Homepage feature cards - 2 columns on tablet */
  #homePage div[style*="grid-template-columns: repeat(3, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}


/* ===== DASHBOARD STAT CARDS ===== */
.stat-card {
  background: var(--panel);
  border: 1px solid rgba(15,23,36,0.06);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  box-shadow: var(--shadow-sm);
  transition: all 300ms ease;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-3));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 300ms ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(14,165,164,0.2);
}

.stat-card:hover::before {
  transform: scaleX(1);
}

/* ===== DASHBOARD CARDS ===== */
.card h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

/* ===== TOAST ANIMATIONS ===== */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes slideOutDown {
  from {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
}


/* ===== FOOTER ===== */
.footer {
  background: var(--panel);
  border-top: 1px solid rgba(15,23,36,0.06);
  padding: var(--space-2) var(--space-3);
  text-align: center;
  flex-shrink: 0;
  position: relative;
  z-index: 50;
  margin-top: auto;
}

.footer p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.footer p a {
  color: var(--accent-1);
  text-decoration: none;
  transition: color 200ms ease;
}

.footer p a:hover {
  color: var(--accent-3);
  text-decoration: underline;
}


/* ===== SIGNUP PAGE OPTIMIZATION ===== */
#signupPage .form {
  gap: var(--space-1);
}

#signupPage label {
  margin-bottom: 4px;
  font-size: 12px;
}

#signupPage .input,
#signupPage select.input {
  min-height: 36px;
  font-size: 13px;
}

#signupPage .btn.large {
  padding: var(--space-1) var(--space-2);
  font-size: 13px;
  min-height: 40px;
  margin-bottom: 4px;
}

#signupPage h2 {
  font-size: 18px;
}

#phoneVerificationSection {
  margin-bottom: var(--space-2) !important;
  padding: var(--space-1) !important;
}

#phoneVerificationSection h3 {
  font-size: 14px;
  margin: 0 0 var(--space-1) 0 !important;
}

#phoneVerificationSection p {
  font-size: 12px;
  margin: 0 0 var(--space-1) 0 !important;
}


/* ===== LOGIN PAGE REDESIGN ===== */
#loginPage .card {
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* Modern OTP Input Styling */
.otp-input {
  width: 50px !important;
  height: 50px !important;
  padding: 0 !important;
  text-align: center;
  font-size: 20px !important;
  font-weight: 700;
  border: 2px solid rgba(14,165,164,0.2) !important;
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  transition: all 200ms ease;
}

.otp-input:focus {
  border-color: var(--accent-1) !important;
  box-shadow: 0 0 0 3px rgba(14,165,164,0.1);
  outline: none;
}

.otp-input::placeholder {
  color: rgba(15,23,36,0.2);
  font-weight: 400;
}

.otp-input-container {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: var(--space-2);
}

/* Login Page Optimization */
#loginPage .field {
  margin-bottom: var(--space-1);
}

#loginPage label {
  margin-bottom: 4px;
  font-size: 12px;
}

#loginPage .input,
#loginPage select.input {
  min-height: 36px;
  font-size: 13px;
}

#loginPage .btn.large {
  padding: var(--space-1) var(--space-2);
  font-size: 13px;
  min-height: 40px;
  margin-bottom: 4px;
}

#loginPage .btn.secondary {
  background: rgba(14,165,164,0.1);
  color: var(--accent-1);
  border: 1px solid rgba(14,165,164,0.2);
}

#loginPage .btn.secondary:hover {
  background: rgba(14,165,164,0.15);
  border-color: rgba(14,165,164,0.3);
}

/* Responsive OTP Input */
@media (max-width: 480px) {
  .otp-input {
    width: 44px !important;
    height: 44px !important;
    font-size: 18px !important;
  }
  
  .otp-input-container {
    gap: 6px;
  }

  /* Login Page Mobile Optimization */
  #loginPage .card {
    max-width: 100%;
    padding: var(--space-1) !important;
    margin: 0 !important;
  }

  #loginPage .field {
    margin-bottom: var(--space-1);
  }

  #loginPage .input,
  #loginPage select.input {
    font-size: 16px;
    min-height: 44px;
  }

  #loginPage .btn.large {
    min-height: 44px;
    font-size: 14px;
    padding: var(--space-1) var(--space-2);
  }

  #loginPage h2 {
    font-size: 18px;
  }

  #loginPage h3 {
    font-size: 14px;
  }

  #loginPage p {
    font-size: 12px;
  }

  /* Icon sizing for mobile */
  #loginPage .card > div:first-child > div:first-child {
    width: 50px !important;
    height: 50px !important;
    font-size: 24px !important;
  }
}


/* Dashboard Card Mobile Responsive */
@media (max-width: 768px) {
  .dashboard-card-responsive {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  
  .dashboard-card-buttons {
    width: 100% !important;
    flex-direction: row !important;
  }
  
  .dashboard-card-buttons button {
    flex: 1 !important;
    min-width: 0 !important;
  }
}

@media (max-width: 480px) {
  .dashboard-card-buttons {
    flex-direction: column !important;
  }
  
  .dashboard-card-buttons button {
    width: 100% !important;
  }
}


/* Chat/Messages Mobile Responsive */
@media (max-width: 768px) {
  .chat-container-responsive {
    grid-template-columns: 1fr !important;
    height: calc(100vh - 200px) !important;
    min-height: 500px !important;
  }
  
  .conversations-panel {
    display: flex !important;
  }
  
  .chat-window-panel {
    display: none !important;
  }
  
  /* When chat is active on mobile */
  .chat-container-responsive.chat-active .conversations-panel {
    display: none !important;
  }
  
  .chat-container-responsive.chat-active .chat-window-panel {
    display: flex !important;
  }
  
  /* Show back button on mobile */
  .chat-container-responsive.chat-active #backToConversationsBtn {
    display: inline-flex !important;
  }
}


/* Hero Title Mobile Responsive */
@media (max-width: 768px) {
  .hero-title {
    font-size: 32px !important;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 28px !important;
    line-height: 1.3 !important;
  }
}


/* ===== ADMIN PANEL MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
  /* Admin header - stack on mobile */
  #adminPage .page > div > div:first-child {
    flex-direction: column !important;
    gap: 12px;
    text-align: center;
  }
  
  /* Admin tabs - horizontal scroll on mobile */
  #adminPage .page > div > div:nth-child(2) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
  }
  
  #adminPage .page > div > div:nth-child(2)::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
  }
  
  /* Admin tab buttons - smaller on mobile */
  .admin-tab {
    padding: 10px 16px !important;
    font-size: 13px !important;
    white-space: nowrap;
    flex-shrink: 0;
  }
  
  .admin-tab svg {
    width: 14px !important;
    height: 14px !important;
  }
  
  /* Stats grid - single column on mobile */
  #adminStatsContainer {
    grid-template-columns: 1fr !important;
  }
  
  /* Tables - make scrollable horizontally */
  #adminUsersTable,
  #adminListingsTable,
  #adminReviewsTable {
    font-size: 11px !important;
  }
  
  #adminUsersTable th,
  #adminListingsTable th,
  #adminReviewsTable th,
  #adminUsersTable td,
  #adminListingsTable td,
  #adminReviewsTable td {
    padding: 8px 6px !important;
    font-size: 10px !important;
  }
  
  /* Action buttons - stack vertically on mobile */
  #adminUsersTable td:last-child > div,
  #adminListingsTable td:last-child > div,
  #adminReviewsTable td:last-child > div {
    flex-direction: column !important;
    gap: 4px !important;
  }
  
  #adminUsersTable button,
  #adminListingsTable button,
  #adminReviewsTable button {
    width: 100% !important;
    justify-content: center !important;
    padding: 6px 8px !important;
    font-size: 9px !important;
  }
  
  /* Search input - full width on mobile */
  #userSearchInput,
  #listingSearchInput,
  #reviewSearchInput {
    width: 100% !important;
    max-width: 100% !important;
  }
  
  /* Recent activity grid - single column */
  #adminRecentActivity > div {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 480px) {
  /* Even smaller on very small screens */
  .admin-tab {
    padding: 8px 12px !important;
    font-size: 12px !important;
    gap: 4px !important;
  }
  
  .admin-tab span {
    display: none; /* Hide text, show only icons on very small screens */
  }
  
  /* Stats cards - smaller text */
  #adminStatsContainer > div {
    padding: 12px !important;
  }
  
  #adminStatsContainer > div > div:nth-child(2) {
    font-size: 24px !important;
  }
  
  /* Table - hide less important columns on very small screens */
  #adminUsersTable th:nth-child(4),
  #adminUsersTable td:nth-child(4),
  #adminUsersTable th:nth-child(7),
  #adminUsersTable td:nth-child(7) {
    display: none; /* Hide email and verified columns */
  }
  
  #adminListingsTable th:nth-child(5),
  #adminListingsTable td:nth-child(5),
  #adminListingsTable th:nth-child(7),
  #adminListingsTable td:nth-child(7) {
    display: none; /* Hide owner and source columns */
  }
  
  #adminReviewsTable th:nth-child(2),
  #adminReviewsTable td:nth-child(2),
  #adminReviewsTable th:nth-child(3),
  #adminReviewsTable td:nth-child(3) {
    display: none; /* Hide reviewer and reviewee columns */
  }
}
