/* Mobile-first responsive CSS */

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg: #f9fafb;
  --card-bg: #ffffff;
  --text: #1f2937;
  --text-light: #6b7280;
  --border: #e5e7eb;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  word-break: break-word;
  overflow-wrap: break-word;
}

body {
  font-family: 'Rubik', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* Prevent text overflow globally */
p {
  word-break: break-word;
  overflow-wrap: break-word;
}
.hidden { display: none !important; }

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

@media (min-width: 768px) {
  /* .container { padding: 1.5rem; } */
}

@media (min-width: 1024px) {
  /* .container { padding: 2rem; } */
}

/* ================================
   CUSTOM SCROLLBARS (Dark Theme)
   ================================ */

/* Webkit browsers (Chrome, Safari, Edge, Opera) */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: #1f2937;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: #4b5563;
  border-radius: 10px;
  border: 2px solid #1f2937;
}

::-webkit-scrollbar-thumb:hover {
  background: #6b7280;
}

::-webkit-scrollbar-thumb:active {
  background: #9ca3af;
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: #4b5563 #1f2937;
}

/* Scrollbar for modal specifically (optional - darker) */
.modal::-webkit-scrollbar-track {
  background: #111827;
}

.modal::-webkit-scrollbar-thumb {
  background: #374151;
  border: 2px solid #111827;
}

.modal::-webkit-scrollbar-thumb:hover {
  background: #4b5563;
}

/* ================================
   MOBILE NAVIGATION
   ================================ */
.navbar {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  /* padding: 1rem; */
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar h1 {
  font-size: 1.25rem;
  color: var(--primary);
  font-weight: 700;
}

/* Hamburger Menu Button (Mobile Only) */
/* Hamburger Menu Button (Mobile Only) */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  width: 44px;
  height: 44px;
  position: relative;
  z-index: 101;
}

.hamburger span {
  display: block;
  width: 25px;
  height: 3px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  position: relative;
}

/* X Animation - Centered & Clean */
.hamburger.active {
  gap: 0;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg);
  position: absolute;
  top: 50%;
  left: 50%;
  margin-left: -12.5px;
  margin-top: -1.5px;
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
  transform: scale(0);
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg);
  position: absolute;
  top: 50%;
  left: 50%;
  margin-left: -12.5px;
  margin-top: -1.5px;
}

/* Mobile Menu */
.nav-links {
  position: fixed;
  top: 0;
  right: -100%;
  width: 280px;
  height: 100vh;
  background: var(--card-bg);
  padding: 5rem 2rem 2rem;
  box-shadow: -4px 0 10px rgba(0,0,0,0.1);
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 99;
}

.nav-links.active {
  right: 0;
}

.nav-links a,
.nav-links button {
  padding: 1rem;
  text-decoration: none;
  color: var(--text);
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.2s;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  width: 100%;
}

.nav-links a:hover,
.nav-links button:hover {
  background: var(--bg);
  color: var(--primary);
}

/* Mobile Menu Overlay */
.nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0,0,0,0.5);
  z-index: 98;
  display: none;
}

.nav-overlay.active {
  display: block;
}

/* Desktop Navigation */
@media (min-width: 768px) {
  .hamburger {
    display: none;
  }

  .nav-links {
    position: static;
    width: auto;
    height: auto;
    padding: 0;
    flex-direction: row;
    box-shadow: none;
    background: transparent;
  }

  .nav-links a,
  .nav-links button {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    width: auto;
  }

  .nav-overlay {
    display: none !important;
  }
}

/* ================================
   BUTTONS
   ================================ */
button, .btn {
  padding: 1rem 1.5rem;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#logout-btn{
  color: #fff;
  background: #3b4878fa;
}
#logout-btn:hover{
  background: #667fd8fa;
}
.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--card-bg);
}

/* Add after .btn-secondary */
.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
  transform: translateY(-1px);
}

.btn-danger:active {
  transform: translateY(0);
}

.btn-small {
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ================================
   CARDS
   ================================ */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .card {
    padding: 1.5rem;
  }
}

.card h2 {
  margin-bottom: 1rem;
  color: var(--text);
  font-size: 1.25rem;
}

@media (min-width: 768px) {
  .card h2 {
    font-size: 1.5rem;
  }
}

/* ================================
   STATS GRID
   ================================ */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-card {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  transition: transform 0.2s;
}

.stat-card:active {
  transform: scale(0.98);
}

.stat-card h3 {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}

@media (min-width: 768px) {
  .stat-value {
    font-size: 2.0rem;
  }
}

/* ================================
   FORMS
   ================================ */
.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text);
  font-size: 0.875rem;
}

input, textarea, select {
  width: 100%;
  padding: 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

/* ================================
   LISTS
   ================================ */
.list-item {
  background: var(--card-bg);
  padding: 1rem;
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow);
  touch-action: manipulation;
}

