@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --bg: #0a0e14;
    --bg-elevated: #111820;
    --bg-card: #151c26;
    --bg-card-hover: #1a2330;
    --border: rgba(255,255,255,.08);
    --border-strong: rgba(255,255,255,.14);
    --text: #f0f4f8;
    --text-muted: #8b9cb3;
    --accent: #00e5cc;
    --accent-dim: rgba(0,229,204,.12);
    --accent-glow: rgba(0,229,204,.35);
    --cyan: #00d4ff;
    --success: #34d399;
    --warning: #fbbf24;
    --info: #60a5fa;
    --danger: #f87171;
    --radius: 14px;
    --radius-lg: 20px;
    --shadow: 0 16px 48px rgba(0,0,0,.45);
    --header-h: 72px;
    --font: 'Inter', system-ui, sans-serif;
    --transition: .2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: #fff; }

img { max-width: 100%; display: block; }

button, input, select, textarea {
    font: inherit;
    color: inherit;
}

/* ─── Header ─── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-h);
    background: rgba(10,14,20,.92);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.site-header__inner {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    flex-shrink: 0;
}

.brand:hover { color: var(--text); }

.brand__icon {
    width: 40px;
    height: 40px;
    color: var(--accent);
    display: flex;
}

.brand__icon svg { width: 100%; height: 100%; }

.brand__text {
    font-size: 13px;
    line-height: 1.25;
    color: var(--text-muted);
}

.brand__text strong {
    color: var(--text);
    font-weight: 700;
    font-size: 15px;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 12px;
}

.site-nav a {
    color: var(--text-muted);
    padding: 8px 14px;
    border-radius: 10px;
    font-weight: 500;
    font-size: 14px;
}

.site-nav a:hover,
.site-nav a.active {
    color: var(--text);
    background: var(--bg-card);
}

.header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-search {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0 14px;
    min-width: 200px;
    transition: border-color var(--transition);
}

.header-search:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.header-search svg {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.header-search input {
    background: none;
    border: none;
    outline: none;
    padding: 10px 10px 10px 8px;
    width: 100%;
    color: var(--text);
    font-size: 14px;
}

.header-search input::placeholder { color: var(--text-muted); }

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: #0a0e14;
    border: 2px solid var(--border-strong);
}

.user-name {
    font-size: 13px;
    color: var(--text-muted);
    display: none;
}

@media (min-width: 900px) {
    .user-name { display: block; }
}

.burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.burger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: var(--transition);
}

.mobile-drawer {
    position: fixed;
    inset: 0;
    z-index: 200;
    pointer-events: none;
    opacity: 0;
    transition: opacity .3s;
}

.mobile-drawer.open {
    pointer-events: auto;
    opacity: 1;
}

.mobile-drawer__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.6);
}

.mobile-drawer__panel {
    position: absolute;
    top: 0;
    right: 0;
    width: min(320px, 88vw);
    height: 100%;
    background: var(--bg-elevated);
    border-left: 1px solid var(--border);
    padding: 24px;
    transform: translateX(100%);
    transition: transform .3s;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-drawer.open .mobile-drawer__panel {
    transform: translateX(0);
}

.mobile-drawer a {
    color: var(--text);
    padding: 14px 16px;
    border-radius: 12px;
    font-weight: 500;
}

.mobile-drawer a:hover {
    background: var(--bg-card);
}

@media (max-width: 900px) {
    .site-nav, .header-search { display: none; }
    .burger { display: flex; }
}

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn--primary {
    background: var(--accent);
    color: #0a0e14;
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn--primary:hover {
    background: #33ecd6;
    color: #0a0e14;
    transform: translateY(-1px);
}

.btn--ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-strong);
}

.btn--ghost:hover {
    color: var(--text);
    border-color: var(--text-muted);
    background: var(--bg-card);
}

.btn--sm { padding: 8px 14px; font-size: 13px; }

.btn--icon {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 10px;
}

/* ─── Main layout ─── */
.site-main {
    flex: 1;
    max-width: 1320px;
    margin: 0 auto;
    padding: 32px 20px 48px;
    width: 100%;
}

.page-hero {
    margin-bottom: 28px;
}

.page-hero h1 {
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 800;
    letter-spacing: -.02em;
    margin-bottom: 10px;
}

.page-hero p {
    color: var(--text-muted);
    font-size: 16px;
    max-width: 640px;
}

