/* ==========================================================================
   Vigor Property — Auth & Admin
   Builds on the tokens and components in site.css.
   ========================================================================== */

/* ---------- Shared form bits ---------- */
.field-error { color: var(--accent); font-size: 13px; font-weight: 500; }

.checkbox { display: inline-flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 14px; cursor: pointer; }
.checkbox input {
    appearance: none;
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    margin: 0;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--bg);
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}
.checkbox input::after {
    content: '';
    width: 5px;
    height: 9px;
    margin-top: -2px;
    border: solid var(--bg);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform 0.15s var(--ease);
}
.checkbox input:checked { background: var(--accent); border-color: var(--accent); }
.checkbox input:checked::after { transform: rotate(45deg) scale(1); }

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card);
    color: var(--text-2);
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent-line); }

/* ---------- Login ---------- */
.auth { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; min-height: 100dvh; }

.auth-brand {
    position: relative;
    overflow: hidden;
    border-right: 1px solid var(--border);
    background: var(--bg-raised);
    isolation: isolate;
}
.auth-brand .hero-grid-bg { z-index: -1; mask-image: radial-gradient(ellipse 80% 70% at 50% 70%, #000 20%, transparent 75%); -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 70%, #000 20%, transparent 75%); }
.auth-glow {
    position: absolute;
    left: 50%;
    bottom: -30%;
    z-index: -1;
    width: 120%;
    aspect-ratio: 1.6;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(255, 107, 0, 0.4), rgba(255, 107, 0, 0.08) 45%, transparent 70%);
    filter: blur(30px);
    transform: translateX(-50%);
}
.auth-brand-inner {
    display: flex;
    flex-direction: column;
    gap: 48px;
    height: 100%;
    padding: clamp(32px, 5vw, 64px);
}
.auth-brand-title {
    margin-bottom: 16px;
    font-family: var(--font-display);
    font-size: clamp(2rem, 3.6vw, 3.25rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
    text-transform: uppercase;
}
.auth-brand .muted { max-width: 420px; }
.auth-art { position: relative; inset: auto; flex: 1; min-height: 220px; margin-top: auto; }

.auth-main { display: grid; place-items: center; padding: 40px var(--gutter); }
.auth-card { display: flex; flex-direction: column; width: 100%; max-width: 420px; }
.auth-mobile-logo { display: none; margin-bottom: 40px; }
.auth-title { margin-bottom: 8px; font-size: clamp(2rem, 3vw, 2.5rem); font-weight: 800; letter-spacing: -0.035em; }
.auth-form { display: flex; flex-direction: column; gap: 20px; margin-top: 36px; }
.auth-back { align-self: center; margin-top: 32px; color: var(--text-2); font-size: 14px; transition: color 0.2s; }
.auth-back:hover { color: var(--accent); }

/* ---------- Admin shell ---------- */
.admin-body { background: var(--bg); }
.admin { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; min-height: 100dvh; }

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    border-right: 1px solid var(--border);
    background: var(--bg-raised);
    overflow-y: auto;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; height: 72px; padding: 0 20px; border-bottom: 1px solid var(--border-soft); flex-shrink: 0; }
.sidebar-close { display: none; }
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; padding: 12px 12px 24px; }
.sidebar-group { margin: 20px 12px 8px; color: var(--text-3); font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
.sidebar-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--text-2);
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s;
}
.sidebar-link .icon { flex-shrink: 0; }
a.sidebar-link:hover { background: var(--card); color: var(--white); }
.sidebar-link.is-active { background: var(--accent-soft); color: var(--white); }
.sidebar-link.is-active .icon { color: var(--accent); }
.sidebar-link.is-active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--accent);
}
.sidebar-link.is-disabled { color: var(--text-3); cursor: not-allowed; }
.soon {
    margin-left: auto;
    padding: 2px 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-3);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.sidebar-count { margin-left: auto; min-width: 22px; padding: 2px 7px; border-radius: 999px; background: var(--accent); color: var(--bg); font-size: 11px; font-weight: 700; text-align: center; }
