/* =========================================================
   AI메트로 — Admin console styles
   ========================================================= */

.admin-body { background: #f4f2ec; }

.admin-app { min-height: calc(100vh - 72px); padding: 40px 0 80px; }

/* loading */
.admin-loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 80px 20px; color: var(--muted);
  font-size: 14px;
}
.spinner {
  width: 32px; height: 32px; border-radius: 50%;
  border: 3px solid rgba(15,26,43,.15);
  border-top-color: var(--ink);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* gate */
.admin-gate {
  display: flex; justify-content: center; align-items: center;
  min-height: 70vh;
  padding: 40px 20px;
}
.admin-gate-inner {
  max-width: 520px;
  text-align: center;
  background: var(--white);
  border: 1px solid var(--line);
  padding: 56px 40px;
  border-radius: 4px;
}
.admin-gate-inner h1 {
  font-size: 32px;
  margin: 20px 0 16px;
  letter-spacing: -0.02em;
}
.gate-desc {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
  margin-bottom: 32px;
}
.gate-desc strong { color: var(--ink); }
.btn-google { padding: 14px 24px; display: inline-flex; align-items: center; gap: 10px; }
.gate-note {
  margin-top: 24px;
  color: var(--muted-2);
  font-size: 12px;
}

/* wrap */
.admin-wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px;
}