.list-item:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.list-item:active {
  transform: translateY(0);
}

@media (min-width: 768px) {
  .list-item {
    padding: 1.25rem;
  }
}

/* ================================
   LOADING SPINNER
   ================================ */
.loading {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ================================
   BADGES
   ================================ */
.badge {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }

/* ================================
   MODAL / POPUP
   ================================ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--text);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-light);
  padding: 0.5rem;
  line-height: 1;
  transition: color 0.2s;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.modal-close:hover {
  color: var(--text);
  background: var(--bg);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

@media (min-width: 768px) {
  .modal {
    max-width: 600px;
  }
  
  .modal-header,
  .modal-body {
    padding: 2rem;
  }
}

/* ================================
   ICON BUTTONS
   ================================ */
.btn-icon {
  background: none;
  border: none;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  font-size: 1.125rem;
  opacity: 0.6;
  transition: all 0.2s;
  border-radius: 6px;
}

.btn-icon:hover {
  opacity: 1;
  background: var(--bg);
  transform: scale(1.1);
}

.btn-icon:active {
  transform: scale(0.95);
}

/* Button Success variant */
.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  background: #059669;
  transform: translateY(-1px);
}

/* Tables - Responsive */
table {
  font-size: 0.875rem;
}

@media (max-width: 640px) {
  table {
    font-size: 0.8125rem;
  }
  
  table th,
  table td {
    padding: 0.5rem 0.25rem !important;
  }
}

/* Details/Summary styling */
details summary {
  user-select: none;
  padding: 0.5rem 0;
}

details summary:hover {
  color: var(--primary);
}

