:root {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #111926;
  background-color: #f4f5f7;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background: #f4f5f7;
}

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.subtitle {
  color: #6c757d;
  margin: 0.25rem 0 0;
}

.card {
  background: #fff;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 15px 35px rgba(30, 42, 50, 0.08);
  margin-bottom: 1.5rem;
}

.stack label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.9rem;
  color: #3f4750;
}

input,
button {
  font: inherit;
}

input {
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid #d9dee5;
  background: #fdfdff;
}

button {
  border: none;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  background: #1a73e8;
  color: #fff;
  font-weight: 600;
}

button.ghost {
  background: transparent;
  border: 1px solid rgba(26, 115, 232, 0.3);
  color: #1a73e8;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hidden {
  display: none;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

th,
td {
  text-align: left;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid #eceff3;
}

tr:last-child td {
  border-bottom: none;
}

.code-pill {
  font-family: 'JetBrains Mono', Consolas, monospace;
  background: #f0f4ff;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
}

.badge {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.badge.active {
  background: rgba(56, 142, 60, 0.15);
  color: #2e7d32;
}

.badge.unused {
  background: rgba(25, 118, 210, 0.15);
  color: #1565c0;
}

.badge.revoked,
.badge.expired {
  background: rgba(229, 57, 53, 0.12);
  color: #c62828;
}

.muted {
  color: #8a9099;
}

#devices-body ul {
  padding-left: 1.2rem;
}

#devices-body li {
  margin-bottom: 0.4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

#devices-body button {
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
  font-size: 0.8rem;
}

#login-form,
#create-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hint {
  font-size: 0.85rem;
  color: #8a9099;
}

.header-actions {
  display: flex;
  gap: 0.5rem;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.panel-head-actions input {
  min-width: 220px;
}

#devices-panel {
  min-height: 320px;
}

@media (max-width: 720px) {
  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .panel-head {
    flex-direction: column;
  }
  #filter-input {
    width: 100%;
  }
}
