/* ==========================================================================
   Sentinel Facilities — Painel administrativo
   ========================================================================== */
:root {
    --black: #000;
    --bg: #f5f5f5;
    --panel: #fff;
    --ink: #171717;
    --muted: #737373;
    --line: #e0e0e0;
    --dark: #0a0a0a;
    --font: 'Montserrat', Arial, Helvetica, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.55; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -.035em; line-height: 1.2; }
h1 { font-size: 27px; text-transform: uppercase; }
h2 { font-size: 16px; }
p { margin: 0 0 12px; }
ul { margin: 0; padding: 0; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.text-right { text-align: right; }

/* Botões ------------------------------------------------------------------ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 10px 18px; border: 1px solid transparent; border-radius: 0; background: transparent; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; transition: all .2s; }
.btn:hover { transform: translateY(-1px); }
.btn-solid { background: var(--black); color: #fff; border-color: var(--black); }
.btn-solid:hover { background: #333; }
.btn-outline { border-color: var(--line); color: var(--ink); background: #fff; }
.btn-outline:hover { border-color: var(--black); }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 8px 14px; font-size: 10px; }
.btn-danger-outline { border-color: #d44; color: #c22; background: #fff; }
.btn-danger-outline:hover { background: #fff1f1; }
.btn-link, .danger-link { background: none; border: 0; padding: 0; cursor: pointer; font-size: 11px; font-weight: 700; color: var(--ink); text-decoration: underline; }
.danger-link { color: #c22; }

/* Login ------------------------------------------------------------------- */
.auth-body { background: #fff; }
.auth-split { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.auth-brand-panel { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 48px 56px; background: var(--black); color: #fff; overflow: hidden; }
.auth-logo { position: relative; z-index: 1; }
.auth-logo img { width: 210px; height: auto; }
.auth-brand-copy { position: relative; z-index: 1; }
.auth-brand-copy h1 { font-size: clamp(2.2rem, 4vw, 3.6rem); margin-bottom: 24px; text-transform: uppercase; }
.auth-brand-copy > p:last-child { color: #a3a3a3; max-width: 42ch; }
.auth-brand-footer { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 20px; font-size: 11px; color: #a3a3a3; }
.auth-brand-footer a { color: #fff; border-bottom: 1px solid #555; }
.auth-form-panel { display: grid; place-items: center; padding: 48px 32px; }
.auth-form-wrap { width: min(100%, 380px); }
.auth-kicker { font-size: 10px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: #888; margin-bottom: 10px; }
.auth-form-wrap h2 { font-size: 30px; text-transform: uppercase; margin-bottom: 8px; }
.auth-subtitle { color: var(--muted); margin-bottom: 30px; }
.auth-form .btn { margin-top: 12px; }
.auth-help { font-size: 11px; color: var(--muted); margin-top: 22px; text-align: center; }

/* Alertas ----------------------------------------------------------------- */
.alert { padding: 13px 16px; margin-bottom: 18px; font-size: 12px; font-weight: 600; border-left: 3px solid var(--black); background: #fff; border-top: 1px solid var(--line); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.alert-success { border-left-color: #17823b; background: #effaf2; }
.alert-error { border-left-color: #c22; background: #fff1f1; }
.alert-info { border-left-color: #444; background: #f4f4f4; }
.alert-warning { border-left-color: #b8860b; background: #fff9e8; }

/* Estrutura do painel ----------------------------------------------------- */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar { width: 252px; flex: 0 0 252px; background: var(--dark); color: #fff; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 40; }
.sidebar-brand { padding: 26px 24px 22px; border-bottom: 1px solid #262626; }
.sidebar-brand img { width: 165px; height: auto; }
.sidebar-label { display: block; font-size: 9px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: #737373; margin-top: 12px; }
.sidebar-nav { flex: 1; padding: 22px 14px; }
.nav-caption { font-size: 9px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: #525252; margin: 18px 10px 10px; }
.nav-caption:first-child { margin-top: 0; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; font-size: 12px; font-weight: 600; color: #a3a3a3; border-left: 2px solid transparent; transition: all .18s; }
.nav-item:hover { color: #fff; background: #171717; }
.nav-item.active { color: #fff; background: #171717; border-left-color: #fff; }
.nav-item svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; flex: 0 0 17px; }
.nav-count { margin-left: auto; font-style: normal; font-size: 9px; font-weight: 800; background: #fff; color: #000; min-width: 20px; text-align: center; padding: 2px 5px; }
.sidebar-footer { padding: 16px 24px; border-top: 1px solid #262626; font-size: 9px; color: #525252; letter-spacing: .06em; }
.admin-main { flex: 1; min-width: 0; }
.admin-topbar { height: 66px; display: flex; align-items: center; gap: 16px; padding: 0 30px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.topbar-spacer { flex: 1; }
.sidebar-toggle { display: none; flex-direction: column; gap: 4px; background: none; border: 0; cursor: pointer; padding: 6px; }
.sidebar-toggle span { width: 20px; height: 2px; background: var(--ink); }
.topbar-icon { position: relative; width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); }
.topbar-icon svg { width: 18px; height: 18px; fill: none; stroke: var(--ink); stroke-width: 1.6; }
.badge-dot { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; display: grid; place-items: center; background: var(--black); color: #fff; font-size: 9px; font-weight: 800; }
.topbar-user { display: flex; align-items: center; gap: 10px; padding-left: 16px; border-left: 1px solid var(--line); }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; background: var(--black); color: #fff; font-size: 13px; font-weight: 800; flex: 0 0 34px; }
.avatar.small { width: 30px; height: 30px; flex-basis: 30px; font-size: 11px; }
.topbar-user-info strong { display: block; font-size: 11px; }
.topbar-user-info small { display: block; font-size: 9px; color: var(--muted); }
.logout-form button { border: 1px solid var(--line); background: #fff; padding: 8px 12px; font-size: 10px; font-weight: 800; text-transform: uppercase; cursor: pointer; letter-spacing: .06em; }
.logout-form button:hover { border-color: var(--black); }
.admin-content { padding: 30px; max-width: 1500px; }

/* Cabeçalho das páginas --------------------------------------------------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.page-head p { color: var(--muted); font-size: 12px; margin: 6px 0 0; }
.page-head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.admin-breadcrumb { display: flex; gap: 8px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 10px; }
.admin-breadcrumb a:hover { color: var(--ink); }

/* Cards ------------------------------------------------------------------- */
.admin-card { background: var(--panel); border: 1px solid var(--line); margin-bottom: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.card-head a { font-size: 11px; font-weight: 700; }
.card-head a:hover { text-decoration: underline; }
.card-hint { font-size: 10px; color: var(--muted); }
.head-actions { display: flex; gap: 14px; }
.empty { padding: 44px 22px; text-align: center; color: var(--muted); font-size: 13px; }
.empty a { color: var(--ink); font-weight: 700; text-decoration: underline; }

/* Dashboard --------------------------------------------------------------- */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.stat-card { display: block; background: #fff; border: 1px solid var(--line); padding: 22px; transition: border-color .2s, transform .2s; }
.stat-card:hover { border-color: var(--black); transform: translateY(-2px); }
.stat-label { display: block; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.stat-card strong { display: block; font-size: 38px; font-weight: 900; letter-spacing: -.06em; line-height: 1.1; margin: 12px 0 6px; }
.stat-foot { font-size: 10px; color: var(--muted); }
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.dashboard-grid .admin-card:last-child { grid-column: 1 / -1; }
.chart { display: flex; align-items: flex-end; gap: 10px; height: 210px; padding: 24px 22px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; gap: 8px; }
.chart-bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.chart-bar { width: min(100%, 42px); min-height: 3px; background: var(--black); transition: height .5s; }
.chart-col span { font-size: 9px; color: var(--muted); }
.activity-list { list-style: none; padding: 10px 22px 20px; }
.activity-list li { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.activity-list li:last-child { border-bottom: 0; }
.activity-dot { width: 8px; height: 8px; background: var(--black); margin-top: 6px; flex: 0 0 8px; }
.activity-list a { font-size: 13px; font-weight: 700; }
.activity-list a:hover { text-decoration: underline; }
.activity-list small { display: block; font-size: 10px; color: var(--muted); margin-top: 3px; }

/* Tabelas ----------------------------------------------------------------- */
.table-responsive { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { text-align: left; padding: 13px 18px; font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); background: #fafafa; white-space: nowrap; }
.admin-table td { padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 12px; vertical-align: middle; }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table tbody tr:hover { background: #fafafa; }
.admin-table a { font-weight: 700; }
.admin-table a:hover { text-decoration: underline; }
.table-sub { display: block; font-size: 10px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.row-actions { display: flex; gap: 12px; justify-content: flex-end; align-items: center; white-space: nowrap; }
.row-actions a { font-size: 11px; font-weight: 700; }
.inline-form { display: inline; }
.badge { display: inline-block; padding: 3px 8px; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; background: #eee; }
.badge-published, .badge-active, .badge-convertido { background: #e2f5e8; color: #176b36; }
.badge-draft, .badge-inactive, .badge-arquivado { background: #ececec; color: #666; }
.badge-novo { background: #000; color: #fff; }
.badge-em_contato { background: #fff2d6; color: #8a5a00; }
.badge-super { background: #000; color: #fff; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.filter-form { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-form input, .filter-form select { border: 1px solid var(--line); background: #fff; padding: 9px 12px; outline: none; min-width: 180px; }
.filter-form input:focus, .filter-form select:focus { border-color: var(--black); }
.toolbar-count { font-size: 10px; color: var(--muted); white-space: nowrap; }
.status-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 18px; }
.status-tabs a { padding: 9px 14px; font-size: 11px; font-weight: 700; background: #fff; border: 1px solid var(--line); }
.status-tabs a.active { background: var(--black); color: #fff; border-color: var(--black); }
.status-tabs span { opacity: .55; margin-left: 4px; }

/* Formulários ------------------------------------------------------------- */
.form-card { padding: 24px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-row + .form-row { margin-top: 4px; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
.field label { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: #525252; }
.required { color: #c22; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 0; background: #fff; color: var(--ink); padding: 10px 12px; outline: none; transition: border-color .2s; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--black); }
.field-error { color: #c22; font-size: 11px; font-weight: 600; }
.form-actions { display: flex; gap: 10px; margin-top: 10px; }
.form-divider { display: flex; align-items: center; gap: 14px; margin: 18px 0; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.form-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.side-card { padding: 20px; }
.side-card h2 { margin-bottom: 16px; }
.side-delete { margin: 14px 0; }
.permission-group { border: 1px solid var(--line); margin: 0 0 14px; padding: 12px 16px 16px; }
.permission-group legend { padding: 0 8px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }
.permission-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 20px; }
.permission-options label { display: flex; align-items: flex-start; gap: 8px; font-size: 11px; cursor: pointer; }
.permission-options input { margin-top: 3px; accent-color: #000; }
.permission-options small { display: block; color: var(--muted); font-size: 9px; }
.switch-row { display: flex; align-items: flex-start; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); cursor: pointer; }
.switch-row input { margin-top: 3px; accent-color: #000; }
.switch-row strong { display: block; font-size: 12px; }
.switch-row small { display: block; color: var(--muted); font-size: 10px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tabs a { padding: 12px 18px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs a.active { color: var(--ink); border-bottom-color: var(--black); }

/* Editor de artigos ------------------------------------------------------- */
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.editor-main .admin-card { padding: 24px; }
.editor-side { display: grid; gap: 16px; }
.input-title { font-size: 19px !important; font-weight: 700 !important; padding: 12px 14px !important; }
.slug-field { display: flex; align-items: center; border: 1px solid var(--line); background: #fff; }
.slug-field span { padding: 10px 0 10px 12px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.slug-field input { border: 0 !important; }
.editor-toolbar { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 6px; border: 1px solid var(--line); border-bottom: 0; background: #fafafa; }
.editor-toolbar button { min-width: 32px; height: 30px; border: 1px solid transparent; background: #fff; cursor: pointer; font-size: 12px; font-weight: 700; }
.editor-toolbar button:hover { border-color: var(--black); }
.editor-toolbar .editor-image-btn { padding: 0 10px; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.toolbar-divider { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.editor { min-height: 460px; border: 1px solid var(--line); background: #fff; padding: 22px; outline: none; line-height: 1.8; overflow-y: auto; }
.editor:focus { border-color: var(--black); }
.editor:empty::before { content: attr(data-placeholder); color: #a3a3a3; }
.editor h2 { font-size: 24px; margin: 24px 0 12px; }
.editor h3 { font-size: 19px; margin: 20px 0 10px; }
.editor img { max-width: 100%; height: auto; margin: 16px 0; }
.editor blockquote { border-left: 3px solid var(--black); margin: 18px 0; padding-left: 16px; }
.featured-preview { height: 130px; border: 1px dashed #bbb; display: grid; place-items: center; margin-bottom: 14px; background: #fafafa; overflow: hidden; }
.featured-preview img { width: 100%; height: 100%; object-fit: cover; }
.featured-preview span { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }

/* Detalhes ---------------------------------------------------------------- */
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.detail-list { margin: 0; padding: 8px 22px 20px; }
.detail-list > div { display: grid; grid-template-columns: 180px 1fr; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.detail-list > div:last-child { border-bottom: 0; }
.detail-list dt { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.detail-list dd { margin: 0; font-size: 13px; }
.lead-message { padding: 20px 22px; font-size: 13px; line-height: 1.8; }
.notification-list { padding: 4px 0; }
.notification-item { display: flex; gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.notification-item:last-child { border-bottom: 0; }
.notification-item.unread { background: #f0f6ff; border-left: 3px solid var(--black); }
.notification-icon { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; border: 1px solid var(--line); background: #fff; }
.notification-icon svg { width: 17px; height: 17px; fill: none; stroke: var(--ink); stroke-width: 1.6; }
.notification-body { flex: 1; }
.notification-body strong { font-size: 12px; }
.notification-body p { font-size: 12px; color: #525252; margin: 3px 0; }
.notification-body small { font-size: 10px; color: var(--muted); }
.notification-actions { display: flex; gap: 10px; align-items: center; }
.notification-actions a { font-size: 11px; font-weight: 700; text-decoration: underline; }
.notification-actions button { border: 1px solid var(--line); background: #fff; padding: 4px 9px; cursor: pointer; }

/* Paginação no painel ----------------------------------------------------- */
.pagination { display: flex; gap: 5px; padding: 18px; flex-wrap: wrap; }
.page-link { display: grid; place-items: center; min-width: 34px; height: 34px; border: 1px solid var(--line); font-size: 11px; font-weight: 700; background: #fff; }
.page-link:hover, .page-link.current { background: var(--black); color: #fff; border-color: var(--black); }
.page-link.disabled { opacity: .4; }

/* Responsivo -------------------------------------------------------------- */
@media (max-width: 1100px) {
    .editor-layout, .detail-layout { grid-template-columns: 1fr; }
    .editor-side { grid-template-columns: repeat(2, 1fr); }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
    .admin-sidebar { position: fixed; left: -260px; transition: left .25s; box-shadow: 6px 0 24px rgba(0,0,0,.2); }
    .admin-sidebar.open { left: 0; }
    .sidebar-toggle { display: flex; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .dashboard-grid .admin-card:last-child { grid-column: auto; }
    .auth-split { grid-template-columns: 1fr; }
    .auth-brand-panel { min-height: 300px; padding: 32px; }
    .auth-brand-footer { display: none; }
}
@media (max-width: 700px) {
    .admin-content { padding: 18px; }
    .admin-topbar { padding: 0 18px; }
    .topbar-user-info { display: none; }
    .page-head { flex-direction: column; align-items: flex-start; }
    .form-row, .editor-side { grid-template-columns: 1fr; }
    .permission-options { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .detail-list > div { grid-template-columns: 1fr; gap: 2px; }
}
