/* A2 Press — painel no estilo do WordPress */
:root { --wp-bg: #f0f0f1; --wp-side: #1d2327; --wp-side-2: #2c3338; --wp-side-text: #f0f0f1; --wp-blue: #2271b1; --wp-blue-d: #135e96; --wp-border: #c3c4c7; --wp-border-l: #dcdcde; --wp-text: #1d2327; --wp-muted: #646970; --wp-red: #d63638; --wp-green: #00a32a; --wp-yellow: #dba617; --brand: #87501F; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--wp-bg); color: var(--wp-text); font: 14px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif; }
a { color: var(--wp-blue); }
a:hover { color: var(--wp-blue-d); }
code { background: #f6f7f7; padding: 2px 5px; border-radius: 3px; font-size: 12.5px; }
h1, h2, h3 { color: var(--wp-text); }
.muted { color: var(--wp-muted); }
.small { font-size: 12.5px; }
.b { font-weight: 600; }
.center { text-align: center; }
:focus-visible { outline: 2px solid var(--wp-blue); outline-offset: 1px; }

/* Barra superior */
#adminbar { position: fixed; top: 0; left: 0; right: 0; height: 40px; background: var(--wp-side); color: var(--wp-side-text); display: flex; align-items: center; gap: 8px; padding: 0 12px; z-index: 50; font-size: 13px; }
#adminbar a { color: var(--wp-side-text); text-decoration: none; }
#adminbar a:hover { color: #72aee6; }
.bar-site { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.bar-view { font-weight: 400; color: #a7aaad; }
.bar-right { margin-left: auto; display: flex; gap: 16px; align-items: center; }
.bar-menu { display: none; background: none; border: 0; color: #fff; cursor: pointer; padding: 6px; }
.mark { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 6px; background: var(--brand); color: #fff; font-weight: 800; font-size: 12px; letter-spacing: -.02em; }

/* Menu lateral */
#wrap { display: flex; padding-top: 40px; min-height: 100vh; }
#side { position: fixed; top: 40px; bottom: 0; left: 0; width: 180px; background: var(--wp-side); padding: 10px 0; overflow-y: auto; z-index: 40; display: flex; flex-direction: column; }
#side a { display: flex; align-items: center; gap: 9px; padding: 9px 14px; color: var(--wp-side-text); text-decoration: none; font-size: 14px; }
#side a svg { color: #a7aaad; flex: none; }
#side a:hover { background: var(--wp-side-2); color: #72aee6; }
#side a:hover svg { color: #72aee6; }
#side a.current { background: var(--wp-blue); color: #fff; font-weight: 600; position: relative; }
#side a.current svg { color: #fff; }
#side a.current::after { content: ''; position: absolute; right: 0; top: 50%; transform: translateY(-50%); border: 8px solid transparent; border-right-color: var(--wp-bg); }
.side-ver { margin-top: auto; padding: 14px; color: #8c8f94; font-size: 12px; }
#content { margin-left: 180px; padding: 10px 20px 60px; flex: 1; min-width: 0; }
.page-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0 14px; }
.page-head h1 { font-size: 23px; font-weight: 400; margin: 0; }
.page-title-action { border: 1px solid var(--wp-blue); color: var(--wp-blue); border-radius: 3px; padding: 4px 10px; text-decoration: none; font-size: 13px; background: #f6f7f7; }
.page-title-action:hover { background: #f0f0f1; border-color: var(--wp-blue-d); }

@media (max-width: 782px) {
  .bar-menu { display: block; }
  .bar-user, .bar-view { display: none; }
  #side { transform: translateX(-100%); transition: transform .2s ease; width: 220px; }
  #side.is-open { transform: none; }
  #content { margin-left: 0; padding: 10px 12px 60px; }
}

/* Avisos */
.notice { background: #fff; border: 1px solid var(--wp-border-l); border-left: 4px solid var(--wp-blue); box-shadow: 0 1px 1px rgba(0,0,0,.04); margin: 5px 0 15px; padding: 1px 12px; position: relative; }
.notice p { margin: .6em 0; }
.notice-success { border-left-color: var(--wp-green); }
.notice-error { border-left-color: var(--wp-red); }
.notice-warning { border-left-color: var(--wp-yellow); }
.notice-info { border-left-color: #72aee6; }
.is-dismissible { padding-right: 38px; }
.notice .dismiss { position: absolute; top: 4px; right: 4px; background: none; border: 0; cursor: pointer; color: var(--wp-muted); font-size: 16px; padding: 6px; }

/* Botões */
.button, .button-primary { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 32px; padding: 0 12px; font-size: 13px; line-height: 2.15; border-radius: 3px; border: 1px solid var(--wp-blue); background: #f6f7f7; color: var(--wp-blue); cursor: pointer; text-decoration: none; white-space: nowrap; font-family: inherit; }
.button:hover { background: #f0f0f1; border-color: var(--wp-blue-d); color: var(--wp-blue-d); }
.button-primary { background: var(--wp-blue); color: #fff; }
.button-primary:hover { background: var(--wp-blue-d); color: #fff; }
.button-primary:disabled { background: #a7aaad; border-color: #a7aaad; cursor: not-allowed; }
.button-hero { min-height: 46px; padding: 0 24px; font-size: 14px; }
.button-link { background: none; border: 0; padding: 0; color: var(--wp-blue); cursor: pointer; text-decoration: underline; font: inherit; }
.button-link.delete, .delete, .delete a { color: #b32d2e; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
form.inline { display: inline; }

/* Caixas */
.postbox { background: #fff; border: 1px solid var(--wp-border-l); box-shadow: 0 1px 1px rgba(0,0,0,.04); margin-bottom: 20px; min-width: 0; }
.postbox .hndle { font-size: 14px; font-weight: 600; margin: 0; padding: 10px 12px; border-bottom: 1px solid var(--wp-border-l); display: flex; align-items: center; gap: 8px; }
.postbox .inside { padding: 12px; }
.narrow-box { max-width: 640px; }
.count-badge { background: var(--wp-red); color: #fff; border-radius: 10px; font-size: 11px; padding: 0 7px; line-height: 18px; }

/* Tabelas */
.widefat { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--wp-border-l); }
.widefat th, .widefat td { text-align: left; padding: 8px 10px; vertical-align: top; }
.widefat thead th { font-weight: 400; border-bottom: 1px solid var(--wp-border-l); color: var(--wp-text); }
.striped > tbody > tr:nth-child(odd) { background: #f6f7f7; }
.widefat input:not([type=checkbox]):not([type=radio]), .widefat select { width: 100%; }
.row-title { font-size: 14px; font-weight: 600; }
.row-actions { font-size: 13px; color: #a7aaad; visibility: hidden; padding-top: 2px; }
tr:hover .row-actions, .row-actions:focus-within { visibility: visible; }
@media (max-width: 782px) { .row-actions { visibility: visible; } .wp-list-table { display: block; overflow-x: auto; } }
.post-state { color: var(--wp-muted); font-weight: 600; }
.w-30 { width: 30%; }
.w-80 { width: 80px; }
.w-120 { width: 120px; }
.w-thumb { width: 64px; }
.thumb { width: 56px; height: 42px; object-fit: cover; border-radius: 3px; display: block; }
.thumb-empty { background: repeating-linear-gradient(45deg, #f0f0f1 0 6px, #e6e6e7 6px 12px); }
.row-new td { background: #f0f6fc; }
.row-warn td { background: #fcf9e8; }
.tag { display: inline-block; font-size: 11.5px; background: #f0f0f1; border-radius: 3px; padding: 1px 7px; }
.tag-blue { background: #f0f6fc; color: var(--wp-blue-d); border: 1px solid #c5d9ed; }
.tag-pend { display: inline-block; font-size: 12px; background: #fcf0f1; color: #8a2424; border: 1px solid #f0c3c4; border-radius: 3px; padding: 1px 6px; margin: 2px 4px 2px 0; }

/* Formulários */
input[type=text], input[type=email], input[type=url], input[type=password], input[type=number], input[type=search], input:not([type]), select, textarea { font: inherit; font-size: 14px; border: 1px solid #8c8f94; border-radius: 4px; padding: 0 8px; min-height: 32px; background: #fff; color: var(--wp-text); width: 100%; max-width: 100%; }
textarea { padding: 6px 8px; line-height: 1.5; resize: vertical; }
textarea.code { font-family: Consolas, Monaco, monospace; font-size: 12.5px; }
input:focus, select:focus, textarea:focus { border-color: var(--wp-blue); box-shadow: 0 0 0 1px var(--wp-blue); outline: none; }
.small-text { width: 80px !important; }
.fld { display: flex; flex-direction: column; gap: 5px; margin-bottom: 16px; }
.fld > label, .fld > span { font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
.fld-inline { flex-direction: row; align-items: center; margin: 0; }
.description { color: var(--wp-muted); font-size: 13px; margin: 2px 0 0; font-style: normal; }
.fld-heading { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--wp-muted); border-bottom: 1px solid var(--wp-border-l); padding-bottom: 6px; margin: 26px 0 14px; }
.fields > .fld-heading:first-child { margin-top: 4px; }
.counter { font-weight: 400; color: var(--wp-muted); font-size: 12px; }
.counter.over { color: var(--wp-red); }
.check { display: flex; align-items: center; gap: 6px; margin: 6px 0; }
.color-row { display: flex; gap: 8px; align-items: center; }
.color-row input[type=color] { width: 44px; height: 32px; padding: 0; border: 1px solid #8c8f94; border-radius: 4px; background: #fff; cursor: pointer; }
.color-row input[type=text] { width: 110px !important; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.slider { width: 36px; height: 20px; border-radius: 20px; background: #8c8f94; position: relative; transition: background .15s; flex: none; }
.slider::after { content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + .slider { background: var(--wp-blue); }
.switch input:checked + .slider::after { transform: translateX(16px); }
.switch input:focus-visible + .slider { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--wp-blue); }

/* Mídia nos campos */
.media-field { display: flex; gap: 12px; align-items: flex-start; }
.media-prev { width: 140px; height: 96px; flex: none; border: 1px dashed var(--wp-border); border-radius: 4px; background: #f6f7f7; display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--wp-muted); font-size: 12px; }
.media-prev img, .media-prev video { width: 100%; height: 100%; object-fit: cover; }
.media-ctrl { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.media-field.is-loading .media-prev { opacity: .5; }
@media (max-width: 600px) { .media-field { flex-direction: column; } .media-prev { width: 100%; height: 160px; } }

/* Repetidor */
.fld-repeater { border: 1px solid var(--wp-border-l); border-radius: 4px; padding: 10px; background: #fbfbfc; }
.rep-head { display: flex; justify-content: space-between; font-weight: 600; margin-bottom: 6px; }
.rep-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.rep-row { border: 1px solid var(--wp-border-l); border-radius: 4px; background: #fff; }
.rep-bar { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--wp-border-l); background: #f6f7f7; cursor: pointer; }
.rep-n { width: 22px; height: 22px; border-radius: 50%; background: #dcdcde; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex: none; }
.rep-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--wp-muted); }
.rep-tools { display: flex; gap: 10px; flex: none; }
.rep-tools .button-link { text-decoration: none; font-size: 13px; }
.rep-body { padding: 12px 12px 0; }
.rep-row.is-closed .rep-body { display: none; }
.fld-repeater .fld-repeater { background: #fff; }

/* Editor */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.editor-side { position: static; } /* antes era fixa e escondia o fim da coluna (SEO) */
@media (max-width: 1100px) { .editor { grid-template-columns: minmax(0, 1fr); } .editor-side { position: static; } }
.title-input { font-size: 1.7em !important; min-height: 46px !important; padding: 3px 10px !important; margin-bottom: 8px; }
.name-row { display: flex; gap: 8px; }
.name-row select { width: auto; min-height: 46px; font-size: 16px; }
.permalink { color: var(--wp-muted); font-size: 13px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; }
.slug-input { width: auto !important; min-width: 200px; min-height: 26px !important; font-size: 13px !important; }
.tpl-info { margin-bottom: 12px; }
.pub-actions { display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid var(--wp-border-l); margin: 12px -12px -12px; padding: 10px 12px; background: #f6f7f7; }
.serp { border: 1px solid var(--wp-border-l); border-radius: 6px; padding: 10px 12px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 2px; font-family: Arial, sans-serif; }
.serp-url { color: #202124; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.serp-t { color: #1a0dab; font-size: 17px; line-height: 1.3; }
.serp-d { color: #4d5156; font-size: 13px; line-height: 1.45; }
.sticky-save { position: sticky; bottom: 0; background: var(--wp-bg); padding: 12px 0; margin: 0; z-index: 5; }

/* Nova página */
.new-page { background: #fff; border: 1px solid var(--wp-border-l); padding: 16px 20px; margin-bottom: 20px; }
.new-page h2 { margin: 0 0 4px; font-size: 18px; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 14px; }
.tpl-card { border: 1px solid var(--wp-border-l); border-radius: 6px; padding: 14px; display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--wp-text); background: #fff; transition: border-color .15s, box-shadow .15s; }
.tpl-card:hover { border-color: var(--wp-blue); box-shadow: 0 0 0 1px var(--wp-blue); color: var(--wp-text); }
.tpl-card.is-off { opacity: .55; pointer-events: none; }
.tpl-name { font-weight: 600; font-size: 15px; }

/* Painel inicial */
.welcome { background: #fff; border: 1px solid var(--wp-border-l); padding: 24px 28px; margin-bottom: 20px; position: relative; overflow: hidden; }
.welcome::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: linear-gradient(180deg, #87501F, #CF9046 60%, #322116); }
.welcome h2 { font-size: 21px; font-weight: 400; margin: 0 0 6px; }
.welcome-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; margin-top: 18px; }
.welcome-cols h3 { font-size: 14px; margin: 0 0 10px; }
.links { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.dash { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; }
.glance { list-style: none; margin: 0 0 10px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.glance a { text-decoration: none; }
.health { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.health li { padding: 6px 10px 6px 12px; border-left: 4px solid; background: #f6f7f7; }
.h-bad { border-color: var(--wp-red) !important; }
.h-warn { border-color: var(--wp-yellow) !important; }
.h-info { border-color: #72aee6 !important; }
.ok-line { color: var(--wp-green); font-weight: 600; }

/* Mídia */
.upload-box { border: 2px dashed var(--wp-border); border-radius: 6px; text-align: center; padding: 28px 16px; }
.upload-box.is-over { border-color: var(--wp-blue); background: #f0f6fc; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 16px; }
.media-item { background: #fff; border: 1px solid var(--wp-border-l); display: flex; flex-direction: column; }
.media-thumb { aspect-ratio: 4 / 3; background: #f6f7f7; display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--wp-muted); font-weight: 700; }
.media-thumb img, .media-thumb video { width: 100%; height: 100%; object-fit: cover; }
.media-info { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.copy { cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy.copied { background: #edfaef; }

/* Janela da biblioteca */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-box { background: #fff; width: min(1100px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; border-radius: 4px; overflow: hidden; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--wp-border-l); }
.modal-head h2 { margin: 0; font-size: 18px; font-weight: 400; }
.modal-head .button-link { font-size: 20px; text-decoration: none; color: var(--wp-muted); }
.modal-tools { display: flex; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--wp-border-l); }
.modal-tools input[type=search] { max-width: 280px; }
.modal-grid { padding: 16px; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.modal-grid button { border: 1px solid var(--wp-border-l); padding: 0; background: #f6f7f7; cursor: pointer; aspect-ratio: 1; overflow: hidden; position: relative; }
.modal-grid button:hover, .modal-grid button:focus-visible { box-shadow: 0 0 0 3px var(--wp-blue); }
.modal-grid img, .modal-grid video { width: 100%; height: 100%; object-fit: cover; display: block; }
.modal-grid span { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,.9); font-size: 11px; padding: 3px 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Perguntas */
.faq-admin .postbox { margin-bottom: 10px; }
.faq-admin .is-new { border-color: #72aee6; }
.faq-row { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 16px; }
.faq-row .fld { margin-bottom: 10px; }
.faq-side { border-left: 1px solid var(--wp-border-l); padding-left: 14px; display: flex; flex-direction: column; gap: 2px; }
@media (max-width: 700px) { .faq-row { grid-template-columns: 1fr; } .faq-side { border: 0; padding: 0; } }
.menu-table td:nth-child(3) { min-width: 240px; }

/* Login e instalação */
body.auth { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px 16px; }
.auth-box { background: #fff; border: 1px solid var(--wp-border-l); box-shadow: 0 1px 3px rgba(0,0,0,.04); padding: 28px; width: 100%; max-width: 380px; }
.auth-wide { max-width: 640px; }
.auth-logo { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.auth-logo .mark { width: 40px; height: 40px; font-size: 16px; border-radius: 10px; }
.auth h1 { font-size: 22px; font-weight: 400; margin: 16px 0 4px; }
.auth h2 { font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--wp-muted); margin: 24px 0 10px; border-bottom: 1px solid var(--wp-border-l); padding-bottom: 6px; }
.form .button-hero { width: 100%; margin-top: 8px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 520px) { .grid-2 { grid-template-columns: 1fr; } }
.radios { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.checks { list-style: none; margin: 16px 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.checks .ok strong { color: var(--wp-green); }
.checks .bad strong, .checks .bad { color: var(--wp-red); }
.checks .warn strong { color: var(--wp-yellow); }
.note { background: #fcf9e8; border-left: 4px solid var(--wp-yellow); padding: 8px 12px; }

.fld-toggle .switch { justify-content: flex-start; }
.fld-toggle { flex-direction: row; }

.rep-thumb { width: 44px; height: 32px; border-radius: 3px; overflow: hidden; background: #e6e6e7; flex: none; }
.rep-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rep-thumb:empty { background: repeating-linear-gradient(45deg, #f0f0f1 0 5px, #e6e6e7 5px 10px); }

/* Celular: nada do editor passa da largura da tela (antes os campos ficavam cortados à direita) */
.editor-main, .editor-side, .postbox, .inside, .fld { min-width: 0; max-width: 100%; }
.name-row > * { min-width: 0; }
.name-row .title-input { flex: 1 1 auto; width: 100%; }
.permalink code { overflow-wrap: anywhere; white-space: normal; }
.slug-input { min-width: 0 !important; flex: 1 1 160px; max-width: 100%; }
.tag-pend { max-width: 100%; overflow-wrap: anywhere; }
.fld input, .fld textarea, .fld select { max-width: 100%; }

/* Repetidor: botão Editar/Fechar visível em cada linha */
.rep-head-r { display: flex; gap: 12px; align-items: baseline; }
.rep-toggle { font-weight: 600; color: var(--wp-blue, #2271b1) !important; }
.rep-row .rep-open-l { display: none; } .rep-row .rep-close-l { display: inline; }
.rep-row.is-closed .rep-open-l { display: inline; } .rep-row.is-closed .rep-close-l { display: none; }
.rep-row.is-closed .rep-bar { border-bottom: 0; }
.rep-row:not(.is-closed) > .rep-bar { background: #eef3f8; }