/* head */
.admin-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 24px; margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--ink);
  flex-wrap: wrap;
}
.admin-head h1 {
  font-size: 36px; letter-spacing: -0.02em;
  margin-top: 6px;
}
.admin-sub {
  color: var(--muted);
  font-size: 14px; margin-top: 8px;
  font-family: var(--sans);
}
.admin-head-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* toolbar */
.admin-toolbar {
  display: flex; justify-content: space-between;
  align-items: center; gap: 16px;
  margin-bottom: 20px;
  padding: 14px 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 2px;
  flex-wrap: wrap;
}
.admin-filter { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.admin-filter label {
  display: inline-flex; gap: 8px; align-items: center;
  font-size: 13px; color: var(--muted);
}
.admin-filter select, .admin-filter input {
  padding: 8px 10px; font-size: 13px;
  border: 1px solid var(--line-strong); background: var(--white);
  border-radius: 2px; font-family: var(--sans); outline: none;
}
.admin-filter input[type="search"] { min-width: 200px; }
.admin-filter select:focus, .admin-filter input:focus { border-color: var(--ink); }

/* table */
.admin-list {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.admin-table thead th {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: uppercase;
}
.admin-table tbody td {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.admin-table tbody tr:hover { background: rgba(15, 26, 43, .02); }
.admin-table tbody tr:last-child td { border-bottom: 0; }

.row-title { font-family: var(--serif); font-weight: 700; font-size: 16px; color: var(--ink); line-height: 1.4; }
.row-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.row-date { font-family: var(--mono); font-size: 12px; color: var(--muted-2); }

.cat-pill {
  display: inline-block;
  font-size: 12px;
  padding: 3px 10px;
  background: var(--paper);
  border-radius: 12px;
  color: var(--ink-soft);
}
.status-badge {
  display: inline-block;
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: 2px;
}
.status-pub { background: #dcead1; color: #2f6a2a; }
.status-draft { background: #f0e7c9; color: #7a5a18; }

.role-badge {
  display: inline-block;
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: 2px;
  vertical-align: middle;
  margin-left: 6px;
}
.role-owner    { background: var(--ink); color: var(--paper); }
.role-admin    { background: var(--ink); color: var(--paper); }
.role-editor   { background: #3e2d6b; color: #fff; }
.role-reporter { background: var(--accent); color: #fff; }
.role-reader   { background: var(--paper-2); color: var(--ink-soft); border: 1px solid var(--line); }
.role-guest    { background: var(--paper-2); color: var(--muted); }

/* ========== Admin Tabs ========== */
.admin-tabs {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
  padding: 0 4px;
  flex-wrap: wrap;
}
.admin-tab {
  background: transparent;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  font-family: var(--sans);
  border-radius: 2px 2px 0 0;
}
.admin-tab:hover { color: var(--ink); background: var(--paper); }
.admin-tab.active {
  color: var(--ink);
  border-bottom-color: var(--ink);
  font-weight: 700;
  background: var(--white);
}

/* ========== Editor Toolbar (WP-style) ========== */
.editor-toolbar {
  display: flex; flex-wrap: wrap; gap: 2px;
  padding: 6px 8px;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-bottom: 0;
  border-radius: 2px 2px 0 0;
}
.editor-toolbar button {
  background: transparent;
  border: 1px solid transparent;
  padding: 6px 10px;
  font-size: 13px;
  font-family: var(--sans);
  color: var(--ink);
  border-radius: 2px;
  cursor: pointer;
  min-width: 32px;
  height: 32px;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  transition: background .15s ease, border-color .15s ease;
}
.editor-toolbar button:hover {
  background: var(--white);
  border-color: var(--line-strong);
}
.editor-toolbar button[data-fmt="template"] {
  margin-left: auto;
  background: var(--ink); color: var(--paper);
  font-size: 12px; font-weight: 600;
  padding: 6px 12px;
}
.editor-toolbar button[data-fmt="template"]:hover { background: #1c2a3f; border-color: #1c2a3f; }
.editor-toolbar .tb-sep {
  width: 1px; background: var(--line);
  align-self: stretch; margin: 4px 4px;
}
#f-content {
  border-top-left-radius: 0 !important;
  border-top-right-radius: 0 !important;
}
.editor-counter {
  padding: 6px 10px;
  font-size: 12px;
  color: var(--muted-2);
  font-family: var(--mono);
  text-align: right;
}

/* ========== Template Picker ========== */
.tpl-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 26, 43, .6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 24px;
  animation: fadeIn .15s ease;
}
.tpl-modal {
  position: relative;
  background: var(--white);
  border-radius: 4px;
  width: 100%; max-width: 780px;
  padding: 40px 40px 32px;
  box-shadow: 0 24px 80px rgba(15, 26, 43, .45);
  max-height: 92vh;
  overflow-y: auto;
  animation: popIn .2s ease;
}
.tpl-close {
  position: absolute; top: 12px; right: 16px;
  width: 36px; height: 36px;
  font-size: 28px; line-height: 1;
  color: var(--muted);
  background: transparent; border: 0;
  border-radius: 50%;
}
.tpl-close:hover { background: var(--paper); color: var(--ink); }
.tpl-modal .eyebrow { margin-bottom: 16px; }
.tpl-modal h2 {
  font-family: var(--serif);
  font-size: 30px; letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.tpl-sub { color: var(--muted); font-size: 14px; line-height: 1.7; margin-bottom: 28px; }
.tpl-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.tpl-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 20px 22px;
  text-align: left;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
  font-family: var(--sans);
  display: flex; flex-direction: column; gap: 8px;
}
.tpl-card:hover {
  border-color: var(--ink);
  background: var(--white);
  transform: translateY(-2px);
}
.tpl-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  padding: 3px 10px;
  background: var(--ink); color: var(--paper);
  border-radius: 2px;
  align-self: flex-start;
  margin-bottom: 4px;
}
.tpl-card h3 { font-family: var(--serif); font-size: 20px; margin: 0; line-height: 1.3; color: var(--ink); }
.tpl-card p { font-size: 13px; color: var(--muted); line-height: 1.6; margin: 0; }
.tpl-blank {
  width: 100%;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  background: transparent;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  border-radius: 2px;
  font-family: var(--sans);
}
.tpl-blank:hover { border-color: var(--ink); color: var(--ink); background: var(--paper); }
@media (max-width: 640px) { .tpl-modal { padding: 28px 22px 24px; } .tpl-grid { grid-template-columns: 1fr; } }

/* ========== Users Table ========== */
.admin-users .user-av-sm {
  width: 32px; height: 32px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ink); color: var(--paper);
  font-family: var(--serif); font-weight: 700;
  font-size: 14px;
  object-fit: cover;
}
.admin-users .self-tag {
  display: inline-block;
  font-size: 10px;
  padding: 2px 6px;
  background: var(--accent); color: #fff;
  border-radius: 2px;
  vertical-align: middle;
  font-weight: 600;
  margin-left: 4px;
}
.role-select {
  padding: 7px 10px;
  font-size: 13px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: var(--white);
  font-family: var(--sans);
  min-width: 130px;
}
.role-select:focus { border-color: var(--ink); outline: none; }

/* ========== Inbox (문의함) ========== */
.inbox-item {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 2px;
  margin-bottom: 8px;
  overflow: hidden;
}
.inbox-item[open] { border-color: var(--ink); }
.inbox-item > summary {
  list-style: none;
  padding: 14px 18px;
  cursor: pointer;
  display: grid;
  grid-template-columns: auto auto 1fr 2fr auto;
  gap: 14px;
  align-items: center;
  font-size: 14px;
  transition: background .15s ease;
}
.inbox-item > summary::-webkit-details-marker { display: none; }
.inbox-item > summary:hover { background: var(--paper); }
.inbox-item .inbox-name { font-size: 13px; color: var(--ink); }
.inbox-item .inbox-subject {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inbox-item .inbox-date {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted-2);
  white-space: nowrap;
}
.inbox-body {
  padding: 20px 22px 22px;
  border-top: 1px solid var(--line);
  background: var(--paper);
}
.inbox-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 20px;
  margin-bottom: 16px;
  font-size: 13px;
}
.inbox-meta-grid .k {
  display: inline-block;
  min-width: 60px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-right: 8px;
}
.inbox-meta-grid a { color: var(--accent-ink); border-bottom: 1px solid currentColor; }
.inbox-message {
  background: var(--white);
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-soft);
  white-space: pre-wrap;
  margin: 0 0 14px;
  max-height: 400px;
  overflow: auto;
}
.inbox-actions { display: flex; gap: 6px; flex-wrap: wrap; }

@media (max-width: 720px) {
  .inbox-item > summary { grid-template-columns: 1fr; gap: 4px; padding: 12px 14px; }
  .inbox-meta-grid { grid-template-columns: 1fr; }
}

/* ========== Dashboard ========== */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.dash-card {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 22px;
  border-radius: 2px;
  display: flex; flex-direction: column; gap: 6px;
}
.dash-card .dash-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
}
.dash-card .dash-value {
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 900;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.dash-card .dash-hint {
  font-size: 12px;
  color: var(--muted-2);
}
.dash-card.accent {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.dash-card.accent .dash-label { color: var(--accent); }
.dash-card.accent .dash-value { color: var(--paper); }
.dash-card.accent .dash-hint { color: rgba(247,243,234,.6); }

.dash-recent {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 20px;
}
.dash-panel {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 24px;
  border-radius: 2px;
}
.dash-panel h3 {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.dash-panel ul li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.dash-panel ul li:last-child { border-bottom: 0; }
.dash-panel ul li a {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--ink);
  display: block;
  line-height: 1.4;
}
.dash-panel ul li a:hover { color: var(--accent-ink); }
.dash-panel ul li .meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted-2);
  margin-top: 4px;
}

@media (max-width: 900px) {
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-recent { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .dashboard-grid { grid-template-columns: 1fr; }
}

/* ========== Pages management ========== */
.pages-list { display: grid; gap: 12px; }
.page-row {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 16px 20px;
  border-radius: 2px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 16px;
  align-items: center;
}
.page-row .page-info { display: flex; flex-direction: column; gap: 4px; }
.page-row .page-title {
  font-family: var(--serif); font-weight: 700; font-size: 16px;
}
.page-row .page-slug {
  font-family: var(--mono); font-size: 11px;
  color: var(--muted);
}
.page-row .page-actions { display: flex; gap: 6px; }

.btn-danger { color: #b42a2a; }
.btn-danger:hover { background: #fce6e6; border-color: #e4b0b0; color: #b42a2a; }

.admin-empty, .admin-error {
  padding: 60px 40px; text-align: center;
  color: var(--muted);
}
.admin-empty h3, .admin-error h3 {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--ink);
  margin-bottom: 10px;
}
.admin-error .hint { font-size: 13px; margin-top: 12px; color: var(--muted-2); }

/* ===== Editor ===== */
.editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  align-items: start;
}
.editor-main {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 32px;
}
.editor-main .form-row { margin-bottom: 22px; }
.editor-main label {
  display: block;
  font-weight: 600; font-size: 13px;
  color: var(--ink); margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.editor-main .req { color: #b42a2a; }
.label-hint {
  display: block;
  font-weight: 400; font-size: 12px; color: var(--muted);
  margin-top: 3px;
  line-height: 1.6;
}
.label-hint code {
  background: var(--paper); padding: 1px 5px;
  border-radius: 2px; font-size: 11.5px;
}
.editor-main input[type="text"],
.editor-main input[type="url"],
.editor-main textarea,
.editor-main select {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--sans);
  font-size: 15px;
  background: var(--white);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  color: var(--ink);
  outline: none;
  transition: border-color .15s ease;
}
.editor-main input:focus,
.editor-main textarea:focus,
.editor-main select:focus {
  border-color: var(--ink);
}
#f-title { font-family: var(--serif); font-size: 22px; font-weight: 700; }
#f-content {
  min-height: 420px;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.8;
  resize: vertical;
}
#f-excerpt { resize: vertical; }

/* preview */
.preview-box {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px dashed var(--line-strong);
}
.preview-title {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--muted);
  margin-bottom: 16px;
  text-transform: uppercase;
}
.preview-content {
  padding: 24px;
  background: var(--paper);
  border-radius: 2px;
  font-size: 16px;
  line-height: 1.9;
  color: var(--ink-soft);
}
.preview-content h2 { font-family: var(--serif); font-size: 22px; margin: 24px 0 12px; color: var(--ink); }
.preview-content p { margin-bottom: 14px; }
.preview-content blockquote {
  margin: 14px 0; padding: 10px 0 10px 20px;
  border-left: 3px solid var(--accent);
  font-family: var(--serif); font-style: italic;
  color: var(--ink);
}
.preview-content ul { margin: 10px 0 10px 22px; list-style: disc; }
.preview-content a { color: var(--accent-ink); text-decoration: underline; }
.preview-content strong { color: var(--ink); }

/* side */
.editor-side {
  display: flex; flex-direction: column; gap: 16px;
  position: sticky;
  top: 88px;
}
.side-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 20px 22px;
}
.side-card h4 {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.side-card .form-row { margin-bottom: 14px; }
.side-card .form-row:last-child { margin-bottom: 0; }
.side-card input, .side-card select, .side-card textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 13px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: var(--white);
  font-family: var(--sans);
  outline: none;
}
.side-card input:focus, .side-card select:focus { border-color: var(--ink); }
.hue-val {
  width: 36px; height: 36px; border-radius: 2px;
  border: 1px solid var(--line-strong);
  display: inline-block;
  flex-shrink: 0;
}
.side-actions { display: flex; flex-direction: column; gap: 10px; }
.btn-block { width: 100%; justify-content: center; padding: 12px 16px; }
.side-info p { font-size: 13px; color: var(--ink); line-height: 1.7; }
.side-info .muted { color: var(--muted); font-size: 12px; }

