/**
 * Vibot Agency — shared with team.vibot.tech / platform auth tokens
 */
:root {
  --font-sans: "DM Sans", system-ui, sans-serif;
  --font-display: "Syne", system-ui, sans-serif;
  --font-mono: "DM Mono", ui-monospace, monospace;
  --stone-100: #f5f5f4;
  --stone-200: #e7e5e4;
  --stone-400: #a8a29e;
  --stone-500: #78716c;
  --stone-600: #57534e;
  --stone-800: #292524;
  --stone-900: #1c1917;
  --amber-500: #f59e0b;
  --amber-600: #d97706;
  --ink-950: #0b0a08;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(28, 25, 23, 0.05);
  --shadow-card: 0 1px 2px rgba(28, 25, 23, 0.05);
}

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

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-sans);
  color: var(--stone-900);
  background: var(--stone-100);
  -webkit-font-smoothing: antialiased;
}

body.mode-login {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  min-height: 100dvh;
}

.hidden {
  display: none !important;
}

/* ── Login ── */
.login-page {
  width: 100%;
  max-width: 26rem;
  animation: login-in 0.45s ease forwards;
}

@keyframes login-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  justify-content: center;
}

.login-mark {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-md);
  background: var(--amber-500);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-950);
  box-shadow: var(--shadow-sm);
}

.login-brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.login-brand-text small {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--stone-500);
  margin-top: 0.15rem;
}

.login-card {
  background: #fff;
  border: 1px solid var(--stone-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 1.5rem 1.35rem 1.35rem;
}

@media (min-width: 480px) {
  .login-card {
    padding: 1.75rem 1.6rem 1.5rem;
  }
}

.login-kicker {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--stone-500);
  margin-bottom: 0.35rem;
  text-align: center;
}

.login-card h1 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  text-align: center;
  letter-spacing: -0.02em;
}

.login-desc {
  font-size: 0.8125rem;
  color: var(--stone-600);
  line-height: 1.5;
  margin: 0 0 1.25rem;
  text-align: center;
}

.field-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--stone-500);
  margin-bottom: 0.35rem;
}

.text-input {
  width: 100%;
  padding: 0.65rem 1rem;
  border: 1px solid var(--stone-200);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.text-input:focus {
  outline: none;
  border-color: rgba(245, 158, 11, 0.55);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.12);
}

.pw-wrap {
  position: relative;
  margin-bottom: 1rem;
}

.pw-wrap .text-input {
  margin-bottom: 0;
  padding-right: 2.75rem;
}

.pw-toggle {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--stone-400);
  cursor: pointer;
  padding: 0.25rem;
  line-height: 0;
  border-radius: 6px;
}

.pw-toggle:hover {
  color: var(--stone-600);
}

.btn-submit {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: var(--stone-900);
  color: #fff;
  transition: background 0.15s;
}

.btn-submit:hover:not(:disabled) {
  background: var(--stone-800);
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.login-err {
  font-size: 0.8125rem;
  color: #b91c1c;
  margin: 0 0 0.85rem;
  padding: 0.5rem 0.65rem;
  background: rgba(185, 28, 28, 0.06);
  border-radius: var(--radius-md);
  display: none;
}

.login-err.is-visible {
  display: block;
}

.login-foot {
  margin: 1rem 0 0;
  font-size: 0.75rem;
  color: var(--stone-500);
  text-align: center;
  line-height: 1.45;
}

.spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Dashboard ── */
body.mode-app {
  display: block;
  background: var(--stone-100);
}

.app-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  background: #fff;
  border-bottom: 1px solid var(--stone-200);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
}

.topbar-mark {
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  background: var(--amber-500);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-950);
}

.btn-ghost {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--stone-200);
  background: #fff;
  color: var(--stone-600);
  cursor: pointer;
}

.btn-ghost:hover {
  border-color: var(--stone-400);
  color: var(--stone-900);
}

.app-main {
  flex: 1;
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2rem;
}

.panel {
  background: #fff;
  border: 1px solid var(--stone-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 1.5rem;
}

.panel h1 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
  letter-spacing: -0.02em;
}

.muted {
  font-size: 0.875rem;
  color: var(--stone-500);
  margin: 0;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 1.25rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

th,
td {
  text-align: left;
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid var(--stone-200);
}

th {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--stone-500);
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
}

.badge.on {
  background: rgba(245, 158, 11, 0.15);
  color: var(--amber-600);
}

.badge.off {
  background: rgba(185, 28, 28, 0.08);
  color: #b91c1c;
}

.app-nav {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
  padding: 0.2rem;
  background: var(--stone-200);
  border-radius: var(--radius-md);
  width: fit-content;
}

.nav-tab {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--stone-600);
  cursor: pointer;
}

.nav-tab.is-active {
  background: #fff;
  color: var(--stone-900);
  box-shadow: var(--shadow-sm);
}

.dash-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.dash-head code {
  font-family: var(--font-mono);
  font-size: 0.75em;
}

.secret-banner {
  margin: 1rem 0;
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(217, 119, 6, 0.35);
}

.secret-banner-title {
  font-family: var(--font-display);
  font-weight: 700;
  margin: 0 0 0.25rem;
}

.secret-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.secret-code {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  word-break: break-all;
  flex: 1;
  min-width: 12rem;
  padding: 0.5rem 0.65rem;
  background: #fff;
  border-radius: var(--radius-md);
  border: 1px solid var(--stone-200);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  margin: 0.35rem 0;
  cursor: pointer;
}

.dash-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn-primary {
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  border: none;
  background: var(--stone-900);
  color: #fff;
  cursor: pointer;
}

.btn-primary:hover:not(:disabled) {
  background: var(--stone-800);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.create-panel {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--stone-200);
}

.create-panel h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
}

.create-panel .hint {
  font-size: 0.8125rem;
  color: var(--stone-500);
  margin: 0 0 1rem;
}

.create-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1rem;
}

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

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

.form-err {
  font-size: 0.8125rem;
  color: #b91c1c;
  margin: 0 0 1rem;
  padding: 0.5rem 0.65rem;
  background: rgba(185, 28, 28, 0.06);
  border-radius: var(--radius-md);
  display: none;
}

.form-err.is-visible {
  display: block;
}

.create-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

textarea.text-input {
  resize: vertical;
  min-height: 4rem;
}

.label-hint {
  font-weight: 400;
  color: var(--stone-500);
  text-transform: none;
  letter-spacing: 0;
}

.col-actions {
  width: 5.5rem;
  text-align: right;
}

.btn-link {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border: none;
  background: transparent;
  color: var(--stone-600);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.btn-link:hover {
  color: var(--stone-900);
}

select.text-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2378716c' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}
