/* Shared styles for admin pages (dashboard, team, login…). The editor has its own editor.css. */
:root {
  --bg: #0f1020;
  --panel: #15172b;
  --panel-2: #1c1f38;
  --line: #2a2d4d;
  --text: #eef0fb;
  --muted: #9a9dbd;
  --accent: #6a5cff;
  --accent-2: #00c2a8;
  --warn: #ffb95c;
  --danger: #ff5c7a;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: #a79dff; }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
h1 { font-size: 24px; margin: 0; }
h2 { font-size: 16px; margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 14px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--panel-2); cursor: pointer; text-decoration: none; color: var(--text); white-space: nowrap;
}
.btn:hover { border-color: #444a7a; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); border-color: rgba(255,92,122,.4); }
.btn.small { padding: 6px 10px; font-size: 13px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 6px; line-height: 0; }
.icon-btn:hover { background: var(--panel-2); color: var(--text); }

/* Forms */
label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 0; }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  display: block; width: 100%; margin-top: 5px; padding: 10px 12px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 9px; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
input[readonly] { color: var(--muted); }
.error { color: var(--danger); font-size: 13px; margin: 12px 0 0; min-height: 1em; }
.hint { color: var(--muted); font-size: 12px; margin: 6px 0 0; }

/* Top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 20px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; color: var(--text); text-decoration: none; }
.logo {
  width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; color: #fff; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { padding: 7px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--text); background: var(--panel-2); }
.nav a.on { color: var(--text); background: var(--panel-2); }
.user-box { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
}

/* Page layout */
.page { max-width: 1100px; margin: 0 auto; padding: 28px 20px 60px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.stack > * + * { margin-top: 16px; }

/* Status pills */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.draft { color: var(--muted); background: rgba(154,157,189,.12); }
.pill.published { color: var(--accent-2); background: rgba(0,194,168,.12); }
.pill.changed { color: var(--warn); background: rgba(255,185,92,.12); }

/* Project grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.project { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; } /* no overflow:hidden: the ⋯ menu must show outside the card */
.project:hover { border-color: #3a3e6a; }
.thumb { border-radius: var(--radius) var(--radius) 0 0; aspect-ratio: 16 / 10; background: #0b0c18 center / contain no-repeat; display: grid; place-items: center; color: var(--muted); border-bottom: 1px solid var(--line); text-decoration: none; }
.project-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.project-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.project-title h3 { margin: 0; font-size: 15px; word-break: break-word; }
.project-meta { color: var(--muted); font-size: 12px; }
.project-actions { display: flex; gap: 6px; margin-top: auto; padding-top: 6px; }
.project-actions .btn { flex: 1; }

.empty-state { text-align: center; padding: 56px 20px; }
.empty-state .logo { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 14px; }

/* Menus */
.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 190px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 4px;
  box-shadow: 0 12px 30px rgba(0,0,0,.45);
}
.menu button, .menu a { display: block; width: 100%; white-space: nowrap; text-align: left; padding: 9px 11px; background: none; border: 0; border-radius: 7px; cursor: pointer; color: var(--text); text-decoration: none; }
.menu button:hover, .menu a:hover { background: var(--line); }
.menu .danger { color: var(--danger); }

/* Modal */
.modal-bg { position: fixed; inset: 0; z-index: 100; background: rgba(6,7,16,.7); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.modal { width: min(460px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: 0 24px 70px rgba(0,0,0,.55); }
.modal h2 { font-size: 18px; margin-bottom: 4px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }

.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.choice label { margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; color: var(--text); background: var(--bg); }
.choice label:has(input:checked) { border-color: var(--accent); background: rgba(106,92,255,.1); }
.choice input { margin: 0 6px 0 0; }
.choice span { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }

.copy-row { display: flex; gap: 8px; margin-top: 6px; }
.copy-row input { margin: 0 !important; flex: 1; min-width: 0; }
.qr-box { display: grid; place-items: center; background: #fff; border-radius: 12px; padding: 14px; margin: 16px auto 0; width: 220px; }
.qr-box canvas { width: 192px; height: 192px; image-rendering: pixelated; }
.notice { border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-top: 14px; }
.notice.warn { background: rgba(255,185,92,.1); color: var(--warn); }
.notice.ok { background: rgba(0,194,168,.1); color: var(--accent-2); }
.notice ul { margin: 6px 0 0; padding-left: 18px; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
td select { margin: 0; width: auto; padding: 6px 8px; }

/* Auth pages */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(120% 70% at 50% 0%, #2a2360 0%, var(--bg) 60%); }
.auth .card { width: min(400px, 100%); padding: 28px; }
.auth .logo { width: 48px; height: 48px; border-radius: 14px; margin-bottom: 14px; }
.auth h1 { font-size: 22px; }
.auth p { color: var(--muted); margin: 6px 0 0; }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 200;
  background: var(--panel-2); border: 1px solid var(--line); padding: 11px 16px; border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.4); max-width: calc(100vw - 32px);
}

@media (max-width: 640px) {
  .topbar { padding: 10px 16px; }
  .page { padding: 20px 16px 48px; }
  .choice { grid-template-columns: 1fr; }
  .user-box .name { display: none; }
}

/* Language menu (top bar, and top-right corner of the log-in pages) */
.lang-select {
  padding: 5px 8px; border-radius: 8px; background: var(--panel); color: var(--muted);
  border: 1px solid var(--line); font: inherit; font-size: 13px; width: auto; margin: 0;
}
body.auth > .lang-select { position: fixed; top: 14px; right: 14px; }