/* ─── Catalog toolbar ─── */
.catalog-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    margin-bottom: 28px;
}

.catalog-search {
    flex: 1;
    min-width: 240px;
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0 16px;
}

.catalog-search:focus-within {
    border-color: var(--accent);
}

.catalog-search input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    padding: 13px 12px;
    color: var(--text);
}

.catalog-filters {
    display: flex;
    gap: 6px;
    background: var(--bg-card);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.filter-tab {
    padding: 9px 16px;
    border-radius: 9px;
    border: none;
    background: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.filter-tab:hover { color: var(--text); }

.filter-tab.active {
    background: var(--accent-dim);
    color: var(--accent);
}

.category-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.chip {
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    border: 1px solid var(--border);
    background: var(--bg-card);
    transition: var(--transition);
}

.chip:hover, .chip.active {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-dim);
}

/* ─── Card grid ─── */
.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.work-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.work-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow);
}

.work-card--add {
    border-style: dashed;
    border-color: var(--border-strong);
    min-height: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-muted);
    cursor: pointer;
    background: transparent;
}

.work-card--add:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
    transform: none;
    box-shadow: none;
}

.work-card--add .add-icon {
    font-size: 32px;
    opacity: .6;
}

.work-card__cover {
    position: relative;
    aspect-ratio: 3/4;
    overflow: hidden;
    background: linear-gradient(160deg, #1a2330, #0d1219);
}

.work-card__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s;
}

.work-card:hover .work-card__cover img {
    transform: scale(1.04);
}

.work-card__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: 800;
    color: var(--accent);
    opacity: .4;
}

.work-card__badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.status-done { background: rgba(52,211,153,.2); color: var(--success); }
.status-progress { background: rgba(251,191,36,.2); color: var(--warning); }
.status-moderation { background: rgba(96,165,250,.2); color: var(--info); }

.work-card__body {
    padding: 14px 16px 16px;
}

.work-card__title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.work-card__title a { color: inherit; }
.work-card__title a:hover { color: var(--accent); }

.work-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}

.work-card__author { font-weight: 500; }

.work-card__stats {
    display: flex;
    align-items: center;
    gap: 10px;
}

.load-more-wrap {
    text-align: center;
    margin-top: 36px;
}

.empty-state {
    text-align: center;
    padding: 64px 20px;
    color: var(--text-muted);
}

.empty-state p { margin-bottom: 20px; font-size: 17px; }

/* ─── Reader overlay ─── */
.reader-page {
    padding: 0;
    max-width: none;
}

.reader-overlay {
    min-height: calc(100dvh - var(--header-h));
    display: flex;
    flex-direction: column;
    background: radial-gradient(ellipse at top, #111820 0%, var(--bg) 60%);
}

.reader-modal {
    flex: 1;
    max-width: 1100px;
    margin: 24px auto;
    width: calc(100% - 40px);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.reader-modal__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    gap: 16px;
    flex-wrap: wrap;
}

.reader-breadcrumb {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.reader-breadcrumb a { color: var(--text-muted); }
.reader-breadcrumb a:hover { color: var(--accent); }

.reader-page-num {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.reader-modal__content {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 420px;
}

.reader-panel {
    padding: 28px;
    display: flex;
    flex-direction: column;
}

.reader-panel--image {
    background: #0d1219;
    border-right: 1px solid var(--border);
    align-items: center;
    justify-content: center;
    position: relative;
}

.reader-panel--text {
    overflow-y: auto;
}

.reader-image-wrap {
    position: relative;
    max-width: 100%;
    border-radius: 12px;
    overflow: hidden;
}

.reader-image-wrap img {
    max-height: 55vh;
    width: auto;
    margin: 0 auto;
    border-radius: 12px;
}

.reader-text-placeholder {
    width: 100%;
    height: 100%;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-dim), transparent);
    border-radius: 12px;
    font-size: 48px;
    opacity: .5;
}

.reader-page-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: -.01em;
}

.reader-page-text {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text);
}

.reader-hotspot-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 8px;
}

.reader-hotspot-list li {
    padding: 14px 16px;
    background: var(--bg-card);
    border-radius: 12px;
    border-left: 3px solid var(--accent);
}

.reader-hotspot-list strong {
    display: block;
    font-size: 13px;
    color: var(--accent);
    margin-bottom: 4px;
}

