/* ===== Painel administrativo Gabivivi ===== */
body.admin { background: #f4f2ef; }
.admin-bar { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 40; }
.admin-bar-inner { width: min(1280px, 94%); margin: 0 auto; display: flex; align-items: center; gap: 1.6rem; padding: .7rem 0; flex-wrap: wrap; }
.admin-brand img { height: 34px; }
.admin-nav { display: flex; gap: 1.1rem; flex-wrap: wrap; flex: 1; }
.admin-nav a, .admin-actions a { color: rgba(255,251,247,.85); font-size: .88rem; font-weight: 600; }
.admin-nav a.is-active, .admin-nav a:hover, .admin-actions a:hover { color: #fff; }
.admin-nav a.is-active { border-bottom: 2px solid var(--red); }
.admin-actions { display: flex; gap: 1rem; }
.admin-main { width: min(1280px, 94%); padding: 2.2rem 0 4rem; }
.admin-title { font-size: 1.9rem; margin-bottom: 1.4rem; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 1.5rem; margin-bottom: 1.6rem; }
.panel h2 { font-size: 1.2rem; font-family: var(--font-body); font-weight: 700; }
.panel-split { display: grid; grid-template-columns: 1fr 1.6fr; gap: 1.6rem; align-items: start; }

.table { width: 100%; border-collapse: collapse; font-size: .9rem; background: #fff; }
.table th, .table td { padding: .7rem .6rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.table img { width: 46px; height: 46px; object-fit: cover; border-radius: 8px; }
.table-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.btn-sm { padding: .38rem .8rem; font-size: .78rem; }
.btn-danger { background: #fff; border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }
.badge { font-size: .72rem; font-weight: 700; padding: .18rem .55rem; border-radius: 999px; background: #eee; color: #555; }
.badge-on { background: #e7f6ec; color: #14622f; }
.badge-off { background: #fde8e8; color: #9b0000; }
.toolbar { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.checkbox { display: flex; align-items: center; gap: .5rem; font-size: .9rem; font-weight: 600; color: var(--navy); }
.checkbox input { width: auto; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .8rem; }
.media-card { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.media-card img, .media-card video { width: 100%; aspect-ratio: 1/1; object-fit: cover; }
.media-card .media-foot { padding: .4rem; display: flex; justify-content: center; }
.help { font-size: .78rem; color: var(--muted); margin-top: .25rem; }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--navy), #000d3a); padding: 2rem; }
.login-card { background: #fff; border-radius: 18px; padding: 2.4rem; width: min(420px, 100%); box-shadow: 0 24px 60px rgba(0,0,0,.35); text-align: center; }
.login-card img { max-width: 210px; margin: 0 auto 1.6rem; }
@media (max-width: 860px) { .panel-split { grid-template-columns: 1fr; } }

/* Ações da tabela em linha única */
.table td.table-actions { white-space: nowrap; }
.table-actions { display: flex; gap: .35rem; flex-wrap: nowrap; align-items: center; justify-content: flex-end; }
.table-actions form { display: inline-flex; margin: 0; }
.toolbar .btn { flex: 0 0 auto; }
.btn-sm { white-space: nowrap; }
.table td:first-child, .table th:first-child { width: 1%; }
.bulk-bar { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .7rem .9rem; margin-bottom: 1rem; }
.bulk-bar select { width: auto; min-width: 200px; }
.bulk-bar .bulk-count { font-size: .82rem; color: var(--muted); }
.inline-cats { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.inline-cats form { display: inline-flex; gap: .4rem; align-items: center; }
.inline-cats input[type=text] { width: 190px; padding: .45rem .7rem; }
.cat-pill { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid var(--line); border-radius: 999px; padding: .25rem .7rem; font-size: .8rem; background: #fff; }
.cat-pill button { background: none; border: 0; color: var(--red); cursor: pointer; font-weight: 700; }
details.mini > summary { cursor: pointer; font-size: .85rem; font-weight: 700; color: var(--navy); }
details.mini { margin-bottom: 1.2rem; }
details.mini[open] > summary { margin-bottom: .8rem; }

/* ===== Barra superior e tabelas (v5) ===== */
.toolbar { align-items: center; }
.toolbar .filter-form { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; flex: 1 1 320px; }
.toolbar .filter-form input[type=search] { min-width: 220px; }
.toolbar .filter-form input, .toolbar .filter-form select { height: 40px; }
.toolbar .btn { align-self: center; height: 40px; padding: 0 1.1rem; border-radius: 10px; }
.toolbar-cta { flex: 0 0 auto; white-space: nowrap; }

.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { min-width: 860px; table-layout: auto; }
.table td, .table th { vertical-align: middle; }
.table .col-name { width: 40%; min-width: 220px; }
.table .col-actions { width: 1%; text-align: right; }
.table-actions .btn { padding: .32rem .7rem; font-size: .76rem; border-radius: 8px; }
.cat-table { min-width: 640px; }
.cat-table input[type=text] { width: 100%; min-width: 160px; padding: .4rem .6rem; }
.inline-cats .cat-new input[type=text] { width: 220px; }

/* ===== v6 — cores, botões em ícone e grids ===== */
.admin-bar { background: var(--red); }
.admin-nav a.is-active { border-bottom-color: #fff; }
.login-wrap { background: linear-gradient(135deg, var(--red), #8f0000); }
.admin-title { color: var(--navy); }

/* Botões em ícone */
.btn-icon {
  width: 34px; height: 34px; padding: 0; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: #fff; color: var(--navy);
  cursor: pointer; transition: .16s ease; flex: 0 0 auto;
}
.btn-icon svg { width: 17px; height: 17px; display: block; }
.btn-icon:hover { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-icon.is-danger { color: var(--red); border-color: rgba(249,0,0,.35); }
.btn-icon.is-danger:hover { background: var(--red); border-color: var(--red); color: #fff; }
.btn-icon.is-primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-icon.is-primary:hover { background: var(--navy); border-color: var(--navy); }

/* Grids */
.table-wrap { overflow-x: auto; border-radius: 12px; }
.table { min-width: 780px; table-layout: fixed; }
.table th, .table td { overflow: hidden; text-overflow: ellipsis; }
.table td.col-name { white-space: normal; word-break: break-word; }
.table td.table-actions, .table th.col-actions { white-space: nowrap; overflow: visible; }
.table-actions { display: flex; gap: .35rem; justify-content: flex-end; align-items: center; flex-wrap: nowrap; }
.cat-table { min-width: 620px; }
.cat-table input[type=text], .cat-table input[type=number] { width: 100%; min-width: 0; padding: .4rem .6rem; }
.toolbar .btn-primary { border-radius: 10px; }

/* ===== v7 — células de ação e filtros ===== */
.table td.table-actions { display: table-cell; white-space: nowrap; overflow: hidden; text-align: right; }
.table td.table-actions .actions-inner,
.table-actions form { display: inline-flex; gap: .35rem; align-items: center; vertical-align: middle; margin: 0; }
.table td.table-actions .actions-inner { justify-content: flex-end; width: 100%; }
.table th.col-actions { overflow: hidden; }

.toolbar .filter-form input[type=search],
.toolbar .filter-form select,
.toolbar .filter-form .btn { height: 46px; min-height: 46px; line-height: 1.2; }
.toolbar .filter-form select { padding: 0 2.2rem 0 .9rem; flex: 0 1 260px; }
.toolbar .filter-form input[type=search] { flex: 1 1 240px; padding: 0 .9rem; }
.toolbar .filter-form { flex-wrap: nowrap; }
.toolbar .btn { height: 46px; }
@media (max-width: 760px) { .toolbar .filter-form { flex-wrap: wrap; } }