/* toast */
.admin-toast {
  position: fixed;
  bottom: 32px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--paper);
  padding: 14px 22px;
  border-radius: 2px;
  font-size: 14px;
  box-shadow: 0 6px 24px rgba(15,26,43,.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 999;
}
.admin-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* header auth widget */
#authWidget { display: flex; align-items: center; gap: 8px; }
.auth-loading { font-size: 12px; color: var(--muted); padding: 0 10px; }

.user-widget { position: relative; }
.user-trigger {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--white);
  font-size: 13px;
  color: var(--ink);
  max-width: 200px;
  transition: border-color .15s ease, background .15s ease;
}
.user-trigger:hover { border-color: var(--line-strong); }
.user-trigger img {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.user-avatar-fallback {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--ink); color: var(--paper);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-weight: 700; font-size: 14px;
  flex-shrink: 0;
}
.user-name {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 140px;
  font-weight: 500;
}
.user-menu {
  position: absolute;
  top: calc(100% + 8px); right: 0;
  min-width: 240px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 2px;
  box-shadow: 0 10px 32px rgba(15,26,43,.12);
  overflow: hidden;
  z-index: 60;
}
.user-menu-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.user-menu-name { font-weight: 600; font-size: 14px; }
.user-menu-email { font-size: 12px; color: var(--muted); margin-top: 2px; word-break: break-all; }
.user-menu-item {
  display: block;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--ink);
  text-align: left;
  width: 100%;
  border-bottom: 1px solid var(--line);
  background: transparent;
}
.user-menu-item:last-child { border-bottom: 0; }
.user-menu-item:hover { background: var(--paper); color: var(--accent-ink); }
.user-menu-signout { color: #b42a2a; }
.user-menu-signout:hover { background: #fce6e6; color: #b42a2a; }

/* ============================================
   Auth Modal (Google + Email)
   ============================================ */
.auth-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 26, 43, .55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn .15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

.auth-modal {
  position: relative;
  background: var(--white);
  border-radius: 4px;
  width: 100%;
  max-width: 420px;
  padding: 36px 32px 32px;
  box-shadow: 0 20px 60px rgba(15, 26, 43, .35);
  animation: popIn .2s ease;
  max-height: 92vh;
  overflow-y: auto;
}
.auth-modal-close {
  position: absolute; top: 10px; right: 14px;
  width: 32px; height: 32px;
  font-size: 26px; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; line-height: 1;
}
.auth-modal-close:hover { background: var(--paper); color: var(--ink); }

.auth-modal-brand {
  display: inline-flex; align-items: center; gap: 6px;
  margin-bottom: 20px;
}
.auth-modal-brand .metro-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ink);
  display: inline-block;
}
.auth-modal-brand .metro-line {
  width: 16px; height: 2px; background: var(--ink);
  display: inline-block;
}
.auth-modal-brandname {
  font-family: var(--serif); font-weight: 900; font-size: 17px;
  margin-left: 6px;
}
.auth-modal-title {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.auth-modal-sub {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 24px;
}

.btn-google-full {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 16px;
  background: var(--white);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  font-size: 14px; font-weight: 500;
  transition: all .15s ease;
  font-family: var(--sans);
}
.btn-google-full:hover { background: var(--paper); border-color: var(--ink); }
.btn-google-full:disabled { opacity: .6; cursor: not-allowed; }

.auth-divider {
  text-align: center;
  margin: 20px 0 16px;
  position: relative;
  color: var(--muted);
  font-size: 12px;
}
.auth-divider::before, .auth-divider::after {
  content: ""; position: absolute; top: 50%;
  width: calc(50% - 50px); height: 1px;
  background: var(--line);
}
.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }
.auth-divider span { background: var(--white); padding: 0 12px; }