.sidebar-foot { margin-top: auto; padding: 12px; border-top: 1px solid var(--border-soft); }

.sidebar-backdrop { display: none; }

.admin-main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 16px;
    height: 72px;
    padding: 0 clamp(16px, 3vw, 40px);
    border-bottom: 1px solid var(--border);
    background: rgba(11, 11, 11, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
.sidebar-open { display: none; }
.topbar-title { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; }
.topbar-user { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.topbar-user-text { display: flex; flex-direction: column; line-height: 1.3; }
.topbar-user-text strong { font-size: 14px; font-weight: 600; }
.topbar-user-text span { color: var(--text-3); font-size: 12px; }
.avatar {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--bg);
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 800;
}

.admin-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
    max-width: 1400px;
    padding: clamp(20px, 3vw, 40px);
}

/* ---------- Dashboard ---------- */
.welcome { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 8px; }
.welcome-date { margin-bottom: 8px; color: var(--accent); font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.welcome-title { margin-bottom: 6px; font-size: clamp(1.75rem, 3vw, 2.5rem); font-weight: 800; letter-spacing: -0.035em; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    overflow: hidden;
    transition: border-color 0.3s, transform 0.3s var(--ease);
}
.kpi:hover { border-color: rgba(255, 107, 0, 0.4); transform: translateY(-3px); }
.kpi:first-child::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 80%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 107, 0, 0.16), transparent 65%);
    pointer-events: none;
}
.kpi-head { display: flex; align-items: center; justify-content: space-between; }
.kpi-label { color: var(--text-2); font-size: 14px; font-weight: 500; }
.kpi-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.kpi-value { font-family: var(--font-display); font-size: clamp(2rem, 3vw, 2.6rem); font-weight: 700; line-height: 1.1; letter-spacing: -0.04em; }
.kpi-note { color: var(--text-3); font-size: 13px; }

.panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.panel { display: flex; flex-direction: column; padding: 24px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.panel-head h3 { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em; }
.panel-meta { color: var(--text-3); font-size: 13px; }

.status-bars { display: flex; flex-direction: column; gap: 20px; }
.status-row { display: flex; justify-content: space-between; margin-bottom: 8px; color: var(--text-2); font-size: 14px; }
.status-row strong { color: var(--white); }
.status-track { height: 10px; border-radius: 5px; background: var(--bg); overflow: hidden; }
.status-track span { display: block; height: 100%; border-radius: 5px; background: var(--accent); }
.status-bars li:not(:first-child) .status-track span { background: #3A3A3A; }

.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; flex: 1; padding: 24px 12px; text-align: center; }
.empty-icon { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 8px; border: 1px dashed var(--border); border-radius: 16px; color: var(--accent); }
.empty .muted { max-width: 320px; font-size: 14px; }

.table-wrap { margin: 0 -24px -24px; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
    padding: 12px 24px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--bg-raised);
    color: var(--text-3);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}
.table td { padding: 14px 24px; border-bottom: 1px solid var(--border-soft); color: var(--text-2); white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color 0.2s; }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
.table .num { text-align: right; color: var(--white); font-weight: 600; font-variant-numeric: tabular-nums; }
.cell-main { display: flex; align-items: center; gap: 12px; }
.cell-main div { display: flex; flex-direction: column; line-height: 1.35; }
.cell-main strong { color: var(--white); font-weight: 600; }
.cell-main span { color: var(--text-3); font-size: 13px; }
.cell-thumb { display: grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--accent); }

.status { display: inline-flex; padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; color: var(--white); font-size: 12px; font-weight: 600; }
.status-hot { border-color: transparent; background: var(--accent); color: var(--bg); }

.feed { display: flex; flex-direction: column; }
.feed li { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 12px; padding: 14px 0; border-bottom: 1px solid var(--border-soft); }
.feed li:first-child { padding-top: 0; }
.feed li:last-child { border-bottom: 0; padding-bottom: 0; }
.feed .tag { grid-row: span 2; align-self: start; margin-top: 2px; }
.feed strong { font-size: 14px; font-weight: 600; line-height: 1.4; }
.feed time { color: var(--text-3); font-size: 13px; }

