/* ==========================================================================
   EVO.AL — Admin panel styles
   ========================================================================== */

:root {
  --brand: #2563EB;
  --brand-600: #1d4ed8;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius: 16px;
  --sidebar-w: 250px;
}

[data-theme="dark"] {
  --bg: #0b1120;
  --bg-2: #0f172a;
  --panel: #131c2e;
  --panel-2: #182238;
  --border: rgba(255, 255, 255, .09);
  --border-strong: rgba(255, 255, 255, .16);
  --text: #f1f5f9;
  --text-soft: #aeb9ca;
  --text-mute: #6b7688;
  --shadow: 0 20px 50px rgba(0, 0, 0, .35);
}
[data-theme="light"] {
  --bg: #F8FAFC;
  --bg-2: #eef2f9;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --border: rgba(17, 24, 39, .1);
  --border-strong: rgba(17, 24, 39, .18);
  --text: #111827;
  --text-soft: #4b5563;
  --text-mute: #9aa4b2;
  --shadow: 0 20px 50px rgba(17, 24, 39, .12);
}

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

.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 25%, transparent); display: inline-block; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 22px 16px;
  z-index: 50;
  transition: transform .3s var(--ease);
}
.side-logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -.02em; padding: 4px 8px 22px; }
.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.side-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 12px;
  color: var(--text-soft); font-weight: 600; font-size: 14.5px;
  transition: background .2s, color .2s;
}
.side-nav a i { width: 20px; text-align: center; }
.side-nav a:hover { background: var(--panel); color: var(--text); }
.side-nav a.is-active { background: color-mix(in srgb, var(--brand) 16%, transparent); color: var(--text); }
.side-nav a.is-active i { color: var(--brand); }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #f43f5e; color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }

.side-foot { display: flex; flex-direction: column; gap: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.side-visit { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; color: var(--text-mute); font-size: 13.5px; font-weight: 600; }
.side-visit:hover { color: var(--text); background: var(--panel); }
.side-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; background: var(--panel); }
.side-user-info { flex: 1; min-width: 0; }
.side-user-info strong { display: block; font-size: 14px; }
.side-user-info small { color: var(--text-mute); font-size: 12px; }
.side-logout { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--border); background: transparent; color: var(--text-soft); display: grid; place-items: center; transition: .2s; }
.side-logout:hover { background: #dc2626; color: #fff; border-color: #dc2626; }

.sidebar-toggle {
  position: fixed; top: 16px; left: 16px; z-index: 60;
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--border); color: var(--text);
  display: none; place-items: center; font-size: 17px;
  box-shadow: var(--shadow);
}
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 40; }

/* ---------- Main ---------- */
.admin-main { margin-left: var(--sidebar-w); padding: 34px 34px 60px; max-width: 1240px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head h1 { font-size: 27px; font-weight: 800; letter-spacing: -.02em; }
.page-sub { color: var(--text-mute); font-size: 14px; margin-top: 4px; }
.back-link { display: inline-flex; align-items: center; gap: 8px; color: var(--text-mute); font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.back-link:hover { color: var(--text); }

/* ---------- Buttons ---------- */
.btn-primary {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 18px; border-radius: 12px;
  background: var(--brand); color: #fff; border: none;
  font-weight: 700; font-size: 14px;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--brand) 35%, transparent);
  transition: transform .2s var(--ease), background .2s, box-shadow .2s;
}
.btn-primary:hover { transform: translateY(-2px); background: var(--brand-600); }
.btn-primary:active { transform: scale(.97); }
.btn-primary:disabled { opacity: .6; pointer-events: none; }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 18px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--border); color: var(--text);
  font-weight: 600; font-size: 14px; transition: .2s;
}
.btn-ghost:hover { border-color: var(--border-strong); }
.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 10px; }