.reader-hotspot {
    position: absolute;
    border: 2px dashed var(--accent);
    background: var(--accent-dim);
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
    transition: var(--transition);
}

.reader-hotspot:hover,
.reader-hotspot.active {
    background: rgba(0,229,204,.28);
    border-style: solid;
}

.hotspot-num {
    position: absolute;
    top: -10px;
    left: -10px;
    width: 22px;
    height: 22px;
    background: var(--accent);
    color: #0a0e14;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reader-modal__nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 18px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
}

.reader-dots {
    display: flex;
    gap: 8px;
}

.reader-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: var(--border-strong);
    cursor: pointer;
    padding: 0;
    transition: var(--transition);
}

.reader-dot.active {
    background: var(--accent);
    transform: scale(1.3);
}

.comic_page { display: none; }
.comic_page.active { display: contents; }

.support-panel {
    max-width: 1100px;
    margin: 0 auto 32px;
    width: calc(100% - 40px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.support-panel h3 {
    font-size: 18px;
    margin-bottom: 16px;
}

.note-item {
    padding: 12px 16px;
    background: var(--bg-elevated);
    border-radius: 10px;
    margin-bottom: 10px;
}

.note-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.note-form textarea {
    width: 100%;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    resize: vertical;
    min-height: 80px;
    margin-bottom: 12px;
}

@media (max-width: 768px) {
    .reader-modal__content {
        grid-template-columns: 1fr;
    }
    .reader-panel--image {
        border-right: none;
        border-bottom: 1px solid var(--border);
        min-height: 240px;
    }
}

/* ─── How-to ─── */
.howto {
    max-width: 1320px;
    margin: 0 auto;
    padding: 48px 20px 64px;
    border-top: 1px solid var(--border);
}

.howto__title {
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 32px;
}

.howto__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.howto__item {
    text-align: center;
    padding: 24px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.howto__icon {
    font-size: 28px;
    margin-bottom: 12px;
}

.howto__item h3 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
}

.howto__item p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ─── Auth ─── */
.auth-page {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: radial-gradient(ellipse at center, #111820, var(--bg));
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    box-shadow: var(--shadow);
}

.auth-card h1 {
    font-size: 24px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 8px;
}

.auth-card .subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 28px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    outline: none;
    transition: border-color var(--transition);
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.auth-card .btn { width: 100%; margin-top: 8px; }

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-muted);
}

/* ─── Admin ─── */
body.admin-body {
    background: var(--bg);
}

.admin-shell {
    display: flex;
    min-height: calc(100dvh - var(--header-h));
}

.admin-sidebar {
    width: 260px;
    background: var(--bg-elevated);
    border-right: 1px solid var(--border);
    padding: 24px 16px;
    position: sticky;
    top: var(--header-h);
    height: calc(100dvh - var(--header-h));
    overflow-y: auto;
    flex-shrink: 0;
}

.admin-sidebar__head {
    padding: 0 12px 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.admin-sidebar__head strong {
    display: block;
    font-size: 16px;
    margin-bottom: 4px;
}

.admin-sidebar__head small {
    color: var(--text-muted);
    font-size: 13px;
}

.admin-sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.admin-sidebar nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-radius: 10px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 14px;
}

.admin-sidebar nav a:hover,
.admin-sidebar nav a.active {
    background: var(--accent-dim);
    color: var(--accent);
}

.admin-content {
    flex: 1;
    padding: 28px 32px;
    overflow-x: auto;
}

.admin-page-title {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 6px;
    letter-spacing: -.02em;
}

.admin-page-sub {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 24px;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.admin-stat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
}

.admin-stat__num {
    display: block;
    font-size: 32px;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
}

.admin-stat__label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 6px;
}

.admin-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.admin-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 12px;
}

.admin-panel__head h2 {
    font-size: 17px;
    font-weight: 700;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 14px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.admin-table th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    font-weight: 600;
    background: rgba(0,0,0,.2);
}

.admin-table td { color: var(--text); }

.admin-table a {
    color: var(--accent);
    font-weight: 500;
}

.admin-table tr:hover td {
    background: rgba(255,255,255,.02);
}

.admin-table .actions {
    white-space: nowrap;
}

.admin-table .actions a,
.admin-table .actions button {
    margin-right: 10px;
    opacity: .7;
    transition: opacity var(--transition);
}

