@font-face {
    font-family: "Nunito Sans";
    font-style: normal;
    font-weight: 200 1000;
    font-display: swap;
    src: url("../fonts/nunito-sans-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --red: #e30613;
    --red-dark: #b30410;
    --ink: #121820;
    --muted: #66707c;
    --line: #e3e7ed;
    --bg: #f2f4f7;
    --panel: #fff;
    --sidebar: #0c1220;
    --sidebar-soft: #16203a;
    --radius: 12px;
    --topbar-h: 64px;
    --font: "Nunito Sans", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--ink);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
p { margin: 0 0 12px; }
code { background: #eef1f5; padding: 2px 6px; border-radius: 4px; font-size: 12px; }

/* ---------- Login ---------- */
.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at 25% 18%, #1c2a44 0%, #0b101a 55%, #070a10 100%);
    padding: 28px;
}

.login-wrap { width: 100%; max-width: 420px; }

.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    margin-bottom: 22px;
    justify-content: center;
}

.login-brand small { display: block; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: #8f9bb0; }
.login-brand strong { font-size: 18px; letter-spacing: .3px; }

.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, .45);
}

.login-card h1 { font-size: 22px; }
.login-sub { color: var(--muted); font-size: 13.5px; margin-bottom: 22px; }
.login-foot { font-size: 12px; color: #8b939e; margin: 18px 0 0; text-align: center; }

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

.admin-sidebar {
    width: 252px;
    flex-shrink: 0;
    background: var(--sidebar);
    color: #c6cfdd;
    display: flex;
    flex-direction: column;
    padding: 22px 16px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    color: #fff;
    padding: 0 8px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    margin-bottom: 16px;
}

.admin-brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background: var(--red);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: -.5px;
    flex-shrink: 0;
}

.admin-brand strong { display: block; font-size: 15px; line-height: 1.2; }
.admin-brand small { font-size: 11px; color: #7f8ca1; letter-spacing: .4px; }

.admin-nav { display: flex; flex-direction: column; gap: 3px; flex: 1; overflow-y: auto; }

.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 11px;
    border-radius: 8px;
    font-size: 13.5px;
    color: #aab6c8;
    transition: background .15s ease, color .15s ease;
}

