:root {
  --bg: #0b1630;
  --bg-alt: #102247;
  --panel: #ffffff;
  --panel-soft: #f5f8ff;
  --text: #17233c;
  --muted: #5f6d89;
  --line: #dce5f5;
  --primary: #174ea6;
  --primary-dark: #123b7c;
  --accent: #ff9f1c;
  --success: #e6f8ed;
  --success-text: #167445;
  --danger: #fdeaea;
  --danger-text: #ab1f2d;
  --shadow: 0 20px 45px rgba(5, 17, 44, 0.16);
  --radius: 20px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, #09142c 0%, #0b2248 55%, #12356d 100%);
}
.page-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 380px 1fr;
}
.brand-panel {
  padding: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand-card {
  width: 100%;
  max-width: 320px;
  text-align: center;
  color: white;
}
.mascot {
  width: 100%;
  border-radius: 28px;
  box-shadow: 0 25px 55px rgba(0, 0, 0, 0.28);
  margin-bottom: 20px;
}
.eyebrow {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.brand-copy h1 {
  margin: 14px 0 6px;
  font-size: 40px;
}
.brand-copy p {
  margin: 0;
  color: rgba(255,255,255,.84);
  line-height: 1.6;
}
.content-panel {
  background: #eef4ff;
  padding: 36px;
  border-top-left-radius: 32px;
  border-bottom-left-radius: 32px;
}
.card {
  background: var(--panel);
  border: 1px solid rgba(220, 229, 245, .9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.auth-card {
  max-width: 520px;
}
.card-header {
  padding: 26px 28px 0;
}
.card-header h2,
.card-header h3 {
  margin: 0 0 8px;
}
.card-header p {
  margin: 0;
  color: var(--muted);
}
.stack-form {
  padding: 28px;
  display: grid;
  gap: 18px;
}
.stack-form label span {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}
input, textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: white;
  font: inherit;
}
textarea { resize: vertical; min-height: 120px; }
input:focus, textarea:focus {
  outline: none;
  border-color: #7aa2eb;
  box-shadow: 0 0 0 4px rgba(23, 78, 166, .12);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  border: none;
  border-radius: 14px;
  padding: 14px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.btn-full { width: 100%; }
.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-accent {
  background: var(--accent);
  color: #1f2638;
}
.btn-secondary {
  background: #e7eefc;
  color: var(--primary-dark);
}
.helper-text {
  margin: 0 28px 28px;
  color: var(--muted);
}
.flash-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}
.flash {
  padding: 14px 16px;
  border-radius: 14px;
  font-weight: 600;
}
.flash-success {
  background: var(--success);
  color: var(--success-text);
}
.flash-danger {
  background: var(--danger);
  color: var(--danger-text);
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.topbar h2 {
  margin: 0 0 8px;
}
.topbar p {
  margin: 0;
  color: var(--muted);
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.pill {
  background: white;
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 600;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 24px;
  margin-bottom: 24px;
}
.button-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.button-row .btn {
  flex: 1 1 220px;
}
.tips-card { padding-bottom: 18px; }
.tips-list {
  margin: 10px 28px 28px;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.7;
}
.history-card {
  overflow: hidden;
}
.table-wrap {
  width: 100%;
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
}
thead {
  background: #eff5ff;
}
th, td {
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}
.message-cell {
  min-width: 280px;
  white-space: pre-wrap;
}
.status {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: capitalize;
}
.status-pending { background: #fff3da; color: #8b5e00; }
.status-sent { background: #e6f8ed; color: #167445; }
.status-failed { background: #fdeaea; color: #ab1f2d; }
.empty-state {
  padding: 0 28px 28px;
  color: var(--muted);
}
@media (max-width: 1080px) {
  .page-shell {
    grid-template-columns: 1fr;
  }
  .brand-panel {
    padding-bottom: 0;
  }
  .content-panel {
    border-radius: 32px 32px 0 0;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 640px) {
  .content-panel,
  .brand-panel {
    padding: 18px;
  }
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
}
