* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #1f2430;
  background: #f7f7f5;
}
a { color: #1a6b52; text-decoration: none; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 15px;
}
.btn-primary { background: #1a6b52; color: #fff; }
.btn-primary:hover { background: #145a44; }
.btn-outline { background: transparent; border-color: #1a6b52; color: #1a6b52; }
.btn-outline:hover { background: #eaf3ef; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.link-btn { background: none; border: none; color: #6b7280; cursor: pointer; font-size: 14px; padding: 0; }
.link-btn:hover { color: #1f2430; }

/* Messages */
.messages { max-width: 1080px; margin: 16px auto 0; padding: 0 24px; }
.message { padding: 10px 16px; border-radius: 8px; margin-bottom: 10px; font-size: 14px; }
.message-success { background: #e6f4ec; color: #14532d; }
.message-error { background: #fbe9e7; color: #7f1d1d; }
.message-warning { background: #fff7e6; color: #7a4a00; }
.message-info { background: #eaf1fb; color: #1a4a80; }

/* Public site */
.site-header { border-bottom: 1px solid #e5e5e0; background: #fff; }
.site-header-inner { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; flex-wrap: wrap; gap: 12px; }
.brand { font-weight: 700; font-size: 18px; }
.hero { padding: 80px 0 60px; text-align: center; }
.hero h1 { font-size: 36px; max-width: 720px; margin: 0 auto 16px; }
.hero .lead { font-size: 18px; color: #4b5563; max-width: 640px; margin: 0 auto 28px; }
.features { padding: 40px 0; background: #fff; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.feature h3 { margin-bottom: 8px; }
.feature p { color: #4b5563; font-size: 14px; }
.enquire { padding: 60px 0; }

/* FIX for the reported bug: the form column now has a guaranteed
   minimum/max width instead of an even 1fr/1fr split, so it can
   no longer get squeezed narrow enough to stack labels/inputs
   awkwardly and stretch the card vertically. Collapses to a single
   column on small screens (see media query below), where the fix
   isn't needed because there's no squeeze to begin with. */
.enquire-inner { display: grid; grid-template-columns: 1fr minmax(320px, 420px); gap: 48px; align-items: start; }
.site-footer { padding: 24px 0; text-align: center; color: #9ca3af; font-size: 13px; }
.site-footer-inner { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.footer-links { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; padding: 0; margin: 0; }
.footer-links a { color: #9ca3af; }
.footer-links a:hover { color: #1f2430; }

.card {
  background: #fff;
  border: 1px solid #e5e5e0;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}
.card form p { margin: 0 0 14px; }
.card label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.card input, .card textarea, .card select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #d7d7d2;
  border-radius: 6px;
  font-size: 14px;
}
.card ul.errorlist { list-style: none; padding: 0; margin: 4px 0 0; color: #b3261e; font-size: 12px; }
.card button[type="submit"] { width: 100%; text-align: center; }
.enquiry-submitted h3 { margin-top: 0; }
.enquiry-submitted p { margin: 0; color: #4b5563; font-size: 14px; }

.auth-wrap { display: flex; justify-content: center; padding: 80px 24px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h1 { margin-top: 0; font-size: 22px; }

/* Panel */
.panel-body { background: #f7f7f5; }
.panel-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px;
  background: #14261f;
  color: #d1e3da;
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
}
.sidebar .brand { color: #fff; margin-bottom: 24px; font-size: 16px; }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.sidebar nav a { color: #d1e3da; padding: 9px 12px; border-radius: 6px; font-size: 14px; }
.sidebar nav a:hover { background: rgba(255,255,255,0.08); }
.sidebar nav a.active { background: #1a6b52; color: #fff; }
.logout-form { margin-top: auto; }

.panel-main { flex: 1; padding: 32px 40px; max-width: 1000px; }
.panel-main h1 { margin-top: 0; }

.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }

.hint { color: #6b7280; font-size: 14px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-top: 24px; }
.stat-card { background: #fff; border: 1px solid #e5e5e0; border-radius: 12px; padding: 18px; }
.stat-label { font-size: 13px; color: #6b7280; margin-bottom: 6px; }
.stat-value { font-size: 24px; font-weight: 700; margin-bottom: 8px; }

.data-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; }
.data-table th, .data-table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid #eee; font-size: 14px; }
.data-table th { background: #fafaf8; font-weight: 600; color: #4b5563; }
.row-link { cursor: pointer; }
.row-link:hover { background: #fafaf8; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #eee; color: #444; }
.badge-connected, .badge-approved, .badge-sent, .badge-delivered, .badge-read, .badge-completed { background: #e6f4ec; color: #14532d; }
.badge-pending, .badge-queued, .badge-draft, .badge-sending { background: #fff7e6; color: #7a4a00; }
.badge-error, .badge-failed, .badge-rejected, .badge-disconnected { background: #fbe9e7; color: #7f1d1d; }

/* ============================================================
   Hero visual (phone mockup) — additive only, uses the existing
   palette (#1a6b52 etc.), not a new color system.
   ============================================================ */
.hero-grid { display: grid; grid-template-columns: 1fr; gap: 40px; align-items: center; text-align: left; }
.hero-grid h1 { margin: 0 0 16px; text-align: left; }
.hero-grid .lead { margin: 0 0 24px; text-align: left; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.phone-mock {
  justify-self: center;
  width: 240px;
  background: #1f2430;
  border-radius: 30px;
  padding: 8px;
}
.phone-mock-screen {
  background: #eceae4;
  border-radius: 22px;
  overflow: hidden;
  min-height: 380px;
  display: flex;
  flex-direction: column;
}
.phone-mock-bar {
  background: #1a6b52;
  color: #fff;
  padding: 12px 14px 10px;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.phone-mock-bar .dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  color: #1a6b52;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
}
.phone-mock-body { flex: 1; padding: 14px 10px; }
.bubble {
  background: #fff;
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 12px;
  line-height: 1.4;
  max-width: 88%;
  margin-bottom: 8px;
  color: #1f2430;
}
.bubble strong { display: block; margin-bottom: 4px; font-size: 11px; color: #1a6b52; }
.bubble .time { display: block; text-align: right; font-size: 10px; color: #9ca3af; margin-top: 6px; }

/* ============================================================
   Responsive fixes
   ============================================================ */
@media (max-width: 760px) {
  .hero { padding: 48px 0 36px; text-align: left; }
  .hero h1 { font-size: 28px; text-align: left; margin: 0 0 14px; }
  .hero .lead { text-align: left; margin: 0 0 24px; }

  .enquire { padding: 40px 0; }
  .enquire-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .enquire-inner > div > p { max-width: none; }

  .panel-main { padding: 24px 16px; }
  .panel-shell { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; align-items: center; padding: 12px 16px; overflow-x: auto; }
  .sidebar nav { flex-direction: row; }
  .sidebar .brand { margin-bottom: 0; margin-right: 16px; white-space: nowrap; }
  .logout-form { margin-top: 0; margin-left: auto; }

  .phone-mock { width: 200px; }
}

@media (min-width: 761px) {
  .site-footer-inner { flex-direction: row; justify-content: space-between; }
  .hero-grid { grid-template-columns: 1.1fr 0.9fr; }
}