:root {
  --ink: #1c2230;
  --ink-soft: #5b6472;
  --line: #e3e7ee;
  --bg: #f6f7fb;
  --panel: #ffffff;
  --accent: #2f5d50;
  --accent-soft: #e8f0ec;
  --danger: #b3413a;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 14px 28px;
}

.brand {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.brand span { color: var(--accent); }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  color: var(--ink-soft);
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px;
}

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

.page-head h1 {
  font-size: 22px;
  margin: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn:hover { background: #244a40; text-decoration: none; color: #fff; }

.btn-secondary {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-secondary:hover { background: var(--accent-soft); color: var(--ink); }

.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #8f3530; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}

.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.search-bar input[type="text"] {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 14px;
}

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

th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

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

tr:last-child td { border-bottom: none; }

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

.badge-active { background: var(--accent-soft); color: var(--accent); }
.badge-inactive { background: #f1e6e5; color: var(--danger); }

.row-actions a { margin-right: 12px; font-size: 13px; }

.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--ink-soft);
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-grid .full { grid-column: 1 / -1; }

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ink-soft);
}

input[type="text"], input[type="email"], input[type="tel"], input[type="password"], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
}

textarea { resize: vertical; min-height: 80px; }

.form-actions {
  margin-top: 22px;
  display: flex;
  gap: 10px;
}

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

.alert-success { background: var(--accent-soft); color: var(--accent); }
.alert-error { background: #f1e6e5; color: var(--danger); }

/* Login page */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 32px;
}

.login-card h1 {
  font-size: 19px;
  margin: 0 0 4px;
}

.login-card p {
  color: var(--ink-soft);
  font-size: 13px;
  margin: 0 0 22px;
}

.login-card label { margin-top: 14px; }
.login-card .btn { width: 100%; justify-content: center; margin-top: 20px; }

@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
  .container { padding: 16px; }
}
