:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --panel: #ffffff;
  --ink: #17202e;
  --muted: #647082;
  --line: #dfe5ec;
  --accent: #177a68;
  --accent-strong: #0e5f51;
  --danger: #b42318;
  --gold: #f3b64b;
  --sky: #d7e7ff;
  --shadow: 0 20px 50px rgba(22, 32, 46, 0.08);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 470px) minmax(360px, 1fr);
}

.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px;
  background: #ffffff;
  border-right: 1px solid var(--line);
}

.brand-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
  font-weight: 800;
  font-size: 25px;
}

.brand-mark.small {
  width: 38px;
  height: 38px;
  font-size: 18px;
}

.auth-panel h1 {
  margin: 28px 0 12px;
  font-size: 44px;
  line-height: 1;
  letter-spacing: 0;
}

.auth-panel p {
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 32px;
  max-width: 36ch;
}

.google-button,
.primary,
.secondary,
.ghost,
.nav-item,
.icon-button {
  border-radius: 8px;
  min-height: 44px;
  border: 1px solid transparent;
  padding: 0 16px;
  font-weight: 700;
}

.google-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: min(100%, 330px);
  background: var(--ink);
  color: #ffffff;
}

.google-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  color: var(--ink);
  font-weight: 900;
}

.auth-note {
  margin-top: 20px;
  color: var(--muted);
  font-size: 14px;
}

.auth-preview {
  display: grid;
  align-content: center;
  padding: 56px;
  background:
    linear-gradient(135deg, rgba(23, 122, 104, 0.18), transparent 35%),
    linear-gradient(45deg, rgba(243, 182, 75, 0.2), transparent 45%),
    #eef3f8;
}

.preview-toolbar,
.preview-grid {
  width: min(760px, 100%);
  margin-inline: auto;
}

.preview-toolbar {
  height: 52px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  border-radius: 8px 8px 0 0;
}

.preview-toolbar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #9ca8b7;
}

.preview-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  box-shadow: var(--shadow);
}

.mini-card {
  min-height: 170px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--line);
}

.mini-card.tall {
  grid-row: span 2;
  min-height: 360px;
  background:
    linear-gradient(90deg, transparent 40%, var(--line) 41%, transparent 42%),
    linear-gradient(#ffffff 0 0);
}

.mini-card.dark {
  background: var(--ink);
}

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

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

.brand-row,
.account-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-row span,
.account-box span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.nav-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.nav-item {
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--muted);
}

.nav-item.active {
  background: #eef7f5;
  color: var(--accent-strong);
}

.account-box {
  margin-top: auto;
  min-width: 0;
}

.avatar {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--sky);
  color: #12385f;
  font-weight: 900;
  flex: 0 0 auto;
}

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

.topbar,
.panel-head,
.stats-row,
.field-row,
.button-row,
.code-row {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-strong);
  font-size: 13px;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.04em;
}

h1,
h2,
p {
  margin-top: 0;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.05;
}

.plan-pill {
  min-width: 170px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.plan-pill strong,
.plan-pill span {
  display: block;
}

.plan-pill span,
.panel-head p,
.stat-block span,
.code-info span,
.code-meta,
.value-box,
.link-stack span {
  color: var(--muted);
}

.stats-row {
  gap: 14px;
  margin-bottom: 18px;
}

.notice {
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid #b7ded5;
  border-radius: 8px;
  background: #eefaf7;
  color: var(--accent-strong);
  font-weight: 750;
}

.stat-block {
  flex: 1;
  min-height: 92px;
  padding: 18px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--line);
}

.stat-block strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.stat-block.accent {
  background: #17202e;
  color: #ffffff;
  border-color: #17202e;
}

.stat-block.accent span {
  color: #c7d0db;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(340px, 0.95fr) minmax(320px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.form-panel,
.qr-panel,
.list-panel {
  padding: 22px;
}

.panel-head {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-head h2 {
  margin: 0 0 4px;
  font-size: 21px;
}

.panel-head p {
  margin: 0;
  font-size: 14px;
}

form {
  display: grid;
  gap: 15px;
}

label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 14px;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 12px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(23, 122, 104, 0.13);
}

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

.field-row {
  gap: 12px;
}

.color-input {
  height: 45px;
  padding: 5px;
}

.primary,
.secondary {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.primary:hover,
.secondary:hover {
  background: var(--accent-strong);
}

.secondary {
  background: var(--ink);
  border-color: var(--ink);
}

.ghost {
  background: #ffffff;
  color: var(--ink);
  border-color: var(--line);
}

.full {
  width: 100%;
}

.qr-panel {
  position: sticky;
  top: 28px;
}

.qr-preview {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  width: min(100%, 380px);
  margin: 0 auto 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 18px;
}

.qr-preview svg {
  width: 100%;
  height: 100%;
}

.empty-qr {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #9aa4b2;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.value-box {
  min-height: 48px;
  overflow-wrap: anywhere;
  border-radius: 8px;
  background: #f7f9fb;
  border: 1px solid var(--line);
  padding: 12px;
  font-size: 14px;
}

.link-stack {
  display: grid;
  gap: 10px;
}

.link-stack div {
  display: grid;
  gap: 4px;
  min-height: 58px;
  overflow-wrap: anywhere;
  border-radius: 8px;
  background: #f7f9fb;
  border: 1px solid var(--line);
  padding: 12px;
  font-size: 14px;
}

.link-stack span {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.link-stack strong {
  font-weight: 750;
}

.button-row {
  gap: 10px;
  margin-top: 14px;
}

.button-row button {
  flex: 1;
}

.list-panel {
  margin-top: 18px;
}

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

.code-row {
  min-height: 74px;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.code-row.selected {
  border-color: var(--accent);
  background: #f3fbf9;
}

.code-swatch {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex: 0 0 auto;
}

.code-info {
  min-width: 0;
  flex: 1;
}

.code-info strong,
.code-info span {
  display: block;
}

.code-info span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.code-meta {
  display: grid;
  justify-items: end;
  gap: 4px;
  min-width: 110px;
  font-size: 13px;
}

.row-actions {
  display: flex;
  gap: 6px;
}

.icon-button {
  min-height: 36px;
  padding: 0 10px;
  background: #ffffff;
  color: var(--ink);
  border-color: var(--line);
  font-size: 13px;
}

.icon-button.danger {
  color: var(--danger);
}

.empty-state {
  padding: 24px;
  color: var(--muted);
  background: #f7f9fb;
  border: 1px dashed var(--line);
  border-radius: 8px;
  text-align: center;
}

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

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

  .nav-list {
    grid-template-columns: repeat(3, 1fr);
  }

  .qr-panel {
    position: static;
  }

  .auth-preview {
    display: none;
  }
}

@media (max-width: 680px) {
  .workspace,
  .auth-panel {
    padding: 18px;
  }

  .topbar,
  .stats-row,
  .field-row,
  .code-row,
  .button-row {
    align-items: stretch;
    flex-direction: column;
  }

  .plan-pill {
    width: 100%;
  }

  .code-meta {
    justify-items: start;
  }

  .row-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
}
