:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #111827;
  --accent-text: #ffffff;
  --error: #b91c1c;
  --error-bg: #fef2f2;
}

* { box-sizing: border-box; }

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

body.center {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page { width: 100%; max-width: 420px; padding: 24px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 32px;
}

.brand { font-size: 20px; font-weight: 700; margin: 0 0 24px; text-align: center; }
h1 { font-size: 18px; margin: 0 0 20px; }

label { display: block; font-size: 13px; color: var(--muted); margin: 16px 0 6px; }

input, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
}

button {
  padding: 9px 14px;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

button.full { width: 100%; margin-top: 24px; padding: 11px; }
button:disabled { opacity: 0.6; cursor: not-allowed; }
button.secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }
button.danger { background: var(--error); }

.error {
  margin-top: 16px; padding: 10px 12px; border-radius: 6px;
  background: var(--error-bg); color: var(--error); font-size: 13px; display: none;
}

.otp-input { letter-spacing: 6px; font-size: 20px; text-align: center; }

/* Admin shell layout */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; background: #111827; color: #fff; padding: 24px 16px; flex-shrink: 0;
}
.sidebar .brand { color: #fff; text-align: left; }
.sidebar nav a {
  display: block; padding: 10px 12px; border-radius: 6px; color: #d1d5db;
  text-decoration: none; font-size: 14px; margin-bottom: 4px;
}
.sidebar nav a:hover, .sidebar nav a.active { background: rgba(255,255,255,0.1); color: #fff; }
.main { flex: 1; padding: 32px; max-width: 1100px; }

table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 8px; overflow: hidden; }
th, td { padding: 10px 12px; text-align: left; font-size: 13px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; background: #f9fafb; }
tr:last-child td { border-bottom: none; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: #f9fafb; }

.toolbar { display: flex; gap: 12px; margin-bottom: 16px; align-items: center; flex-wrap: wrap; }
.toolbar input, .toolbar select { width: auto; }

.status-badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; background: #f3f4f6;
}
.status-active { background: #dcfce7; color: #166534; }
.status-suspended { background: #fef9c3; color: #854d0e; }
.status-blocked { background: #fee2e2; color: #991b1b; }
.status-deactivated { background: #e5e7eb; color: #374151; }
.status-deleted { background: #f3f4f6; color: #6b7280; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 16px; }
.stat-card .value { font-size: 24px; font-weight: 700; }
.stat-card .label { font-size: 12px; color: var(--muted); margin-top: 4px; }

.action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-top: 16px; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: none;
  align-items: center; justify-content: center; z-index: 10;
}
.modal-backdrop.open { display: flex; }
.modal { background: var(--card); border-radius: 10px; padding: 24px; width: 360px; }

.pagination { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

.hint { font-size: 13px; color: var(--muted); }
