:root {
  --bg: #07111E;
  --panel: #0D1E38;
  --panel-2: #122040;
  --border: rgba(255, 255, 255, 0.08);
  --text: #E8EDF2;
  --muted: rgba(232, 237, 242, 0.45);
  --accent: #4cfcff;
  --yellow: #fff228;
  --red: #f87171;
  --success: #4ade80;
  --radius: 10px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --serif: 'Outfit', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }
button { cursor: pointer; font: inherit; }
input, textarea, select { font: inherit; }

/* ── Login ─────────────────────────────────────────────── */
#screen-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(ellipse at 40% 30%, #0d2556 0%, var(--bg) 65%);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 36px;
}

.login-card .logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.login-card .logo-wrap img { width: 36px; height: 36px; }

.login-card .logo-wrap span {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.04em;
}

.login-card h1 {
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
}

.login-card p.sub {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 28px;
}

/* ── Dashboard layout ──────────────────────────────────── */
#screen-dashboard {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.dash-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 17, 30, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  height: 60px;
  gap: 24px;
}

.dash-topbar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.dash-topbar__brand img { width: 28px; height: 28px; }

.dash-topbar__brand span {
  font-family: var(--serif);
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.04em;
}

.dash-tabs {
  display: flex;
  gap: 4px;
  flex: 1;
  overflow-x: auto;
}

.dash-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  background: none;
  border: none;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s;
  cursor: pointer;
}

.dash-tab:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.dash-tab.active { color: var(--accent); background: rgba(76,252,255,0.1); }

.dash-tab .badge {
  background: var(--accent);
  color: #000;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 99px;
  min-width: 18px;
  text-align: center;
}

.dash-topbar__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.dash-topbar__actions a {
  font-size: 0.78rem;
  color: var(--muted);
}

/* ── Main content ──────────────────────────────────────── */
.dash-main {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px 60px;
}

/* ── Tab panes ─────────────────────────────────────────── */
.tab-pane { display: none; }
.tab-pane.active { display: block; }

.pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
}

.pane-header h2 {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
}

/* ── Buttons ──────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 20px;
  min-height: 40px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  white-space: nowrap;
  text-decoration: none;
}

.btn:hover { opacity: 0.88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--accent); color: #000; }
.btn-ghost { background: rgba(255,255,255,0.07); color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: rgba(248,113,113,0.15); color: var(--red); border: 1px solid rgba(248,113,113,0.25); }
.btn-sm { padding: 0 14px; min-height: 32px; font-size: 0.78rem; }

/* ── Forms ────────────────────────────────────────────── */
.form-grid { display: grid; gap: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-full { grid-column: 1 / -1; }

label.field { display: flex; flex-direction: column; gap: 6px; }

label.field > span {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

label.field small {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  margin-top: 2px;
}

.field-input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="datetime-local"],
input[type="url"],
select,
textarea {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 0.9rem;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}

.field-input:focus,
input:focus,
textarea:focus,
select:focus {
  border-color: rgba(76, 252, 255, 0.5);
}

input[type="file"] {
  padding: 8px 12px;
  background: rgba(255,255,255,0.03);
  color: var(--muted);
  font-size: 0.82rem;
}

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

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
}

.checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--accent);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.status-msg {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
}
.status-msg.success { background: rgba(74,222,128,0.12); color: var(--success); }
.status-msg.error { background: rgba(248,113,113,0.12); color: var(--red); }
.status-msg.loading { color: var(--muted); }

/* ── Article form panel ──────────────────────────────── */
.article-form-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 28px;
}

