/* Lots web dashboard — hand-crafted CSS */
:root {
  --bg: #f8f9fa;
  --fg: #1a1a2e;
  --accent: #2d6a9f;
  --accent-light: #e8f0fe;
  --success: #2d8a4e;
  --danger: #c0392b;
  --warning: #e67e22;
  --muted: #6c757d;
  --border: #dee2e6;
  --card-bg: #fff;
  --radius: 6px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Nav */
nav {
  background: var(--fg);
  color: #fff;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
nav .logo { font-weight: 700; font-size: 1.1rem; letter-spacing: 0.5px; }
nav a { color: rgba(255,255,255,.8); font-size: 0.9rem; }
nav a:hover { color: #fff; text-decoration: none; }
nav .spacer { flex: 1; }
nav .user { font-size: 0.8rem; color: rgba(255,255,255,.5); }

.badge {
  background: var(--danger);
  color: #fff;
  font-size: 0.7rem;
  padding: 0.1rem 0.45rem;
  border-radius: 10px;
  margin-left: 0.3rem;
  vertical-align: super;
}

/* Layout */
main {
  max-width: 1000px;
  margin: 1.5rem auto;
  padding: 0 1rem;
}

h1 { font-size: 1.4rem; margin-bottom: 1rem; }
h2 { font-size: 1.1rem; margin-bottom: 0.75rem; color: var(--muted); }

/* Cards */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.stat {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}
.stat .number {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
}
.stat .label { font-size: 0.8rem; color: var(--muted); }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.5rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border); }
th { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
tr:hover { background: var(--accent-light); }

/* Status badges */
.status {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-weight: 600;
}
.status-active { background: #d4edda; color: #155724; }
.status-replied { background: #cce5ff; color: #004085; }
.status-completed { background: #e2e3e5; color: #383d41; }
.status-bounced { background: #f8d7da; color: #721c24; }
.status-paused { background: #fff3cd; color: #856404; }
.status-unsubscribed { background: #f8d7da; color: #721c24; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.45rem 1rem;
  border: none;
  border-radius: var(--radius);
  font-size: 0.85rem;
  cursor: pointer;
  font-weight: 500;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #245a8a; text-decoration: none; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #24703e; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #a93226; }
.btn-sm { padding: 0.25rem 0.6rem; font-size: 0.8rem; }

/* Forms */
input[type="text"], input[type="number"], input[type="search"],
select, textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: inherit;
}
textarea { resize: vertical; min-height: 200px; }
label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 0.3rem; }
.form-group { margin-bottom: 1rem; }

/* Flash messages */
.flash {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.flash.success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.flash.error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* Timeline */
.timeline { position: relative; padding-left: 1.5rem; }
.timeline::before {
  content: '';
  position: absolute;
  left: 0.5rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-item {
  position: relative;
  margin-bottom: 1.25rem;
  padding-left: 1rem;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.1rem;
  top: 0.4rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}
.timeline-item.reply::before { background: var(--success); }
.timeline-item .date { font-size: 0.75rem; color: var(--muted); }
.timeline-item .body { font-size: 0.9rem; margin-top: 0.25rem; white-space: pre-wrap; }

/* Utility */
.text-muted { color: var(--muted); }
.text-sm { font-size: 0.85rem; }
.mt-1 { margin-top: 0.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.flex { display: flex; gap: 0.5rem; align-items: center; }
.fade-out { animation: fadeOut 0.5s forwards; }
@keyframes fadeOut { to { opacity: 0; height: 0; padding: 0; overflow: hidden; } }

/* Search bar */
.search-bar { margin-bottom: 1rem; }
.search-bar input { max-width: 400px; }

/* Pagination */
.pagination { display: flex; gap: 0.5rem; justify-content: center; margin-top: 1rem; }
.pagination a, .pagination span {
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
}
.pagination .current { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Login page */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
}
.login-box {
  text-align: center;
  padding: 3rem;
}
.login-box h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.login-box p { color: var(--muted); margin-bottom: 2rem; }
.btn-google {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  cursor: pointer;
  color: var(--fg);
}
.btn-google:hover { background: var(--accent-light); text-decoration: none; }

/* Preview pane */
.preview-pane {
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  min-height: 150px;
}
.preview-pane pre { white-space: pre-wrap; font-size: 0.9rem; }

/* Actions list */
.action-item {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.action-item:last-child { border-bottom: none; }
