/* Force light color scheme globally regardless of OS/Browser dark mode */
html, body {
  color-scheme: light !important;
  background-color: #f8fafc !important;
  color: #0f172a !important;
}

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-glass: rgba(255, 255, 255, 0.95);
  --primary: #059669;
  --primary-hover: #047857;
  --primary-light: #ecfdf5;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --border-color: #cbd5e1;
  --border-focus: #059669;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  --shadow-card: 0 4px 12px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-glow: 0 4px 14px rgba(5, 150, 105, 0.25);
  --transition-fast: 0.15s ease;
  --transition-smooth: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background-color: var(--bg-main) !important;
  color: var(--text-main) !important;
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-size: 1rem;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.75rem;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 800;
  font-size: 1.25rem;
  white-space: nowrap;
}

.brand span { white-space: nowrap; }

.brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #059669, #047857);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: var(--shadow-glow);
  font-size: 1.2rem;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  transition: var(--transition-fast);
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: var(--text-main);
}

.nav-btn:hover, .nav-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.mobile-container {
  max-width: 520px;
  margin: 0 auto;
  padding: 1.75rem 1.2rem;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.75rem;
}

.form-group { margin-bottom: 1.5rem; }
.form-label {
  display: block;
  font-size: 0.975rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.form-input, .form-textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.1rem;
  color: var(--text-main);
  font-size: 1rem;
  font-weight: 500;
  transition: var(--transition-fast);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.italic-placeholder::placeholder {
  font-style: italic;
  color: #94a3b8;
}

.form-input:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

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

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.capture-box {
  background: var(--bg-card);
  border: 2px dashed #059669;
  border-radius: var(--radius-md);
  padding: 2.25rem 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-card);
}

.capture-box:hover {
  border-color: var(--primary-hover);
  background: var(--primary-light);
  box-shadow: var(--shadow-glow);
}

.capture-icon-circle {
  width: 62px;
  height: 62px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin: 0 auto 0.85rem;
}

.preview-container {
  position: relative;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: none;
  border: 2px solid var(--primary);
}

.preview-img {
  width: 100%;
  height: auto;
  display: block;
}

.retake-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(15, 23, 42, 0.85);
  color: #ffffff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

.btn-submit {
  width: 100%;
  background: linear-gradient(135deg, #059669, #047857);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-full);
  padding: 1.1rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(5, 150, 105, 0.35);
}

.admin-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}

.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: var(--transition-fast);
}

.filters-bar { display: flex; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.search-input { flex: 1; min-width: 250px; }

/* Mobile Responsive Layout Rules */
@media (max-width: 640px) {
  .navbar {
    padding: 0.65rem 0.85rem !important;
    gap: 0.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .brand {
    font-size: 1.05rem !important;
    gap: 0.4rem !important;
    white-space: nowrap !important;
    flex-shrink: 0;
  }

  .brand span {
    white-space: nowrap !important;
  }

  .brand-icon {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.95rem !important;
    flex-shrink: 0;
  }

  /* HIDE top navbar buttons on mobile */
  .nav-links a.nav-btn,
  .nav-links .nav-btn {
    display: none !important;
  }

  #userBadge {
    padding: 0.25rem 0.6rem !important;
    font-size: 0.75rem !important;
    max-width: 130px;
    border-radius: var(--radius-full);
  }

  #userBadgeText {
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
  }

  .grid-2 {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }

  .mobile-container, .admin-container {
    padding: 1.25rem 0.85rem 80px 0.85rem !important;
  }

  .stats-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.5rem !important;
  }

  .stat-card {
    padding: 0.75rem 0.35rem !important;
    text-align: center;
  }

  .stat-card h3 {
    font-size: 0.625rem !important;
    line-height: 1.1;
  }

  .stat-card .stat-val {
    font-size: 1.2rem !important;
    font-weight: 800;
  }

  .mobile-bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 60px;
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
    z-index: 999;
    align-items: center;
    justify-content: space-around;
  }

  .mobile-bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 700;
    gap: 2px;
  }

  .mobile-bottom-nav a.active {
    color: var(--primary);
    background: var(--primary-light);
    border-top: 3px solid var(--primary);
  }
}

@media (min-width: 641px) {
  .mobile-bottom-nav { display: none !important; }
}
