:root {
  --primary: #16a34a;
  --primary-dark: #15803d;
  --secondary: #059669;
  --accent: #10b981;
  --background: #f0fdf4;
  --surface: #ffffff;
  --text: #1f2937;
  --text-light: #6b7280;
  --border: #d1d5db;
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
}

* { box-sizing: border-box; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background-color: var(--background);
  color: var(--text);
  margin: 0;
  min-height: 100vh;
}

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

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* ---------- Landing / Auth ---------- */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, var(--background), #dcfce7);
}
.auth-card {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  padding: 40px;
  width: 100%;
  max-width: 420px;
}
.auth-card h1 { font-size: 1.5rem; margin-bottom: 4px; color: var(--primary-dark); }
.auth-card p.subtitle { color: var(--text-light); margin-top: 0; margin-bottom: 24px; }

.landing-hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  background: linear-gradient(135deg, var(--background), #dcfce7);
}
.landing-hero h1 { font-size: 2.4rem; color: var(--primary-dark); margin-bottom: 12px; }
.landing-hero p { color: var(--text-light); font-size: 1.1rem; max-width: 560px; margin-bottom: 28px; }
.landing-buttons { display: flex; gap: 14px; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 16px; }
label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  background: var(--surface);
  color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  text-align: center;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); text-decoration: none; }
.btn-outline { background: transparent; color: var(--primary-dark); border: 1px solid var(--primary); }
.btn-outline:hover { background: var(--background); text-decoration: none; }
.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ---------- Layout ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  flex-shrink: 0;
}
.sidebar .brand { padding: 0 24px 20px; font-weight: 700; color: var(--primary-dark); font-size: 1.1rem; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 24px;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 500;
}
.sidebar nav a:hover { background: var(--background); text-decoration: none; }
.sidebar nav a.active { background: var(--background); color: var(--primary-dark); border-right: 3px solid var(--primary); }
.sidebar .user-box { padding: 16px 24px; border-top: 1px solid var(--border); margin-top: 16px; font-size: 0.85rem; color: var(--text-light); }

.main-content { flex: 1; padding: 28px 32px; max-width: 1200px; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 10px; }
.page-header h1 { margin: 0; font-size: 1.5rem; }
.page-header p { margin: 4px 0 0; color: var(--text-light); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; }
.stat-card .label { color: var(--text-light); font-size: 0.85rem; margin-bottom: 6px; }
.stat-card .value { font-size: 1.6rem; font-weight: 700; color: var(--primary-dark); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 800px) { .grid-2 { grid-template-columns: 1fr; } .app-shell { flex-direction: column; } .sidebar { width: 100%; } .main-content { padding: 20px; } }

/* ---------- Table ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
th { color: var(--text-light); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; }
tr:last-child td { border-bottom: none; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; }
.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-error { background: #fee2e2; color: #b91c1c; }
.badge-default { background: #e5e7eb; color: #374151; }

/* ---------- Alerts ---------- */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 0.9rem; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

.empty-state { text-align: center; padding: 40px 20px; color: var(--text-light); }
.text-muted { color: var(--text-light); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.flex { display: flex; }
.gap-8 { gap: 8px; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
