/* ==========================================================================
   All Yono Lite - Admin Panel Design System
   ========================================================================== */
:root {
    --a-primary: #5A48F5;
    --a-primary-2: #8B5CF6;
    --a-accent: #FF7A45;
    --a-bg: #F2F3F9;
    --a-surface: #FFFFFF;
    --a-text: #1B1F33;
    --a-muted: #6A7188;
    --a-border: #E4E6F0;
    --a-sidebar: #171A2E;
    --a-sidebar-2: #1F2340;
    --a-success: #16A34A;
    --a-danger: #DC2626;
    --a-warning: #D97706;
    --a-info: #0284C7;
    --a-radius: 14px;
    --a-shadow: 0 4px 20px rgba(23, 26, 46, .07);
    --a-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body {
    margin: 0; font-family: var(--a-font); font-size: 14.5px; line-height: 1.6;
    color: var(--a-text); background: var(--a-bg);
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: var(--a-primary); text-decoration: none; }
a:hover { color: #4335D6; }
h1, h2, h3, h4 { line-height: 1.3; margin: 0 0 .6em; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
.icon { vertical-align: -.16em; }

.admin-shell { display: flex; min-height: 100vh; }

/* ---------------------------- Sidebar ---------------------------- */
.admin-sidebar {
    width: 248px; background: var(--a-sidebar); color: #A7ABC7;
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 50;
    display: flex; flex-direction: column; transition: transform .25s ease;
}
.admin-sidebar { overflow-y: auto; }
.admin-sidebar::-webkit-scrollbar { width: 5px; }
.admin-sidebar::-webkit-scrollbar-thumb { background: #2E3352; border-radius: 3px; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; border-bottom: 1px solid rgba(255,255,255,.08); position: sticky; top: 0; background: var(--a-sidebar); z-index: 2; }
.sidebar-brand img { border-radius: 9px; }
.sidebar-brand strong { color: #fff; display: block; font-size: .95rem; line-height: 1.2; }
.sidebar-brand small { color: #7C81A3; font-size: .72rem; }

.sidebar-nav { padding: 10px 0 20px; flex: 1; }
.sidebar-nav ul { list-style: none; margin: 0; padding: 0; }
.nav-link {
    display: flex; align-items: center; gap: 12px; width: 100%;
    padding: 10px 16px; color: #A7ABC7; font-size: .875rem; font-weight: 500;
    border: none; background: none; text-align: left; cursor: pointer; font-family: inherit;
    transition: background .14s ease, color .14s ease;
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,.05); }
.nav-link.active { color: #fff; background: linear-gradient(90deg, rgba(90,72,245,.28), transparent); border-left: 3px solid var(--a-primary); padding-left: 13px; }
.nav-ico { display: inline-flex; width: 22px; justify-content: center; flex-shrink: 0; }
.nav-label { flex: 1; line-height: 1.35; }
.nav-chevron { opacity: .6; transition: transform .18s ease; flex-shrink: 0; }
.nav-group.open .nav-chevron { transform: rotate(180deg); opacity: .9; }
.nav-group-toggle { width: 100%; }
.nav-sub { display: none; padding: 4px 0 6px; }
.nav-group.open .nav-sub { display: block; }
.nav-sub a {
    display: block; padding: 8px 18px 8px 49px; color: #8E93B3; font-size: .83rem;
    border-left: 2px solid transparent; margin-left: 18px;
}
.nav-sub a:hover { color: #fff; }
.nav-sub a.active { color: #C9C4FF; border-left-color: var(--a-primary-2); }
.nav-logout { color: #E2A0A0; }
.nav-logout:hover { background: rgba(220,38,38,.14); color: #fff; }

/* ---------------------------- Main area ---------------------------- */
.admin-main { flex: 1; margin-left: 248px; min-width: 0; display: flex; flex-direction: column; transition: margin-left .25s ease; }
.admin-main-full { margin-left: 0; }
/* Desktop collapse via topbar toggle */
body.sidebar-collapsed .admin-sidebar { transform: translateX(-100%); }
body.sidebar-collapsed .admin-main { margin-left: 0; }
.admin-topbar {
    background: var(--a-surface); border-bottom: 1px solid var(--a-border);
    display: flex; align-items: center; gap: 14px; padding: 12px 22px;
    position: sticky; top: 0; z-index: 40; min-height: 62px;
}
.topbar-title { font-size: 1.1rem; margin: 0; flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--a-border);
    background: #fff; color: var(--a-muted); cursor: pointer; transition: all .15s ease; padding: 0;
}
.icon-btn:hover { color: var(--a-primary); border-color: #C9C4FF; background: #F5F4FF; }
.icon-btn:active { transform: scale(.96); }
.icon-btn:focus-visible { outline: 2px solid var(--a-primary); outline-offset: 2px; }
.btn-ghost { background: transparent; border: 1px solid var(--a-border); color: var(--a-muted); }
.btn-ghost:hover { border-color: var(--a-primary); color: var(--a-primary); background: #F6F5FF; }

.admin-menu { position: relative; }
.admin-menu-btn {
    display: flex; align-items: center; gap: 9px; padding: 6px 12px 6px 6px;
    background: #F4F5FA; border: none; border-radius: 999px; cursor: pointer; font-family: inherit;
}
.admin-menu-btn:hover { background: #ECECF6; }
.avatar {
    width: 32px; height: 32px; border-radius: 50%; background: var(--a-primary); color: #fff;
    display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .9rem;
}
.admin-menu-name { font-weight: 600; font-size: .85rem; }
.admin-menu-drop {
    position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--a-border);
    border-radius: 12px; box-shadow: 0 10px 30px rgba(23,26,46,.14); min-width: 170px; padding: 6px; z-index: 60;
}
.admin-menu-drop a { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 8px; color: var(--a-text); font-size: .87rem; }
.admin-menu-drop a:hover { background: #F5F4FF; color: var(--a-primary); }

.admin-content { padding: 20px; max-width: 1400px; width: 100%; }

/* ---------------------------- Cards & grids ---------------------------- */
.a-card { background: var(--a-surface); border: 1px solid var(--a-border); border-radius: var(--a-radius); box-shadow: var(--a-shadow); padding: 20px 22px; margin-bottom: 20px; }
.a-card h2 { font-size: 1.05rem; margin-bottom: 16px; }
.a-card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.a-card-head h2 { margin: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card {
    background: var(--a-surface); border: 1px solid var(--a-border); border-radius: var(--a-radius);
    padding: 18px 20px; display: flex; align-items: center; gap: 15px; box-shadow: var(--a-shadow);
}
.stat-icon { width: 46px; height: 46px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-icon.p1 { background: #EEECFE; color: var(--a-primary); }
.stat-icon.p2 { background: #E8F7EF; color: var(--a-success); }
.stat-icon.p3 { background: #FDF0E8; color: var(--a-accent); }
.stat-icon.p4 { background: #E8F4FD; color: var(--a-info); }
.stat-value { font-size: 1.45rem; font-weight: 800; line-height: 1.1; }
.stat-label { color: var(--a-muted); font-size: .8rem; font-weight: 600; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.two-col-uneven { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }

/* ---------------------------- Tables ---------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--a-border); border-radius: 12px; }
.a-table { width: 100%; border-collapse: collapse; background: #fff; }
.a-table th {
    text-align: left; padding: 11px 14px; background: #F7F8FC; color: var(--a-muted);
    font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700;
    border-bottom: 1px solid var(--a-border); white-space: nowrap;
}
.a-table td { padding: 11px 14px; border-bottom: 1px solid #F0F1F7; font-size: .87rem; vertical-align: middle; }
.a-table tr:last-child td { border-bottom: none; }
.a-table tr:hover td { background: #FAFAFE; }
.t-title { font-weight: 600; color: var(--a-text); }
.t-sub { color: var(--a-muted); font-size: .76rem; }
.t-icon { width: 34px; height: 34px; border-radius: 8px; object-fit: contain; background: #F2F3F9; display: block; }
.t-actions { display: flex; gap: 5px; white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

/* ---------------------------- Buttons ---------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 9px 16px; border-radius: 10px; border: 1px solid transparent;
    font-size: .85rem; font-weight: 600; font-family: inherit; line-height: 1.2; white-space: nowrap;
    cursor: pointer; transition: all .15s ease;
}
.btn-primary { background: linear-gradient(135deg, var(--a-primary), var(--a-primary-2)); color: #fff; box-shadow: 0 4px 12px rgba(90,72,245,.28); }
.btn-primary:hover { box-shadow: 0 6px 16px rgba(90,72,245,.4); color: #fff; transform: translateY(-1px); }
.btn-accent { background: linear-gradient(135deg, #FF6A3D, #FF9A3D); color: #fff; }
.btn-accent:hover { color: #fff; transform: translateY(-1px); }
.btn-outline { background: #fff; border-color: #D9D6FA; color: var(--a-primary); }
.btn-outline:hover { background: #F5F4FF; }
.btn-soft { background: #F0F1F7; color: var(--a-text); }
.btn-soft:hover { background: #E7E8F2; color: var(--a-primary); }
.btn-danger { background: #FEF2F2; color: var(--a-danger); border-color: #FECACA; }
.btn-danger:hover { background: var(--a-danger); color: #fff; border-color: var(--a-danger); }
.btn-sm { padding: 6px 11px; font-size: .78rem; border-radius: 8px; }
.btn-sm.icon-only { padding: 6px 8px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.icon-action {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--a-border);
    background: #fff; color: var(--a-muted); cursor: pointer; transition: all .14s ease;
}
.icon-action:hover { color: var(--a-primary); border-color: #C9C4FF; background: #F5F4FF; }
.icon-action.danger:hover { color: var(--a-danger); border-color: #FCA5A5; background: #FEF2F2; }

/* ---------------------------- Badges ---------------------------- */
.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.badge-success { background: #DCFCE7; color: #15803D; }
.badge-warning { background: #FEF3C7; color: #B45309; }
.badge-danger { background: #FEE2E2; color: #B91C1C; }
.badge-info { background: #E0F2FE; color: #0369A1; }
.badge-muted { background: #EEF0F6; color: var(--a-muted); }
.badge-primary { background: #EDEBFF; color: #5A48F5; }

/* ---------------------------- Forms ---------------------------- */
.a-form { max-width: 100%; }
.form-section { border-top: 2px solid #F0F1F7; padding-top: 22px; margin-top: 22px; }
.form-section:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }
.form-section-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--a-muted); font-weight: 800; margin-bottom: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 18px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 18px; }
.form-field { margin-bottom: 16px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { display: block; font-weight: 600; font-size: .82rem; margin-bottom: 6px; }
.form-field label .req { color: var(--a-danger); }
.form-field .hint { color: var(--a-muted); font-size: .74rem; margin-top: 5px; display: block; }
.form-field input[type=text], .form-field input[type=email], .form-field input[type=password],
.form-field input[type=number], .form-field input[type=url], .form-field input[type=date],
.form-field input[type=datetime-local], .form-field select, .form-field textarea {
    width: 100%; padding: 10px 13px; border: 1.5px solid var(--a-border); border-radius: 10px;
    font-size: .9rem; font-family: inherit; outline: none; background: #fff; color: var(--a-text);
    transition: border-color .14s ease, box-shadow .14s ease;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
    border-color: var(--a-primary); box-shadow: 0 0 0 3px rgba(90,72,245,.13);
}
.form-field textarea { resize: vertical; }
.form-field textarea.code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .82rem; }
.field-error { color: var(--a-danger); font-size: .75rem; margin-top: 5px; display: block; }

/* --------------------- Two-column form layout ---------------------
   Apps / Pages / Blog add+edit forms: main content on the left, a sticky
   sidebar on the right with Publish, Categories, images and SEO boxes. */
.a-form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.a-form-main { margin-bottom: 0; min-width: 0; }
.a-form-main > .a-card-head { margin-bottom: 4px; }
.a-form-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 76px; min-width: 0; }
.a-form-side .side-box { margin-bottom: 0; padding: 16px 17px; }
.side-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 2px; }
.side-actions .btn { width: 100%; justify-content: center; margin-bottom: 0; }
/* Separate on/off switches row (e.g. byline pill + review box) */
.eeat-switches { display: flex; gap: 10px 28px; flex-wrap: wrap; margin-bottom: 16px; padding: 12px 14px; background: #F9FAFD; border: 1px solid var(--a-border); border-radius: 12px; }
.eeat-switches .form-field { margin-bottom: 0; }

/* Toggle switch */
.toggle { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; vertical-align: middle; line-height: 1; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; margin: 0; }
.toggle .track {
    display: inline-block; vertical-align: middle;
    width: 44px; height: 24px; border-radius: 999px; background: #D8DBE8;
    transition: background .16s ease; position: relative; flex-shrink: 0;
    box-shadow: inset 0 1px 3px rgba(23,26,46,.12);
}
.toggle .track::after {
    content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
    background: #fff; border-radius: 50%; transition: transform .16s ease; box-shadow: 0 1px 4px rgba(0,0,0,.28);
}
.toggle input:checked + .track { background: var(--a-primary); box-shadow: inset 0 1px 3px rgba(90,72,245,.35); }
.toggle input:checked + .track::after { transform: translateX(20px); }
.toggle input:focus-visible + .track { outline: 2px solid var(--a-primary); outline-offset: 2px; }
.toggle .toggle-label { font-size: .85rem; font-weight: 600; line-height: 1.3; vertical-align: middle; white-space: nowrap; display: inline-flex; align-items: center; }
/* Toggle inside a form field: block-level flex so the label text is
   perfectly vertically centered with the switch and spans the row */
.form-field label.toggle { display: flex; margin-bottom: 0; }
.form-field .toggle { margin: 4px 0; }
.toggle .track { flex-shrink: 0; }

/* Image picker field: thumbnail + action buttons, the URL itself is kept
   in a hidden input (users pick from the library or upload a file) */
.image-field {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    background: #F9FAFD; border: 1px solid var(--a-border); border-radius: 14px;
    padding: 14px 16px;
}
.image-preview {
    width: 96px; height: 96px; border-radius: 12px; border: 1.5px solid var(--a-border);
    background: #fff center/contain no-repeat; flex-shrink: 0; position: relative;
    overflow: hidden; cursor: pointer; transition: border-color .14s ease, box-shadow .14s ease;
}
.image-preview:hover { border-color: #C9C4FF; box-shadow: 0 0 0 3px rgba(90,72,245,.12); }
.image-preview[data-empty="true"] { border-style: dashed; border-color: #CBD0E2; background: #fff; }
.image-preview[data-empty="true"]::after {
    content: ""; position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%239CA1B8' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2' ry='2'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'/%3E%3Cpolyline points='21 15 16 10 5 21'/%3E%3C/svg%3E") center/32px no-repeat;
    opacity: .7;
}
.image-field-body { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 200px; }
.image-field-buttons { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.image-file-name { font-size: .74rem; color: var(--a-muted); word-break: break-all; display: inline-flex; align-items: center; gap: 6px; }
.image-file-name strong { color: var(--a-text); font-weight: 600; }
.image-upload-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }

/* Character counter (SEO title / meta description) */
.char-count { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 700; margin-top: 5px; color: var(--a-muted); }
.char-count::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--a-success); }
.char-count.warn { color: var(--a-warning); }
.char-count.warn::before { background: var(--a-warning); }
.char-count.over { color: var(--a-danger); }
.char-count.over::before { background: var(--a-danger); }

/* Compact inline form rows (menus, quick-add bars): input, select and the
   submit button share the exact same height and sit on one baseline */
.inline-row-form { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.inline-row-form .form-field { margin-bottom: 0; flex: 1 1 220px; min-width: 0; }
.inline-row-form .form-field input:not([type=hidden]),
.inline-row-form .form-field select { height: 42px; padding-top: 0; padding-bottom: 0; }
.inline-row-form .form-field .hint { margin-top: 4px; }
.inline-row-actions { display: flex; align-items: center; }
.inline-row-actions .btn { height: 42px; padding-top: 0; padding-bottom: 0; }

/* Media library: keep every row inside its card, never overflow the grid cell */
.media-item { min-width: 0; }
.media-item form { min-width: 0; flex-wrap: wrap; }
.media-item form input[type=text] { min-width: 0; width: 100%; max-width: 100%; }
.a-card-head form { flex-wrap: wrap; max-width: 100%; }
.a-card-head form input[type=file] { max-width: 240px; min-width: 0; }
.a-form input, .a-form select, .a-form textarea { max-width: 100%; }

/* Rich editor */
.al-editor-toolbar {
    display: flex; flex-wrap: wrap; gap: 4px; padding: 8px;
    border: 1.5px solid var(--a-border); border-bottom: none; border-radius: 10px 10px 0 0; background: #F9FAFD;
}
.al-toolbar-btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 30px; height: 30px; padding: 0 7px; border: none; background: transparent;
    border-radius: 7px; color: var(--a-muted); font-size: .8rem; font-weight: 700; cursor: pointer; font-family: inherit;
}
.al-toolbar-btn:hover { background: #ECECF6; color: var(--a-text); }
.al-toolbar-btn.active { background: #E2DEFC; color: var(--a-primary); }
.al-editor-area {
    min-height: 260px; padding: 14px 16px; border: 1.5px solid var(--a-border); border-radius: 0 0 10px 10px;
    background: #fff; outline: none; font-size: .92rem; overflow-y: auto; max-height: 480px;
}
.al-editor-area:focus { border-color: var(--a-primary); box-shadow: 0 0 0 3px rgba(90,72,245,.13); }
.al-editor-area img { max-width: 100%; height: auto; border-radius: 8px; }
.al-editor-area[data-empty="true"]::before { content: attr(data-placeholder); color: #9CA1B8; pointer-events: none; }
.al-editor-source { width: 100%; min-height: 260px; border: 1.5px solid var(--a-border); border-top: none; border-radius: 0 0 10px 10px; padding: 14px; font-family: ui-monospace, Consolas, monospace; font-size: .82rem; }

/* Repeatable rows (FAQs, features) */
.repeat-rows { display: flex; flex-direction: column; gap: 12px; }
.repeat-row { background: #F9FAFD; border: 1px solid var(--a-border); border-radius: 12px; padding: 14px; position: relative; }
.repeat-row-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.repeat-row-title { font-size: .76rem; font-weight: 800; color: var(--a-muted); text-transform: uppercase; letter-spacing: .06em; }

/* ------------------- Minimalist FAQ builder -------------------
   Compact rows: numbered question line with On toggle + remove, answer
   textarea below. Used by the App FAQs and Page FAQs sections. */
.faq-min .repeat-rows { gap: 8px; }
.faq-min .repeat-row { background: transparent; border: 1px solid var(--a-border); border-radius: 10px; padding: 10px 12px; }
.faq-row-top { display: flex; align-items: center; gap: 9px; }
.faq-row-num { flex: 0 0 auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: #EEF1FA; color: #5B6478; font-size: .7rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.faq-q-input { flex: 1 1 auto; min-width: 0; padding: 8px 11px; border: 1.5px solid var(--a-border); border-radius: 8px; font-family: inherit; font-size: .88rem; font-weight: 600; outline: none; background: #fff; color: var(--a-text); transition: border-color .14s ease, box-shadow .14s ease; }
.faq-q-input:focus { border-color: var(--a-primary); box-shadow: 0 0 0 3px rgba(90,72,245,.13); }
.faq-vis { flex: 0 0 auto; }
.faq-vis .toggle-label { font-size: .74rem; color: var(--a-muted); }
.faq-del { flex: 0 0 auto; border: none; background: transparent; color: var(--a-muted); cursor: pointer; padding: 7px; border-radius: 8px; line-height: 0; transition: color .12s ease, background .12s ease; }
.faq-del:hover { color: var(--a-danger); background: #FDECEC; }
.faq-a-input { width: 100%; margin-top: 8px; padding: 9px 11px; border: 1.5px solid var(--a-border); border-radius: 8px; font-family: inherit; font-size: .85rem; resize: vertical; outline: none; background: #fff; color: var(--a-text); transition: border-color .14s ease, box-shadow .14s ease; }
.faq-a-input:focus { border-color: var(--a-primary); box-shadow: 0 0 0 3px rgba(90,72,245,.13); }
.repeat-remove { color: var(--a-danger); background: none; border: none; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 700; font-family: inherit; padding: 4px 8px; border-radius: 7px; }
.repeat-remove:hover { background: #FEF2F2; }
.drag-handle { cursor: grab; color: var(--a-muted); display: inline-flex; }

/* SEO preview */
.seo-preview { background: #fff; border: 1px solid var(--a-border); border-radius: 12px; padding: 16px 18px; }
.seo-preview .sp-title, .seo-preview .sp-desc { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.seo-preview .sp-title { color: #1A0DAB; font-size: 1.05rem; font-weight: 500; margin: 0 0 3px; }
.seo-preview .sp-url { color: #0E7A2F; font-size: .78rem; margin-bottom: 4px; }
.seo-preview .sp-desc { color: #4D5156; font-size: .84rem; margin: 0; }

/* Media library */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.media-item { border: 1px solid var(--a-border); border-radius: 12px; overflow: hidden; background: #fff; position: relative; }
.media-thumb { display: block; width: 100%; height: 120px; object-fit: contain; background: #F2F3F9; padding: 6px; }
.media-meta { padding: 8px 10px; font-size: .72rem; color: var(--a-muted); }
.media-meta strong { display: block; color: var(--a-text); font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-item-actions { display: flex; gap: 5px; padding: 0 8px 8px; }

/* Pagination (shared admin partial) */
.pagination { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 18px; }
.page-info { font-size: .78rem; color: var(--a-muted); margin-right: auto; }
.page-btn {
    min-width: 34px; height: 34px; padding: 0 11px; border: 1px solid var(--a-border);
    border-radius: 9px; background: #fff; color: var(--a-text);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .82rem; font-weight: 600; text-decoration: none; font-family: inherit;
    transition: background .14s ease, border-color .14s ease, color .14s ease;
}
.page-btn:hover { border-color: var(--a-primary); color: var(--a-primary); }
.page-btn.active { background: var(--a-primary); border-color: var(--a-primary); color: #fff; cursor: default; }
.page-btn.disabled { opacity: .45; pointer-events: none; }
.page-dots { color: var(--a-muted); font-size: .8rem; padding: 0 2px; user-select: none; }

/* Media picker modal */
.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 17, 34, .55); }
.modal-box { position: relative; background: #fff; border-radius: 16px; width: min(680px, calc(100vw - 32px)); max-height: 84vh; display: flex; flex-direction: column; box-shadow: 0 24px 70px rgba(10,12,30,.35); }
.modal-box.modal-wide { width: min(900px, calc(100vw - 32px)); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--a-border); }
.modal-head h3 { margin: 0; font-size: 1rem; }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-foot { padding: 13px 18px; border-top: 1px solid var(--a-border); display: flex; justify-content: flex-end; gap: 10px; }
.media-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.media-pick { border: 2px solid var(--a-border); border-radius: 10px; padding: 6px; cursor: pointer; background: #fff; }
.media-pick:hover, .media-pick.selected { border-color: var(--a-primary); }
.media-pick img { width: 100%; height: 84px; object-fit: contain; background: #F6F7FB; border-radius: 7px; }
.media-pick small { display: block; font-size: .66rem; color: var(--a-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 4px; }

/* Drag-sortable list */
.sortable-list { display: flex; flex-direction: column; gap: 10px; }
.sortable-item {
    display: flex; align-items: center; gap: 12px; background: #fff;
    border: 1px solid var(--a-border); border-radius: 12px; padding: 12px 16px;
    cursor: grab; transition: box-shadow .15s ease, border-color .15s ease;
}
.sortable-item.dragging { opacity: .6; box-shadow: 0 8px 24px rgba(23,26,46,.18); border-color: var(--a-primary); }
.sortable-item .si-label { flex: 1; }
.sortable-item .si-label strong { display: block; font-size: .9rem; }
.sortable-item .si-label small { color: var(--a-muted); font-size: .75rem; }

/* Alerts, login */
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-radius: 11px; font-size: .87rem; margin-bottom: 16px; }
.alert-success { background: #F0FDF4; color: #166534; border: 1px solid #BBF7D0; }
.alert-error { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.alert-info { background: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(140deg, #4534E0, #9333EA); padding: 20px; }
.login-card { background: #fff; border-radius: 18px; padding: 34px 32px; width: min(400px, 100%); box-shadow: 0 24px 70px rgba(10,12,30,.4); }
.login-brand { text-align: center; margin-bottom: 22px; }
.login-brand img { width: 52px; height: 52px; border-radius: 14px; margin: 0 auto 10px; }
.login-brand strong { font-size: 1.15rem; }
.login-brand small { display: block; color: var(--a-muted); }
.login-card .form-field input { padding: 12px 14px; }

/* Dashboard recent lists */
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { display: flex; align-items: center; gap: 11px; padding: 10px 2px; border-bottom: 1px dashed #EDEEF5; font-size: .85rem; }
.mini-list li:last-child { border-bottom: none; }
.mini-list img { width: 34px; height: 34px; border-radius: 8px; }
.mini-list .ml-body { flex: 1; min-width: 0; }
.mini-list .ml-body strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.mini-list .ml-body small { color: var(--a-muted); font-size: .74rem; }
.mini-list .ml-time { color: var(--a-muted); font-size: .74rem; white-space: nowrap; }

/* Activity log colors */
.log-action { font-size: .74rem; font-weight: 700; }

/* Responsive admin */
@media (max-width: 1100px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .two-col, .two-col-uneven { grid-template-columns: 1fr; }
    .form-grid-3 { grid-template-columns: 1fr 1fr; }
    .a-form-layout { grid-template-columns: 1fr; }
    .a-form-side { position: static; }
}
@media (max-width: 860px) {
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.open { transform: translateX(0); box-shadow: 0 0 60px rgba(0,0,0,.4); }
    body.sidebar-collapsed .admin-sidebar { transform: translateX(-100%); }
    body.sidebar-collapsed .admin-main { margin-left: 0; }
    .admin-main { margin-left: 0; }
    .admin-menu-name { display: none; }
}
@media (max-width: 640px) {
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
    .admin-content { padding: 14px 15px; }
    .topbar-title { font-size: .98rem; }
}
