/* Ensure elements hidden via the [hidden] attribute are not overridden by display rules (e.g. .auth-panel) */
[hidden] { display: none !important; }

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

:root {
  color-scheme: dark;
  --black: #0b0b0d;
  --panel: #17171b;
  --panel-2: #222229;
  --gold: #c9a24d;
  --green: #6fd6a3;
  --red: #f87171;
  --blue: #7aa7ff;
  --line: rgba(255, 255, 255, 0.08);
  --muted: #8a8f98;
  --text: #f7f7f8;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--black);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
}

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

button {
  min-height: 40px;
  cursor: pointer;
}

.shell {
  min-height: 100vh;
}

.auth-panel {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(520px, 100%);
  border: 1px solid rgba(201, 162, 77, 0.3);
  background: var(--panel);
  padding: 36px;
}

.auth-card h1,
.topline h1,
.panel h2,
.panel h3 {
  font-family: Sora, Inter, sans-serif;
  letter-spacing: 0;
}

.auth-card h1 {
  margin: 8px 0 12px;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1;
}

.auth-card p {
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.7;
}

.auth-form {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.auth-form input,
.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}

.auth-form input:focus,
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: rgba(201, 162, 77, 0.6);
}

.auth-form button,
.primary-btn {
  border: 0;
  background: var(--gold);
  color: var(--black);
  padding: 0 16px;
  font-weight: 800;
}

.auth-error {
  min-height: 20px;
  color: var(--red);
  font-size: 0.9rem;
}

.auth-card a,
.inline-link {
  color: var(--gold);
  font-size: 0.9rem;
  text-decoration: none;
}

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

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
  background: #101014;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.brand {
  color: var(--text);
  text-decoration: none;
}

.brand strong {
  display: block;
  font-family: Sora, Inter, sans-serif;
  font-size: 1.2rem;
}

.brand span,
.eyebrow {
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.rail nav {
  display: grid;
  gap: 6px;
}

.nav-btn,
.ghost-btn {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 0 12px;
}

.nav-btn:hover,
.nav-btn.active,
.ghost-btn:hover {
  border-color: rgba(201, 162, 77, 0.34);
  color: var(--text);
  background: rgba(201, 162, 77, 0.08);
}

.ghost-btn {
  margin-top: auto;
}

.main {
  min-width: 0;
  padding: 28px;
}

.topline {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.topline h1 {
  margin: 8px 0 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.identity {
  min-width: 180px;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 16px;
}

.identity span,
.identity small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.identity strong {
  display: block;
  color: var(--gold);
  font-family: Sora, Inter, sans-serif;
  font-size: 2rem;
}

.notice {
  margin-top: 18px;
  border: 1px solid rgba(111, 214, 163, 0.4);
  background: rgba(111, 214, 163, 0.08);
  color: var(--green);
  padding: 12px 14px;
}

.view-root {
  margin-top: 24px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

.panel {
  grid-column: span 4;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 18px;
  min-width: 0;
}

.panel.wide {
  grid-column: span 8;
}

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

.panel h2,
.panel h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.panel p,
.muted {
  color: var(--muted);
  line-height: 1.65;
}

.stat {
  display: grid;
  gap: 4px;
}

.stat strong {
  color: var(--gold);
  font-family: Sora, Inter, sans-serif;
  font-size: 2rem;
}

.list {
  display: grid;
  gap: 10px;
}

.row {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  padding: 12px;
}

.row-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border: 1px solid rgba(201, 162, 77, 0.28);
  color: var(--gold);
  padding: 0 8px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.tag.blue {
  border-color: rgba(122, 167, 255, 0.35);
  color: var(--blue);
}

.tag.green {
  border-color: rgba(111, 214, 163, 0.38);
  color: var(--green);
}

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

.secondary-btn {
  border: 1px solid rgba(201, 162, 77, 0.34);
  background: transparent;
  color: var(--gold);
  padding: 0 12px;
  font-weight: 700;
}

.secondary-btn:hover {
  background: rgba(201, 162, 77, 0.08);
}

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

.field {
  display: grid;
  gap: 6px;
}

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

.field label {
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.8rem;
  font-weight: 700;
}

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

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

  .rail {
    position: static;
    height: auto;
  }

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

  .topline {
    flex-direction: column;
  }

  .panel,
  .panel.wide {
    grid-column: 1 / -1;
  }

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