/* style.css - shared styles */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&family=Sora:wght@600;700&display=swap');

:root {
  --bg:        #f4f6fb;
  --surface:   #ffffff;
  --border:    #e2e8f0;
  --primary:   #4f6ef7;
  --primary-h: #3a58e0;
  --danger:    #ef4444;
  --success:   #22c55e;
  --text:      #1e293b;
  --muted:     #64748b;
  --radius:    12px;
  --shadow:    0 2px 12px rgba(0,0,0,0.07);
}

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

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

h1, h2, h3 {
  font-family: 'Sora', sans-serif;
}

/* ── Auth Pages ──────────────────────────────── */
.auth-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
}

.auth-card h1 {
  font-size: 1.6rem;
  margin-bottom: 6px;
}

.auth-card p.subtitle {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 28px;
}

/* ── Form Elements ───────────────────────────── */
.form-group {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
}

input, select {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  transition: border 0.2s;
  width: 100%;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
}

/* ── Buttons ─────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: background 0.2s, opacity 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  width: 100%;
}
.btn-primary:hover { background: var(--primary-h); }

.btn-danger {
  background: var(--danger);
  color: #fff;
  font-size: 0.82rem;
  padding: 6px 14px;
}
.btn-danger:hover { opacity: 0.85; }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { background: var(--bg); }

.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── Alerts ──────────────────────────────────── */
.alert {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
  margin-bottom: 16px;
  display: none;
}
.alert-error   { background: #fef2f2; color: #b91c1c; border: 1px solid #fca5a5; }
.alert-success { background: #f0fdf4; color: #15803d; border: 1px solid #86efac; }

/* ── Layout ──────────────────────────────────── */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  font-family: 'Sora', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.9rem;
  color: var(--muted);
}

.navbar-right a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}
.navbar-right a:hover { color: var(--primary); }

.main-content {
  max-width: 900px;
  margin: 36px auto;
  padding: 0 24px;
}

/* ── Cards ───────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  margin-bottom: 24px;
}

.card h2 {
  font-size: 1.15rem;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* ── Tables ──────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

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

td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg); }

/* ── Badges ──────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.76rem;
  font-weight: 600;
}
.badge-green  { background: #dcfce7; color: #15803d; }
.badge-red    { background: #fef2f2; color: #b91c1c; }
.badge-blue   { background: #eff6ff; color: #1d4ed8; }
.badge-gray   { background: #f1f5f9; color: #475569; }

/* ── Page header ─────────────────────────────── */
.page-header {
  margin-bottom: 28px;
}
.page-header h1 { font-size: 1.5rem; }
.page-header p  { color: var(--muted); font-size: 0.9rem; margin-top: 4px; }

/* ── Nav links ───────────────────────────────── */
.nav-links {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.nav-links a {
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--muted);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all 0.15s;
}
.nav-links a:hover, .nav-links a.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ── Empty state ─────────────────────────────── */
.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ── Link ────────────────────────────────────── */
a.link {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.9rem;
}
a.link:hover { text-decoration: underline; }

/* ── Responsive ──────────────────────────────── */
@media (max-width: 600px) {
  .auth-card { padding: 28px 20px; }
  .main-content { margin: 20px auto; }
  .navbar { padding: 0 16px; }
  table { font-size: 0.82rem; }
}