.admin-nav-link svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; flex-shrink: 0; }
.admin-nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.admin-nav-link.is-active { background: var(--red); color: #fff; font-weight: 600; }
.admin-nav-link.is-active svg { stroke: #fff; }

.admin-sidebar-foot { padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .08); display: flex; flex-direction: column; gap: 8px; }
.admin-site-link { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: #9ba8bb; }
.admin-site-link svg { width: 15px; height: 15px; fill: currentColor; }
.admin-site-link:hover { color: #fff; }
.admin-version { font-size: 11px; color: #586478; }

.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.admin-topbar {
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 10px 26px;
    min-height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 30;
    box-shadow: 0 1px 2px rgba(18, 24, 32, .04);
}

.admin-heading h1 { font-size: 19px; font-weight: 700; letter-spacing: -.2px; }
.admin-heading p { font-size: 12.5px; color: var(--muted); margin: 3px 0 0; }
.admin-title-short { display: none; }

.admin-topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.admin-topbar-actions .btn { padding: 9px 14px; font-size: 12.5px; }

.admin-menu-btn { display: none; flex-direction: column; gap: 4px; border: 0; background: transparent; padding: 6px; cursor: pointer; }
.admin-menu-btn span { width: 20px; height: 2px; background: #444c58; border-radius: 2px; }

.admin-user { position: relative; }

.admin-user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 10px 4px 4px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-family: inherit;
    color: var(--ink);
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}
.admin-user-chip:hover { background: #f8fafc; border-color: #d3d9e2; }
.admin-user-chip:focus-visible { outline: 2px solid rgba(227, 6, 19, .35); outline-color: color-mix(in srgb, var(--red) 35%, transparent); outline-offset: 2px; }
.admin-user-chip[aria-expanded="true"] { background: #f8fafc; border-color: #d3d9e2; }

.admin-avatar { width: 32px; height: 32px; border-radius: 50%; background: #e9edf4; color: #3d4653; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.admin-avatar.small { width: 28px; height: 28px; font-size: 12px; }
.admin-user-info { display: flex; flex-direction: column; line-height: 1.2; text-align: left; }
.admin-user-info strong { font-size: 12.5px; }
.admin-user-info small { font-size: 11px; color: #8b939e; }

.admin-user-chevron { width: 14px; height: 14px; fill: none; stroke: #98a1ac; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s ease; }
.admin-user-chip[aria-expanded="true"] .admin-user-chevron { transform: rotate(180deg); }

.admin-user-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 230px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 18px 40px rgba(18, 24, 32, .16);
    padding: 6px;
    z-index: 50;
}
.admin-user-card { padding: 10px 12px 12px; border-bottom: 1px solid #eef1f5; margin-bottom: 6px; }
.admin-user-card strong { display: block; font-size: 13px; }
.admin-user-card small { display: block; font-size: 11.5px; color: #8b939e; margin-top: 2px; word-break: break-all; }
.admin-user-dropdown a,
.admin-user-dropdown button {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 9px 12px;
    border: 0;
    border-radius: 8px;
    background: none;
    font-family: inherit;
    font-size: 13px;
    color: #3d4653;
    cursor: pointer;
    text-align: left;
}
.admin-user-dropdown a:hover, .admin-user-dropdown button:hover { background: #f4f6f9; }
.admin-user-dropdown .is-danger { color: #b91c1c; }
.admin-user-dropdown .is-danger:hover { background: #fdecec; }

.admin-content { padding: 26px; max-width: 1360px; width: 100%; margin: 0 auto; }

/* ---------- Componentes ---------- */
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 22px;
}

.panel-muted { background: #fafbfc; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.panel-head h2 { font-size: 15px; font-weight: 700; }
.panel-link { font-size: 12.5px; color: var(--red); font-weight: 600; }
.panel-tag { font-size: 11.5px; color: #8b939e; }
.panel-note { font-size: 12px; color: #8b939e; margin: 12px 0 0; }
.panel-text { font-size: 13px; color: var(--muted); margin: 0; }
.panel-simple-title { font-size: 14px; margin-bottom: 8px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 22px; }
.stat-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.stat-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .7px; color: #7b8592; font-weight: 600; }
.stat-value { font-size: 30px; font-weight: 700; letter-spacing: -1px; }
.stat-foot { font-size: 11.5px; color: #98a1ac; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.dashboard-aside { display: flex; flex-direction: column; }
.dashboard-aside .panel { margin-bottom: 18px; }

.bar-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.bar-list li { display: grid; grid-template-columns: 105px 1fr 26px; align-items: center; gap: 10px; font-size: 12.5px; }
.bar-label { color: #4c5663; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 7px; background: #eef1f5; border-radius: 4px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 4px; }
.bar-value { text-align: right; color: #6c7681; font-weight: 600; }

.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quick-link { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 12.5px; font-weight: 600; color: #4c5663; }
.quick-link:hover { border-color: var(--red); color: var(--red); }

/* ---------- Visão geral ---------- */
.dashboard-stats .stat-card {
    flex-direction: row;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.dashboard-stats .stat-card:hover { border-color: #d3d9e2; box-shadow: 0 6px 18px rgba(18, 24, 32, .05); }

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    background: var(--tone-soft, #eef1f5);
    color: var(--tone, #4c5663);
}
.stat-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.stat-tone-red { --tone: #e30613; --tone-soft: #fdecec; }
.stat-tone-amber { --tone: #a15c07; --tone-soft: #fef3e2; }
.stat-tone-blue { --tone: #075985; --tone-soft: #e0f2fe; }
.stat-tone-green { --tone: #18794e; --tone-soft: #e7f6ee; }

.stat-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dashboard-stats .stat-value { font-size: 28px; line-height: 1.15; }
.dashboard-stats .stat-foot { font-size: 11.5px; color: #98a1ac; }

.dashboard-table { table-layout: fixed; }
.dashboard-table td { padding: 12px; }
.dashboard-table .post-cell { min-width: 0; }
.dashboard-table th:nth-child(2), .dashboard-table td:nth-child(2) { width: 122px; }
.dashboard-table th:nth-child(3), .dashboard-table td:nth-child(3) { width: 96px; }
.dashboard-table th:nth-child(4), .dashboard-table td:nth-child(4) { width: 60px; }
.dashboard-table .post-thumb { width: 54px; height: 40px; border-radius: 6px; border: 1px solid #eef1f5; }
.post-cell-body { min-width: 0; }
.post-cell-body .table-title { font-size: 13px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-cell-body small { display: block; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cat-tag { display: inline-flex; align-items: center; gap: 7px; min-width: 0; max-width: 100%; font-size: 12.5px; color: #4c5663; }
.cat-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

.td-date { white-space: nowrap; }
.td-date strong { display: block; font-size: 12.5px; font-weight: 600; }
.td-date small { color: #98a1ac; font-size: 11px; }

.dashboard-rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.dashboard-rank li { display: flex; align-items: center; gap: 11px; padding: 10px 0; border-bottom: 1px solid #eef1f5; }
.dashboard-rank li:first-child { padding-top: 0; }
.dashboard-rank li:last-child { border-bottom: 0; padding-bottom: 0; }
.dashboard-rank .rank { width: 16px; flex-shrink: 0; text-align: center; font-size: 13px; font-weight: 700; color: #c3cad4; }
.dashboard-rank li:first-child .rank { color: var(--red); }
.dashboard-rank .rank-thumb { width: 46px; height: 34px; border-radius: 6px; overflow: hidden; background: #eef1f5; flex-shrink: 0; }
.dashboard-rank .rank-thumb img { width: 100%; height: 100%; object-fit: cover; }
.dashboard-rank .rank-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dashboard-rank a { font-size: 12.5px; font-weight: 600; line-height: 1.35; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dashboard-rank a:hover { color: var(--red); }
.dashboard-rank small { font-size: 11px; color: #98a1ac; }
.dashboard-rank .rank-empty { font-size: 12.5px; color: #98a1ac; border-bottom: 0; }

.dashboard-quick .quick-link { display: flex; align-items: center; gap: 8px; padding: 10px 11px; font-size: 12px; }
.dashboard-quick .quick-link svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; color: #8b939e; flex-shrink: 0; }
.dashboard-quick .quick-link:hover svg { color: var(--red); }

/* ---------- Formulários ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field-label { font-size: 12px; font-weight: 600; color: #4c5663; }
.field-hint { font-size: 11.5px; color: #98a1ac; margin: 0; }

input[type="text"], input[type="search"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], input[type="datetime-local"], input[type="color"],
input[type="file"], select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-family: inherit;
    font-size: 13.5px;
    color: var(--ink);
    background: #fff;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

input:focus, select:focus, textarea:focus { border-color: #c3cad4; box-shadow: 0 0 0 3px rgba(227, 6, 19, .08); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 8%, transparent); }
textarea { resize: vertical; min-height: 100px; }
input[type="color"] { padding: 4px; height: 40px; cursor: pointer; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-row-3 { grid-template-columns: repeat(3, 1fr); }
.field-small { max-width: 120px; }
.field-wide { grid-column: 1 / -1; }

.input-title { font-size: 20px; font-weight: 700; padding: 13px 14px; }

.check { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: #4c5663; margin-bottom: 12px; cursor: pointer; }
.check input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    width: 38px;
    height: 22px;
    margin: 0;
    flex-shrink: 0;
    border-radius: 999px;
    background: #d7dce4;
    border: 0;
    cursor: pointer;
    transition: background .18s ease;
}
.check input[type="checkbox"]::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(18, 24, 32, .3);
    transition: transform .18s ease;
}
.check input[type="checkbox"]:checked { background: var(--red); }
.check input[type="checkbox"]:checked::after { transform: translateX(16px); }
.check input[type="checkbox"]:focus-visible { outline: 2px solid rgba(227, 6, 19, .35); outline-color: color-mix(in srgb, var(--red) 35%, transparent); outline-offset: 2px; }
.check-inline { margin-bottom: 0; }

.stack-form { display: flex; flex-direction: column; gap: 12px; }
.stack-form-tight { gap: 8px; margin-bottom: 10px; }
.form-narrow { max-width: 880px; }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: end; }
.form-grid .field { margin-bottom: 0; }
.form-actions { display: flex; gap: 10px; align-items: center; grid-column: 1 / -1; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 8px;
    border: 1px solid transparent;
    padding: 10px 16px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
    white-space: nowrap;
}

.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-secondary { background: #fff; border-color: #d8dde5; color: #3d4653; }
.btn-secondary:hover { border-color: #b9c1cc; background: #f8fafc; }
.btn-ghost { background: transparent; border-color: transparent; color: #66707c; }
.btn-ghost:hover { background: #f1f3f7; color: var(--ink); }
.btn-danger { background: #b91c1c; color: #fff; }
.btn-danger:hover { background: #991b1b; }
.btn-sm { padding: 7px 12px; font-size: 12px; }
.btn-block { width: 100%; }

.link-btn { background: none; border: 0; padding: 0; font-family: inherit; font-size: 12px; color: #66707c; cursor: pointer; text-decoration: underline; }
.link-btn:hover { color: var(--red); }
.link-danger { background: none; border: 0; padding: 0; font-size: 12px; color: #b91c1c; cursor: pointer; text-decoration: underline; }

.icon-btn { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; border: 1px solid transparent; color: #66707c; font-size: 13px; }
.icon-btn:hover { background: #f1f3f7; color: var(--ink); }
.icon-btn-danger:hover { background: #fdecec; color: #b91c1c; }

/* ---------- Tabelas ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
    text-align: left;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .7px;
    color: #8994a1;
    font-weight: 700;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.table td { padding: 13px 12px; border-bottom: 1px solid #eef1f5; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table-hover tbody tr:hover { background: #fafbfc; }
.table-title { font-weight: 600; color: var(--ink); display: block; }
.table-title:hover { color: var(--red); }
.table td small { display: block; color: #98a1ac; font-size: 11.5px; margin-top: 2px; }
.table-empty { text-align: center; color: #98a1ac; padding: 26px 0; font-size: 13px; }
.th-actions { width: 150px; }
.td-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.td-actions form { display: inline; }

.post-cell { display: flex; align-items: center; gap: 12px; min-width: 300px; }
.post-thumb { width: 46px; height: 34px; border-radius: 5px; overflow: hidden; background: #eef1f5; flex-shrink: 0; }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; }

.badge { display: inline-block; padding: 3px 8px; border-radius: 20px; font-size: 10.5px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; }
.badge-published { background: #e7f6ee; color: #18794e; }
.badge-draft { background: #eef1f5; color: #5c6672; }
.badge-scheduled { background: #fef3e2; color: #a15c07; }
.badge-featured { background: #fdecec; color: #b91c1c; margin-left: 4px; }
.badge-role-admin { background: #ede9fe; color: #5b21b6; }
.badge-role-editor { background: #e0f2fe; color: #075985; }
.badge-role-author { background: #eef1f5; color: #4c5663; }

.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell small { color: #98a1ac; }

/* ---------- Usuários ---------- */
.users-table .user-email { color: #4c5663; word-break: break-word; }
.users-table .td-actions { flex-wrap: nowrap; justify-content: flex-end; gap: 4px; }

@media (max-width: 900px) {
    .users-table thead th:nth-child(5), .users-table .user-last { display: none; }
}

@media (max-width: 720px) {
    .users-table thead th:nth-child(4), .users-table .user-posts { display: none; }
}

@media (max-width: 640px) {
    .users-table thead { display: none; }
    .users-table, .users-table tbody { display: block; }
    .users-table tr {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 6px 10px;
        border: 1px solid #e8ecf1;
        border-radius: 10px;
        padding: 12px;
        margin-bottom: 8px;
    }
    .users-table tr:last-child { margin-bottom: 0; }
    .users-table td { display: block; border: 0; padding: 0; }
    .users-table .user-name { order: 1; flex: 1 1 120px; min-width: 0; }
    .users-table .user-actions { order: 2; display: flex; align-items: center; gap: 4px; margin-left: auto; }
    .users-table .user-email { order: 3; flex: 1 1 100%; font-size: 12px; color: #66707c; }
    .users-table .user-role { order: 4; flex: 0 0 auto; }
    .users-table .user-status { order: 5; flex: 0 0 auto; }
}

/* ---------- Categorias ---------- */
.categories-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.categories-toolbar h2 { font-size: 16px; font-weight: 700; }
.categories-toolbar p { margin: 4px 0 0; font-size: 12.5px; color: #8b939e; }
.categories-toolbar .btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.category-create { display: block; }

.category-list { display: flex; flex-direction: column; gap: 6px; }
.category-row {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto auto auto;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 8px 12px;
    border: 1px solid #e8ecf1;
    border-radius: 10px;
    background: #fff;
}
.category-row:hover { border-color: #dde3ea; }
.category-row.is-dragging {
    position: relative;
    z-index: 40;
    border-color: #d7dde6;
    box-shadow: 0 16px 34px rgba(15, 23, 42, .16);
}
body.is-sorting { user-select: none; }

.category-drag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #b3bcc7;
    cursor: grab;
    touch-action: none;
}
.category-drag svg { width: 15px; height: 15px; fill: currentColor; }
.category-drag:hover { background: #eef1f5; color: #66707c; }
.category-row.is-dragging .category-drag { color: var(--red); background: #fdecec; cursor: grabbing; }

.category-swatch {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    background: var(--category-color, #e30613);
    box-shadow: inset 0 0 0 1px rgba(18, 24, 32, .1);
}

.category-main { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.category-name { min-width: 0; font-size: 13.5px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.category-slugline { flex-shrink: 0; font-size: 11px; color: #98a1ac; }
.category-color-picker {
    position: relative;
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: var(--category-color, #e30613);
    box-shadow: inset 0 0 0 1px rgba(18, 24, 32, .1);
}
.category-color-picker span { position: absolute; inset: 0; border-radius: inherit; background: var(--category-color, #e30613); pointer-events: none; }
.category-color-picker input[type="color"] { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.category-color-picker:hover { box-shadow: inset 0 0 0 1px rgba(18, 24, 32, .22), 0 0 0 3px rgba(18, 24, 32, .06); }
.category-color-picker:focus-within { outline: 2px solid rgba(227, 6, 19, .35); outline-color: color-mix(in srgb, var(--red) 35%, transparent); outline-offset: 2px; }
.category-count { flex-shrink: 0; font-size: 11px; font-weight: 600; color: #66707c; background: #eef1f5; border-radius: 20px; padding: 3px 9px; white-space: nowrap; }
.category-status { font-size: 10px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; border-radius: 20px; padding: 4px 8px; white-space: nowrap; }
.category-status.is-on { background: #e7f6ee; color: #18794e; }
.category-status.is-off { background: #eef1f5; color: #5c6672; }

.category-actions { display: inline-flex; align-items: center; gap: 4px; }
.category-edit { display: inline-flex; align-items: center; gap: 6px; }
.category-edit svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 720px) {
    .category-row { grid-template-columns: auto auto minmax(0, 1fr) auto auto; gap: 8px; padding: 8px 10px; }
    .category-count { display: none; }
    .category-row .category-edit {
        justify-content: center;
        width: 30px;
        height: 30px;
        padding: 0;
        border: 0;
        background: transparent;
        color: #66707c;
    }
    .category-row .category-edit:hover { background: #f1f3f7; color: var(--ink); }
    .category-edit span { display: none; }
}

@media (max-width: 420px) {
    .category-slugline { display: none; }
}

/* ---------- Mídia ---------- */
.media-head-info { display: flex; align-items: baseline; gap: 8px; }
.media-head-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.media-search { display: flex; gap: 8px; }
.media-search input { width: 190px; padding: 7px 10px; font-size: 12.5px; }
.media-upload-open { display: inline-flex; align-items: center; gap: 6px; }
.media-upload-open svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.modal-panel.media-upload-panel { width: min(520px, 100%); }
.media-upload-panel .modal-head p { margin: 4px 0 0; font-size: 12px; color: #8b939e; }
.media-upload-form { display: flex; flex-direction: column; }
.media-upload-body { padding: 18px 20px; }
.modal-foot.media-upload-foot { justify-content: flex-end; }
.media-upload-foot .btn { min-width: 110px; justify-content: center; }

.upload-form { display: flex; flex-direction: column; gap: 12px; }
.dropzone {
    border: 1.5px dashed #ccd3dd;
    border-radius: 10px;
    background: #fafbfc;
    padding: 26px 18px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}
.dropzone:hover { border-color: var(--red); background: #fff8f8; }
.dropzone input[type="file"] { display: none; }
.dropzone-icon { font-size: 22px; color: var(--red); }
.dropzone strong { font-size: 13px; }
.dropzone small { font-size: 11.5px; color: #98a1ac; }
.dropzone-list { font-size: 11.5px; color: #4c5663; margin-top: 6px; text-align: left; }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 14px; }
.media-card { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.media-thumb { aspect-ratio: 4 / 3; background: #eef1f5; }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-meta { padding: 8px 10px; }
.media-meta strong { display: block; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-meta small { font-size: 10.5px; color: #98a1ac; }
.media-card-actions { padding: 0 10px 10px; }
.media-card-actions .btn { display: inline-flex; align-items: center; gap: 5px; }
.media-card-actions svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.modal-panel.media-edit-panel { width: min(560px, 100%); }
.media-edit-panel .modal-head p { margin: 4px 0 0; max-width: 420px; font-size: 12px; color: #8b939e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-edit-body { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 16px; padding: 18px 20px; }
.media-edit-preview { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #eef1f5; align-self: start; }
.media-edit-preview img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.media-edit-fields { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.media-edit-fields .field { margin-bottom: 0; }
.media-edit-meta { font-size: 11px; color: #98a1ac; }
.modal-foot.media-edit-foot { justify-content: space-between; align-items: center; flex-wrap: wrap; row-gap: 10px; }
.media-edit-actions { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.media-edit-foot .link-danger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border: 1px solid #f1c9c9;
    border-radius: 8px;
    background: #fff;
    font-size: 12px;
    font-weight: 600;
    color: #b91c1c;
    text-decoration: none;
}
.media-edit-foot .link-danger svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.media-edit-foot .link-danger:hover { background: #fdecec; border-color: #e2a3a3; color: #991b1b; }

/* ---------- Galerias ---------- */
.gallery-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.gallery-admin-card { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.gallery-admin-cover { aspect-ratio: 16 / 10; background: #eef1f5; display: grid; place-items: center; color: #98a1ac; font-size: 12px; }
.gallery-admin-cover img { width: 100%; height: 100%; object-fit: cover; }
.gallery-admin-body { padding: 12px 14px; }
.gallery-admin-body h3 { font-size: 14px; margin-bottom: 4px; }
.gallery-admin-body p { font-size: 11.5px; color: #8b939e; margin: 0 0 10px; }
.gallery-admin-actions { display: flex; align-items: center; gap: 6px; }

.gallery-items { display: flex; flex-direction: column; gap: 8px; }
.gallery-item-row { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfc; }
.gallery-item-row img { width: 58px; height: 44px; object-fit: cover; border-radius: 5px; }
.gallery-item-row input[type="text"] { flex: 1; padding: 8px 10px; font-size: 12.5px; }

/* ---------- Editor ---------- */
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 318px; gap: 22px; align-items: start; }
.editor-main { min-width: 0; }
.editor-side { position: sticky; top: 88px; }
.editor-side .panel { margin-bottom: 18px; padding: 18px; }

.editor { border: 1px solid var(--line); border-radius: 10px; overflow: clip; background: #fff; }
.editor-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; padding: 7px; background: #f7f9fb; border-bottom: 1px solid var(--line); position: sticky; top: var(--topbar-h); z-index: 5; }
.editor-toolbar button {
    min-width: 30px;
    height: 30px;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #3d4653;
    font-family: inherit;
    padding: 0 6px;
}
.editor-toolbar button:hover { background: #fff; border-color: #dde2e9; }
.editor-toolbar button.is-active { background: #fff; border-color: var(--red); color: var(--red); }
.editor-toolbar select { width: auto; min-width: 118px; padding: 5px 8px; font-size: 12px; }
.toolbar-divider { width: 1px; height: 20px; background: #dde2e9; margin: 0 3px; }

.editor-area {
    min-height: 430px;
    padding: 24px 26px;
    font-size: 16px;
    line-height: 1.7;
    color: #222a31;
    outline: none;
}
.editor-area:empty::before { content: attr(data-placeholder); color: #a6afba; }
.editor-area p { margin: 0 0 16px; }
.editor-area h2 { font-size: 24px; margin: 26px 0 12px; }
.editor-area h3 { font-size: 19px; margin: 22px 0 10px; }
.editor-area blockquote { margin: 18px 0; padding: 12px 18px; border-left: 3px solid var(--red); background: #faf4f4; font-style: italic; }
.editor-area ul, .editor-area ol { padding-left: 22px; margin: 0 0 16px; }
.editor-area img { max-width: 100%; border-radius: 6px; margin: 12px auto; }
.editor-area a { color: var(--red); text-decoration: underline; }
.editor-area figure { margin: 16px 0; }
.editor-area figcaption { font-size: 12.5px; color: #8b939e; }

.editor-source { display: none; width: 100%; min-height: 430px; border: 0; border-top: 1px solid var(--line); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; line-height: 1.6; padding: 18px; }
.editor.is-source .editor-area { display: none; }
.editor.is-source .editor-source { display: block; }

.upload-trigger { display: block; cursor: pointer; }
.upload-trigger input[type="file"] { display: none; }
.gallery-upload-thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.gallery-upload-thumbs img { width: 56px; height: 42px; object-fit: cover; border-radius: 5px; border: 1px solid var(--line); }
.gallery-upload-actions { display: flex; align-items: center; gap: 6px; margin-top: 12px; }
.gallery-upload-actions .btn-primary { flex: 1; }
.field-hint.is-error { color: #b91c1c; }

.cover-picker { display: flex; flex-direction: column; gap: 8px; }
.cover-preview { aspect-ratio: 16 / 9; border: 1px dashed #ccd3dd; border-radius: 8px; background: #fafbfc; overflow: hidden; display: grid; place-items: center; color: #98a1ac; font-size: 11.5px; }
.cover-preview img { width: 100%; height: 100%; object-fit: cover; }
.cover-preview-wide { aspect-ratio: 3 / 1; }
.cover-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.publish-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.info-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 12px; }
.info-list li { display: flex; justify-content: space-between; gap: 10px; }
.info-list span { color: #8b939e; }
.info-list strong { font-weight: 600; }

.radio-row { display: flex; gap: 10px; }
.radio-pill { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; font-size: 12.5px; cursor: pointer; }
.radio-pill input { accent-color: var(--red); }
.radio-pill:has(input:checked) { border-color: var(--red); background: #fff7f7; background: color-mix(in srgb, var(--red) 6%, #fff); color: var(--red); }

.danger-zone {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border: 1px solid #f3c9c9;
    background: #fdf7f7;
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-top: 8px;
}
.danger-zone strong { font-size: 13px; }
.danger-zone p { font-size: 12px; color: #8b6a6a; margin: 2px 0 0; }

/* ---------- Anúncios ---------- */
.icon-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn[type="submit"] { border: 1px solid transparent; background: none; }

.ads-table .ad-cell { display: flex; align-items: center; gap: 10px; min-width: 190px; }
.ad-cell-thumb { width: 62px; height: 40px; flex-shrink: 0; border-radius: 6px; overflow: hidden; background: #eef1f5; display: grid; place-items: center; font-size: 9px; font-weight: 700; letter-spacing: .5px; color: #8994a1; }
.ad-cell-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ad-cell-body { min-width: 0; }
.ad-cell-body .table-title { max-width: 230px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-group-tag { display: inline-block; margin-top: 4px; padding: 2px 7px; border-radius: 20px; background: #ede9fe; color: #5b21b6; font-size: 10px; font-weight: 700; }
.ad-position { font-size: 12px; color: #4c5663; }
.ad-target { display: block; font-size: 12px; color: #4c5663; }
.ads-table .ad-target + small { margin-top: 3px; }
.ad-period { font-size: 12px; color: #4c5663; white-space: nowrap; }
.ad-metrics { font-size: 12px; color: #66707c; white-space: nowrap; }
.ad-metrics strong { font-weight: 700; color: var(--ink); }

.ad-group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.ad-group-card { border: 1px solid #e8ecf1; border-radius: 10px; background: #fbfcfd; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.ad-group-head { display: flex; align-items: center; gap: 8px; }
.ad-group-head strong { font-size: 13px; }
.ad-group-count { margin-left: auto; font-size: 11px; font-weight: 600; color: #66707c; background: #eef1f5; border-radius: 20px; padding: 3px 9px; white-space: nowrap; }
.ad-group-mode { margin: 0; font-size: 11.5px; color: #8b939e; }
.ad-group-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }

.modal-panel.ad-group-modal { width: min(440px, 100%); }

.ad-positions-panel summary { cursor: pointer; font-size: 13px; font-weight: 700; }
.ad-positions-panel summary::marker { color: var(--red); }
.ad-positions-note { padding-top: 14px; }
.ad-positions-note ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; font-size: 12.5px; }
.ad-positions-note li { display: flex; gap: 12px; }
.ad-positions-note span { color: #66707c; }

.ad-conditions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 4px; }
.ad-condition-block .field-label { display: block; margin-bottom: 4px; }
.ad-condition-block .field-hint { margin: 0 0 10px; }
.check-grid { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.check-grid .check { margin-bottom: 0; }

@media (max-width: 900px) {
    .ads-table th:nth-child(3), .ads-table td:nth-child(3),
    .ads-table th:nth-child(4), .ads-table td:nth-child(4) { display: none; }
    .ad-conditions { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
    .ads-table th:nth-child(2), .ads-table td:nth-child(2),
    .ads-table th:nth-child(5), .ads-table td:nth-child(5) { display: none; }
    .ads-table { table-layout: fixed; }
    .ads-table td { padding: 10px 8px; }
    .ads-table th:nth-child(6), .ads-table td:nth-child(6) { width: 84px; }
    .ads-table .th-actions { width: 76px; }
    .ads-table .ad-cell { min-width: 0; }
    .ads-table .ad-cell-thumb { display: none; }
    .ad-cell-body .table-title { max-width: 100%; }
    .ad-cell-body small { display: none; }
}

/* ---------- Configurações e perfil ---------- */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; }
.settings-wide { grid-column: 1 / -1; }
.settings-actions { display: flex; justify-content: flex-end; margin-bottom: 30px; }
.logo-row { display: flex; gap: 16px; align-items: flex-start; }
.logo-controls { flex: 1; min-width: 0; }
.og-preview { width: 150px; flex: 0 0 150px; aspect-ratio: 1200 / 630; border: 1px dashed #ccd3dd; border-radius: 8px; display: grid; place-items: center; background: #fafbfc; font-size: 11px; color: #98a1ac; overflow: hidden; }
.og-preview img { width: 100%; height: 100%; object-fit: cover; }

.featured-panel { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.featured-panel .field-label { display: block; margin-bottom: 10px; }
.featured-panel .panel-text { margin-bottom: 10px; }
.radio-row { flex-wrap: wrap; }
.featured-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.featured-modes .radio-pill { justify-content: center; padding: 9px 10px; }
.logo-preview { width: 150px; height: 64px; flex: 0 0 150px; border: 1px dashed #ccd3dd; border-radius: 8px; display: grid; place-items: center; background: #fafbfc; font-size: 11.5px; color: #98a1ac; overflow: hidden; }
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.favicon-preview { width: 64px; height: 64px; flex: 0 0 64px; }

.primary-color { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.primary-color-text { display: flex; flex-direction: column; gap: 3px; }
.settings-group-title { font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: #8994a1; margin: 16px 0 0; }

.settings-colors { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 14px 0 18px; }
.settings-color { display: flex; flex-direction: column; gap: 6px; }
.color-field { display: flex; align-items: center; gap: 9px; }
.color-swatch {
    position: relative;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border-radius: 9px;
    overflow: hidden;
    cursor: pointer;
    background: var(--swatch, #e30613);
    box-shadow: inset 0 0 0 1px rgba(18, 24, 32, .12);
}
.color-swatch input[type="color"] { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.color-swatch:hover { box-shadow: inset 0 0 0 1px rgba(18, 24, 32, .24), 0 0 0 3px rgba(18, 24, 32, .06); }
.color-swatch:focus-within { outline: 2px solid rgba(227, 6, 19, .35); outline-color: color-mix(in srgb, var(--red) 35%, transparent); outline-offset: 2px; }
.color-hex { font-size: 11.5px; font-weight: 600; color: #66707c; letter-spacing: .3px; text-transform: uppercase; }

.menu-preview {
    margin: 6px 0 12px;
    border-radius: 10px;
    background: var(--preview-bg, #e30613);
    color: var(--preview-text, #fff);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .2px;
    text-transform: uppercase;
    overflow: hidden;
}
.menu-preview-bar { display: flex; align-items: center; gap: 14px; min-height: 54px; padding: 0 14px; }
.menu-preview-ticker { display: flex; align-items: center; gap: 8px; padding: 7px 14px; background: #fff; color: #6a727d; font-size: 10px; font-weight: 400; letter-spacing: 0; text-transform: none; border-top: 1px solid rgba(0, 0, 0, .06); white-space: nowrap; overflow: hidden; }
.menu-preview-ticker span { color: var(--preview-primary, #e30613); font-size: 9.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; padding-right: 8px; border-right: 1px solid var(--line); }
.menu-preview-brand { font-size: 11.5px; font-weight: 700; letter-spacing: .8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-preview-links { display: flex; gap: 12px; margin-left: auto; }
.menu-preview-links span { padding: 5px 0; border-bottom: 2px solid transparent; white-space: nowrap; }
.menu-preview-links .is-active { border-bottom-color: var(--preview-accent, #fff); }
.menu-preview-search { display: grid; place-items: center; width: 22px; height: 22px; flex: 0 0 22px; border-radius: 50%; background: rgba(0, 0, 0, .16); background: color-mix(in srgb, var(--preview-text, #fff) 18%, transparent); }
.menu-preview-search svg { width: 12px; height: 12px; fill: currentColor; }

.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }

@media (max-width: 900px) {
    .settings-actions {
        position: sticky;
        bottom: 0;
        z-index: 6;
        justify-content: stretch;
        margin: 0 -16px -16px;
        padding: 12px 16px;
        background: var(--bg);
        border-top: 1px solid var(--line);
    }
    .settings-actions .btn { width: 100%; }
}

@media (max-width: 720px) {
    .settings-colors { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .settings-color { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
    .logo-row { flex-wrap: wrap; gap: 12px; }
    .menu-preview-bar { gap: 10px; }
    .menu-preview-links { gap: 9px; }
}



/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(8, 12, 20, .6); z-index: 90; display: grid; place-items: center; padding: 22px; }
.modal[hidden] { display: none; }
.modal-panel { background: #fff; border-radius: 14px; width: min(920px, 100%); max-height: 88vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 16px; }
.modal-close { border: 0; background: none; font-size: 26px; line-height: 1; cursor: pointer; color: #66707c; }
.modal-toolbar { display: flex; align-items: center; gap: 14px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.modal-toolbar input { max-width: 260px; padding: 8px 11px; }
.modal-hint { font-size: 11.5px; color: #98a1ac; }
.modal-upload { display: inline-flex; flex: 0 0 auto; cursor: pointer; }
.modal-upload input[type="file"] { display: none; }
.modal-status { margin-left: auto; font-size: 11.5px; font-weight: 600; color: #14653d; }
.modal-status.is-error { color: #b91c1c; }
.modal-grid { padding: 16px 20px; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.modal-grid figure, .modal-item { margin: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; cursor: pointer; background: #eef1f5; position: relative; }
.modal-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.modal-item span { display: block; font-size: 10.5px; padding: 5px 6px; background: #fff; color: #66707c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.modal-item:hover { border-color: #c9d0da; }
.modal-item.is-selected { border-color: var(--red); }
.modal-loading { padding: 26px; color: #98a1ac; font-size: 13px; grid-column: 1 / -1; text-align: center; }
.modal-foot { display: flex; justify-content: space-between; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--line); background: #fafbfc; }

.category-modal-panel { width: min(500px, 100%); }
.category-modal-panel .modal-head p { margin: 4px 0 0; font-size: 12px; color: #8b939e; }
.category-modal-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.category-modal-body .field { margin-bottom: 0; }
.category-modal-options { display: flex; align-items: center; gap: 10px; }
.category-modal-options-label { margin-right: auto; font-size: 12.5px; color: #4c5663; }
.category-modal-error { margin: 0 20px 14px; padding: 9px 12px; border-radius: 8px; border: 1px solid #f3c4c4; background: #fdecec; color: #991b1b; font-size: 12.5px; }
.category-modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: #fafbfc; }

/* ---------- Toast ---------- */
.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 120; display: flex; flex-direction: column; gap: 10px; }
.toast { display: flex; align-items: center; gap: 10px; min-width: 230px; max-width: 360px; padding: 12px 14px; border-radius: 10px; background: #14653d; color: #fff; font-size: 13px; font-weight: 600; box-shadow: 0 16px 36px rgba(8, 12, 20, .28); animation: toast-in .22s ease; }
.toast.is-error { background: #991b1b; }
.toast svg { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.toast button { margin-left: auto; border: 0; background: none; color: inherit; opacity: .75; font-size: 18px; line-height: 1; cursor: pointer; }
.toast button:hover { opacity: 1; }
.toast.is-leaving { animation: toast-out .18s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

/* ---------- Alertas ---------- */
.alert { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 15px; border-radius: 9px; margin-bottom: 16px; font-size: 13px; }
.alert-success { background: #e8f7ee; color: #14653d; border: 1px solid #bde5ce; }
.alert-error { background: #fdecec; color: #991b1b; border: 1px solid #f3c4c4; }
.alert-close { border: 0; background: none; color: inherit; font-size: 18px; cursor: pointer; line-height: 1; }

/* ---------- Paginação ---------- */
.pagination { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.page-link { padding: 6px 11px; border: 1px solid var(--line); border-radius: 6px; font-size: 12.5px; color: #66707c; }
.page-link:hover { border-color: var(--red); color: var(--red); }
.page-link.is-current { background: var(--red); border-color: var(--red); color: #fff; }

/* ---------- Lista de matérias ---------- */
.empty-state { text-align: center; color: #98a1ac; font-size: 13px; padding: 26px 0; margin: 0; }

.filters-panel { padding: 14px 16px; margin-bottom: 18px; }
.filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-search { position: relative; flex: 1 1 260px; min-width: 180px; display: block; }
.filter-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; fill: none; stroke: #98a1ac; stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.filter-search input { padding-left: 38px; }
.filter-bar select { width: auto; min-width: 156px; flex: 0 0 auto; }
.filter-clear { font-size: 12px; color: #8b939e; text-decoration: underline; }
.filter-clear:hover { color: var(--red); }

.list-head { margin-bottom: 14px; }
.list-head-title { display: flex; align-items: baseline; gap: 8px; }
.list-head-actions { display: flex; align-items: center; gap: 10px; }

.view-toggle { display: inline-flex; gap: 2px; padding: 2px; background: #f4f6f9; border: 1px solid var(--line); border-radius: 9px; }
.view-btn { display: grid; place-items: center; width: 32px; height: 30px; border: 0; border-radius: 7px; background: transparent; color: #8b939e; cursor: pointer; }
.view-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.view-btn:hover { color: var(--ink); }
.view-btn.is-active { background: #fff; color: var(--red); box-shadow: 0 1px 3px rgba(18, 24, 32, .12); }

.icon-action { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 7px; color: #66707c; }
.icon-action svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-action:hover { background: #f1f3f7; color: var(--ink); }
.icon-action.is-danger:hover { background: #fdecec; color: #b91c1c; }

.posts-table .th-actions { width: 168px; }
.posts-table .post-cell { min-width: 0; }
.posts-table .post-cell small { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.posts-table .td-actions { flex-wrap: nowrap; justify-content: flex-end; gap: 4px; }
.posts-table th:last-child, .posts-table td:last-child { text-align: right; }

.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 16px; }
.post-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; transition: border-color .15s ease, box-shadow .15s ease; }
.post-card:hover { border-color: #d3d9e2; box-shadow: 0 8px 20px rgba(18, 24, 32, .06); }
.post-card-cover { position: relative; display: block; aspect-ratio: 16 / 9; background: #eef1f5; }
.post-card-cover img { width: 100%; height: 100%; object-fit: cover; }
.post-card-noimg { position: absolute; inset: 0; display: grid; place-items: center; color: #b6bfca; }
.post-card-noimg svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.post-card-tags { position: absolute; top: 10px; left: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.post-card-body { display: flex; flex-direction: column; gap: 6px; flex: 1; padding: 12px 14px 14px; }
.post-card-meta-top { font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; color: #8b939e; }
.post-card-title { font-size: 14px; font-weight: 700; line-height: 1.35; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-card-title:hover { color: var(--red); }
.post-card-meta { font-size: 11.5px; color: #98a1ac; }
.post-card-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 8px; }
.post-card-icons { display: inline-flex; align-items: center; gap: 2px; }

/* ---------- Responsivo ---------- */
@media (max-width: 1180px) {
    .editor-layout { grid-template-columns: minmax(0, 1fr); }
    .editor-side { position: static; }
    .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .admin-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 60;
        transform: translateX(-100%);
        transition: transform .2s ease;
        box-shadow: 0 0 40px rgba(0, 0, 0, .3);
    }
    .admin-sidebar.is-open { transform: translateX(0); }
    .admin-menu-btn { display: flex; }
    .admin-topbar { padding: 12px 16px; flex-wrap: wrap; }
    .admin-content { padding: 16px; }
    .admin-user-info { display: none; }
    .admin-user-chip { gap: 6px; padding-right: 6px; }
    .editor-toolbar { position: static; }
    .settings-grid, .profile-grid { grid-template-columns: minmax(0, 1fr); }
    .field-row { grid-template-columns: 1fr; }
    .ad-positions-note ul { grid-template-columns: 1fr; }
    .filter-bar select { flex: 1 1 160px; }
    .posts-table .col-author { display: none; }
}

@media (max-width: 480px) {
    .media-head-tools { flex-direction: column; align-items: stretch; }
    .media-upload-open { justify-content: center; }
}

@media (max-width: 560px) {
    .admin-title-full { display: none; }
    .admin-title-short { display: inline; }
    .stat-grid, .stat-grid-3 { grid-template-columns: minmax(0, 1fr); }
    .dashboard-table th:nth-child(2), .dashboard-table td:nth-child(2),
    .dashboard-table th:nth-child(4), .dashboard-table td:nth-child(4) { display: none; }
    .dashboard-table td { padding: 10px 8px; }
    .dashboard-table .post-thumb { width: 46px; height: 34px; }
    .quick-actions { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .editor-area { padding: 16px; font-size: 15px; }
    .modal-toolbar { flex-direction: column; align-items: stretch; }
    .modal-toolbar input { max-width: none; }
    .post-grid { grid-template-columns: minmax(0, 1fr); }
    .filter-bar select { flex: 1 1 45%; }
    .filter-bar .btn { flex: 1 1 100%; }
    .posts-table .col-category, .posts-table .col-date, .posts-table .col-status { display: none; }
    .posts-table { table-layout: fixed; }
    .posts-table .post-thumb { display: none; }
    .list-head { align-items: flex-start; }
    .media-head-tools { width: 100%; }
    .media-search { flex: 1 1 160px; }
    .media-search input { width: 100%; }
    .media-edit-body { grid-template-columns: minmax(0, 1fr); }
    .media-edit-preview img { aspect-ratio: 16 / 9; }
    .toast-stack { left: 16px; right: 16px; bottom: 16px; }
    .toast { max-width: none; }
}
