:root { font-family: Arial, sans-serif; color: #172033; background: #f5f7fb; }
body { margin: 0; padding: 24px; }
.topbar { display:flex; justify-content:space-between; align-items:center; gap:16px; margin-bottom:22px; }
h1 { margin:0; font-size:28px; }
p { margin:6px 0 0; color:#667085; }
button { background:#172033; color:white; border:0; border-radius:10px; padding:10px 14px; cursor:pointer; }
.cards { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin-bottom:18px; }
.card { background:white; border-radius:18px; padding:18px; box-shadow:0 8px 22px rgba(16,24,40,.08); }
.card span { display:block; color:#667085; font-size:14px; margin-bottom:8px; }
.card strong { font-size:20px; }
.tabs { display:flex; gap:8px; margin:20px 0; }
.tabs a { padding:10px 14px; border-radius:999px; background:white; text-decoration:none; color:#172033; }
.tabs .active { background:#172033; color:white; }
.tabs .disabled { opacity:.45; cursor:not-allowed; }
table { width:100%; border-collapse:collapse; background:white; border-radius:18px; overflow:hidden; box-shadow:0 8px 22px rgba(16,24,40,.08); }
th, td { padding:14px 12px; text-align:right; border-bottom:1px solid #edf0f5; }
th:first-child, td:first-child { text-align:left; }
thead th { background:#eef2f7; }
.total { font-weight:700; }
footer { margin-top:20px; color:#667085; }
code { background:#eef2f7; padding:3px 6px; border-radius:6px; }
.login-body { min-height:100vh; display:grid; place-items:center; padding:0; }
.login-card { width: min(380px, calc(100vw - 40px)); background:white; padding:28px; border-radius:22px; box-shadow:0 10px 30px rgba(16,24,40,.12); }
.login-card form { display:grid; gap:10px; margin-top:20px; }
.login-card input { padding:12px; border:1px solid #d0d5dd; border-radius:10px; }
.error { background:#fee4e2; color:#912018; padding:10px; border-radius:10px; margin-top:14px; }
@media (max-width: 780px) { .cards { grid-template-columns:1fr; } body { padding:14px; } table { font-size:13px; } th, td { padding:10px 8px; } }

.notice {
  background: #eef6ff;
  border: 1px solid #b9d7ff;
  padding: 12px 14px;
  border-radius: 12px;
  margin: 12px 0 18px 0;
}
.admin-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  align-items: end;
  margin: 12px 0 24px 0;
  padding: 16px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 1px 6px rgba(0,0,0,.08);
}
.admin-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
}
.admin-form input,
.admin-form select {
  padding: 9px 10px;
  border: 1px solid #cfd7e3;
  border-radius: 8px;
}
.admin-form button {
  padding: 10px 14px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
}
.total {
  font-size: 1.35rem;
  font-weight: 800;
}

.api-key-box {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin: 12px 0 24px 0;
  box-shadow: 0 1px 6px rgba(0,0,0,.08);
}
.api-key-box code {
  font-size: 1rem;
}
.compact-form {
  display: block;
}
.hint {
  color: #667085;
  font-size: .9rem;
  margin-top: 8px;
}

.success-message {
  background: #e8fff0;
  border: 1px solid #9ee6b5;
  color: #155724;
  padding: 12px 14px;
  border-radius: 12px;
  margin: 12px 0 18px 0;
  font-weight: 700;
}
.api-key-box {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin: 12px 0 24px 0;
  box-shadow: 0 1px 6px rgba(0,0,0,.08);
}
.api-key-box code {
  font-size: 1rem;
}
.compact-form {
  display: block;
}


.api-key-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 8px 0 16px 0;
  overflow-x: auto;
}
.api-key-row input {
  flex: 1;
  font-family: monospace;
  padding: 10px;
  border: 1px solid #cfd7e3;
  border-radius: 8px;
}
.api-key-row button {
  padding: 10px 14px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
}

.user-admin {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin: 12px 0 24px 0;
  box-shadow: 0 1px 6px rgba(0,0,0,.08);
}
.inline-user-form {
  display: contents;
}
.inline-user-form select,
.inline-user-form input {
  padding: 7px 8px;
  border: 1px solid #cfd7e3;
  border-radius: 8px;
}
.inline-delete-form {
  display: inline-block;
  margin-left: 6px;
}
.user-actions {
  min-width: 280px;
}
.user-actions input {
  max-width: 160px;
}
button.danger {
  background: #dc3545;
  color: white;
}
.api-key-row input {
  min-width: min(100%, 900px);
}
