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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f7fa;
  color: #2d3748;
  font-size: 15px;
  line-height: 1.5;
}

/* ---- Navbar ---- */
.navbar {
  background: #1a365d;
  color: white;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  min-height: 56px;
}
.nav-brand {
  font-weight: 700;
  font-size: 1.1em;
  color: white;
  text-decoration: none;
  white-space: nowrap;
}
.nav-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-left: auto;
}
.nav-links a {
  color: #bee3f8;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 0.9em;
  transition: background 0.15s;
}
.nav-links a:hover, .nav-links a.active {
  background: rgba(255,255,255,0.15);
  color: white;
}
.nav-links a.logout { color: #fc8181; }

/* ---- Container ---- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 20px;
}

h1 { font-size: 1.6em; margin-bottom: 16px; color: #1a365d; }
h2 { font-size: 1.2em; margin: 20px 0 12px; color: #2d4a6f; }

/* ---- Login / Signup ---- */
.login-page {
  background: #ebf4ff;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-box {
  background: white;
  border-radius: 10px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.1);
  padding: 40px;
  width: 100%;
  max-width: 420px;
}
.login-box h1 { text-align: center; margin-bottom: 4px; }
.login-box h2 { text-align: center; margin-bottom: 24px; font-size: 1em; color: #718096; }

/* ---- Forms ---- */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.9em; }
.form-group input[type=text],
.form-group input[type=tel],
.form-group input[type=password],
.form-group input[type=datetime-local],
.form-group input[type=file],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  font-size: 0.95em;
  transition: border-color 0.15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #4299e1;
  box-shadow: 0 0 0 3px rgba(66,153,225,0.15);
}
.form-group small { color: #718096; font-size: 0.82em; display: block; margin-top: 4px; }
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: normal;
  margin-bottom: 4px;
}
.checkbox-label input { width: auto; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.92em;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: #3182ce; color: white; }
.btn-primary:hover { background: #2b6cb0; }
.btn-secondary { background: #e2e8f0; color: #2d3748; }
.btn-secondary:hover { background: #cbd5e0; }
.btn-danger { background: #e53e3e; color: white; }
.btn-danger:hover { background: #c53030; }
.btn-full { width: 100%; justify-content: center; }
.btn-sm { padding: 5px 10px; font-size: 0.82em; }
.btn-row { display: flex; gap: 12px; align-items: center; margin-top: 16px; }

/* ---- Tables ---- */
table { width: 100%; border-collapse: collapse; margin-bottom: 20px; background: white; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
thead { background: #ebf4ff; }
th { text-align: left; padding: 11px 14px; font-size: 0.82em; text-transform: uppercase; letter-spacing: 0.05em; color: #4a5568; }
td { padding: 11px 14px; border-top: 1px solid #e2e8f0; vertical-align: middle; }
tr:hover td { background: #f7fafc; }
.msg-preview { font-family: monospace; font-size: 0.88em; }

/* ---- Stats Grid ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  border-top: 3px solid #3182ce;
}
.stat-number { font-size: 2em; font-weight: 700; color: #1a365d; }
.stat-label { font-size: 0.82em; color: #718096; margin-top: 4px; }

/* ---- Two-col layout ---- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-bottom: 28px; }
@media (max-width: 700px) { .two-col { grid-template-columns: 1fr; } }

/* ---- Alerts ---- */
.alert {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 0.92em;
}
.alert-success { background: #c6f6d5; color: #276749; border: 1px solid #9ae6b4; }
.alert-error { background: #fed7d7; color: #9b2c2c; border: 1px solid #fc8181; }

/* ---- Badges ---- */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.78em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-sent { background: #c6f6d5; color: #276749; }
.badge-pending { background: #fefcbf; color: #744210; }
.badge-sending { background: #bee3f8; color: #2c5282; }
.badge-failed { background: #fed7d7; color: #9b2c2c; }
.badge-cancelled { background: #e2e8f0; color: #718096; }

/* ---- Confirmation box ---- */
.confirmation-box {
  background: white;
  border: 2px solid #fc8181;
  border-radius: 10px;
  padding: 28px;
  max-width: 640px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
.confirmation-box h2 { color: #c53030; margin-top: 0; }
.preview-block {
  background: #f7fafc;
  border-radius: 6px;
  padding: 16px;
  margin: 16px 0;
}
.preview-block p { margin-bottom: 8px; }
.recipient-count { font-size: 1.1em; font-weight: 700; color: #2b6cb0; }
.message-preview {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 12px;
  white-space: pre-wrap;
  font-family: monospace;
  font-size: 0.92em;
  margin-top: 6px;
}

/* ---- Misc ---- */
.muted { color: #a0aec0; font-style: italic; }
.back-link { display: inline-block; margin-bottom: 12px; color: #4299e1; text-decoration: none; font-size: 0.9em; }
.back-link:hover { text-decoration: underline; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.page-header h1 { margin-bottom: 0; }
.detail-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.detail-card p { margin-bottom: 8px; }
