/* RideHub Platform Super-admin — utilitarian, polished */

:root {
  --bg:        #ffffff;
  --surface:   #fafafa;
  --surface-2: #f5f5f7;
  --border:    #ececef;
  --border-strong: #d4d4d8;

  --text:      #18181b;
  --text-soft: #3f3f46;
  --muted:     #71717a;
  --muted-soft:#a1a1aa;

  --link:      #1e40af;
  --link-hover:#1e3a8a;

  --pending:    #b45309;
  --pending-bg: #fef3c7;
  --active:     #047857;
  --active-bg:  #d1fae5;
  --declined:   #b91c1c;
  --declined-bg:#fee2e2;
  --suspended:  #52525b;
  --suspended-bg:#e4e4e7;

  --radius:    4px;
  --shadow:    0 1px 2px rgba(0,0,0,0.03);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

button { font-family: inherit; }

:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 1px;
  border-radius: 3px;
}

/* ============ Topbar ============ */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 76rem;
  margin: 0 auto;
  padding: 0.55rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text);
  letter-spacing: -0.005em;
}
.brand:hover { text-decoration: none; }
.brand-mark { display: none; }
.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.83rem;
}
.topbar-right a {
  color: var(--text-soft);
  font-size: 0.83rem;
}
.topbar-right a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.logout-btn {
  font-size: 0.82rem;
  padding: 0.28rem 0.65rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  cursor: pointer;
  line-height: 1.3;
}
.logout-btn:hover { background: var(--surface-2); }

/* ============ Layout ============ */
main.container {
  max-width: 76rem;
  margin: 0 auto;
  padding: 1.5rem;
}

/* ============ Page head ============ */
.page-head {
  margin-bottom: 1rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.page-head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.page-head p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.page-head p strong { color: var(--text); font-weight: 500; }

/* ============ Filter tabs ============ */
.filter-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}
.filter-tabs a {
  padding: 0.45rem 0.85rem;
  color: var(--muted);
  font-size: 0.83rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.filter-tabs a:hover {
  color: var(--text);
  text-decoration: none;
}
.filter-tabs a.active {
  color: var(--text);
  border-bottom-color: var(--text);
  font-weight: 500;
}
.filter-tabs .count {
  display: inline-block;
  margin-left: 0.3rem;
  font-size: 0.75rem;
  color: var(--muted-soft);
  font-variant-numeric: tabular-nums;
}
.filter-tabs a.active .count { color: var(--muted); }

/* ============ Status badges ============ */
.status-badge {
  display: inline-block;
  padding: 0.08rem 0.4rem;
  border-radius: 3px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  vertical-align: middle;
}
.status-badge.pending   { color: var(--pending);   background: var(--pending-bg); }
.status-badge.active    { color: var(--active);    background: var(--active-bg); }
.status-badge.declined  { color: var(--declined);  background: var(--declined-bg); }
.status-badge.suspended { color: var(--suspended); background: var(--suspended-bg); }

/* ============ Tables ============ */
.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
}
.business-table,
.table-wrap table {
  width: 100%;
  border-collapse: collapse;
}
.business-table th,
.business-table td,
.table-wrap th,
.table-wrap td {
  padding: 0.5rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  vertical-align: middle;
}
.business-table thead th,
.table-wrap thead th {
  background: var(--surface);
  font-weight: 500;
  font-size: 0.74rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.45rem 0.85rem;
}
.business-table tbody tr:last-child td,
.table-wrap tbody tr:last-child td { border-bottom: none; }
.business-table tbody tr:hover { background: var(--surface); }

.business-table td.muted,
.business-table td .muted { color: var(--muted); }
.business-table td:nth-child(4) { font-variant-numeric: tabular-nums; }

.business-table .actions {
  white-space: nowrap;
  text-align: right;
  padding: 0.35rem 0.85rem;
}
.business-table .actions form { display: inline; margin: 0; }
.business-table .actions button + button { margin-left: 0.3rem; }

.empty-state {
  text-align: center !important;
  padding: 1.2rem !important;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ============ Buttons ============ */
.btn-approve, .btn-decline {
  font-size: 0.78rem;
  padding: 0.22rem 0.65rem;
  border: 1px solid;
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--bg);
  line-height: 1.35;
  transition: background 0.1s, color 0.1s;
}
.btn-approve { color: var(--active); border-color: var(--active); }
.btn-approve:hover { background: var(--active); color: var(--bg); }
.btn-decline { color: var(--declined); border-color: var(--declined); }
.btn-decline:hover { background: var(--declined); color: var(--bg); }

