/* =====================================================================
   Painel administrativo — Grupo FR Coura
   ===================================================================== */

:root {
  --azul: #071C85;
  --ciano: #00CEFF;
  --escuro: #050E3F;
  --escuro-2: #0B1A5C;
  --bg: #f3f5f9;
  --card: #ffffff;
  --borda: #e2e6ee;
  --texto: #0b1230;
  --muted: #5a6480;
  --danger: #c0392b;
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--texto);
  font-size: 15px;
  line-height: 1.55;
}
a { color: var(--azul); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; }
h2 { font-size: 1.15rem; }
hr.sep { border: 0; border-top: 1px solid var(--borda); margin: 20px 0; }
code { background: #eef1f6; padding: 1px 5px; border-radius: 4px; font-size: .9em; }
.muted { color: var(--muted); font-size: .92em; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--azul);
  color: #fff;
  border: 1px solid var(--azul);
  font: inherit;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: filter .15s, background .15s;
  white-space: nowrap;
}
.btn:hover { filter: brightness(.95); text-decoration: none; }
.btn--ghost { background: #fff; color: var(--escuro); border-color: var(--borda); }
.btn--ghost:hover { background: #f3f5f9; }
.btn--danger { background: #fff; color: var(--danger); border-color: #e7cdca; }
.btn--danger:hover { background: var(--danger); color: #fff; }
.btn--sm { padding: 6px 11px; font-size: .82rem; border-radius: 6px; }
.btn--full { width: 100%; justify-content: center; margin-top: 8px; }

/* ---------- Alertas ---------- */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-weight: 600; font-size: .92rem; }
.alert--ok { background: #e7f6dd; color: #3c6b1c; }
.alert--erro { background: #fbe4df; color: #9c2f1c; }
.alert--aviso { background: #fdf1d8; color: #8a6412; }

/* ---------- Login ---------- */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--escuro);
  padding: 24px;
}
.login {
  background: #fff;
  border-radius: 16px;
  padding: 38px 34px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 30px 70px rgba(0,0,0,.3);
  text-align: center;
}
.login__logo { height: 46px; margin-bottom: 14px; }
.login h1 { font-size: 1.2rem; margin-bottom: 2px; }
.login__sub { color: var(--muted); margin: 0 0 20px; }
.login label { display: block; text-align: left; font-weight: 600; font-size: .85rem; margin: 12px 0 5px; }
.login input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--borda);
  border-radius: 8px;
  font: inherit;
}
.login input:focus { outline: 0; border-color: var(--azul); }
.login__back { display: inline-block; margin-top: 16px; font-size: .85rem; color: var(--muted); }

/* ---------- Layout ---------- */
.adm { display: flex; min-height: 100vh; }
.adm__side {
  width: 232px;
  background: var(--escuro);
  color: #dfe5f5;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
}
.adm__brand { padding: 20px; border-bottom: 1px solid rgba(255,255,255,.1); }
.adm__brand img { height: 38px; filter: brightness(0) invert(1); opacity: .95; }
.adm__nav { display: flex; flex-direction: column; padding: 12px 0; flex: 1; overflow-y: auto; }
.adm__nav a {
  color: #c9d1ea;
  padding: 11px 22px;
  font-weight: 600;
  font-size: .92rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-left: 3px solid transparent;
}
.adm__nav a:hover { background: rgba(255,255,255,.06); text-decoration: none; color: #fff; }
.adm__nav a.is-active { background: rgba(0,206,255,.12); border-left-color: var(--ciano); color: #fff; }
.adm__badge {
  background: var(--ciano);
  color: var(--escuro);
  font-size: .72rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
}
.adm__side-foot { padding: 16px 22px; border-top: 1px solid rgba(255,255,255,.1); display: flex; flex-direction: column; gap: 8px; }
.adm__side-foot a { color: #a7b0cc; font-size: .85rem; }
.adm__side-foot a:hover { color: #fff; }

.adm__main { margin-left: 232px; flex: 1; min-width: 0; display: flex; flex-direction: column; }
.adm__top {
  background: #fff;
  border-bottom: 1px solid var(--borda);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 30;
}
.adm__top h1 { font-size: 1.1rem; margin: 0; flex: 1; }
.adm__user { color: var(--muted); font-size: .88rem; }
.adm__burger { display: none; border: 0; background: none; font-size: 1.4rem; cursor: pointer; }
.adm__content { padding: 26px 28px 60px; max-width: 1120px; width: 100%; }

/* ---------- Painéis ---------- */
.panel {
  background: var(--card);
  border: 1px solid var(--borda);
  border-radius: var(--radius);
  padding: 22px 22px;
  margin-bottom: 22px;
}
.panel__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.panel__head h2 { margin: 0; }

.split { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 22px; align-items: start; }

/* ---------- Dashboard ---------- */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-bottom: 24px; }
.dash-card {
  background: #fff;
  border: 1px solid var(--borda);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--texto);
}
.dash-card:hover { border-color: var(--azul); text-decoration: none; }
.dash-card__num { font-size: 1.9rem; font-weight: 800; line-height: 1; }
.dash-card__label { font-weight: 700; }
.dash-card__sub { font-size: .8rem; color: var(--muted); }
.help-list { padding-left: 18px; margin: 0; }
.help-list li { margin: 6px 0; }

/* ---------- Formulários ---------- */
.form-adm label { display: block; font-weight: 600; font-size: .86rem; margin: 14px 0 5px; }
.form-adm label:first-child { margin-top: 0; }
.form-adm input[type=text],
.form-adm input[type=email],
.form-adm input[type=password],
.form-adm input[type=number],
.form-adm input[type=file],
.form-adm select,
.form-adm textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--borda);
  border-radius: 7px;
  font: inherit;
  background: #fff;
}
.form-adm textarea { resize: vertical; }
.form-adm input:focus, .form-adm select:focus, .form-adm textarea:focus { outline: 0; border-color: var(--azul); }
.form-adm__actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .88rem; cursor: pointer; }
.check input { width: auto; }
.check--sm { font-size: .8rem; font-weight: 500; margin-top: 6px; }
.check-wrap { display: flex; align-items: flex-end; padding-bottom: 4px; }

.thumb {
  display: block;
  max-width: 100%;
  width: 220px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--borda);
  margin-bottom: 8px;
  background: #eef1f6;
}
.thumb--logo { aspect-ratio: auto; height: 60px; width: auto; object-fit: contain; padding: 6px 10px; }

