/* Genial Games admin panel */
:root {
  --paper: #F6F6F5; --panel: #FFFFFF; --bar: #EBEBE9; --ink: #1D1D1F; --ink-2: #5E5E62; --line: #D9D9D6;
  --accent: #E0262B; --ok: #1F7A3A; --radius: 10px;
  --f-display: "Sora", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --f-body: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font: 400 15px/1.55 var(--f-body); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.boot { padding: 40px; color: var(--ink-2); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 999px;
  border: 0; background: var(--ink); color: #fff; font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--accent); }
.btn:disabled { opacity: .45; cursor: default; background: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-ghost:hover { background: var(--bar); color: var(--ink); }
.btn-danger { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1.5px #F1B9BA; }
.btn-danger:hover { background: var(--accent); color: #fff; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; border: 0; background: var(--bar); cursor: pointer; display: inline-grid; place-items: center; font-weight: 700; }
.icon-btn:hover { background: var(--ink); color: #fff; }
.icon-btn:disabled { opacity: .35; cursor: default; background: var(--bar); color: var(--ink); }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login { width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 32px 28px; display: grid; gap: 14px; }
.login .brand { display: grid; justify-items: start; gap: 14px; margin-bottom: 6px; }
.login .brand img { height: 44px; width: auto; }
.login h1 { font-size: 24px; }
.login p { margin: 0; color: var(--ink-2); font-size: 14px; }
.login .btn { margin-top: 6px; padding: 12px 18px; }
.back-site { font-size: 14px; color: var(--ink-2); text-decoration: none; text-align: center; }
.back-site:hover { color: var(--accent); }

/* Fields */
.field { display: grid; gap: 6px; }
.field > span, .label { font-weight: 700; font-size: 13px; }
.hint { font-size: 13px; color: var(--ink-2); margin: 0; }
input[type=text], input[type=url], input[type=email], input[type=tel], input[type=password], select, textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 8px; background: #fff; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); outline: none; }
textarea { resize: vertical; min-height: 96px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); }
.msg { font-size: 14px; min-height: 1.2em; margin: 0; }
.msg.err { color: var(--accent); }
.msg.ok { color: var(--ok); }
.notice { background: #FFF6E5; border: 1px solid #F0D9A8; border-radius: var(--radius); padding: 12px 14px; font-size: 14px; }
.notice.err { background: #FDECEC; border-color: #F1B9BA; }

/* Panel layout */
.top { position: sticky; top: 0; z-index: 20; background: var(--bar); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 12px; padding: 10px 20px; flex-wrap: wrap; }
.top .brand { display: flex; align-items: center; gap: 10px; font-family: var(--f-display); font-weight: 700; font-size: 17px; text-decoration: none; margin-right: auto; }
.top .brand img { height: 30px; width: auto; }
.top .brand span { padding-left: 12px; border-left: 1.5px solid var(--line); color: var(--ink-2); font-size: 15px; }
.save-state { font-size: 13px; color: var(--ink-2); }
.save-state.dirty { color: var(--accent); font-weight: 700; }
.layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 0; min-height: calc(100vh - 57px); }
.side { border-right: 1px solid var(--line); padding: 20px 12px; display: grid; align-content: start; gap: 2px; }
.side button { text-align: left; padding: 10px 14px; border-radius: 8px; border: 0; background: none; font-weight: 700; cursor: pointer; color: var(--ink-2); }
.side button:hover { background: var(--bar); color: var(--ink); }
.side button.on { background: var(--ink); color: #fff; }
.main { padding: 28px clamp(16px, 3vw, 40px) 80px; max-width: 980px; min-width: 0; display: grid; gap: 20px; align-content: start; }
.main > h1 { font-size: 28px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px; display: grid; gap: 16px; }
.card h2 { font-size: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Lists */
.list { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); overflow: hidden; }
.item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 12px 16px; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; }
.item .thumb { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: var(--bar); }
.item .title { font-weight: 700; }
.item .sub { font-size: 13px; color: var(--ink-2); }
.item.no-thumb { grid-template-columns: minmax(0, 1fr) auto; }
.empty { padding: 22px 16px; color: var(--ink-2); text-align: center; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--bar); margin-left: 6px; vertical-align: 1px; }

/* Images */
.img-field { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 16px; align-items: center; }
.img-box { width: 140px; aspect-ratio: 1; border-radius: 12px; background: var(--bar) center/cover no-repeat; border: 1px dashed var(--line); display: grid; place-items: center; color: var(--ink-2); font-size: 12px; text-align: center; }
.img-box.wide { aspect-ratio: 16 / 9; }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.shot { position: relative; border-radius: 10px; overflow: hidden; background: var(--bar); aspect-ratio: 16 / 9; }
.shot img { width: 100%; height: 100%; object-fit: cover; }
.shot .tools { position: absolute; inset: auto 6px 6px 6px; display: flex; gap: 4px; justify-content: flex-end; }
.shot .tools .icon-btn { width: 28px; height: 28px; background: rgba(255,255,255,.92); }
.shot .tools .icon-btn:hover { background: var(--ink); color: #fff; }
.shot .num { position: absolute; top: 6px; left: 6px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.file-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.busy { font-size: 13px; color: var(--ink-2); }

/* Stores */
.stores { display: grid; gap: 10px; }
.store-row { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 12px; align-items: center; }
.store-row label { font-weight: 700; font-size: 14px; }
.store-row small { display: block; font-weight: 500; color: var(--ink-2); font-size: 12px; }
.platforms-out { font-weight: 700; }

/* Rich text editor */
.rte { border: 1.5px solid var(--line); border-radius: 10px; background: #fff; }
.rte:focus-within { border-color: var(--ink); }
.rte-bar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; border-bottom: 1px solid var(--line); background: #FAFAF9; border-radius: 10px 10px 0 0; position: sticky; top: 57px; z-index: 5; }
.rte-bar button { min-width: 34px; height: 32px; padding: 0 9px; border: 0; border-radius: 6px; background: none; cursor: pointer; font-weight: 700; font-size: 13px; }
.rte-bar button:hover, .rte-bar button.on { background: var(--bar); }
.rte-bar .sep { width: 1px; background: var(--line); margin: 4px 2px; }
.rte-area { min-height: 260px; padding: 16px 18px; outline: none; line-height: 1.65; overflow-wrap: anywhere; }
.rte-area:empty::before { content: attr(data-placeholder); color: #9A9A9E; }
.rte-area > * { margin: 0 0 10px; }
.rte-area h2 { font-size: 22px; margin-top: 18px; }
.rte-area h3 { font: 700 16px/1.4 var(--f-body); margin-top: 12px; letter-spacing: 0; }
.rte-area a { color: var(--accent); }
.rte-area a[href^="#"] { color: var(--ink); text-decoration: underline dotted; }
.rte-area ul, .rte-area ol { padding-left: 1.4em; }
.menu { position: absolute; z-index: 30; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.12);
  max-height: 300px; overflow: auto; min-width: 240px; padding: 6px; }
.menu button { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: 6px; background: none; cursor: pointer; font-size: 14px; }
.menu button:hover { background: var(--bar); }
.menu .menu-empty { padding: 8px 10px; font-size: 13px; color: var(--ink-2); }

/* Inbox */
.count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 12px; line-height: 20px; text-align: center; }
.inbox-row { width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); font: inherit; color: inherit; cursor: pointer; }
.inbox-row:hover { background: #FAFAF9; }
.inbox-row .title { font-weight: 600; }
.inbox-row.unread .title { font-weight: 800; }
.inbox-row.unread .title::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 8px; vertical-align: 1px; }
.inbox-row .when { white-space: nowrap; }
.details { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 18px; margin: 0; }
.details dt { font-weight: 700; font-size: 13px; color: var(--ink-2); }
.details dd { margin: 0; overflow-wrap: anywhere; }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; background: #FAFAF9; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }

@media (max-width: 760px) {
  .layout { grid-template-columns: minmax(0, 1fr); align-content: start; }
  .side { border-right: 0; border-bottom: 1px solid var(--line); display: flex; overflow-x: auto; padding: 8px 12px; gap: 4px; }
  .side button { white-space: nowrap; }
  .grid-2, .store-row, .img-field { grid-template-columns: 1fr; }
  .item { grid-template-columns: auto minmax(0, 1fr); }
  .item .row-actions { grid-column: 1 / -1; }
  .item.no-thumb { grid-template-columns: 1fr; }
  .details { grid-template-columns: 1fr; gap: 2px; }
  .details dd { margin-bottom: 8px; }
  .rte-bar { top: 0; position: static; }
}
@media (max-width: 600px) {
  .top-in { gap: 6px 8px; padding: 8px 12px; }
  .top .brand img { height: 24px; }
  .top .brand span { display: none; }
  .top .btn { padding: 7px 12px; font-size: 13px; }
  .save-state { order: 9; width: 100%; font-size: 12px; }
  .rte-bar button { min-width: 30px; padding: 0 7px; }
}