.auth-tabs {
  display: flex;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.auth-tab {
  flex: 1;
  padding: 10px 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-family: var(--sans);
}
.auth-tab:hover { color: var(--ink); }
.auth-tab.active { color: var(--ink); border-bottom-color: var(--ink); font-weight: 700; }

.auth-form { display: flex; flex-direction: column; gap: 8px; }
.auth-form label {
  font-size: 12px; font-weight: 600; color: var(--ink);
  margin-top: 6px;
  display: flex; align-items: center; gap: 6px;
}
.auth-form .auth-opt { color: var(--muted-2); font-weight: 400; font-size: 11px; }
.auth-form input {
  padding: 11px 14px;
  font-family: var(--sans); font-size: 14px;
  background: var(--white);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  outline: none; color: var(--ink);
  transition: border-color .15s ease;
}
.auth-form input:focus { border-color: var(--ink); }

.auth-row-between {
  display: flex; justify-content: flex-end;
  margin: 4px 0 4px;
}
.auth-link {
  background: transparent;
  color: var(--accent-ink);
  font-size: 12px;
  padding: 4px 0;
  font-family: var(--sans);
}
.auth-link:hover { text-decoration: underline; }
.auth-link-inline { color: var(--accent-ink); text-decoration: underline; }

.auth-submit {
  margin-top: 12px;
  width: 100%;
  padding: 13px;
  justify-content: center;
}
.auth-submit:disabled { opacity: .6; cursor: not-allowed; }

.auth-hint {
  font-size: 11px; color: var(--muted-2);
  margin-top: 10px;
  line-height: 1.6;
  text-align: center;
}

.auth-err {
  font-size: 12px;
  color: #b42a2a;
  background: #fce6e6;
  padding: 9px 12px;
  border-radius: 2px;
  margin-top: 10px;
  line-height: 1.5;
}
.auth-err.ok {
  color: #2f6a2a;
  background: #dcead1;
}

@media (max-width: 480px) {
  .auth-modal { padding: 28px 22px 24px; }
  .auth-modal-title { font-size: 22px; }
}

/* responsive */
@media (max-width: 1000px) {
  .editor-layout { grid-template-columns: 1fr; }
  .editor-side { position: static; }
  .user-name { display: none; }
  .user-trigger { padding: 2px; }
}
@media (max-width: 640px) {
  .admin-wrap { padding: 0 20px; }
  .admin-head h1 { font-size: 28px; }
  .admin-table { font-size: 13px; }
  .admin-table thead th { padding: 10px; font-size: 11px; }
  .admin-table tbody td { padding: 12px 10px; }
  .admin-filter { width: 100%; }
  .admin-filter input[type="search"] { min-width: 100%; }
  .admin-toolbar { flex-direction: column; align-items: stretch; }
}
