body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #f5f7fb;
  color: #1f2937;
}

a {
  color: inherit;
  text-decoration: none;
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card,
.card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 420px;
}

label {
  display: block;
  margin: 14px 0 6px;
  font-weight: 600;
}

input,
select {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid #cfd6e0;
  border-radius: 10px;
  background: #fff;
}

button {
  margin-top: 18px;
  padding: 10px 16px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  background: #2563eb;
  color: #fff;
  font-weight: 600;
}

button.secondary {
  background: #64748b;
}

button.warning {
  background: #f59e0b;
}

button.small-btn {
  margin-top: 0;
  padding: 8px 12px;
  font-size: 14px;
}

.topbar {
  background: #111827;
  color: #fff;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar-right {
  display: flex;
  gap: 12px;
  align-items: center;
}

.app-shell {
  display: flex;
  min-height: calc(100vh - 60px);
}

.sidebar {
  width: 240px;
  background: #0f172a;
  color: #fff;
  padding: 24px 16px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-nav a {
  display: block;
  padding: 12px 14px;
  border-radius: 10px;
  color: #cbd5e1;
  font-weight: 600;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: #1e293b;
  color: #fff;
}

.content-area {
  flex: 1;
  min-width: 0;
}

.container {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 16px;
}

.container.narrow {
  max-width: 760px;
}

.page-head,
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.action-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.stats-grid-5 {
  grid-template-columns: repeat(5, 1fr);
}

.label {
  color: #64748b;
  margin-bottom: 8px;
}

.value {
  font-size: 30px;
  font-weight: 700;
}

.alert {
  padding: 12px 14px;
  border-radius: 10px;
  margin: 12px 0 16px;
}

.alert-error {
  background: #fee2e2;
  color: #991b1b;
}

.alert-success {
  background: #dcfce7;
  color: #166534;
}

.muted {
  color: #64748b;
}

.mt {
  margin-top: 20px;
}

.mb {
  margin-bottom: 20px;
}

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

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: middle;
}

.data-table th {
  font-size: 14px;
  color: #475569;
}

.badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.badge-success {
  background: #dcfce7;
  color: #166534;
}

.badge-muted {
  background: #e5e7eb;
  color: #374151;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.inline-form {
  display: inline;
}

.link-button {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 10px;
  background: #2563eb;
  color: #fff;
  font-weight: 600;
}

.link-button.small {
  padding: 8px 12px;
  font-size: 14px;
}

.secondary-link {
  background: #e5e7eb;
  color: #111827;
}

.form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
  flex-wrap: wrap;
}

.actions-cell {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}

.detail-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.detail-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #e5e7eb;
}

.detail-key {
  font-weight: 700;
  color: #475569;
}

.detail-value {
  word-break: break-word;
}

.password-value {
  font-family: Consolas, Monaco, monospace;
  font-size: 16px;
  font-weight: 700;
}

.stack-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.stack-actions form {
  margin: 0;
}

.stack-actions button,
.stack-actions .link-button {
  width: 100%;
  box-sizing: border-box;
  text-align: center;
}

.highlight-card {
  border: 2px solid #bfdbfe;
  background: #eff6ff;
}

.radio-group {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.radio-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.radio-row input[type="radio"] {
  width: auto;
  margin: 0;
}

@media (max-width: 1100px) {
  .stats-grid-5 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    width: auto;
  }

  .stats-grid,
  .stats-grid-5 {
    grid-template-columns: 1fr;
  }

  .page-head,
  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}
