/* ZhanWangTech Central Auth — clean Sellfox-style admin UI
   Phase 4 v1
*/
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-muted: #475569;
  --text-faint: #94a3b8;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-light: #eff6ff;
  --success: #059669;
  --success-light: #d1fae5;
  --warn: #d97706;
  --warn-light: #fef3c7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.10);
  --radius: 8px;
  --radius-lg: 12px;
}

html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}

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

/* ---- App bar (top) ---- */
.zw-bar {
  background: #0f172a;
  color: #fff;
  height: 52px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
  position: sticky; top: 0; z-index: 100;
}
.zw-bar-brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: #fff; font-weight: 700; font-size: 15px;
}
.zw-bar-brand:hover { color: #fff; text-decoration: none; opacity: 0.9; }
.zw-bar-icon {
  width: 30px; height: 30px;
  background: var(--accent); border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
}
.zw-bar-spacer { flex: 1; }
.zw-bar-meta {
  font-size: 12px; color: rgba(255,255,255,0.7);
  display: inline-flex; align-items: center; gap: 14px;
}
.zw-bar-meta a { color: rgba(255,255,255,0.85); }
.zw-bar-meta a:hover { color: #fff; }
.zw-bar-divider { width: 1px; height: 20px; background: rgba(255,255,255,0.18); }
.zw-bar-pill {
  background: rgba(255,255,255,0.1);
  padding: 4px 10px; border-radius: 12px;
  font-size: 11px; letter-spacing: 0.4px;
}

/* ---- Card-form (login/apply/invitation) ---- */
.card-shell {
  min-height: calc(100vh - 52px);
  display: flex; align-items: center; justify-content: center;
  padding: 40px 16px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  width: 100%; max-width: 460px;
  padding: 40px 36px;
}
.card-wide { max-width: 620px; }
.card h1 {
  font-size: 22px; font-weight: 700; margin-bottom: 6px;
  color: var(--text);
}
.card .subtitle { color: var(--text-muted); margin-bottom: 24px; }

/* ---- Form controls ---- */
.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: 12.5px; font-weight: 600;
  margin-bottom: 6px; color: var(--text-muted);
  letter-spacing: 0.2px; text-transform: uppercase;
}
.field input, .field textarea, .field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.field .hint { font-size: 12px; color: var(--text-faint); margin-top: 4px; }
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr; gap: 12px;
}
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr); gap: 8px;
  background: var(--bg);
  padding: 10px; border-radius: 6px;
  border: 1px solid var(--border);
}
.checkbox-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 4px;
  cursor: pointer;
}
.checkbox-row:hover { background: rgba(37,99,235,0.06); }
.checkbox-row input[type="checkbox"] { width: 14px; height: 14px; cursor: pointer; }
.checkbox-row span { font-size: 13px; color: var(--text); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  font-size: 14px; font-weight: 600;
  border: 0; border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, transform 0.05s;
  font-family: inherit;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent); color: #fff;
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:disabled {
  background: var(--text-faint); cursor: not-allowed;
}
.btn-secondary {
  background: #fff; color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover { background: var(--bg); }
.btn-danger {
  background: #fff; color: var(--danger);
  border: 1px solid var(--danger);
}
.btn-danger:hover { background: var(--danger-light); }
.btn-sm { padding: 5px 11px; font-size: 12.5px; }
.btn-block { width: 100%; }

/* ---- Alerts ---- */
.alert {
  padding: 10px 14px;
  border-radius: 6px; font-size: 13px;
  margin-bottom: 14px;
  display: none;
}
.alert.show { display: block; }
.alert-success { background: var(--success-light); color: #065f46; }
.alert-error   { background: var(--danger-light);  color: #991b1b; }
.alert-info    { background: var(--accent-light);  color: #1e3a8a; }
.alert-warn    { background: var(--warn-light);    color: #92400e; }

/* ---- Admin layout ---- */
.admin-shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}
.admin-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px;
}
.admin-header h1 {
  font-size: 22px; font-weight: 700; color: var(--text);
}
.admin-header .badge { font-size: 11px; padding: 3px 9px; border-radius: 10px; }
.badge {
  display: inline-block; font-size: 11px; padding: 3px 9px; border-radius: 10px;
  letter-spacing: 0.4px; font-weight: 600; text-transform: uppercase;
}
.badge-green { background: var(--success-light); color: #065f46; }
.badge-blue  { background: var(--accent-light);  color: #1d4ed8; }
.badge-amber { background: var(--warn-light);    color: #92400e; }
.badge-red   { background: var(--danger-light);  color: #991b1b; }
.badge-gray  { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }

.tabs {
  display: flex; gap: 6px; border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}
.tab {
  padding: 10px 16px; font-size: 13px; font-weight: 600;
  color: var(--text-muted); cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: none; border: 0; border-bottom: 2px solid transparent;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab .count {
  font-size: 11px; background: var(--bg); padding: 1px 7px;
  border-radius: 10px; margin-left: 4px;
  border: 1px solid var(--border);
}

.section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.section-head {
  display: flex; align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: #fcfdff;
}
.section-head h2 {
  font-size: 14px; font-weight: 700; color: var(--text);
  letter-spacing: 0.2px; text-transform: uppercase;
}
.section-head .spacer { flex: 1; }
.section-body { padding: 0; }

table.table {
  width: 100%; border-collapse: collapse;
}
table.table th, table.table td {
  text-align: left; padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  vertical-align: middle;
}
table.table th {
  background: #fcfdff; color: var(--text-muted);
  font-weight: 600; font-size: 11.5px;
  letter-spacing: 0.3px; text-transform: uppercase;
}
table.table tr:last-child td { border-bottom: 0; }
table.table tr:hover td { background: #fcfdff; }
table.table .col-actions { text-align: right; white-space: nowrap; }
table.table .mono { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; }
table.table .truncate { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }
.empty {
  text-align: center; padding: 40px 16px;
  color: var(--text-faint); font-size: 13px;
}

/* Modal-ish dialog (simple) */
.dialog-bg {
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.5);
  display: none;
  align-items: center; justify-content: center;
  z-index: 1000;
}
.dialog-bg.show { display: flex; }
.dialog {
  background: #fff; border-radius: var(--radius-lg);
  width: 100%; max-width: 480px;
  padding: 28px;
  box-shadow: var(--shadow-lg);
}
.dialog h3 { font-size: 17px; margin-bottom: 6px; }
.dialog .actions {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 18px;
}

/* Footer */
.zw-footer {
  text-align: center; color: var(--text-faint);
  font-size: 12px; padding: 24px;
}

/* Utilities */
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.right { text-align: right; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.spacer { flex: 1; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 8px; }
.mt-2 { margin-top: 8px; }
.text-sm { font-size: 12.5px; }
.copy-btn {
  background: none; border: 0; color: var(--accent);
  cursor: pointer; font-size: 12px; font-weight: 600;
  padding: 2px 8px; border-radius: 4px;
}
.copy-btn:hover { background: var(--accent-light); }

@media (max-width: 720px) {
  .admin-shell { padding: 14px; }
  .field-row { grid-template-columns: 1fr; }
  table.table th, table.table td { padding: 8px 10px; font-size: 12.5px; }
  .card { padding: 28px 22px; }
  .zw-bar-meta .hide-mobile { display: none; }
}
