/* Legătura dintre aspectul Administrării MB din WordPress (mbx-app.css, copiat întocmai) și ecranele Filament.
   Cadrul (antet, meniu, bara de jos) vine din mbx-app.css; aici: locul paginii în cadru și componentele Filament
   (capul paginii, butoane, câmpuri, tabele, file, ferestre) îmbrăcate ca în panoul vechi. */

/* ---------- regulile generale din app.css nu au voie să strice câmpurile Filament ---------- */
.fi-body .fi-input-wrp input, .fi-body .fi-input-wrp select, .fi-body .fi-input-wrp textarea,
.fi-body .fi-select-input, .fi-body .fi-input {
  width: 100%; min-height: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; outline: none;
}
.fi-body .fi-input-wrp input:focus, .fi-body .fi-input-wrp select:focus, .fi-body .fi-input-wrp textarea:focus { box-shadow: none; border: 0; }
.fi-body label:not(.mbx-page *) { margin: 0; font-size: inherit; font-weight: inherit; color: inherit; display: revert; }
.fi-body .fi-checkbox-input, .fi-body .fi-radio-input { width: 1rem; height: 1rem; min-height: 0; padding: 0; flex: 0 0 auto; }
.fi-body input[type=file]:not(.mbx-page *) { border: 0; padding: 0; background: none; }

/* ---------- Admin MB: pagina în cadrul vechi (meniul din stânga, antetul de sus) ---------- */
:is(.fi-panel-admin, .fi-panel-site) .fi-layout { display: block; }
:is(.fi-panel-admin, .fi-panel-site) .fi-main-ctn { margin-left: var(--side); padding: calc(var(--top) + 28px) 32px 56px; width: auto; min-height: 100vh; }
:is(.fi-panel-admin, .fi-panel-site) .fi-main { max-width: 1120px; margin: 0 auto; padding: 0; width: 100%; }
:is(.fi-panel-admin, .fi-panel-site) .fi-page > .fi-page-header-main-ctn, :is(.fi-panel-admin, .fi-panel-site) .fi-page-header-main-ctn { padding-top: 0; row-gap: 20px; }
:is(.fi-panel-admin, .fi-panel-site) .fi-page-main { row-gap: 18px; }
:is(.fi-panel-admin, .fi-panel-site) .mbx-shell .mbx-logout { margin: 0; display: inline-flex; }

@media (max-width: 900px) {
  :is(.fi-panel-admin, .fi-panel-site) .fi-main-ctn { margin-left: 0; padding: calc(var(--top) + 18px) 14px calc(96px + env(safe-area-inset-bottom, 0px)); }
}

/* ---------- capul paginii = .mbx-pagehead ---------- */
:is(.fi-panel-admin, .fi-panel-site) .fi-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
:is(.fi-panel-admin, .fi-panel-site) .fi-header-heading { font-family: var(--serif); font-weight: 700; font-size: 30px; line-height: 1.15; letter-spacing: -.005em; color: var(--ink); }
:is(.fi-panel-admin, .fi-panel-site) .fi-header-subheading { margin-top: 6px; color: var(--muted); font-size: 15px; }
:is(.fi-panel-admin, .fi-panel-site) .fi-breadcrumbs { display: none; }
@media (max-width: 900px) {
  :is(.fi-panel-admin, .fi-panel-site) .fi-header { align-items: center; padding-bottom: 12px; }
  :is(.fi-panel-admin, .fi-panel-site) .fi-header-heading { font-size: 24px; }
}