.admin-table .actions a:hover,
.admin-table .actions button:hover { opacity: 1; }

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge-published { background: rgba(52,211,153,.15); color: var(--success); }
.badge-draft { background: rgba(251,191,36,.15); color: var(--warning); }

.admin-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.admin-filters input,
.admin-filters select {
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 14px;
}

.admin-form {
    padding: 24px;
}

.admin-form .form-group { margin-bottom: 18px; }

.admin-form .form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.form-preview {
    max-width: 200px;
    border-radius: 12px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
}

.form-preview--lg {
    max-width: 100%;
    max-height: 280px;
    object-fit: contain;
}

.form-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    margin-top: 28px;
    font-size: 14px;
}

.btn-link {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--accent);
    font-size: 14px;
    padding: 0;
}

.btn-link--danger { color: var(--danger); }

form.inline { display: inline; }

.color-dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
}

.color-red { background: #f87171; }
.color-blue { background: #60a5fa; }
.color-green { background: #34d399; }

.pages-list {
    list-style: none;
    padding: 8px;
}

.pages-list__item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 8px;
    background: var(--bg-elevated);
    transition: border-color var(--transition);
}

.pages-list__item:hover { border-color: var(--border-strong); }

.drag-handle {
    cursor: grab;
    color: var(--text-muted);
    user-select: none;
}

.page-type-icon { font-size: 18px; }

.page-info { flex: 1; }
.page-info strong { display: block; font-size: 14px; }
.page-info small { color: var(--text-muted); font-size: 12px; }

.pages-list__item.dragging { opacity: .5; }

/* Hotspot editor */
.hotspot-editor {
    margin-top: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    background: var(--bg-elevated);
}

.hotspot-editor h3 {
    font-size: 16px;
    margin-bottom: 6px;
}

.hotspot-editor > p {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 16px;
}

.hotspot-canvas {
    position: relative;
    background: #0d1219;
    border-radius: 12px;
    overflow: hidden;
    min-height: 280px;
    cursor: crosshair;
}

.hotspot-canvas img {
    display: block;
    max-width: 100%;
    height: auto;
}

.hotspot-placeholder {
    padding: 80px 20px;
    text-align: center;
    color: var(--text-muted);
}

.hotspot-zone {
    position: absolute;
    border: 2px dashed var(--accent);
    background: var(--accent-dim);
    border-radius: 6px;
    cursor: move;
}

.hotspot-zone.selected {
    border-color: var(--cyan);
    border-style: solid;
}

.zone-num {
    position: absolute;
    top: -11px;
    left: -11px;
    width: 22px;
    height: 22px;
    background: var(--accent);
    color: #0a0e14;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hotspot-list {
    list-style: none;
    margin-top: 16px;
}

.hotspot-list__item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 8px;
}

.hotspot-list__item.selected { border-color: var(--accent); }

.hotspot-list__item input,
.hotspot-list__item textarea {
    width: 100%;
    padding: 8px 10px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 8px;
    color: var(--text);
}

.hs-actions {
    display: flex;
    gap: 8px;
}

@media (max-width: 900px) {
    .admin-sidebar { display: none; }
    .admin-content { padding: 20px 16px; }
}

/* ─── Flash ─── */
.flash {
    position: fixed;
    top: calc(var(--header-h) + 12px);
    right: 20px;
    z-index: 300;
    padding: 14px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: var(--shadow);
    animation: slideIn .3s ease;
}

.flash-success {
    background: rgba(52,211,153,.15);
    color: var(--success);
    border: 1px solid rgba(52,211,153,.3);
}

.flash-error {
    background: rgba(248,113,113,.15);
    color: var(--danger);
    border: 1px solid rgba(248,113,113,.3);
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ─── Footer ─── */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 24px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.site-footer a { color: var(--text-muted); margin: 0 10px; }
.site-footer a:hover { color: var(--accent); }

/* ─── Install ─── */
.install-fieldset {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.install-fieldset legend {
    font-weight: 600;
    padding: 0 8px;
    color: var(--text-muted);
}

.alert {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-error {
    background: rgba(248,113,113,.12);
    color: var(--danger);
    border: 1px solid rgba(248,113,113,.25);
}

.alert-success {
    background: rgba(52,211,153,.12);
    color: var(--success);
    border: 1px solid rgba(52,211,153,.25);
}

.hidden { overflow: hidden; }
