:root {
  --emerald: #047857;
  --emerald-dark: #065f46;
  --emerald-light: #d1fae5;
  --bg: #f8faf9;
  --border: #e5e7eb;
  --text: #1f2937;
  --text-muted: #6b7280;
  --danger: #dc2626;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', Roboto, -apple-system, sans-serif;
  margin: 0;
}

.admin-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background: #fff;
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  flex-shrink: 0;
}

.sidebar .brand {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--emerald-dark);
  margin-bottom: 28px;
  padding: 0 8px;
}

.sidebar a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.94rem;
  margin-bottom: 4px;
}

.sidebar a:hover { background: var(--emerald-light); }
.sidebar a.active { background: var(--emerald); color: #fff; font-weight: 600; }

.main-content { flex: 1; padding: 28px 32px; max-width: 1100px; }

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header h1 { font-size: 1.4rem; margin: 0; }

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  padding: 22px;
  margin-bottom: 20px;
}

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.btn-primary { background: var(--emerald); color: #fff; }
.btn-primary:hover { background: var(--emerald-dark); }
.btn-outline { background: #fff; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--emerald); color: var(--emerald-dark); }
.btn-danger { background: #fff; border: 1px solid var(--danger); color: var(--danger); }
.btn-danger:hover { background: #fef2f2; }
.btn-sm { padding: 6px 12px; font-size: 0.82rem; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
th { color: var(--text-muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; }
tr:hover td { background: #fafafa; }

.badge { padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.badge-active { background: var(--emerald-light); color: var(--emerald-dark); }
.badge-inactive { background: #f3f4f6; color: var(--text-muted); }

.form-group { margin-bottom: 16px; }
label { display: block; font-size: 0.88rem; font-weight: 600; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=number],
textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.92rem;
  font-family: inherit;
}
textarea { resize: vertical; min-height: 90px; }
.hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-size: 0.9rem; }
.alert-success { background: var(--emerald-light); color: var(--emerald-dark); }
.alert-danger { background: #fef2f2; color: var(--danger); }

.field-row {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
  background: #fcfcfc;
}
.field-row-grid {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 1fr 0.7fr auto;
  gap: 10px;
  align-items: end;
}

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.login-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 36px;
  width: 100%;
  max-width: 380px;
}
.login-card h1 { font-size: 1.3rem; color: var(--emerald-dark); margin-top: 0; }

@media (max-width: 768px) {
  .admin-shell { flex-direction: column; }
  .sidebar { width: 100%; display: flex; overflow-x: auto; padding: 12px; }
  .sidebar .brand { display: none; }
  .sidebar a { white-space: nowrap; margin-right: 6px; margin-bottom: 0; }
  .main-content { padding: 18px; }
  .field-row-grid { grid-template-columns: 1fr; }
}
