/* ============================================================
   Rival Car CMS – adminisztráció
   ============================================================ */
.admin-body { background: var(--bg); }
.admin { display: grid; grid-template-columns: 260px 1fr; min-height: 100dvh; }

/* ---------- Oldalsáv ---------- */
.sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; padding: 1.2rem 1rem; background: var(--surface); border-right: 1px solid var(--line); z-index: 60; }
.sidebar__head { display: flex; align-items: center; justify-content: space-between; padding: .2rem .4rem 1.2rem; }
.sidebar__tag { font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; padding: .2rem .55rem; border-radius: 999px; background: color-mix(in srgb, var(--primary) 18%, transparent); color: var(--primary); }
.sidebar__nav { display: flex; flex-direction: column; gap: .2rem; }
.sidebar__link { display: flex; align-items: center; gap: .8rem; padding: .7rem .9rem; border-radius: 12px; color: var(--ink-dim); font-weight: 500; font-size: .95rem; transition: .2s; border: 0; background: none; width: 100%; text-align: left; }
.sidebar__link svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.sidebar__link:hover { color: var(--ink); background: var(--surface-2); }
.sidebar__link.is-active { color: var(--primary); background: color-mix(in srgb, var(--primary) 14%, transparent); font-weight: 600; }
.sidebar__foot { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: .2rem; }
.sidebar__link--btn { cursor: pointer; }