.checklist { display: flex; flex-direction: column; gap: 14px; }
.checklist li { display: flex; align-items: center; gap: 12px; color: var(--text-2); font-size: 14px; }
.checklist .check { display: grid; place-items: center; width: 22px; height: 22px; flex-shrink: 0; border: 1px dashed var(--text-3); border-radius: 50%; }
.checklist .is-done { color: var(--white); }
.checklist .is-done .check { border: 0; background: var(--accent); color: var(--bg); }
.checklist .is-done .check .icon { stroke-width: 3; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
    .kpis { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1023px) {
    .auth { grid-template-columns: 1fr; }
    .auth-brand { display: none; }
    .auth-mobile-logo { display: inline-flex; }

    .admin { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 60;
        width: min(288px, 86vw);
        transform: translateX(-100%);
        transition: transform 0.35s var(--ease);
    }
    .admin.is-open .sidebar { transform: none; }
    .sidebar-close, .sidebar-open { display: inline-grid; }
    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 55;
        display: block;
        background: rgba(0, 0, 0, 0.6);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s;
    }
    .admin.is-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }

    .panel-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .topbar { height: 64px; }
    .topbar-user-text { display: none; }
    .kpis { grid-template-columns: 1fr 1fr; gap: 12px; }
    .kpi { padding: 16px; }
    .kpi-icon { width: 30px; height: 30px; }
    .panel { padding: 18px; }
    .table-wrap { margin: 0 -18px -18px; }
    .table th, .table td { padding-inline: 18px; }
    .welcome .btn { width: 100%; }
}

@media (max-width: 380px) {
    .kpis { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Content management
   ========================================================================== */
.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Page header & alerts ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; }
.page-title { font-size: clamp(1.6rem, 2.6vw, 2.2rem); font-weight: 800; letter-spacing: -0.035em; margin-bottom: 6px; }
.page-head .muted { max-width: 640px; font-size: 15px; }
.page-back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px; color: var(--text-2); font-size: 14px; font-weight: 500; transition: color 0.2s; }
.page-back:hover { color: var(--accent); }
.page-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.alert { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--card); font-size: 14px; font-weight: 500; }
.alert-icon { display: grid; place-items: center; width: 24px; height: 24px; flex-shrink: 0; border-radius: 50%; font-weight: 800; font-size: 13px; }
.alert-success { border-color: rgba(255, 107, 0, 0.35); }
.alert-success .alert-icon { background: var(--accent); color: var(--bg); }
.alert-success .alert-icon .icon { stroke-width: 3; }
.alert-error { border-color: var(--accent); background: var(--accent-soft); }
.alert-error .alert-icon { border: 1px solid var(--accent); color: var(--accent); }

/* ---------- Buttons ---------- */
.btn-danger { border-color: rgba(255, 255, 255, 0.14); background: transparent; color: var(--text-2); }
.btn-danger:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.row-actions .icon-btn { width: 36px; height: 36px; border-radius: 10px; }
.icon-btn-danger:hover { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- Tables ---------- */
.panel-flush { padding: 0; overflow: hidden; }
.panel-flush .table-wrap { margin: 0; }
.panel-flush .table th { border-top: 0; }
.panel-flush .empty { padding: 56px 24px; }
.panel-head-pad { margin: 0; padding: 20px 24px; }
.cell-photo { width: 52px; height: 40px; flex-shrink: 0; border-radius: 10px; object-fit: cover; border: 1px solid var(--border); }
.cell-avatar { width: 40px; height: 40px; flex-shrink: 0; aspect-ratio: 1; border-radius: 50%; border: 1px solid var(--border); }
.cell-avatar .agent-initials { font-size: 14px; letter-spacing: 0; }
.cell-avatar .agent-initials::after, .cell-avatar .agent-avatar-mark { display: none; }
.form-side .image-preview:has(+ .image-actions [name="photo"]) { aspect-ratio: 4 / 5; }
.cell-link { color: var(--white); font-weight: 600; transition: color 0.2s; }
.cell-link:hover { color: var(--accent); }
.cell-sub { display: block; margin-top: 2px; color: var(--text-3); font-size: 13px; }

/* Users */
.user-filters { flex-wrap: wrap; }
.user-filters select { padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--white); font: inherit; font-size: 14px; }
.user-filters select:focus { outline: none; border-color: var(--accent); }
.user-admins-head { margin: 0; padding: 20px 24px; border-bottom: 1px solid var(--border-soft); }
@media (max-width: 600px) {
    .user-filters input { flex-basis: 100%; }
    .user-filters select { flex: 1; }
}