/* ---------- butoane = .mbx-btn ---------- */
.fi-body .fi-btn { min-height: 42px; padding: 0 18px; border-radius: 10px; font-weight: 600; font-size: 14.5px; gap: 8px; }
.fi-body .fi-btn.fi-size-sm, .fi-body .fi-btn.fi-size-xs { min-height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 9px; }
.fi-body .fi-btn.fi-color-primary:not(.fi-outlined) { background: var(--red); color: #fff; box-shadow: 0 1px 2px rgba(95, 18, 21, .25); }
.fi-body .fi-btn.fi-color-primary:not(.fi-outlined):hover { background: var(--red-dark); }
.fi-body .fi-btn.fi-color-gray, .fi-body .fi-btn.fi-outlined { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.fi-body .fi-btn.fi-color-gray:hover, .fi-body .fi-btn.fi-outlined:hover { background: #fdfcfa; box-shadow: inset 0 0 0 1px #cfc9bf; }
.fi-body .fi-btn.fi-color-danger:not(.fi-outlined) { background: #a3241b; color: #fff; }
.fi-body .fi-icon-btn { border-radius: 10px; }

/* ---------- câmpuri = input-urile vechi ---------- */
.fi-body .fi-input-wrp { min-height: 44px; border-radius: 10px; background: #fff; box-shadow: inset 0 0 0 1px #d8d3ca; }
.fi-body .fi-input-wrp:focus-within { box-shadow: inset 0 0 0 1px var(--red), 0 0 0 4px var(--red-soft); }
.fi-body .fi-input-wrp input, .fi-body .fi-input-wrp textarea, .fi-body .fi-input-wrp select { padding: 10px 13px; font-size: 15px; }
.fi-body .fi-fo-field-label-content { font-size: 13px; font-weight: 600; color: var(--ink-2); }

/* ---------- carduri, secțiuni, tabele = .mbx-card ---------- */
.fi-body .fi-section, .fi-body .fi-ta-ctn, .fi-body .fi-wi-stats-overview-stat {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line-2); --tw-ring-shadow: 0 0 #0000;
}
.fi-body .fi-section-header-heading { font-family: var(--serif); font-weight: 700; font-size: 17px; }
.fi-body .fi-ta-header-cell { background: #faf8f4; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.fi-body .fi-ta-row:hover { background: #fdfbf8; }
.fi-body .fi-ta-search-field .fi-input-wrp { min-height: 40px; }

/* ---------- filele = comutatorul .mbx-seg ---------- */
.fi-body .fi-tabs { background: var(--line-2); border-radius: 12px; padding: 4px; gap: 4px; box-shadow: none; }
.fi-body .fi-tabs-item { border-radius: 9px; font-weight: 600; color: var(--ink-2); }
.fi-body .fi-tabs-item.fi-active { background: #fff; color: var(--red); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.fi-body .fi-tabs-item .fi-badge { background: var(--red-soft); color: var(--red); }

/* ---------- etichete și ferestre ---------- */
.fi-body .fi-badge { border-radius: 999px; font-weight: 700; }
.fi-body .fi-modal-window { border-radius: 16px; }
.fi-body .fi-modal-heading { font-family: var(--serif); font-size: 20px; }
.fi-body .fi-dropdown-panel { border-radius: 12px; }
:is(.fi-panel-admin, .fi-panel-site) .mbx-page { width: 100%; }
@media (max-width: 900px) { :is(.fi-panel-admin, .fi-panel-site) .mbx-siteswitch { display: none; } }

/* Paginile refăcute după panoul vechi (au marcajul .mbx-page): spațiile le dă app.css, nu Filament. */
:is(.fi-panel-admin, .fi-panel-site) .fi-page-content { row-gap: 18px; }
:is(.fi-panel-admin, .fi-panel-site) .fi-page-content:has(> .mbx-page) { row-gap: 0; }
:is(.fi-panel-admin, .fi-panel-site) .fi-page-header-main-ctn { padding-bottom: 24px; }
:is(.fi-panel-admin, .fi-panel-site) .fi-page-header-main-ctn:has(.fi-page-content > .mbx-page) { padding-bottom: 0; }
:is(.fi-panel-admin, .fi-panel-site) .fi-page-content > .mbx-page + .mbx-page { margin-top: 0; }
/* În paginile refăcute: căsuțele native, colorate ca în panoul vechi (accent-color), nu cele desenate de Filament. */
:is(.fi-panel-admin, .fi-panel-site) .mbx-page input[type=checkbox], :is(.fi-panel-admin, .fi-panel-site) .mbx-page input[type=radio] {
  -webkit-appearance: auto; appearance: auto; background-image: none; background-color: initial; border: initial; box-shadow: none; padding: 0; min-height: 0; border-radius: initial;
}
/* Paginile refăcute își au capul în pagină (.mbx-pagehead): antetul Filament (titlu + butoane) nu se mai arată;
   butoanele lui rămân însă active și se deschid din pagină (mountAction). */
:is(.fi-panel-admin, .fi-panel-site) .fi-page:has(.fi-page-content > .mbx-page) .fi-header { display: none; }

/* ---------- paginile refăcute (.mbx-page): stilurile implicite ale browserului, ca în panoul vechi ----------
   Administrare MB veche nu avea „reset”: titlurile mici erau îngroșate, paragrafele și listele aveau spațiile lor,
   linkurile erau subliniate. Filament (Tailwind) le șterge pe toate; aici le readucem, cu specificitate zero,
   ca orice regulă din mbx-app.css să rămână mai tare. */
:where(.mbx-page) :where(h1, h2, h3, h4, h5, h6) { font-size: revert; font-weight: revert; }
:where(.mbx-page) :where(p, ul, ol, dl, dd, blockquote, figure, h4, h5, h6) { margin: revert; }
:where(.mbx-page) :where(ul, ol) { padding: revert; list-style: revert; }
:where(.mbx-page) :where(a) { text-decoration: revert; }
:where(.mbx-page) :where(img, svg, video) { display: revert; }

/* ---------- formularele Filament rămase (de ex. ordinul de deplasare): bara de jos fixă, ca .mbx-trfoot din panoul vechi ---------- */
:is(.fi-panel-admin, .fi-panel-site) form.fi-sc-form > .fi-grid:last-child:has(.fi-sc-actions) { position: sticky; bottom: 0; z-index: 3; background: var(--bg, #f3f1ec); padding: 12px 0; }

/* ---------- Feedback: capturi de ecran ---------- */
.mbx-fbshot { position: relative; display: flex; align-items: center; gap: 8px; padding: 12px 14px; border: 1.5px dashed var(--line, #ddd6cc); border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--red, #970f0f); }
.mbx-fbshot:hover { border-color: var(--red, #970f0f); }
.mbx-fbshot input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.mbx-fbshot small { font-weight: 400; }
.mbx-fbthumbs { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 2px; }
.mbx-fbthumb { position: relative; display: grid; place-items: center; width: 76px; height: 76px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line, #e5e1da); background: #f6f3ee; }
.mbx-fbthumb img { width: 100%; height: 100%; object-fit: cover; }
.mbx-fbthumb button { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border: 0; border-radius: 50%; background: rgba(0,0,0,.65); color: #fff; font-size: 15px; line-height: 1; cursor: pointer; }