/* ============ Login ============ */
.login-card {
  max-width: 22rem;
  margin: 5rem auto;
  padding: 1.5rem 1.5rem 1.25rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: var(--shadow);
}
.login-card header {
  margin-bottom: 1.1rem;
  font-size: 0.95rem;
  font-weight: 600;
}
.login-card header strong { display: inline; }
.login-card header small {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--muted);
}
.login-error {
  padding: 0.45rem 0.65rem;
  margin: 0 0 0.85rem 0;
  font-size: 0.82rem;
  color: var(--declined);
  background: var(--declined-bg);
  border-radius: 3px;
}
.login-card label {
  display: block;
  margin-bottom: 0.7rem;
  font-size: 0.82rem;
  color: var(--text);
}
.login-card input,
.profile-form input {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.42rem 0.6rem;
  font: inherit;
  font-size: 0.88rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 3px;
}
.login-card input:focus,
.profile-form input:focus {
  outline: none;
  border-color: var(--link);
  box-shadow: 0 0 0 2px rgba(30, 64, 175, 0.12);
}
.login-card button[type=submit] {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--bg);
  background: var(--text);
  border: none;
  border-radius: 3px;
  cursor: pointer;
}
.login-card button[type=submit]:hover { background: var(--text-soft); }

/* ============ Detail page ============ */
.detail-back {
  display: inline-block;
  margin-bottom: 0.85rem;
  font-size: 0.82rem;
}
.detail-page .table-wrap th {
  width: 11rem;
  font-weight: 500;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.5rem 0.85rem;
}
.detail-page .table-wrap td {
  font-size: 0.88rem;
  color: var(--text);
}
.detail-actions {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.detail-actions::before {
  content: "Actions";
  display: block;
  margin-bottom: 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.detail-actions .actions-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.detail-actions form { margin: 0; }
.detail-actions button {
  padding: 0.35rem 0.95rem;
  font-size: 0.85rem;
}
.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
}
.btn-link {
  font: inherit;
  font-size: 0.82rem;
  padding: 0;
  margin: 0;
  background: none;
  border: none;
  color: var(--link);
  cursor: pointer;
  text-decoration: underline;
}
.btn-link:hover { color: var(--link-hover); }

/* ============ Audit section ============ */
.audit-section {
  margin-top: 1.75rem;
}
.audit-section h3 {
  margin: 0 0 0.55rem 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.audit-table td:nth-child(1) {
  width: 11rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 0.8rem;
}
.audit-table td:nth-child(2) {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.8rem;
  color: var(--text-soft);
}
.audit-table td:nth-child(3) {
  font-size: 0.8rem;
  color: var(--muted);
}

/* ============ Profile ============ */
main.container:has(.profile-page) {
  max-width: 36rem;
}
.profile-section {
  margin-top: 1.5rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
}
.profile-section:first-of-type {
  margin-top: 0.85rem;
  padding-top: 0;
  border-top: none;
}
.profile-section h3 {
  margin: 0 0 0.55rem 0;
  font-size: 0.88rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.profile-section .small { font-size: 0.78rem; }
.profile-form {
  max-width: 22rem;
  margin: 0.6rem 0 0.4rem;
}
.profile-form label {
  display: block;
  margin-bottom: 0.65rem;
  font-size: 0.82rem;
  color: var(--text);
}
.profile-form button[type=submit] {
  margin-top: 0.4rem;
  padding: 0.42rem 0.95rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--bg);
  background: var(--text);
  border: none;
  border-radius: 3px;
  cursor: pointer;
}
.profile-form button[type=submit]:hover { background: var(--text-soft); }
.profile-section form { margin: 0; }
.profile-section form button.btn-decline {
  padding: 0.32rem 0.85rem;
  font-size: 0.83rem;
}
.notice {
  padding: 0.45rem 0.7rem;
  background: var(--active-bg);
  color: var(--active);
  border-radius: 3px;
  font-size: 0.82rem;
  margin-bottom: 0.85rem;
}

/* ============ Responsive ============ */
@media (max-width: 720px) {
  main.container { padding: 1rem; }
  .topbar-inner { padding: 0.5rem 1rem; }
  .business-table thead { display: none; }
  .business-table, .business-table tbody, .business-table tr, .business-table td { display: block; width: 100%; }
  .business-table tr { padding: 0.85rem 1rem; border-bottom: 1px solid var(--border); }
  .business-table tbody td { padding: 0.2rem 0; border: none; font-size: 0.88rem; }
  .business-table .actions { padding: 0.5rem 0 0; text-align: left; }
  .login-card { margin: 2rem 1rem; padding: 1.25rem; }
}
