/* =========================================================
   0) Base reset + global defaults
   ========================================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", Arial, sans-serif;
}

html, body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.45;
}

/* Improve default rendering */
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

/* =========================================================
   1) Design tokens (CSS variables)
   ========================================================= */
:root{
  /* Brand */
  --brand: #5c6b88;
  --brand-hover: #4f5c74;
  --brand-active: #465264;

  /* Backgrounds / surfaces */
  --bg: #f4f4f4;
  --surface: #ffffff;
  --surface-2: #f7f9fc;

  /* Text */
  --text: #1f2937;
  --muted: #6b7280;

  /* Lines */
  --border: rgba(31, 41, 55, 0.10);

  /* Status colors (use for badges, tags) */
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #ef4444;

  /* Layout */
  --page-max: 1200px;

  /* Radius + shadow */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;

  --shadow-sm: 0 8px 18px rgba(0,0,0,.07);
  --shadow-md: 0 10px 24px rgba(0,0,0,.10);

  /* Spacing scale */
  --s-1: 6px;
  --s-2: 10px;
  --s-3: 14px;
  --s-4: 18px;
  --s-5: 24px;
  --s-6: 32px;

  /* Typography scale */
  --h1: 28px;
  --h2: 20px;
  --h3: 16px;
  --p: 14px;
}

/* =========================================================
   2) Typography (headings + helper text)
   ========================================================= */
h1 { font-size: var(--h1); font-weight: 700; letter-spacing: -0.02em; color: var(--brand)}
h2 { font-size: var(--h2); font-weight: 650; letter-spacing: -0.01em; }
h3 { font-size: 12px; font-weight: 600; margin-bottom: 10px; color: #51515170; }

p { font-size: var(--p); color: var(--text); }
.small { font-size: 12px; color: var(--muted); }
.muted { color: var(--muted); }
    
/* =========================================================
   3) Layout helpers
   ========================================================= */
.page {
  padding-top: 80px;
  padding-bottom: 60px;
}

.container {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--s-5);
}

.section {
  margin-top: var(--s-6);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}

.row {
  display: flex;
  gap: var(--s-4);
  flex-wrap: wrap;
  align-items: center;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-4);
}
@media (max-width: 980px) {
  .grid-3 { grid-template-columns: 1fr; }
}

/* =========================================================
   4) Cards / surfaces
   ========================================================= */
.card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: var(--s-5);
}

.card-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: var(--s-3);
}

.hr {
  height: 1px;
  background: var(--border);
  border: 0;
  margin: var(--s-4) 0;
}

/* =========================================================
   5) Buttons
   ========================================================= */
.btn {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .06s ease, background .15s ease, border-color .15s ease, opacity .15s ease;
  display: inline-flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--brand);
  color: #fff;
}
.btn-primary:hover { background: var(--brand-hover); }
.btn-primary:active { background: var(--brand-active); }

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--brand);
}
.btn-ghost:hover { background: rgba(92, 107, 136, 0.08); }

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover { opacity: .92; }

/* =========================================================
   6) Badges / tags
   ========================================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--brand);
}

.badge.success { color: var(--success); }
.badge.warning { color: var(--warning); }
.badge.danger  { color: var(--danger); }

/* =========================================================
   7) Inputs
   ========================================================= */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.input, .select, .textarea {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  outline: none;
}

.input:focus, .select:focus, .textarea:focus {
  border-color: rgba(92, 107, 136, 0.55);
}

.textarea {
  min-height: 90px;
  resize: vertical;
}

/* =========================================================
   8) Table (clean SaaS style)
   ========================================================= */
.table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
}

.table th, .table td {
  padding: 12px 12px;
  text-align: left;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table th {
  font-weight: 800;
  color: var(--muted);
  background: var(--surface-2);
}

.table tr:last-child td { border-bottom: 0; }

/* =========================================================
   9) Demo-only helpers (for your preset page)
   ========================================================= */
.demo-box {
  border: 1px dashed rgba(31, 41, 55, 0.2);
  border-radius: var(--radius-md);
  padding: var(--s-4);
  background: rgba(255,255,255,0.6);
}

.swatch {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.swatch .chip {
  width: 170px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 12px;
}

.swatch .dot {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-block;
  margin-right: 10px;
  vertical-align: middle;
  border: 1px solid rgba(0,0,0,.08);
}