details[open] summary {
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

/* ================================
   TOAST/ALERT
   ================================ */
.toast {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  left: 1rem;
  background: var(--card-bg);
  padding: 1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 1001;
  animation: slideIn 0.3s ease;
}

@media (min-width: 640px) {
  .toast {
    left: auto;
    max-width: 400px;
    bottom: 2rem;
    right: 2rem;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(100px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.toast-success { border-left: 4px solid var(--success); }
.toast-error { border-left: 4px solid var(--danger); }

/* ================================
   LOGIN PAGE
   ================================ */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.login-card {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
}

@media (min-width: 768px) {
  .login-card {
    padding: 1.5rem;
  }
}

.login-card h1 {
  text-align: center;
  margin-bottom: 2rem;
  color: var(--primary);
  font-size: 1.75rem;
}

@media (min-width: 768px) {
  .login-card h1 {
    font-size: 2rem;
  }
}

/* ================================
   HOMEPAGE STYLES
   ================================ */

.homepage {
  min-height: 100vh;
  background: var(--bg);
}

/* Hero Section */
/* HERO: richer animated gradient */
.hero {
  color: white;
  padding: 4rem 1rem;
  text-align: center;

  position: relative;
  overflow: hidden;

  /* Use your purple + deeper purple + a lighter lavender + subtle cyan accent */
  background:
    radial-gradient(1200px circle at 10% 20%, rgba(167, 139, 250, 0.45), transparent 55%),
    radial-gradient(900px circle at 90% 10%, rgba(34, 211, 238, 0.18), transparent 60%),
    radial-gradient(1000px circle at 70% 90%, rgba(99, 102, 241, 0.35), transparent 55%),
    linear-gradient(135deg,
      #312e81 0%,
      #4f46e5 28%,
      #6366f1 55%,
      #a78bfa 78%,
      #312e81 100%
    );

  background-size: 200% 200%, 220% 220%, 200% 200%, 300% 300%;
  animation: heroGradientMove 16s ease-in-out infinite;
}

/* Make sure content stays above overlays */
.hero .container {
  position: relative;
  z-index: 2;
}

/* Extra “sheen” layer that slowly drifts (adds contrast/motion) */
.hero::before {
  content: "";
  position: absolute;
  inset: -30%;
  z-index: 1;
  pointer-events: none;

  background: conic-gradient(
    from 180deg at 50% 50%,
    rgba(255,255,255,0.10),
    rgba(255,255,255,0.00) 35%,
    rgba(255,255,255,0.08) 55%,
    rgba(255,255,255,0.00) 80%,
    rgba(255,255,255,0.10)
  );

  filter: blur(18px);
  opacity: 0.55;
  animation: heroSheen 18s ease-in-out infinite;
  mix-blend-mode: overlay;
}

@keyframes heroGradientMove {
  0%   { background-position: 0% 50%, 100% 0%, 50% 100%, 0% 50%; }
  50%  { background-position: 100% 50%, 0% 100%, 100% 0%, 100% 50%; }
  100% { background-position: 0% 50%, 100% 0%, 50% 100%, 0% 50%; }
}

@keyframes heroSheen {
  0%   { transform: translate(-4%, -2%) rotate(0deg) scale(1.05); }
  50%  { transform: translate(4%, 3%) rotate(18deg) scale(1.10); }
  100% { transform: translate(-4%, -2%) rotate(0deg) scale(1.05); }
}

/* Optional: improve text pop on bright areas */
.hero-title, .hero-subtitle, .hero-description {
  text-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

/* Accessibility: reduce motion */
@media (prefers-reduced-motion: reduce) {
  .hero { animation: none; }
  .hero::before { animation: none; }
}

.hero-title {
  font-size: 3rem;
  font-weight: 900;
  margin-bottom: 1rem;
  letter-spacing: -1px;
}

.hero-subtitle {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  opacity: 0.95;
}

.hero-description {
  font-size: 1.125rem;
  max-width: 600px;
  margin: 0 auto 2rem;
  opacity: 0.9;
  line-height: 1.6;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 2rem;
  }
  
  .hero-subtitle {
    font-size: 1.25rem;
  }
  
  .hero-description {
    font-size: 1rem;
  }
}

/* Features Section */
.features {
  padding: 4rem 1rem;
  background: white;
}

.section-title {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
}

.section-subtitle {
  text-align: center;
  font-size: 1.125rem;
  color: var(--text-light);
  margin-bottom: 3rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.feature-card {
  text-align: center;
  padding: 2rem;
  background: var(--bg);
  border-radius: var(--radius);
  transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.feature-card p {
  color: var(--text-light);
  line-height: 1.6;
}

/* Pricing Section */
.pricing {
  padding: 4rem 1rem;
  background: var(--bg);
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* Responsive pricing grid */
@media (max-width: 1200px) {
  .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .pricing-grid {
    grid-template-columns: 1fr;
  }
}

.pricing-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}

.pricing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.pricing-card-popular {
  border: 3px solid var(--primary);
  transform: scale(1.05);
}

.pricing-card-popular:hover {
  transform: scale(1.05) translateY(-4px);
}

.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: white;
  padding: 0.375rem 1rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pricing-header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
}

.pricing-header h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
}

.pricing-price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.25rem;
}

.pricing-price .currency {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-light);
}

.pricing-price .amount {
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--primary);
}

.pricing-price .period {
  font-size: 1rem;
  color: var(--text-light);
}

.pricing-features {
  list-style: none;
  margin-bottom: 2rem;
}

.pricing-features li {
  padding: 0.75rem 0;
  color: var(--text);
  font-size: 0.9375rem;
  border-bottom: 1px solid var(--border);
}

.pricing-features li:last-child {
  border-bottom: none;
}

/* CTA Section */
.cta {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 4rem 1rem;
  text-align: center;
}

.cta h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.cta p {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

@media (max-width: 768px) {
  .cta h2 {
    font-size: 1.75rem;
  }
  
  .cta p {
    font-size: 1rem;
  }
}

/* Footer */
.footer {
  background: var(--text);
  color: white;
  padding: 2rem 1rem;
  text-align: center;
}

.footer p {
  margin-bottom: 1rem;
  opacity: 0.8;
}

.footer-links {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
}

.footer-links a {
  color: white;
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.footer-links a:hover {
  opacity: 1;
  text-decoration: underline;
}

/* ================================
   INFO BOX / NOTIFICATION
   ================================ */
.info-box {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  border: 1px solid #d1d5db;
  border-left: 4px solid #6366f1;
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.info-box strong {
  color: var(--primary);
  font-weight: 600;
}

@media (max-width: 640px) {
  .info-box {
    flex-direction: column;
    text-align: center;
    font-size: 0.875rem;
  }
}

.btn-grey {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  color: var(--text);
  border: 1px solid #d1d5db;
  font-weight: 500;
  padding: 0.65rem;
}

.btn-grey:hover {
  background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-grey:active {
  transform: translateY(0);
}

/* ================================
   LEGAL PAGES (ToS, Privacy)
   ================================ */
.legal-page {
  background: var(--bg);
  min-height: 100vh;
  padding: 2rem 0 4rem;
}

.legal-header {
  text-align: center;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 2px solid var(--border);
}

.legal-header h1 {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.legal-meta {
  color: var(--text-light);
  font-size: 0.875rem;
  font-style: italic;
}

.legal-content {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  max-width: 900px;
  margin: 0 auto;
}

.legal-intro {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  border-left: 4px solid var(--primary);
  padding: 1.25rem;
  border-radius: var(--radius);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 2rem;
}

.legal-section {
  margin-bottom: 2.5rem;
}

.legal-section h2 {
  color: var(--text);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--bg);
}

.legal-section p {
  line-height: 1.8;
  margin-bottom: 1rem;
  color: var(--text);
}

.legal-section ul,
.legal-section ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
  line-height: 1.8;
}

.legal-section li {
  margin-bottom: 0.5rem;
  color: var(--text);
}

.legal-section strong {
  color: var(--primary);
  font-weight: 600;
}

.legal-section a {
  color: var(--primary);
  text-decoration: underline;
  font-weight: 500;
}

.legal-section a:hover {
  color: var(--primary-dark);
}

.contact-info {
  background: var(--bg);
  padding: 1rem;
  border-radius: var(--radius);
  font-family: 'Courier New', monospace;
  font-size: 0.95rem;
}

.legal-acknowledgment {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-left: 4px solid var(--warning);
  padding: 1.5rem;
  border-radius: var(--radius);
  margin-top: 3rem;
}

.legal-acknowledgment p {
  margin: 0;
  font-size: 1rem;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .legal-page {
    padding: 1rem 0 2rem;
  }

  .legal-header h1 {
    font-size: 1.75rem;
  }

  .legal-content {
    padding: 1.5rem;
  }

  .legal-section h2 {
    font-size: 1.25rem;
  }

  .legal-section ul,
  .legal-section ol {
    margin-left: 1rem;
  }
}

/* ================================
   PLAN TIER BADGES
   ================================ */
.plan-badge {
  display: inline-block;
  padding: 0.325rem 1.0rem;
  border-radius: 5px;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: var(--shadow);
}

.plan-badge-free {
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
  color: white;
}

.plan-badge-starter {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
}

.plan-badge-pro {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
}

.plan-badge-premium {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
}

/* ================================
   SUBSCRIBER DETAIL PAGE ONLY
   ================================ */

/* Section Headers (Desktop-first) */
.subscriber-detail .section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: 0.75rem;
}

.subscriber-detail .section-header h2 {
  margin: 0;
  flex: 1;
}

.subscriber-detail .section-header > div {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Mobile: Stack title and buttons */
@media (max-width: 767px) {
  .subscriber-detail .section-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  
  .subscriber-detail .section-header h2 {
    text-align: left;
  }
  
  .subscriber-detail .section-header > div {
    display: flex;
    gap: 0.5rem;
    width: 100%;
  }
  
  /* View All button takes 50% */
  .subscriber-detail .section-header .view-all-notes-btn,
  .subscriber-detail .section-header .view-all-purchases-btn,
  .subscriber-detail .section-header .view-all-requests-btn,
  .subscriber-detail .section-header .view-all-reminders-btn {
    flex: 1;
    min-width: 0;
  }
  
  /* Add button takes 50% */
  .subscriber-detail .section-header button:last-child {
    flex: 1;
    min-width: 0;
  }
}

/* Inner Action Buttons (in list items) */
.subscriber-detail .list-item .btn,
.subscriber-detail .list-item .btn-small,
.subscriber-detail .list-item .btn-icon {
  white-space: nowrap;
}

/* Mobile: Stack action buttons vertically at bottom */
@media (max-width: 640px) {
  /* Requests: Complete/Cancel buttons */
  .subscriber-detail .list-item .complete-request-btn,
  .subscriber-detail .list-item .cancel-request-btn,
  /* Reminders: Done/Delete buttons */
  .subscriber-detail .list-item .complete-reminder-btn,
  .subscriber-detail .list-item .delete-reminder-btn {
    width: 100%;
    margin-top: 0.5rem;
  }
  
  /* Stack button containers vertically */
  .subscriber-detail .list-item > div:last-child {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
    margin-top: 0.75rem;
  }
  
  /* Make list items fully vertical on mobile */
  .subscriber-detail .list-item {
    flex-direction: column !important;
    align-items: stretch !important;
  }
}

/* Button Icon Helper */
.subscriber-detail .btn-icon {
  background: none;
  border: none;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.subscriber-detail .btn-icon:hover {
  opacity: 1;
}

.telegram-float-text {
position: fixed;
bottom: 7px;
right: 14px;
background: linear-gradient(135deg, #0088cc, #00a0e9);
color: white;
padding: 8px;
border-radius: 10px;
display: flex;
align-items: center;
gap: 5px;
box-shadow: 0 4px 12px rgba(0, 136, 204, 0.4);
z-index: 999;
transition: all 0.3s ease;
cursor: pointer;
text-decoration: none;
font-weight: 400;
font-size: 0.7rem;
}

.telegram-float-text:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 136, 204, 0.6);
}

.telegram-float-text:active {
  transform: translateY(0);
}

/* ================================
   EMPTY STATE
   ================================ */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-light);
}

.empty-state h3 {
  margin-bottom: 0.5rem;
  color: var(--text);
  font-size: 1.25rem;
}

/* ================================
   UTILITY CLASSES
   ================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }

/* ================================
   SAFE AREA INSETS (for notched phones)
   ================================ */
@supports (padding: max(0px)) {
  body {
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
  }
  
  .navbar {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }
}