﻿:root {
  --bg: #050505;
  --bg-elev: #0f0f10;
  --bg-soft: #18181a;
  --line: #2c2c2f;
  --line-strong: #3a3a3e;
  --text: #f5f5f5;
  --text-muted: #bdbdc4;
  --brand: #d4af37;
  --brand-strong: #f1c84b;
  --danger: #ff5d6c;
  --ok: #88d69a;
  --radius: 14px;
  --shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(circle at 12% -20%, rgba(212, 175, 55, 0.15), transparent 38%), var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
}

.auth-card {
  width: min(460px, 100%);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  box-shadow: var(--shadow);
  padding: 2rem;
  text-align: center;
}

.auth-logo {
  width: 96px;
  margin-inline: auto;
  margin-bottom: 1rem;
}

.auth-help {
  margin: 0.6rem 0 0;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.google-wrap {
  display: grid;
  place-items: center;
  margin: 1.3rem 0 0.8rem;
}

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

.sidebar {
  border-right: 1px solid var(--line);
  background: #0a0a0b;
  padding: 1.5rem 1.1rem;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 1.3rem;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.sidebar-brand img {
  width: 42px;
}

.sidebar-brand small {
  color: var(--text-muted);
}

.sidebar-nav {
  display: grid;
  gap: 0.5rem;
}

.nav-item {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--text-muted);
  text-align: left;
  padding: 0.75rem 0.85rem;
  cursor: pointer;
}

.nav-item.is-active {
  color: #fff;
  border-color: rgba(212, 175, 55, 0.42);
  background: rgba(212, 175, 55, 0.1);
}

.sidebar-footer {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  color: var(--text-muted);
  display: grid;
  gap: 0.35rem;
}

.sidebar-footer code {
  white-space: normal;
  word-break: break-word;
  color: var(--brand-strong);
}

.workspace {
  padding: 1.35rem;
  display: grid;
  gap: 1rem;
}

.topbar {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
  padding: 1rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.topbar h2 {
  margin: 0.2rem 0 0;
}

.topbar-subtitle {
  margin: 0;
  color: var(--text-muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.identity-chip {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.48rem 0.8rem;
  background: #111113;
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.metric-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.95rem;
  background: var(--bg-elev);
  display: grid;
  gap: 0.35rem;
}

.metric-card span {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.metric-card strong {
  font-size: 1.5rem;
  color: var(--brand-strong);
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
  padding: 1rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}

.card h3 {
  margin: 0;
}

.studio-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr 1fr;
  gap: 0.85rem;
}

.grid-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.72rem;
}

.grid-form label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.grid-form label.full {
  grid-column: 1 / -1;
}

.grid-form label.check {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

input,
select,
textarea {
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #111113;
  color: #fff;
  padding: 0.58rem 0.68rem;
}

textarea {
  min-height: 86px;
  resize: vertical;
}

.form-actions {
  display: flex;
  gap: 0.6rem;
}

.btn {
  border: 1px solid rgba(212, 175, 55, 0.55);
  background: linear-gradient(180deg, rgba(241, 200, 75, 0.25), rgba(212, 175, 55, 0.14));
  color: #fff;
  border-radius: 10px;
  padding: 0.58rem 0.9rem;
  cursor: pointer;
}

.btn:hover {
  border-color: rgba(241, 200, 75, 0.9);
}

.btn--ghost {
  border-color: var(--line-strong);
  background: #121214;
}

.btn--danger {
  border-color: rgba(255, 93, 108, 0.45);
  background: rgba(255, 93, 108, 0.16);
}

.btn--tiny {
  padding: 0.38rem 0.58rem;
  border-radius: 8px;
  font-size: 0.78rem;
}

.btn--tiny.is-active {
  border-color: rgba(136, 214, 154, 0.55);
  background: rgba(136, 214, 154, 0.18);
}

.badge-preview {
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  min-height: 190px;
  display: grid;
  place-items: center;
}

.badge-preview svg {
  width: min(210px, 76%);
  height: auto;
}

.table-wrap {
  overflow: auto;
}

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

thead th {
  text-align: left;
  color: var(--text-muted);
  font-size: 0.82rem;
  border-bottom: 1px solid var(--line);
  padding: 0.55rem 0.35rem;
}

tbody td {
  padding: 0.6rem 0.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

.empty {
  color: var(--text-muted);
  padding: 0.9rem 0.35rem;
}

.badge-cell {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.badge-cell small {
  color: var(--text-muted);
}

.badge-icon {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
}

.badge-icon svg {
  width: 100%;
  height: 100%;
}

.badge-icon--sm {
  width: 28px;
  height: 28px;
}

.status-pill {
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  padding: 0.2rem 0.46rem;
  font-size: 0.72rem;
}

.status-pill.on {
  border-color: rgba(136, 214, 154, 0.45);
  color: var(--ok);
}

.status-pill.off {
  border-color: rgba(255, 93, 108, 0.45);
  color: var(--danger);
}

.user-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0.85rem;
}

.assignment-controls {
  display: flex;
  gap: 0.5rem;
}

.assigned-badges {
  margin: 0.9rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.55rem;
}

.assigned-badge-item {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #111113;
  padding: 0.55rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.assigned-badge-main {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.assigned-badge-main small {
  color: var(--text-muted);
}

.assigned-badge-actions {
  display: flex;
  gap: 0.4rem;
}

.table-link {
  border: none;
  background: transparent;
  color: var(--brand-strong);
  cursor: pointer;
  padding: 0;
}

tr.is-selected {
  background: rgba(212, 175, 55, 0.08);
}

.status {
  min-height: 1.1rem;
  margin: 0;
  color: var(--text-muted);
}

.status[data-type="success"] {
  color: var(--ok);
}

.status[data-type="error"] {
  color: var(--danger);
}

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

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

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

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

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

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