/* StayLoop App Styles — matches landing page design tokens */
:root {
  --bg: #faf8f5;
  --bg-alt: #f0ebe2;
  --fg: #1c1917;
  --fg-muted: #6b5f53;
  --accent: #c9622f;
  --accent-light: #e8956f;
  --accent-dark: #a84d1e;
  --surface: #ffffff;
  --border: #e5ddd4;
}

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

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Nav */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 48px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.nav__logo { font-family: 'Fraunces', serif; font-size: 20px; font-weight: 700; color: var(--accent); }
.nav__user { font-size: 14px; color: var(--fg-muted); }

/* Layout */
.app-container { max-width: 1200px; margin: 0 auto; padding: 40px 48px; }
.page-header { margin-bottom: 32px; }
.page-title { font-family: 'Fraunces', serif; font-size: 32px; font-weight: 700; color: var(--fg); margin-bottom: 8px; }
.page-sub { color: var(--fg-muted); font-size: 16px; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 24px; margin-bottom: 20px; }
.card-title { font-size: 18px; font-weight: 600; margin-bottom: 16px; color: var(--fg); }

/* Grid */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 768px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* Stats row */
.stats-row { display: flex; gap: 40px; margin-bottom: 24px; }
.stat { display: flex; flex-direction: column; }
.stat__val { font-family: 'Fraunces', serif; font-size: 28px; font-weight: 600; color: var(--accent); }
.stat__label { font-size: 13px; color: var(--fg-muted); }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; color: var(--fg-muted); padding: 8px 12px; border-bottom: 1px solid var(--border); }
td { padding: 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
tr:last-child td { border-bottom: none; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; border: none; text-decoration: none; transition: background 0.15s; }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary { background: var(--bg-alt); color: var(--fg); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: #fee2e2; color: #dc2626; }
.btn-danger:hover { background: #fecaca; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; color: var(--fg); }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; background: var(--surface); color: var(--fg);
  transition: border-color 0.15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(201,98,47,0.1);
}
.form-textarea { resize: vertical; min-height: 80px; }

/* Badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.badge-draft { background: var(--bg-alt); color: var(--fg-muted); }
.badge-running { background: #dcfce7; color: #15803d; }
.badge-complete { background: #dbeafe; color: #1d4ed8; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; font-size: 14px; }
.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.alert-error { background: #fee2e2; color: #dc2626; border: 1px solid #fecaca; }
.alert-info { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }

/* Campaign card */
.campaign-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.campaign-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.campaign-name { font-size: 16px; font-weight: 600; }
.campaign-trigger { font-size: 13px; color: var(--fg-muted); margin-top: 2px; }
.campaign-metrics { display: flex; gap: 20px; margin-top: 12px; }
.campaign-metric { display: flex; flex-direction: column; }
.campaign-metric__val { font-size: 18px; font-weight: 600; color: var(--accent); }
.campaign-metric__label { font-size: 12px; color: var(--fg-muted); }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: var(--surface); border-radius: 16px; padding: 32px; width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto; }
.modal-title { font-family: 'Fraunces', serif; font-size: 24px; font-weight: 700; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; }

/* File upload */
.file-upload { border: 2px dashed var(--border); border-radius: 12px; padding: 32px; text-align: center; cursor: pointer; transition: border-color 0.15s; }
.file-upload:hover { border-color: var(--accent); }
.file-upload__text { color: var(--fg-muted); font-size: 14px; }
.file-upload__text strong { color: var(--accent); }

/* Utility */
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.text-muted { color: var(--fg-muted); font-size: 14px; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.hidden { display: none; }

/* Tabs */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.tab { padding: 12px 24px; font-size: 14px; font-weight: 500; color: var(--fg-muted); cursor: pointer; border-bottom: 2px solid transparent; transition: all 0.15s; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab:hover { color: var(--fg); }

/* Auth pages */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--hero-bg); }
.auth-box { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 40px; width: 100%; max-width: 420px; }
.auth-logo { font-family: 'Fraunces', serif; font-size: 24px; font-weight: 700; color: var(--accent); margin-bottom: 24px; text-align: center; }
.auth-title { font-size: 22px; font-weight: 600; margin-bottom: 24px; text-align: center; }