.article-form-panel h3 {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

/* ── Quill editor ────────────────────────────────────── */
.quill-wrapper {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.ql-toolbar.ql-snow {
  background: rgba(255,255,255,0.04);
  border: none;
  border-bottom: 1px solid var(--border) !important;
}

.ql-container.ql-snow {
  border: none !important;
  background: rgba(255,255,255,0.03);
  font-size: 0.92rem;
  font-family: var(--font);
  min-height: 180px;
}

.ql-editor { color: var(--text); min-height: 180px; }
.ql-editor.ql-blank::before { color: var(--muted); font-style: normal; }

.ql-snow .ql-stroke { stroke: var(--muted); }
.ql-snow .ql-fill { fill: var(--muted); }
.ql-snow .ql-picker { color: var(--muted); }
.ql-snow .ql-picker-options { background: var(--panel-2); border-color: var(--border); }
.ql-snow.ql-toolbar button:hover .ql-stroke,
.ql-snow.ql-toolbar button.ql-active .ql-stroke { stroke: var(--accent); }
.ql-snow.ql-toolbar button:hover .ql-fill,
.ql-snow.ql-toolbar button.ql-active .ql-fill { fill: var(--accent); }
.ql-snow.ql-toolbar button.ql-active { color: var(--accent); }

/* ── Image preview ───────────────────────────────────── */
.img-preview-wrap {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}

.img-preview-wrap img {
  width: 100px;
  height: 70px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

/* ── Articles list ───────────────────────────────────── */
.articles-table {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.article-row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: border-color 0.2s;
}

.article-row:hover { border-color: rgba(76,252,255,0.2); }

.article-row__thumb {
  width: 72px;
  height: 50px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--panel-2);
}

.article-row__thumb-placeholder {
  width: 72px;
  height: 50px;
  border-radius: 6px;
  background: var(--panel-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: rgba(255,255,255,0.15);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.article-row__info { flex: 1; min-width: 0; }

.article-row__title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.article-row__meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-pub {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  letter-spacing: 0.06em;
}
.badge-pub.published { background: rgba(74,222,128,0.15); color: var(--success); }
.badge-pub.draft { background: rgba(255,255,255,0.08); color: var(--muted); }

.article-row__actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ── Messages list ──────────────────────────────────── */
.messages-list { display: flex; flex-direction: column; gap: 12px; }

.message-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
}

.message-card__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.message-card__name { font-weight: 700; color: #fff; }
.message-card__email { font-size: 0.82rem; color: var(--accent); }
.message-card__phone { font-size: 0.82rem; color: var(--muted); }
.message-card__date { font-size: 0.72rem; color: var(--muted); }
.message-card__body { font-size: 0.88rem; color: rgba(232,237,242,0.7); white-space: pre-wrap; line-height: 1.6; }

/* ── Settings panel ─────────────────────────────────── */
.settings-section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.settings-section + .settings-section { margin-top: 20px; }

.settings-section h3 {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.settings-info {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 22px;
  padding: 12px 16px;
  background: rgba(76,252,255,0.05);
  border: 1px solid rgba(76,252,255,0.15);
  border-radius: 8px;
}

.settings-info a { color: var(--accent); }

/* ── Google reviews preview ─────────────────────────── */
.reviews-preview {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.review-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}

.review-card__stars { color: var(--yellow); font-size: 0.85rem; margin-bottom: 6px; }
.review-card__text { font-size: 0.85rem; color: rgba(232,237,242,0.7); line-height: 1.6; margin-bottom: 8px; font-style: italic; }
.review-card__author { font-size: 0.75rem; font-weight: 700; color: #fff; }
.review-card__date { font-size: 0.7rem; color: var(--muted); }

.google-stats {
  display: flex;
  gap: 24px;
  margin-bottom: 20px;
  align-items: baseline;
}

.google-stats__score {
  font-family: var(--serif);
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--yellow);
  line-height: 1;
}

.google-stats__detail { font-size: 0.82rem; color: var(--muted); }

/* ── Empty/loading states ───────────────────────────── */
.empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
  font-size: 0.9rem;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}

/* ── Doc + form side-by-side grid ──────────────────────── */
.doc-form-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

/* ── Documentation panel ───────────────────────────────── */
.doc-panel {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(76, 252, 255, 0.1);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 20px;
  position: sticky;
  top: 80px;
}

.doc-panel__title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

/* ── Steps ─────────────────────────────────────────────── */
.doc-steps {
  display: flex;
  flex-direction: column;
}

.doc-step {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.doc-step:first-child { padding-top: 0; }
.doc-step:last-child { border-bottom: none; padding-bottom: 0; }

.doc-step__num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(76, 252, 255, 0.1);
  border: 1px solid rgba(76, 252, 255, 0.3);
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.doc-step__body { flex: 1; min-width: 0; }

.doc-step__title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.35;
}

.doc-step__text {
  font-size: 0.78rem;
  color: rgba(232, 237, 242, 0.55);
  line-height: 1.65;
}

.doc-step__text a { color: var(--accent); }

.doc-step__text code {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.74rem;
  font-family: 'Courier New', monospace;
  color: var(--yellow);
}

.doc-step__text em { color: var(--muted); font-style: italic; }
.doc-step__text strong { color: var(--text); }

.doc-field {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(232, 237, 242, 0.8);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  padding: 1px 5px;
}

.doc-note {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.74rem;
  color: rgba(232, 237, 242, 0.4);
  line-height: 1.6;
}

.doc-note strong { color: rgba(232, 237, 242, 0.6); }

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 860px) {
  .doc-form-grid { grid-template-columns: 1fr; }
  .doc-panel { position: static; }
}

@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
  .dash-topbar { padding: 0 16px; gap: 12px; }
  .dash-topbar__brand span { display: none; }
  .dash-main { padding: 24px 16px 48px; }
  .article-row__thumb, .article-row__thumb-placeholder { display: none; }
}