/* Enquiries */
.table tr.is-unread td { color: var(--white); }
.table tr.is-unread .cell-link::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--accent); vertical-align: middle; }
.enquiry-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.enquiry-message { color: var(--text-2); font-size: 15px; line-height: 1.7; overflow-wrap: anywhere; }
.enquiry-details { display: flex; flex-direction: column; gap: 14px; margin: 0 0 20px; }
.enquiry-details dt { margin-bottom: 2px; color: var(--text-3); font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.enquiry-details dd { margin: 0; overflow-wrap: anywhere; }
.enquiry-actions { display: flex; flex-direction: column; gap: 10px; }
@media (max-width: 900px) {
    .enquiry-layout { grid-template-columns: 1fr; }
}
.cell-strong { color: var(--white); font-weight: 600; }
.cell-title { color: var(--white); font-weight: 600; }
.sync-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--card); color: var(--text-2); font-size: 14px; }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.sync-dot.is-ok { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.sync-count { margin-left: auto; color: var(--white); }
.cell-wrap { white-space: normal; max-width: 520px; }
td .cell-wrap { display: block; }
.row-actions { display: flex; justify-content: flex-end; gap: 8px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; color: var(--text-3); font-size: 12px; font-weight: 600; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-on { color: var(--white); border-color: rgba(255, 107, 0, 0.35); }
.badge-on::before { background: var(--accent); }

a.kpi { color: inherit; }
.feed-title { font-size: 14px; font-weight: 600; line-height: 1.4; transition: color 0.2s; }
.feed-title:hover { color: var(--accent); }

/* ---------- Forms ---------- */
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.form-main, .form-side { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.form-side { position: sticky; top: 96px; }
.form-side .panel { gap: 20px; }
.form-narrow { display: flex; flex-direction: column; gap: 24px; max-width: 780px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field-wide { grid-column: 1 / -1; }
.field-help { color: var(--text-3); font-size: 13px; }
.field select {
    width: 100%;
    padding: 14px 44px 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23B8B8B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E") no-repeat right 16px center;
    color: var(--white);
    font: inherit;
    font-size: 16px;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.field input[type="date"] { color-scheme: dark; }
.field textarea { min-height: 0; }
.has-error select { border-color: var(--accent); }

.form-submit { display: flex; flex-direction: column; gap: 10px; }
.form-submit-row { flex-direction: row; justify-content: flex-end; }

.save-bar {
    position: sticky;
    bottom: 16px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px 14px 24px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(21, 21, 21, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.9);
}
.save-bar .muted { font-size: 14px; }
.content-form { display: flex; flex-direction: column; gap: 24px; }
.content-form .panel { scroll-margin-top: 96px; }

.section-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.section-tabs a {
    flex-shrink: 0;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-2);
    font-size: 13px;
    font-weight: 500;
    transition: color 0.2s, border-color 0.2s;
}
.section-tabs a:hover { color: var(--white); border-color: var(--accent-line); }

/* Toggle switch */
.toggle { position: relative; display: flex; align-items: flex-start; gap: 14px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-track {
    position: relative;
    width: 44px;
    height: 26px;
    flex-shrink: 0;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg);
    transition: background-color 0.2s, border-color 0.2s;
}
.toggle-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--text-3);
    transition: transform 0.25s var(--ease), background-color 0.2s;
}
.toggle input:checked + .toggle-track { background: var(--accent); border-color: var(--accent); }
.toggle input:checked + .toggle-track::after { transform: translateX(18px); background: var(--bg); }
.toggle input:focus-visible + .toggle-track { outline: 2px solid var(--accent); outline-offset: 3px; }
.toggle-text { display: flex; flex-direction: column; gap: 2px; }
.toggle-text strong { font-size: 14px; font-weight: 600; }
.toggle-text span { color: var(--text-3); font-size: 13px; }

/* Image upload */
.image-input { display: flex; flex-direction: column; gap: 12px; }
.image-input-label { color: var(--text-2); font-size: 13px; font-weight: 500; }
.image-preview {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 16 / 10;
    border: 1px dashed var(--border);
    border-radius: 14px;
    background: var(--bg);
    overflow: hidden;
}
.image-preview img { width: 100%; height: 100%; object-fit: cover; transition: opacity 0.2s, filter 0.2s; }
.image-preview img[hidden], .image-empty[hidden] { display: none; }
.image-preview.is-removing img { opacity: 0.25; filter: grayscale(1); }
.image-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 260px; padding: 16px; color: var(--text-3); font-size: 13px; text-align: center; }
.image-empty .icon { color: var(--accent); }
.image-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.image-actions label.btn { cursor: pointer; }
.remove-check { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 14px; cursor: pointer; }
.remove-check input { width: 16px; height: 16px; accent-color: var(--accent); }
.has-error .image-preview { border-color: var(--accent); }
.content-form .image-preview { aspect-ratio: 21 / 9; max-width: 760px; }

/* List search and pagination (agents) */
.list-search { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--card); }
.list-search > .icon { color: var(--accent); flex-shrink: 0; }
.list-search input { flex: 1; min-width: 0; padding: 8px 0; border: 0; background: transparent; color: var(--white); font: inherit; font-size: 15px; }
.list-search input:focus { outline: none; }
.list-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 24px; border-top: 1px solid var(--border-soft); font-size: 14px; }
.pager-links { display: flex; align-items: center; gap: 10px; }
.pager-current { color: var(--text-2); }
.btn.is-disabled { opacity: 0.4; pointer-events: none; }

