* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --green: #16a34a;
  --green-dark: #15803d;
  --green-light: #dcfce7;
  --green-hover: #f0fdf4;
  --text: #111827;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --bg: #ffffff;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f9fafb;
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* NAV */
nav {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--green);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-brand svg { width: 24px; height: 24px; }

.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.15s;
}
.nav-links a:hover { background: var(--green-hover); color: var(--green); }

/* CONTAINERS */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px;
}

.container-sm {
  max-width: 480px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* CARDS */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.card-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}

.card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* MODULE CARDS */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.module-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: all 0.2s;
  display: block;
}

.module-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--green);
  transform: translateY(-2px);
}

.module-icon {
  width: 44px;
  height: 44px;
  background: var(--green-light);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  color: var(--green);
}

.module-icon svg { width: 22px; height: 22px; }

.module-name {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 4px;
}

.module-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* FORMS */
.form-group {
  margin-bottom: 18px;
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s;
  font-family: inherit;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

textarea { resize: vertical; min-height: 120px; }

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  text-decoration: none;
  font-family: inherit;
}

.btn-primary {
  background: var(--green);
  color: white;
}
.btn-primary:hover { background: var(--green-dark); }

.btn-secondary {
  background: #f3f4f6;
  color: var(--text);
}
.btn-secondary:hover { background: #e5e7eb; }

.btn-outline {
  background: transparent;
  color: var(--green);
  border: 1px solid var(--green);
}
.btn-outline:hover { background: var(--green-hover); }

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-full { width: 100%; }

/* ALERT */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 16px;
}
.alert-error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.alert-success { background: var(--green-light); color: var(--green-dark); border: 1px solid #86efac; }

/* OUTPUT BOX */
.output-box {
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-top: 20px;
  line-height: 1.7;
  font-size: 0.95rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.output-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

/* PAGE HEADER */
.page-header {
  margin-bottom: 28px;
}

.page-header h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}

.page-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  margin-bottom: 16px;
  transition: color 0.15s;
}
.back-link:hover { color: var(--green); }

/* ACTIVITY LOG */
.activity-list { list-style: none; }
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 8px; height: 8px;
  background: var(--green);
  border-radius: 50%;
  margin-top: 7px;
  flex-shrink: 0;
}
.activity-module { font-weight: 600; font-size: 0.875rem; }
.activity-input { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.activity-time { font-size: 0.75rem; color: var(--text-muted); margin-left: auto; white-space: nowrap; }

/* HERO (landing) */
.hero {
  text-align: center;
  padding: 80px 20px 60px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 20px;
  color: var(--text);
}

.hero h1 span { color: var(--green); }

.hero p {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 32px;
}

.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.badge {
  display: inline-block;
  background: var(--green-light);
  color: var(--green-dark);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 16px;
}

/* PRICING */
.pricing-card {
  background: #fff;
  border: 2px solid var(--green);
  border-radius: 16px;
  padding: 40px;
  max-width: 400px;
  margin: 0 auto;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.price { font-size: 3rem; font-weight: 900; color: var(--green); }
.price-period { font-size: 1rem; color: var(--text-muted); }

.feature-list { list-style: none; margin: 24px 0; text-align: left; }
.feature-list li {
  padding: 8px 0;
  font-size: 0.95rem;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border-bottom: 1px solid #f3f4f6;
}
.feature-list li:last-child { border-bottom: none; }
.check { color: var(--green); font-weight: 700; flex-shrink: 0; }

/* ADMIN TABLE */
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th { background: #f9fafb; padding: 10px 14px; text-align: left; font-weight: 600; font-size: 0.8rem; text-transform: uppercase; color: var(--text-muted); border-bottom: 1px solid var(--border); }
td { padding: 12px 14px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }

.stat-box {
  background: var(--green-light);
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 24px;
}
.stat-number { font-size: 2.5rem; font-weight: 900; color: var(--green); }
.stat-label { font-size: 0.9rem; color: var(--green-dark); font-weight: 600; }

/* SPINNER */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* USER INFO */
.user-email { font-size: 0.85rem; color: var(--text-muted); }
.welcome-bar { background: var(--green-light); border-radius: 10px; padding: 16px 20px; margin-bottom: 28px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.welcome-bar-text strong { font-size: 1rem; color: var(--green-dark); }
.welcome-bar-text p { font-size: 0.85rem; color: var(--green-dark); opacity: 0.8; }

/* SMS OUTPUT */
.sms-card {
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 14px;
}
.sms-label { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; letter-spacing: 0.05em; }
.sms-text { font-size: 0.95rem; line-height: 1.6; }

@media (max-width: 640px) {
  .module-grid { grid-template-columns: 1fr; }
  .hero { padding: 50px 20px 40px; }
  nav { padding: 0 16px; }
}
