:root {
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  color-scheme: dark;
  background: #07111f;
  color: #e8eef7;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #07111f;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(
      circle at top right,
      rgba(52, 121, 246, 0.15),
      transparent 34rem
    ),
    #07111f;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.topbar,
.credential-panel,
.dashboard-card {
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(15, 29, 48, 0.86);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.18);
}

.topbar {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 28px;
  border-radius: 20px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1;
}

h2 {
  margin-bottom: 8px;
}

h3 {
  margin-bottom: 8px;
  color: #dbeafe;
}

.eyebrow {
  margin-bottom: 8px;
  color: #7dd3fc;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.subtitle,
.credential-panel p,
.empty-state p,
.footer {
  color: #9fb0c5;
}

.connection-state,
.surface-state {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.75);
  color: #cbd5e1;
  font-size: 0.8rem;
  white-space: nowrap;
}

.connection-state[data-state="connected"] {
  border-color: rgba(34, 197, 94, 0.35);
  color: #86efac;
}

.credential-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(320px, 1.2fr);
  gap: 28px;
  margin-top: 20px;
  padding: 24px;
  border-radius: 18px;
}

.credential-form {
  display: grid;
  gap: 10px;
}

.credential-form label {
  color: #cbd5e1;
  font-size: 0.85rem;
  font-weight: 600;
}

.date-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.date-control {
  display: grid;
  gap: 6px;
}

.date-control input {
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #334155;
  border-radius: 10px;
  outline: none;
  color-scheme: dark;
  background: #081321;
  color: #f8fafc;
}

.date-control input:focus {
  border-color: #38bdf8;
}

.credential-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 10px;
}

.credential-controls input {
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #334155;
  border-radius: 10px;
  outline: none;
  background: #081321;
  color: #f8fafc;
}

.credential-controls input:focus {
  border-color: #38bdf8;
}

.credential-controls button {
  padding: 10px 15px;
  border: 1px solid #2563eb;
  border-radius: 10px;
  background: #2563eb;
  color: white;
  font-weight: 650;
}

.credential-controls button.secondary {
  border-color: #334155;
  background: #132238;
}

.credential-controls button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.form-message {
  min-height: 1.4em;
  margin-bottom: 0;
  font-size: 0.82rem;
}

.surface-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 20px 0;
  padding: 4px;
}

.surface-nav a {
  padding: 9px 13px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 999px;
  background: rgba(15, 29, 48, 0.8);
  color: #cbd5e1;
  text-decoration: none;
  white-space: nowrap;
}

.surface-nav a:hover {
  border-color: #38bdf8;
  color: #f8fafc;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.dashboard-card {
  min-height: 270px;
  padding: 22px;
  border-radius: 18px;
}

.card-heading {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  justify-content: space-between;
}

.api-key-create-form {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 14px;
  background: rgba(8, 19, 33, 0.74);
}

.api-key-create-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.api-key-create-field {
  display: grid;
  gap: 6px;
}

.api-key-create-field label {
  color: #cbd5e1;
  font-size: 0.84rem;
  font-weight: 650;
}

.api-key-create-field input {
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #334155;
  border-radius: 10px;
  outline: none;
  background: #081321;
  color: #f8fafc;
}

.api-key-create-field input:focus {
  border-color: #38bdf8;
}

.api-key-create-form > button {
  justify-self: start;
  padding: 10px 15px;
  border: 1px solid #2563eb;
  border-radius: 10px;
  background: #2563eb;
  color: white;
  font-weight: 650;
}

.api-key-create-form > button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.api-key-created-secret-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid rgba(56, 189, 248, 0.5);
  border-radius: 14px;
  background: rgba(8, 47, 73, 0.58);
}

.api-key-created-secret-panel[hidden] {
  display: none;
}

.api-key-created-secret-panel h3,
.api-key-created-secret-panel p {
  margin: 0;
}

.api-key-created-secret-panel code {
  display: block;
  overflow-wrap: anywhere;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 10px;
  background: #06101c;
  color: #e0f2fe;
  user-select: all;
}

.api-key-created-secret-panel button {
  justify-self: start;
  padding: 9px 13px;
  border: 1px solid #334155;
  border-radius: 9px;
  background: #132238;
  color: #f8fafc;
  font-weight: 650;
}

.api-key-revoke-form {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.api-key-revoke-button {
  padding: 8px 12px;
  border: 1px solid #ef4444;
  border-radius: 9px;
  background: transparent;
  color: #fca5a5;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.api-key-revoke-button:hover:not(:disabled) {
  background: rgb(239 68 68 / 12%);
  color: #fecaca;
}

.api-key-revoke-button:focus-visible {
  outline: 2px solid #f87171;
  outline-offset: 2px;
}

.api-key-revoke-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.api-key-list {
  display: grid;
  gap: 12px;
}

.api-key-item {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 14px;
  background: rgba(8, 19, 33, 0.74);
}

.api-key-item-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.api-key-item-heading h3,
.api-key-meta {
  margin: 0;
}

.api-key-status {
  padding: 4px 8px;
  border: 1px solid #334155;
  border-radius: 999px;
  color: #cbd5e1;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
}

.api-key-meta {
  color: #94a3b8;
  font-size: 0.82rem;
}

.project-create-form {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.project-create-form label {
  color: #cbd5e1;
  font-size: 0.84rem;
  font-weight: 650;
}

.project-create-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.project-create-controls input {
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #334155;
  border-radius: 10px;
  outline: none;
  background: #081321;
  color: #f8fafc;
}

.project-create-controls input:focus {
  border-color: #38bdf8;
}

.project-create-controls button {
  padding: 10px 15px;
  border: 1px solid #2563eb;
  border-radius: 10px;
  background: #2563eb;
  color: white;
  font-weight: 650;
}

.project-create-controls button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.project-update-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.project-update-name {
  width: 100%;
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid #334155;
  border-radius: 9px;
  outline: none;
  background: #081321;
  color: #f8fafc;
}

.project-update-name:focus {
  border-color: #38bdf8;
}

.project-update-button {
  padding: 9px 13px;
  border: 1px solid #2563eb;
  border-radius: 9px;
  background: #2563eb;
  color: white;
  font-weight: 650;
}

.project-update-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.project-archive-form {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.project-archive-button {
  padding: 9px 13px;
  border: 1px solid #dc2626;
  border-radius: 9px;
  background: #991b1b;
  color: #fff;
  font-weight: 650;
}

.project-archive-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.project-list {
  display: grid;
  gap: 12px;
}

.project-item {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 14px;
  background: rgba(8, 19, 33, 0.74);
}

.project-item-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.project-item-heading h3,
.project-meta {
  margin: 0;
}

.project-status {
  padding: 4px 8px;
  border: 1px solid #334155;
  border-radius: 999px;
  color: #cbd5e1;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
}

.project-meta {
  color: #94a3b8;
  font-size: 0.82rem;
}

.empty-state {
  display: grid;
  place-content: center;
  min-height: 160px;
  margin-top: 18px;
  padding: 24px;
  border: 1px dashed rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  text-align: center;
}

.footer {
  padding: 24px 4px 0;
  text-align: center;
  font-size: 0.8rem;
}

@media (max-width: 820px) {
  .topbar {
    display: grid;
  }

  .credential-panel {
    grid-template-columns: 1fr;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 10px;
  }

  .topbar,
  .credential-panel,
  .dashboard-card {
    padding: 18px;
  }

  .credential-controls,
  .project-create-controls,
  .project-update-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .api-key-create-fields {
    grid-template-columns: 1fr;
  }

  .api-key-create-form > button {
    width: 100%;
  }
}