/* Vigor Intel agent picker */
.intel-picker { display: flex; flex-direction: column; gap: 8px; }
.intel-search {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--white);
    font: inherit;
    font-size: 15px;
}
.intel-search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

/* Video link list (agent form and edit pop-up) */
.video-list { display: flex; flex-direction: column; gap: 12px; }
.video-rows { display: flex; flex-direction: column; gap: 10px; }
.video-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) 36px; align-items: center; gap: 10px; }
.video-row .field-error { grid-column: 2 / -1; }
.video-row-badge { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--accent); }
.video-row input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--white);
    font: inherit;
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.video-row input::placeholder { color: #5A5A5A; }
.video-row input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.video-row.has-error input { border-color: var(--accent); }
.video-list-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.video-list-actions .btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Icon picker */
.icon-picker { margin: 0; padding: 0; border: 0; min-width: 0; }
.icon-picker legend { margin-bottom: 8px; padding: 0; color: var(--text-2); font-size: 13px; font-weight: 500; }
.icon-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.icon-option { position: relative; }
.icon-option input { position: absolute; opacity: 0; }
.icon-option > span {
    display: grid;
    place-items: center;
    height: 52px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg);
    color: var(--text-2);
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background-color 0.2s;
}
.icon-option:hover > span { border-color: var(--accent-line); color: var(--white); }
.icon-option input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.icon-option input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 1100px) {
    .form-layout { grid-template-columns: 1fr; }
    .form-side { position: static; }
}

@media (max-width: 600px) {
    .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
    .save-bar { flex-direction: column; align-items: stretch; text-align: center; }
    .form-submit-row { flex-direction: column-reverse; }
    .form-submit-row .btn, .page-actions .btn { width: 100%; }
    .page-actions { width: 100%; }
}