/* ---------- Listas ---------- */
.list-adm { list-style: none; margin: 0; padding: 0; }
.list-adm__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--borda);
  flex-wrap: wrap;
}
.list-adm__item.is-off { opacity: .5; }
.list-adm__thumb {
  width: 66px; height: 46px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--borda);
  background: #eef1f6;
  flex: none;
}
.list-adm__thumb--contain { object-fit: contain; padding: 4px; }
.list-adm__body { flex: 1; min-width: 130px; display: flex; flex-direction: column; }
.list-adm__body strong { font-size: .92rem; }

.row-acts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.row-acts__ord { display: flex; align-items: center; gap: 3px; font-size: .8rem; color: var(--muted); }
.row-acts__ord input { width: 52px; padding: 5px 6px; border: 1px solid var(--borda); border-radius: 5px; font: inherit; }
.inline { display: inline; }

/* ---------- Tabelas ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th, .tbl td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--borda); vertical-align: top; }
.tbl th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.tbl__row--novo { background: #f4f8ff; }
.tbl__row--novo td:first-child { border-left: 3px solid var(--azul); }
.tbl__row--off { opacity: .5; }
.tbl__acts { display: flex; gap: 6px; white-space: nowrap; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--azul); }

.msg-box { background: #f6f8fb; border: 1px solid var(--borda); border-radius: 8px; padding: 16px; margin: 12px 0; white-space: pre-wrap; }

/* ---------- Config ---------- */
.campos-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 12px 0; }
.cores-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.cor-input { display: flex; gap: 6px; }
.cor-input input[type=color] { width: 42px; height: 38px; padding: 2px; border: 1px solid var(--borda); border-radius: 6px; }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.form-sticky {
  position: sticky;
  bottom: 0;
  background: rgba(243,245,249,.95);
  backdrop-filter: blur(4px);
  padding: 14px 0;
  display: flex;
  gap: 10px;
  border-top: 1px solid var(--borda);
}

/* ---------- Grid de fotos ---------- */
.fotos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.fotos-grid__item { margin: 0; border: 1px solid var(--borda); border-radius: 8px; overflow: hidden; background: #fff; }
.fotos-grid__item.is-off { opacity: .5; }
.fotos-grid__item img { width: 100%; height: 110px; object-fit: cover; display: block; }
.fotos-grid__item figcaption { padding: 8px; font-size: .78rem; display: flex; flex-direction: column; gap: 6px; }
.fotos-grid__item .row-acts { gap: 4px; }
.fotos-grid__item .row-acts .btn { padding: 4px 7px; font-size: .74rem; }
.fotos-grid__item .row-acts__ord input { width: 44px; }

/* ---------- Responsivo ---------- */
@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
  .campos-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .adm__side { transform: translateX(-100%); transition: transform .25s; width: 250px; }
  .adm.nav-open .adm__side { transform: none; }
  .adm__main { margin-left: 0; }
  .adm__burger { display: block; }
  .adm__content { padding: 18px 16px 50px; }
  .grid2 { grid-template-columns: 1fr; }
}