/* ---------- Fejléc ---------- */
.admin__main { min-width: 0; display: flex; flex-direction: column; }
.admintop { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 1rem; padding: .9rem 1.8rem; background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.admintop__title { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; }
.admintop__tools { margin-left: auto; display: flex; align-items: center; gap: .7rem; }
.admintop__user { font-size: .85rem; color: var(--ink-dim); }
.admintop .burger { display: none; }
.admin__content { padding: 1.6rem 1.8rem 3rem; }

/* ---------- Dashboard ---------- */
.welcome { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.welcome__title { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .9rem; margin-bottom: 1.6rem; }
.stat { display: flex; flex-direction: column; gap: .2rem; padding: 1.1rem 1.2rem; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); transition: .25s var(--ease); }
.stat:hover { transform: translateY(-3px); border-color: var(--primary); }
.stat__value { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.stat__label { font-size: .78rem; color: var(--ink-dim); letter-spacing: .04em; text-transform: uppercase; }
.stat--accent { background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 70%, #ff5c73)); color: #fff; border-color: transparent; }
.stat--accent .stat__label { color: rgba(255, 255, 255, .8); }
.stat--warn { border-color: var(--warn); }
.stat--warn .stat__value { color: var(--warn); }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ---------- Panelek ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 1.3rem 1.4rem; margin-bottom: 1rem; }
.panel__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .8rem; }
.panel__head h3, .panel__title { font-size: 1rem; font-weight: 700; }
.panel__title { margin-bottom: 1rem; padding-bottom: .7rem; border-bottom: 1px solid var(--line); }
.panel__empty { padding: 1.5rem 0; text-align: center; }
.panel--sticky { position: sticky; top: 84px; }

.list { list-style: none; margin: 0; padding: 0; }
.list__item { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.list__item:last-child { border-bottom: 0; }
.list__item.is-unread .list__title { font-weight: 700; }
.list__main { display: flex; align-items: center; gap: .8rem; min-width: 0; }
.list__title { display: block; font-weight: 600; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list__sub { display: block; font-size: .8rem; color: var(--ink-dim); }
.thumb { display: grid; place-items: center; width: 56px; height: 42px; border-radius: 8px; background: #eef1f6; overflow: hidden; flex: 0 0 auto; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb img.thumb--logo { width: auto; height: auto; max-width: 70%; max-height: 70%; object-fit: contain; opacity: .7; }
.avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), #ff5c73); color: #fff; font-weight: 800; flex: 0 0 auto; }
.pill { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .04em; white-space: nowrap; }
.pill--ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.pill--muted { background: var(--surface-2); color: var(--ink-dim); }
.pill--warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }

/* ---------- Táblázatok ---------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.toolbar__filters { display: flex; gap: .5rem; flex-wrap: wrap; flex: 1; }
.toolbar__filters .input { width: auto; min-width: 150px; }
.input--search { min-width: 260px !important; }
.table-wrap { overflow-x: auto; margin: -.4rem -.4rem 0; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); padding: .6rem .8rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: .7rem .8rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: color-mix(in srgb, var(--primary) 5%, transparent); }
.table .num { text-align: right; white-space: nowrap; }
.table .actions { text-align: right; white-space: nowrap; }
.table__title { font-weight: 600; }
.table__title:hover { color: var(--primary); }
.table__sub { font-size: .78rem; color: var(--ink-dim); }
.inline { display: inline-block; }
.actions .iconbtn { width: 34px; height: 34px; margin-left: .2rem; }

/* ---------- Szerkesztő ---------- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1rem; align-items: start; }
.editor__actions { display: grid; gap: .5rem; margin-top: 1rem; }
.editor__actions .link-arrow { justify-self: center; margin-top: .4rem; }
.meta { margin: 1.2rem 0 0; padding: .8rem 0 0; border-top: 1px solid var(--line); font-size: .8rem; display: grid; gap: .3rem; }
.meta div { display: flex; justify-content: space-between; gap: 1rem; }
.meta dt { color: var(--ink-faint); } .meta dd { margin: 0; }
.input--tall { font-family: var(--mono); font-size: .9rem; line-height: 1.6; }
.colorfield { display: grid; grid-template-columns: 48px 1fr; gap: .5rem; }
.colorfield__swatch { width: 48px; height: 44px; padding: 2px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; }

.switch { display: flex; align-items: center; gap: .7rem; margin: .5rem 0; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track { position: relative; width: 44px; height: 26px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-strong); transition: .25s; flex: 0 0 auto; }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--ink-dim); transition: .25s var(--ease); }
.switch input:checked + .switch__track { background: var(--primary); border-color: var(--primary); }
.switch input:checked + .switch__track::after { transform: translateX(18px); background: #fff; }
.switch input:focus-visible + .switch__track { box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 25%, transparent); }
.switch__label { font-weight: 600; font-size: .95rem; }

.dropzone { display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: 1.6rem 1rem; border: 2px dashed var(--line-strong); border-radius: 16px; background: var(--surface-2); color: var(--ink-dim); text-align: center; cursor: pointer; transition: .25s; margin-top: 1rem; }
.dropzone:hover, .dropzone.is-over { border-color: var(--primary); color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, var(--surface-2)); }
.dropzone__text { font-weight: 600; }
.dropzone__hint { font-size: .78rem; }
.dropzone__preview { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; margin-top: .5rem; }
.dropzone__preview img { width: 90px; height: 64px; object-fit: cover; border-radius: 8px; box-shadow: var(--shadow-sm); }
.dropzone__preview:empty { display: none; }

.imagegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .8rem; }
.imagegrid__item { position: relative; aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; background: #eef1f6; border: 2px solid transparent; }
.imagegrid__item img { width: 100%; height: 100%; object-fit: cover; }
.imagegrid__item--logo img { object-fit: contain; padding: 10%; }
.imagegrid__item.is-cover { border-color: var(--primary); }
.imagegrid__badge { position: absolute; top: .5rem; left: .5rem; padding: .2rem .55rem; border-radius: 999px; background: var(--primary); color: #fff; font-size: .7rem; font-weight: 700; }
.imagegrid__tools { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: .3rem; padding: .4rem; background: linear-gradient(transparent, rgba(0, 0, 0, .6)); opacity: 0; transition: .25s; }
.imagegrid__item:hover .imagegrid__tools, .imagegrid__item:focus-within .imagegrid__tools { opacity: 1; }
.imagegrid__tools .iconbtn { width: 32px; height: 32px; background: rgba(255, 255, 255, .9); color: #0f1420; border: 0; font-size: 1rem; }
.imagegrid__tools .iconbtn--danger:hover { background: var(--err); color: #fff; }
@media (hover: none) { .imagegrid__tools { opacity: 1; } }

.tabs__bar { display: flex; gap: .3rem; margin-bottom: .8rem; }
.tabs__tab { padding: .55rem 1rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-dim); font-weight: 600; font-size: .9rem; }
.tabs__tab.is-active { background: var(--primary); color: #fff; border-color: var(--primary); }
.tabs__panel { display: none; }
.tabs__panel.is-active { display: block; }

/* ---------- Dopyty ---------- */
.inquiries { display: grid; gap: .8rem; }
.inquiry-card { border-left: 4px solid transparent; }
.inquiry-card.is-unread { border-left-color: var(--warn); }
.inquiry-card__head { display: flex; align-items: center; gap: .8rem; margin-bottom: .7rem; }
.inquiry-card__who { display: flex; flex-direction: column; min-width: 0; }
.inquiry-card__meta { margin-left: auto; display: flex; align-items: center; gap: .6rem; font-size: .8rem; }
.inquiry-card__offer { display: inline-block; margin-bottom: .6rem; padding: .3rem .7rem; border-radius: 999px; background: var(--surface-2); font-size: .85rem; }
.inquiry-card__offer:hover { color: var(--primary); }
.inquiry-card__msg { white-space: pre-line; margin: 0 0 .8rem; }
.inquiry-card__actions { display: flex; gap: .4rem; flex-wrap: wrap; }

/* ---------- Márkák ---------- */
.brand-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.brand-admin { display: flex; gap: 1rem; align-items: center; border-top: 4px solid var(--accent); }
.brand-admin__logo { display: grid; place-items: center; width: 100px; height: 72px; background: #fff; border-radius: 12px; flex: 0 0 auto; }
.brand-admin__logo img { max-width: 80%; max-height: 70%; width: auto; height: auto; }
.brand-admin__name { font-size: 1.1rem; font-weight: 700; display: flex; align-items: center; gap: .5rem; }
.brand-admin__actions { display: flex; gap: .4rem; margin-top: .4rem; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); z-index: 100; padding: .8rem 1.3rem; border-radius: 999px; font-weight: 600; font-size: .92rem; color: #fff; box-shadow: var(--shadow); animation: toast-in .4s var(--ease), toast-out .4s var(--ease) 3.6s forwards; }
.toast--ok { background: var(--ok); color: #05261b; }
.toast--err { background: var(--err); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 16px); } }
@keyframes toast-out { to { opacity: 0; transform: translate(-50%, 16px); } }

/* ---------- Bejelentkezés ---------- */
.auth { position: relative; z-index: 1; min-height: 100dvh; display: grid; place-items: center; padding: 1.5rem; }
.auth__card { width: min(420px, 100%); padding: 2.2rem 2rem; }
.auth__logo { display: flex; justify-content: center; margin-bottom: 1.2rem; }
.auth__title { text-align: center; font-size: 1.6rem; font-weight: 800; }
.auth__sub { text-align: center; color: var(--ink-dim); margin: .3rem 0 1.4rem; }
.auth__foot { display: flex; justify-content: space-between; align-items: center; margin-top: 1.4rem; }

/* ---------- Reszponzív ---------- */
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr; } .editor { grid-template-columns: 1fr; } .panel--sticky { position: static; } }
@media (max-width: 860px) {
    .admin { grid-template-columns: 1fr; }
    .sidebar { position: fixed; left: 0; top: 0; width: 280px; transform: translateX(-100%); transition: transform .3s var(--ease); box-shadow: var(--shadow); }
    .sidebar.is-open { transform: none; }
    .admintop { padding: .7rem 1rem; }
    .admintop .burger { display: inline-flex; }
    .admintop__user { display: none; }
    .admin__content { padding: 1rem 1rem 3rem; }
    .toolbar__filters .input, .input--search { min-width: 0 !important; width: 100%; }
    .toolbar__filters { flex-direction: column; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .toolbar > .btn { width: 100%; }
    .welcome .btn { width: 100%; }
    .brandmark__logo--sm { width: 100px; }
}
