:root {
  --bg: #f3efe7;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-strong: #fff9f1;
  --line: rgba(79, 60, 36, 0.16);
  --text: #2f2418;
  --muted: #71614f;
  --accent: #c7642c;
  --accent-2: #0f766e;
  --warn: #b45309;
  --bad: #b42318;
  --shadow: 0 20px 45px rgba(72, 52, 26, 0.12);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  background:
    radial-gradient(circle at top left, rgba(199, 100, 44, 0.2), transparent 35%),
    radial-gradient(circle at bottom right, rgba(15, 118, 110, 0.18), transparent 35%),
    linear-gradient(180deg, #fbf7f0 0%, #efe7da 100%);
}

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

.shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  padding: 28px;
  border-right: 1px solid var(--line);
  background: rgba(255, 250, 244, 0.85);
  backdrop-filter: blur(14px);
}

.brand h1,
.topbar h2,
.login-card h1,
.card h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.nav {
  display: grid;
  gap: 8px;
  margin-top: 28px;
}

.nav a {
  padding: 12px 14px;
  border-radius: 16px;
  color: var(--muted);
  transition: 160ms ease;
}

.nav a.active,
.nav a:hover {
  color: var(--text);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.sidebar-footer {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.content {
  padding: 28px;
}

.brand-copy {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

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

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

.live-strip {
  display: flex;
  align-items: center;
  gap: 14px;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.12);
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent-2);
  box-shadow: 0 0 0 rgba(15, 118, 110, 0.35);
  animation: pulse 1.8s infinite;
}

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

.cards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.two-columns {
  margin-top: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 22px;
  margin-bottom: 18px;
  background:
    radial-gradient(circle at top right, rgba(199, 100, 44, 0.16), transparent 35%),
    linear-gradient(135deg, rgba(255, 249, 241, 0.95), rgba(255, 255, 255, 0.92));
}

.hero h3 {
  margin-bottom: 10px;
  font-size: 30px;
  line-height: 1.2;
}

.hero-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

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

.hero-grid div {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(79, 60, 36, 0.08);
}

.hero-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-grid strong {
  font-size: 22px;
}

.stat h3 {
  margin-top: 6px;
  margin-bottom: 8px;
  font-size: 34px;
}

.card-head,
.service-row,
.summary-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.card-head-links {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.card-head.compact {
  align-items: end;
}

.service-list,
.summary-list,
.alert-list {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.badge,
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge.ok,
.chip {
  background: rgba(15, 118, 110, 0.14);
  color: var(--accent-2);
}

.badge.warn {
  background: rgba(180, 83, 9, 0.14);
  color: var(--warn);
}

.badge.bad {
  background: rgba(180, 35, 24, 0.12);
  color: var(--bad);
}

.alert-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
}

.alert-card.warn {
  border-color: rgba(180, 83, 9, 0.3);
  background: rgba(180, 83, 9, 0.08);
}

.alert-card.bad {
  border-color: rgba(180, 35, 24, 0.28);
  background: rgba(180, 35, 24, 0.08);
}

.alert-card.ok {
  border-color: rgba(15, 118, 110, 0.25);
  background: rgba(15, 118, 110, 0.07);
}

.ssh-log-block {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

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

.ssh-failed-summary {
  margin-top: 16px;
}

.ssh-ban-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
}

.ssh-ban-form label {
  display: grid;
  gap: 8px;
}

.ssh-ban-form input {
  width: min(340px, 100%);
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  font: inherit;
}

.ssh-row-action {
  display: flex;
  justify-content: flex-end;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.pager-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.chip.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.ssh-actions {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.ssh-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.64);
}

.ssh-toggle-title {
  display: inline-block;
  margin-bottom: 6px;
  font-weight: 700;
}

.ssh-toggle-form {
  flex: none;
}

.ssh-toggle-button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.ssh-toggle-button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.ssh-toggle-button.on {
  border-color: rgba(15, 118, 110, 0.26);
  background: rgba(15, 118, 110, 0.1);
  color: var(--accent-2);
}

.ssh-toggle-button.off {
  border-color: rgba(180, 35, 24, 0.22);
  background: rgba(180, 35, 24, 0.08);
  color: var(--bad);
}

.ssh-toggle-track {
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: rgba(113, 97, 79, 0.16);
  transition: background 160ms ease;
}

.ssh-toggle-button.on .ssh-toggle-track {
  background: rgba(15, 118, 110, 0.34);
}

.ssh-toggle-button.off .ssh-toggle-track {
  background: rgba(180, 35, 24, 0.24);
}

.ssh-toggle-thumb {
  position: absolute;
  top: 3px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: white;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
  transition: left 160ms ease, right 160ms ease;
}

.ssh-toggle-button.on .ssh-toggle-thumb {
  right: 3px;
}

.ssh-toggle-button.off .ssh-toggle-thumb {
  left: 3px;
}

.ssh-action-row {
  display: grid;
  gap: 16px;
}

.ssh-action-row label {
  display: grid;
  gap: 8px;
}

.ssh-action-row input {
  width: min(240px, 100%);
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  font: inherit;
}

.ssh-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

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

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

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

.empty {
  text-align: center;
  color: var(--muted);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), #d67c3c);
  color: white;
  font-weight: 700;
  cursor: pointer;
}

.button.secondary {
  width: 100%;
  background: white;
  color: var(--text);
  border: 1px solid var(--line);
}

.button.inline {
  width: auto;
}

.login-body {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(460px, 100%);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.login-form label {
  display: grid;
  gap: 8px;
}

.login-form input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  font: inherit;
}

.alert.error {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(180, 35, 24, 0.1);
  color: var(--bad);
}

.alert.ok,
.alert.warn,
.alert.bad {
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: 14px;
}

.alert.ok {
  background: rgba(15, 118, 110, 0.1);
  color: var(--accent-2);
}

.alert.warn {
  background: rgba(180, 83, 9, 0.1);
  color: var(--warn);
}

.alert.bad {
  background: rgba(180, 35, 24, 0.1);
  color: var(--bad);
}

.share-body {
  padding: 24px;
}

.share-shell {
  width: min(1080px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.share-hero {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 18px;
  align-items: end;
  background:
    radial-gradient(circle at top right, rgba(199, 100, 44, 0.16), transparent 35%),
    linear-gradient(135deg, rgba(255, 249, 241, 0.95), rgba(255, 255, 255, 0.92));
}

.share-copy {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.share-hero-meta {
  display: grid;
  gap: 12px;
}

.share-hero-meta div,
.share-meta div {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(79, 60, 36, 0.08);
}

.share-hero-meta span,
.share-meta span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.share-hero-meta strong,
.share-meta strong {
  display: block;
  font-size: 16px;
  word-break: break-all;
}

.share-lock,
.share-lock-minimal,
.share-subscription,
.app-card,
.share-panel {
  display: grid;
  gap: 16px;
}

.share-lock-minimal {
  text-align: center;
  padding-top: 34px;
  padding-bottom: 34px;
}

.share-lock-minimal h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
}

.share-password-form {
  display: grid;
  gap: 14px;
}

.share-password-form label {
  display: grid;
  gap: 8px;
}

.share-password-form input,
.subscription-row input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  font: inherit;
}

.share-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.share-meta.compact {
  margin-bottom: 4px;
}

.share-actions,
.subscription-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.share-actions form {
  margin: 0;
}

.subscription-row input {
  flex: 1 1 340px;
}

.subscription-admin-list {
  display: grid;
  gap: 16px;
}

.subscription-admin-card {
  display: grid;
  gap: 16px;
}

.share-create-form {
  margin-top: 8px;
}

.share-create-form input {
  width: 100%;
}

.share-token-table td {
  min-width: 110px;
}

.share-token-table td:last-child {
  min-width: 320px;
}

.token-row-note {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.token-link-stack {
  display: grid;
  gap: 8px;
}

.token-link-stack strong {
  word-break: break-all;
}

.token-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.token-actions form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
}

.token-actions input {
  width: 140px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  font: inherit;
}

.app-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.guide-steps {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.7;
  display: grid;
  gap: 8px;
}

.guide-steps li::marker {
  color: var(--accent);
  font-weight: 700;
}

.share-panel {
  margin-top: 0;
}

.share-panel .card-head {
  align-items: start;
}

@media (max-width: 1080px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .cards,
  .two-columns,
  .hero,
  .hero-grid,
  .share-hero,
  .share-meta,
  .app-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(15, 118, 110, 0.4);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 10px rgba(15, 118, 110, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(15, 118, 110, 0);
  }
}