/* ---------- Stat cards ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat-grid-2 { grid-template-columns: repeat(2, 1fr); max-width: 560px; }
.stat-card {
  display: flex; align-items: center; gap: 14px;
  padding: 20px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--border);
}
.stat-ico { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-size: 18px; color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); }
.stat-card strong { display: block; font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.stat-card span { color: var(--text-mute); font-size: 13px; }

/* ---------- Panels ---------- */
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin-bottom: 22px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.panel-head h2 { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.panel-foot { margin-top: 20px; display: flex; justify-content: flex-end; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }

/* ---------- Rank lists ---------- */
.rank-list { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.rank-list li { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 12px; transition: background .2s; }
.rank-list li:hover { background: var(--panel-2); }
.rank-n { width: 22px; text-align: center; color: var(--text-mute); font-weight: 700; font-size: 13px; }
.rank-av { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand), #7c3aed); color: #fff; font-weight: 700; font-size: 14px; flex: 0 0 auto; }
.rank-av img { width: 100%; height: 100%; object-fit: cover; }
.rank-ico { background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c); }
.rank-meta { flex: 1; min-width: 0; }
.rank-meta strong { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-meta small { color: var(--text-mute); font-size: 12px; }
.rank-val { font-weight: 800; font-size: 15px; }
.muted { color: var(--text-mute); font-size: 14px; padding: 6px; }

/* ---------- Chart ---------- */
.chart { width: 100%; height: 180px; }
.chart-lg { height: 240px; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart .bar { fill: var(--brand); transition: fill .2s; }
.chart .bar:hover { fill: #7c3aed; }
.chart .axis-label { fill: var(--text-mute); font-size: 10px; }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }

/* ---------- Analytics ---------- */
.an-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; }

/* Range segmented control */
.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 4px; gap: 2px; }
.seg-btn { padding: 7px 15px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--text-mute); transition: .2s; }
.seg-btn:hover { color: var(--text); }
.seg-btn.is-active { background: var(--brand); color: #fff; }

/* KPI delta pills + card body */
.stat-body { display: flex; flex-direction: column; }
.kpi-delta { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; padding: 2px 8px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.kpi-delta.is-up { color: #16A34A; background: color-mix(in srgb, #16A34A 15%, transparent); }
.kpi-delta.is-down { color: #DC2626; background: color-mix(in srgb, #DC2626 15%, transparent); }
.kpi-delta.is-flat, .kpi-delta.is-new { color: var(--text-mute); background: var(--panel-2); }
.kpi-hint { margin-top: 6px; color: var(--text-mute); font-size: 11px; }

/* Area chart */
.chart-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.chart-head h2 { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.legend { display: flex; gap: 16px; }
.legend .lg { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--text-soft); }
.legend .lg i { width: 11px; height: 11px; border-radius: 3px; }
.legend .lg-views i { background: #3B82F6; }
.legend .lg-clicks i { background: #A855F7; }
.area-chart .ac-grid { stroke: var(--border); stroke-width: 1; }
.area-chart .ac-ytext, .area-chart .ac-xtext { fill: var(--text-mute); font-size: 9px; }
.area-chart .ac-line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.area-chart .line-views { stroke: #3B82F6; }
.area-chart .line-clicks { stroke: #A855F7; }
.area-chart .ac-dot { stroke: var(--panel); stroke-width: 2; }
.area-chart .dot-views { fill: #3B82F6; }
.area-chart .dot-clicks { fill: #A855F7; }
.area-chart .ac-hit { fill: transparent; cursor: crosshair; }

/* Horizontal breakdown bars (sources / devices) */
.bar-list { list-style: none; display: flex; flex-direction: column; gap: 13px; }
.bar-row { display: flex; align-items: center; gap: 12px; }
.bar-ico { width: 34px; height: 34px; border-radius: 10px; flex: 0 0 auto; display: grid; place-items: center; font-size: 14px; color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); }
.bar-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.bar-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 600; }
.bar-label small { color: var(--text-mute); font-weight: 600; }
.bar-track { height: 7px; border-radius: 20px; background: var(--panel-2); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 20px; background: var(--c); min-width: 4px; transition: width .5s var(--ease); }
.bar-val { flex: 0 0 auto; min-width: 40px; text-align: right; font-size: 14px; font-weight: 800; }

/* Mini click-share bar under each ranked link */
.rank-track { display: block; margin-top: 5px; height: 5px; border-radius: 20px; background: var(--panel-2); overflow: hidden; }
.rank-fill { display: block; height: 100%; border-radius: 20px; background: linear-gradient(90deg, var(--brand), #7c3aed); transition: width .5s var(--ease); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: -6px; padding: 6px; }
.data-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.data-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-mute); padding: 0 14px 12px; font-weight: 700; }
.data-table td { padding: 12px 14px; border-top: 1px solid var(--border); font-size: 14px; }
.ta-c { text-align: center; } .ta-r { text-align: right; }
.cell-user { display: flex; align-items: center; gap: 12px; }
.cell-av { width: 38px; height: 38px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand), #7c3aed); color: #fff; font-weight: 700; flex: 0 0 auto; }
.cell-av img { width: 100%; height: 100%; object-fit: cover; }
.cell-user strong { display: block; font-size: 14px; }
.cell-user small { color: var(--text-mute); font-size: 12px; }
.link-mono { color: var(--brand); font-weight: 600; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-admin { background: color-mix(in srgb, #7c3aed 20%, transparent); color: #a78bfa; }
.badge-user { background: color-mix(in srgb, var(--brand) 18%, transparent); color: #60a5fa; }
.badge-pro { background: color-mix(in srgb, #f59e0b 20%, transparent); color: #fbbf24; }
.badge-free { background: color-mix(in srgb, #6b7688 20%, transparent); color: #9aa4b2; }
.badge-order-pending { background: color-mix(in srgb, #f59e0b 20%, transparent); color: #fbbf24; }
.badge-order-paid { background: color-mix(in srgb, #16a34a 20%, transparent); color: #4ade80; }
.badge-order-cancelled { background: color-mix(in srgb, #6b7688 20%, transparent); color: #9aa4b2; }
.row-actions { display: inline-flex; gap: 6px; }
.row-actions form { display: inline; }
.icon-btn { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text-soft); display: grid; place-items: center; font-size: 13px; transition: .2s; }
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.icon-danger:hover { background: #dc2626; color: #fff; border-color: #dc2626; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field[hidden] { display: none; }
.field-full { grid-column: 1 / -1; }
.field > span, .field-label { font-size: 13px; font-weight: 600; color: var(--text-soft); }
.field > span small { color: var(--text-mute); font-weight: 400; }
.field-link { font-size: 12px; font-weight: 500; color: var(--brand); text-decoration: none; float: right; }
.field-link:hover { text-decoration: underline; }
.field input, .field select, .field textarea {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 11px;
  padding: 11px 13px; color: var(--text); font-size: 14px; width: 100%;
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent);
}
.field textarea { resize: vertical; }
.field input[type="color"] { padding: 4px; height: 44px; cursor: pointer; }

.switch-field { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--text-soft); flex-direction: row; cursor: pointer; }
.switch-field > input[type="checkbox"] { position: absolute; opacity: 0; width: 0; height: 0; margin: 0; }
.switch { position: relative; display: inline-block; width: 44px; height: 26px; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch > span, .switch-field .switch { display: inline-block; }
.switch-field .switch { width: 44px; height: 26px; background: var(--border-strong); border-radius: 999px; position: relative; transition: background .2s; }
.switch-field .switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); }
.switch-field input:checked + .switch { background: var(--brand); }
.switch-field input:checked + .switch::after { transform: translateX(18px); }

.switch.mini { width: 40px; height: 23px; }
.switch.mini span { position: absolute; inset: 0; background: var(--border-strong); border-radius: 999px; transition: background .2s; }
.switch.mini span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); }
.switch.mini input:checked ~ span { background: #16a34a; }
.switch.mini input:checked ~ span::after { transform: translateX(17px); }

/* ---------- Upload ---------- */
.upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
.upload-box { display: flex; flex-direction: column; gap: 10px; }
.upload-preview { border-radius: 14px; border: 1px dashed var(--border-strong); background: var(--panel-2) center/cover no-repeat; display: grid; place-items: center; color: var(--text-mute); font-size: 24px; }
.avatar-prev { width: 90px; height: 90px; border-radius: 50%; }
.bg-prev { height: 90px; }
.upload-btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--border); font-size: 13px; font-weight: 600; color: var(--text-soft); cursor: pointer; width: fit-content; transition: .2s; }
.upload-btn:hover { border-color: var(--border-strong); color: var(--text); }

/* ---------- Editor layout ---------- */
.editor-grid { display: grid; grid-template-columns: 1fr 380px; gap: 24px; align-items: start; }
.editor-main { min-width: 0; }
.editor-side { position: sticky; top: 24px; }
.preview-frame { background: var(--panel); border: 1px solid var(--border); border-radius: 26px; padding: 12px; box-shadow: var(--shadow); }
.preview-top { display: flex; gap: 6px; justify-content: center; padding: 6px 0 10px; }
.preview-top span { width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); }
.preview-frame iframe { width: 100%; height: 620px; border: none; border-radius: 18px; background: var(--bg); display: block; }
.preview-empty { height: 420px; display: grid; place-content: center; justify-items: center; gap: 12px; text-align: center; color: var(--text-mute); padding: 20px; }
.preview-empty i { font-size: 34px; }

/* ---------- Link manager ---------- */
.link-form { background: var(--panel-2); border: 1px solid var(--border); border-radius: 14px; padding: 18px; margin-bottom: 18px; }
.link-form-actions { display: flex; gap: 10px; margin-top: 16px; }
.link-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.link-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 14px;
  background: var(--panel-2); border: 1px solid var(--border);
  transition: border-color .2s, opacity .2s, transform .12s;
}
.link-item.is-off { opacity: .5; }
.link-item.dragging { opacity: .4; border-style: dashed; }
.link-item.drag-over { border-color: var(--brand); }
.drag-handle { color: var(--text-mute); cursor: grab; font-size: 14px; }
.drag-handle:active { cursor: grabbing; }
.li-ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-size: 17px; color: #fff; background: linear-gradient(140deg, var(--c), color-mix(in srgb, var(--c) 65%, #000 12%)); flex: 0 0 auto; }
.li-meta { flex: 1; min-width: 0; }
.li-meta strong { display: flex; align-items: center; gap: 6px; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-meta small { color: var(--text-mute); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.li-tag {
  flex: 0 0 auto; display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .03em;
  background: color-mix(in srgb, var(--brand) 18%, transparent); color: #60a5fa;
}
.li-tag-sched { background: color-mix(in srgb, #f59e0b 20%, transparent); color: #fbbf24; padding: 2px 7px; }
.li-tag-social { background: color-mix(in srgb, #ec4899 20%, transparent); color: #f472b6; }
.li-tag-group { background: color-mix(in srgb, #8b5cf6 20%, transparent); color: #a78bfa; }
.li-tag-pkg { background: color-mix(in srgb, #f59e0b 20%, transparent); color: #fbbf24; }

/* ---------- Packages row editor (link form) ---------- */
.pkg-editor { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.pkg-row {
  display: grid; grid-template-columns: 1.2fr .7fr 1.6fr auto;
  gap: 8px; align-items: center;
}
.pkg-row input {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 9px;
  padding: 8px 10px; color: var(--text); font-size: 13px; width: 100%;
}
.pkg-row input:focus { outline: none; border-color: var(--brand); }
.pkg-row .pkg-remove { width: 32px; height: 32px; flex: 0 0 auto; }
.pkg-add { align-self: flex-start; }

.verified-badge { color: #2563EB; }
.li-clicks { font-size: 12px; color: var(--text-mute); white-space: nowrap; }
.empty-links { text-align: center; color: var(--text-mute); padding: 20px; font-size: 14px; }
.is-hidden { display: none; }

/* ---------- Alerts ---------- */
.alert { display: flex; align-items: center; gap: 10px; padding: 12px 15px; border-radius: 12px; font-size: 14px; font-weight: 600; margin-bottom: 18px; }
.alert-error { background: color-mix(in srgb, #dc2626 16%, transparent); color: #fca5a5; border: 1px solid color-mix(in srgb, #dc2626 30%, transparent); }
.alert-pending { background: color-mix(in srgb, #f59e0b 14%, transparent); color: #fbbf24; border: 1px solid color-mix(in srgb, #f59e0b 28%, transparent); }
.alert-pending a { color: inherit; text-decoration: underline; }

/* ---------- Login / Register ---------- */
.login-page { display: grid; place-items: center; min-height: 100vh; padding: 24px;
  background: radial-gradient(900px 500px at 50% -10%, color-mix(in srgb, var(--brand) 20%, transparent), transparent 60%), var(--bg); }
.login-card { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--border); border-radius: 24px; padding: 36px; box-shadow: var(--shadow); }
.register-card { width: min(560px, 100%); }
.login-logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; margin-bottom: 22px; }
.login-card h1 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.login-sub { color: var(--text-mute); font-size: 14px; margin: 6px 0 24px; }
.login-card form { display: flex; flex-direction: column; gap: 16px; }
.login-card .field span { margin-bottom: 0; }
.login-hint { text-align: center; color: var(--text-mute); font-size: 12px; margin-top: 18px; }
.login-hint a { color: var(--brand); font-weight: 600; }
code { background: var(--panel-2); padding: 2px 7px; border-radius: 6px; font-size: .9em; }
.hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* ---------- Pricing / plan picker ---------- */
.plan-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }
@media (max-width: 560px) { .plan-picker { grid-template-columns: 1fr; } }
.plan-picker-standalone { max-width: 640px; }
.plan-card {
  position: relative; display: block; cursor: pointer;
  padding: 20px 18px; border-radius: 16px;
  background: var(--panel-2); border: 2px solid var(--border);
  transition: border-color .2s, transform .2s var(--ease);
}
.plan-card input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.plan-card:hover { transform: translateY(-2px); }
.plan-card:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, var(--panel-2)); }
.plan-card.is-featured { border-color: color-mix(in srgb, #f59e0b 45%, var(--border)); }
.plan-card.is-featured:has(input:checked) { border-color: #f59e0b; background: color-mix(in srgb, #f59e0b 10%, var(--panel-2)); }
.plan-tag {
  position: absolute; top: -10px; right: 16px;
  background: linear-gradient(135deg, #f59e0b, #ea580c); color: #fff;
  font-size: 10.5px; font-weight: 800; letter-spacing: .05em;
  padding: 3px 10px; border-radius: 999px;
}
.plan-tag-inline { position: static; display: inline-block; margin-left: 6px; padding: 2px 8px; font-size: 9px; vertical-align: middle; }
.plan-name { display: block; font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.plan-name small { font-weight: 500; color: var(--text-mute); font-size: 12px; }
.plan-price { display: block; font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 14px; }
.plan-price small { font-size: 13px; font-weight: 500; color: var(--text-mute); }
.plan-features { list-style: none; display: flex; flex-direction: column; gap: 9px; font-size: 13.5px; color: var(--text-soft); }
.plan-features li { display: flex; align-items: center; gap: 9px; }
.plan-features i { color: #16a34a; font-size: 12px; flex: 0 0 auto; }
.plan-features .verified-badge { font-size: 13px; }
.plan-current { display: block; margin-top: 16px; text-align: center; font-size: 12.5px; font-weight: 700; color: var(--text-mute); padding: 9px; border-radius: 10px; background: var(--panel); }
.upgrade-note { text-align: center; color: var(--text-mute); font-size: 13px; margin-top: 18px; max-width: 500px; }

.upgrade-done { text-align: center; padding: 46px 24px; }
.upgrade-done-ico { font-size: 46px; }
.upgrade-pending-ico { font-size: 40px; color: #f59e0b; }
.upgrade-done h2 { font-size: 22px; margin: 14px 0 8px; }
.upgrade-done p { color: var(--text-soft); margin-bottom: 6px; }
.upgrade-done .btn-primary { margin-top: 16px; }

/* ---------- Pro-gated field lock ---------- */
.pro-field.is-locked select { opacity: .6; cursor: not-allowed; }
.pro-lock-note { display: block; margin-top: 6px; color: var(--text-mute); }
.pro-lock-note a { color: var(--brand); font-weight: 600; }
.nav-badge-pro { background: linear-gradient(135deg, #f59e0b, #ea580c); }
.mini-badge { font-size: 10px; padding: 1px 7px; vertical-align: middle; margin-left: 4px; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 24px); background: #0f172a; color: #fff; padding: 12px 18px; border-radius: 999px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s var(--ease); z-index: 300; max-width: 90vw; border: 1px solid var(--border); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.t-success { background: #16a34a; border-color: transparent; }
.toast.t-error { background: #dc2626; border-color: transparent; }
.toast.t-info { background: var(--brand); border-color: transparent; }

/* ---------- SEO section ---------- */
.seo-section { margin-top: 20px; padding-top: 20px; border-top: 1px dashed var(--border); }
.seo-head { margin-bottom: 14px; }
.seo-title { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; }
.seo-title i { color: var(--brand); }
.seo-head small { display: block; margin-top: 4px; color: var(--text-mute); font-size: 12.5px; }

/* ---------- Buttons: danger + stat link ---------- */
.btn-danger { color: #fca5a5; }
.btn-danger:hover { background: #dc2626; color: #fff; border-color: #dc2626; }
.stat-link { text-decoration: none; color: inherit; transition: border-color .2s, transform .2s var(--ease); }
.stat-link:hover { border-color: var(--border-strong); transform: translateY(-2px); }

/* ---------- Messages inbox ---------- */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-mute); }
.empty-state i { font-size: 34px; margin-bottom: 12px; display: block; }
.msg-list { display: flex; flex-direction: column; gap: 14px; }
.msg-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; transition: border-color .2s;
}
.msg-card.is-unread { border-color: color-mix(in srgb, #f43f5e 45%, var(--border)); background: color-mix(in srgb, #f43f5e 5%, var(--panel)); }
.msg-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.msg-from { display: flex; align-items: center; gap: 12px; }
.msg-avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand), #7c3aed); color: #fff; font-weight: 700; flex: 0 0 auto; }
.msg-from strong { display: flex; align-items: center; gap: 7px; font-size: 14.5px; }
.msg-from small a { color: var(--text-mute); font-size: 12.5px; }
.msg-from small a:hover { color: var(--brand); }
.msg-dot { width: 8px; height: 8px; border-radius: 50%; background: #f43f5e; }
.msg-meta { text-align: right; font-size: 12px; color: var(--text-mute); }
.msg-meta .msg-to a { color: var(--brand); font-weight: 600; }
.msg-meta time { display: block; margin-top: 2px; }
.msg-body { margin: 14px 0 16px; font-size: 14.5px; color: var(--text-soft); line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.msg-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.msg-actions form { display: inline; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .editor-grid { grid-template-columns: 1fr; }
  .editor-side { position: static; order: -1; }
  .preview-frame iframe { height: 480px; }
}
@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: grid; }
  .sidebar.open ~ .sidebar-overlay { display: block; }
  .admin-main { margin-left: 0; padding: 76px 18px 50px; }
}
@media (max-width: 560px) {
  .form-grid, .upload-grid { grid-template-columns: 1fr; }
  .stat-grid, .stat-grid-2 { grid-template-columns: 1fr 1fr; }
  .page-head { align-items: flex-start; }
  .pkg-row { grid-template-columns: 1fr; }
  .pkg-row .pkg-remove { justify-self: end; }
}
@media (prefers-reduced-motion: reduce) { * { animation-duration: .001ms !important; transition-duration: .001ms !important; } }

/* ==========================================================================
   Language switcher (EN / SQ)
   ========================================================================== */
.lang-switch { display: inline-flex; align-items: center; gap: 2px;
  padding: 3px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface, rgba(255,255,255,.04)); }
.lang-opt { display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; padding: 5px 10px; border-radius: 999px;
  font-size: .74rem; font-weight: 700; letter-spacing: .02em;
  color: var(--text-mute); transition: color .18s ease, background .18s ease; }
.lang-opt:hover { color: var(--text); }
.lang-opt.is-active { color: #fff; background: var(--brand); }

.lang-switch-side { display: inline-flex; margin-bottom: 12px; }
.lang-switch-float { position: fixed; top: 16px; right: 16px; z-index: 50; }

/* ==========================================================================
   Payment settings page
   ========================================================================== */
.panel-head-sep { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--border); }
.settings-desc { margin: -8px 0 16px; padding: 0; font-size: 13px; }

/* ==========================================================================
   Upgrade page — payment method picker + card checkout
   ========================================================================== */
.pay-methods { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.pay-methods-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-mute); }
.pay-methods form { margin: 0; }
.method-instructions { background: var(--surface, rgba(255,255,255,.04)); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin: 14px 0; font-size: 14px; line-height: 1.6; }
.card-checkout-panel { max-width: 480px; margin: 0 auto; }
#cardCheckoutStatus { margin-top: 14px; text-align: center; }

.method-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-soft); }
