:root {
  --bg: #f4f6fb;
  --card-bg: #ffffff;
  --text: #1f2937;
  --muted: #5b6472;
  --primary: #0a66c2;
  --primary-hover: #084f95;
  --border: #d9dfeb;
  --success-bg: #e7f7ed;
  --success-text: #126531;
  --error-bg: #fdeaea;
  --error-text: #8c1d1d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.container {
  width: min(960px, 92vw);
  margin: 0 auto;
}

.topbar {
  background: #0d1f3c;
  color: #ffffff;
  padding: 18px 0;
}

.topbar-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.app-title {
  margin: 0;
  font-size: 1.35rem;
}

.app-subtitle {
  margin: 4px 0 0;
  color: #d0daef;
  font-size: 0.95rem;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav-actions a,
.link-button {
  color: #ffffff;
  text-decoration: none;
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
}

.nav-actions a:hover,
.link-button:hover {
  text-decoration: underline;
}

.nav-actions .is-active {
  text-decoration: underline;
  font-weight: 600;
}

.content {
  padding: 24px 0 40px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
}

.notice {
  border-left: 4px solid #f59e0b;
  background: #fff8eb;
  padding: 12px;
  border-radius: 8px;
}

.status {
  font-size: 1.05rem;
}

.form-grid {
  display: grid;
  gap: 10px;
  max-width: 360px;
}

input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  font: inherit;
}

select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  font: inherit;
  background: #ffffff;
}

.button,
button {
  display: inline-block;
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--primary);
  color: #ffffff;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
}

.button:hover,
button:hover {
  background: var(--primary-hover);
}

.button-secondary {
  background: #4b5563;
}

.button-secondary:hover {
  background: #374151;
}

.button-danger {
  background: #b91c1c;
}

.button-danger:hover {
  background: #991b1b;
}

.flash-list {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: grid;
  gap: 8px;
}

.flash {
  border-radius: 8px;
  padding: 10px 12px;
  border: 1px solid transparent;
}

.flash-success {
  background: var(--success-bg);
  color: var(--success-text);
  border-color: #bce7cb;
}

.flash-error {
  background: var(--error-bg);
  color: var(--error-text);
  border-color: #f5bbbb;
}

.profile-preview,
.profile-details {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin: 16px 0;
}

.avatar {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid var(--border);
}

.avatar-large {
  width: 120px;
  height: 120px;
}

.avatar-placeholder {
  width: 120px;
  height: 120px;
  border-radius: 999px;
  border: 2px dashed var(--border);
  display: grid;
  place-items: center;
  color: var(--muted);
}

.highlight {
  font-size: 1.1rem;
  font-weight: 600;
}

.actions-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.section-box {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
}

.section-box h3 {
  margin: 0 0 8px;
}

.muted {
  color: var(--muted);
}

.status-ok {
  color: #0f7a33;
  font-weight: 600;
}

.status-error {
  color: #a51f1f;
  font-weight: 600;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

th,
td {
  border: 1px solid var(--border);
  padding: 8px;
  text-align: left;
  font-size: 0.92rem;
  vertical-align: top;
}

th {
  background: #edf2fb;
}

.code-block {
  margin-top: 10px;
  padding: 12px;
  background: #0b1020;
  color: #e7ecf6;
  border-radius: 10px;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.4;
}

@media (max-width: 720px) {
  .topbar-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-actions {
    flex-wrap: wrap;
  }

  .profile-preview,
  .profile-details {
    flex-direction: column;
  }

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