:root {
  --bg: #f3efe5;
  --surface: rgba(255, 252, 246, 0.88);
  --surface-strong: #fffdf7;
  --ink: #1e1a16;
  --muted: #6f655a;
  --line: rgba(48, 36, 25, 0.14);
  --accent: #0f5f4d;
  --accent-2: #d97b29;
  --danger: #9a2d21;
  --success: #0d6b41;
  --shadow: 0 18px 50px rgba(46, 32, 20, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(217, 123, 41, 0.18), transparent 34%),
    radial-gradient(circle at top right, rgba(15, 95, 77, 0.18), transparent 26%),
    linear-gradient(180deg, #f8f4ea 0%, #efe8d8 100%);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

.shell {
  min-height: 100vh;
  padding: 32px 20px 56px;
}

.frame {
  max-width: 1180px;
  margin: 0 auto;
}

.masthead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.tabbar {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.7);
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.82rem;
}

.tab-active {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

.brand {
  font-family: "IBM Plex Serif", Georgia, serif;
  font-size: 1.65rem;
  letter-spacing: 0.02em;
}

.brand small {
  display: block;
  color: var(--muted);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.login-card {
  max-width: 420px;
  margin: 7vh auto 0;
  padding: 28px;
}

.panel {
  padding: 22px;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.meta {
  color: var(--muted);
  font-size: 0.95rem;
}

.grid {
  display: grid;
  gap: 16px;
}

.form-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.9rem;
  color: var(--muted);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--ink);
  font: inherit;
}

.field input[readonly] {
  background: #f2ede3;
}

.field-span {
  grid-column: 1 / -1;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.button-primary {
  background: var(--accent);
  color: #fff;
}

.button-secondary {
  background: #ebe3d2;
  color: var(--ink);
}

.button-danger {
  background: var(--danger);
  color: #fff;
}

.flash-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.flash {
  border-radius: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
}

.flash-error {
  background: rgba(154, 45, 33, 0.08);
  border-color: rgba(154, 45, 33, 0.22);
}

.flash-success {
  background: rgba(13, 107, 65, 0.08);
  border-color: rgba(13, 107, 65, 0.22);
}

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

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pill {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 95, 77, 0.1);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
}

.pagination {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
}

.section-stack {
  display: grid;
  gap: 18px;
}

.table-form {
  display: contents;
}

.table-input {
  width: 100%;
  min-width: 110px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--ink);
  font: inherit;
}

.checkbox-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.button-compact {
  padding: 9px 14px;
}

.ssl-cell {
  max-width: 260px;
  word-break: break-word;
}

.error-text {
  color: var(--danger);
  margin-top: 8px;
}

.danger-zone {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.danger-copy {
  color: var(--danger);
  margin-bottom: 12px;
}

@media (max-width: 860px) {
  .shell {
    padding: 18px 14px 32px;
  }

  .masthead,
  .tabbar,
  .toolbar,
  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  table,
  thead,
  tbody,
  th,
  td,
  tr {
    display: block;
  }

  thead {
    display: none;
  }

  tr {
    border-bottom: 1px solid var(--line);
    padding: 10px 0;
  }

  td {
    padding: 8px 0;
    border: 0;
  }
}
