/* ── See My Ads — Main Stylesheet ─────────────────────────────────────── */

:root {
  --bg:         #F4F4F5;
  --teal:       #5BA4A4;
  --teal-dark:  #4a8f8f;
  --slate:      #2F3A47;
  --slate-light:#3d4d5c;
  --orange:     #FF4E1A;
  --white:      #ffffff;
  --text:       #1a1a1a;
  --text-muted: #6b7280;
  --border:     #e5e7eb;
  --radius:     8px;
  --sidebar-w:  240px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

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

/* ── Auth Pages (login, register, etc.) ───────────────────────────────── */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--slate);
  padding: 24px;
}

.auth-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.15);
}

.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo img {
  height: 56px;
  margin-bottom: 12px;
}

.auth-logo h1 {
  font-size: 22px;
  color: var(--slate);
  font-weight: 700;
}

.auth-logo p {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 4px;
}

/* ── Forms ────────────────────────────────────────────────────────────── */

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--slate);
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  color: var(--text);
  background: #fff;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(91,164,164,0.15);
}

.btn {
  display: inline-block;
  padding: 11px 24px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.2s, opacity 0.2s;
  text-align: center;
}

.btn-primary {
  background: var(--teal);
  color: var(--white);
  width: 100%;
}

.btn-primary:hover { background: var(--teal-dark); text-decoration: none; }

.btn-danger {
  background: var(--orange);
  color: var(--white);
}

.btn-danger:hover { opacity: 0.88; text-decoration: none; }

.btn-secondary {
  background: var(--bg);
  color: var(--slate);
  border: 1px solid var(--border);
}

.btn-secondary:hover { background: var(--border); text-decoration: none; }

.auth-links {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-muted);
}

.auth-links a { color: var(--teal); font-weight: 600; }

/* ── Alerts ───────────────────────────────────────────────────────────── */

.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 14px;
}

.alert-error   { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.alert-info    { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

/* ── App Layout (sidebar + main) ──────────────────────────────────────── */

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────────────────────── */

.sidebar {
  width: var(--sidebar-w);
  background: var(--slate);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--slate-light);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo img {
  height: 36px;
}

.sidebar-logo span {
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
  overflow-y: auto;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  color: #a0aec0;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: var(--slate-light);
  color: var(--white);
}

.sidebar-nav a.active {
  border-left: 3px solid var(--teal);
  padding-left: 17px;
}

.sidebar-nav .nav-icon {
  width: 18px;
  text-align: center;
  font-size: 16px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--slate-light);
  font-size: 13px;
  color: #a0aec0;
}

.sidebar-footer .user-name {
  font-weight: 600;
  color: var(--white);
  display: block;
  margin-bottom: 2px;
}

.sidebar-footer a {
  color: #a0aec0;
  font-size: 12px;
}

.sidebar-footer a:hover { color: var(--orange); }

/* ── Main Content ─────────────────────────────────────────────────────── */

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 32px;
  min-height: 100vh;
}

.page-header {
  margin-bottom: 28px;
}

.page-header h2 {
  font-size: 26px;
  font-weight: 700;
  color: var(--slate);
}

.page-header p {
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Stat Cards ───────────────────────────────────────────────────────── */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.stat-card .stat-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 6px;
}

.stat-card .stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--slate);
}

.stat-card .stat-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Cards / Panels ───────────────────────────────────────────────────── */

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  margin-bottom: 24px;
}

.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--slate);
}

.card-body { padding: 24px; }

/* ── Tables ───────────────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th {
  text-align: left;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #f9fafb; }

/* ── Status Badges ────────────────────────────────────────────────────── */

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-active   { background: #dcfce7; color: #15803d; }
.badge-paused   { background: #fef9c3; color: #854d0e; }
.badge-archived { background: #f3f4f6; color: #6b7280; }
.badge-learning { background: #dbeafe; color: #1d4ed8; }
.badge-error    { background: #fef2f2; color: #b91c1c; }

/* ── Needs Attention ──────────────────────────────────────────────────── */

.attention-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.attention-item:last-child { border-bottom: none; }

.attention-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 15px;
}

.attention-icon.error   { background: #fef2f2; color: var(--orange); }
.attention-icon.warning { background: #fef9c3; color: #ca8a04; }
.attention-icon.info    { background: #eff6ff; color: #3b82f6; }

/* ── Slim Footer ──────────────────────────────────────────────────────── */

.slim-footer {
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  padding: 1rem;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

.slim-footer a { color: var(--text-muted); }

/* ── Responsive ───────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; padding: 20px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
