:root {
  --bg: #0f1419;
  --panel: #161d27;
  --border: #2a3544;
  --text: #e8eef4;
  --muted: #8b9aab;
  --accent: #3dd68c;
  --danger: #f07178;
  --radius: 10px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.studio-app {
  display: flex;
  min-height: 100vh;
}

.studio-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 1.25rem 1rem;
}

.studio-sidebar__brand {
  margin-bottom: 1.5rem;
}

.studio-sidebar__title {
  display: block;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}

.studio-sidebar__tag {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.studio-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.studio-sidebar__link {
  display: block;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
}

.studio-sidebar__link:hover {
  background: rgba(61, 214, 140, 0.08);
  color: var(--text);
}

.studio-sidebar__link.is-active {
  background: rgba(61, 214, 140, 0.15);
  color: var(--accent);
  font-weight: 600;
}

.studio-main-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.studio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

.studio-header__bc {
  font-size: 0.9rem;
  color: var(--muted);
}

.studio-header__bc .bc-sep {
  margin: 0 0.35rem;
  opacity: 0.6;
}

.studio-header__user {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: right;
}

.header-user__name {
  color: var(--text);
}

.header-user__at {
  color: var(--accent);
}

.studio-content {
  flex: 1;
  padding: 1.5rem;
  max-width: 1100px;
}

.studio-footer {
  padding: 0.75rem 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
}

.studio-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}

.studio-card h1 {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
}

.studio-card p.lead {
  margin: 0 0 1rem;
  color: var(--muted);
}

.studio-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

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

.studio-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.studio-table th,
.studio-table td {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.studio-table th {
  color: var(--muted);
  font-weight: 600;
}

.studio-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge--draft {
  background: rgba(139, 154, 171, 0.2);
  color: var(--muted);
}

.badge--active {
  background: rgba(61, 214, 140, 0.2);
  color: var(--accent);
}

.badge--archived {
  background: rgba(240, 113, 120, 0.15);
  color: var(--danger);
}

.btn {
  display: inline-block;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
}

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

.btn--primary:hover {
  filter: brightness(1.06);
}

.btn--ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.field {
  margin-bottom: 1rem;
}

.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  max-width: 480px;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
}

.field textarea {
  min-height: 100px;
  resize: vertical;
}

.msg {
  margin-top: 1rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
}

.msg--err {
  background: rgba(240, 113, 120, 0.12);
  border: 1px solid rgba(240, 113, 120, 0.35);
}

.msg--ok {
  background: rgba(61, 214, 140, 0.12);
  border: 1px solid rgba(61, 214, 140, 0.35);
}

.loading {
  color: var(--muted);
  padding: 1rem;
}

.redirect-msg {
  padding: 2rem;
  text-align: center;
  color: var(--muted);
}

.mesa-tabs .btn.is-active {
  background: rgba(61, 214, 140, 0.15);
  border-color: var(--accent);
  color: var(--accent);
}

.mesa-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 1rem;
  max-width: 640px;
}

.mesa-list li {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.mesa-inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}

.mesa-inline-form .field {
  margin-bottom: 0;
}
