:root {
  --bg: #f2f5f7;
  --surface: #ffffff;
  --surface-alt: #e9eef2;
  --border: #d7e0e6;
  --text: #12202b;
  --muted: #5e7280;
  --accent: #0f8f78;
  --accent-hover: #0c735f;
  --danger: #d64545;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(15, 143, 120, 0.12), transparent 22%),
    linear-gradient(180deg, #f8fbfc 0%, #eef3f5 100%);
}

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

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: 28px 32px 20px;
}

.topbar h1 {
  margin: 0 0 8px;
  font-size: 28px;
}

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

.small {
  font-size: 13px;
}

.layout,
.detail-layout {
  display: grid;
  gap: 18px;
  padding: 0 32px 32px;
}

.layout {
  grid-template-columns: minmax(320px, 420px) 1fr;
}

.detail-layout {
  grid-template-columns: 1.1fr 0.9fr;
}

.panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(18, 32, 43, 0.08);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(18, 32, 43, 0.08);
}

.panel-full {
  grid-column: 1 / -1;
}

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

.section-header h2,
.panel h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.create-form,
.login-panel {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  font-size: 14px;
}

input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
  background: var(--surface);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 14px;
  border: 1px solid transparent;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

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

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-danger {
  background: rgba(214, 69, 69, 0.12);
  border-color: rgba(214, 69, 69, 0.22);
  color: var(--danger);
}

.btn-danger:hover {
  background: rgba(214, 69, 69, 0.18);
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.btn-block {
  width: 100%;
}

.btn.disabled,
.disabled {
  pointer-events: none;
  opacity: 0.5;
}

.badge,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--surface-alt);
}

.status-starting,
.status-ready,
.status-capturing,
.status-finalizing,
.status-deleting,
.status-finished,
.status-stopped,
.status-error {
  color: var(--text);
}

.status-ready,
.status-finished {
  background: rgba(15, 143, 120, 0.12);
  color: var(--accent);
}

.status-capturing,
.status-finalizing,
.status-deleting,
.status-starting {
  background: rgba(246, 178, 35, 0.16);
  color: #8b5a00;
}

.status-error {
  background: rgba(214, 69, 69, 0.14);
  color: var(--danger);
}

.session-list {
  display: grid;
  gap: 14px;
}

.session-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(244,248,250,0.96));
}

.session-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.session-card h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

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

.detail-grid dt {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 6px;
}

.detail-grid dd {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
}

.page-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.page-list li {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  background: var(--surface);
}

.page-list strong,
.page-list span {
  display: block;
}

.page-list span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
  line-height: 1.5;
}

.log-box {
  min-height: 280px;
  max-height: 520px;
  overflow: auto;
  margin: 0;
  padding: 16px;
  border-radius: 16px;
  background: #101820;
  color: #d3f7ef;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.6;
}

.error-box {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(214, 69, 69, 0.12);
  color: var(--danger);
  font-size: 14px;
}

.back-link {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--muted);
}

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

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

@media (max-width: 960px) {
  .layout,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
  }

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