﻿/* =========================================================
   DEIShore - admin.css
   Painel administrativo (mini-CMS). Autossuficiente.
   ========================================================= */
:root {
  --navy-900: #0a1f3c;
  --navy-800: #0e2a4e;
  --navy-700: #143a68;
  --navy-600: #1c4c85;
  --teal-700: #0f6b74;
  --teal-600: #128793;
  --green-600: #1f8c3d;
  --green-500: #2e9e48;
  --orange-500: #e87a1c;
  --orange-600: #c85f0c;
  --red-600: #c0392b;
  --ink: #16202e;
  --ink-soft: #4a5a6e;
  --line: #dbe3ee;
  --bg: #eef3f9;
  --bg-soft: #f6f9fc;
  --white: #fff;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 3px rgba(14,42,78,.08), 0 1px 2px rgba(14,42,78,.06);
  --shadow-md: 0 8px 26px rgba(14,42,78,.12);
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-head: "Poppins", var(--font-body);
  --ease: cubic-bezier(.22,.61,.36,1);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
a { color: var(--teal-700); }
h1, h2, h3 { font-family: var(--font-head); color: var(--navy-800); line-height: 1.2; }

:focus-visible { outline: 3px solid var(--orange-500); outline-offset: 2px; border-radius: 6px; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font-family: var(--font-head); font-weight: 600; font-size: .92rem; line-height: 1;
  padding: .7rem 1.15rem; border-radius: 999px; border: 2px solid transparent;
  transition: transform .15s var(--ease), background .15s, color .15s, border-color .15s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--orange-500); color: var(--navy-900); box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: #ff8c2e; }
.btn--navy { background: var(--navy-800); color: #fff; }
.btn--navy:hover { background: var(--navy-700); }
.btn--ghost { background: #fff; color: var(--navy-800); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--navy-600); background: var(--bg-soft); }
.btn--danger { background: #fff; color: var(--red-600); border-color: #eebbb4; }
.btn--danger:hover { background: var(--red-600); color: #fff; border-color: var(--red-600); }
.btn--sm { padding: .5rem .85rem; font-size: .85rem; }

/* ---------- Top bar ---------- */
.adm-top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  background: #fff; border-bottom: 1px solid var(--line);
  padding: .8rem clamp(1rem, 4vw, 2rem);
  box-shadow: var(--shadow-sm);
}
.adm-top__brand { display: flex; align-items: center; gap: .8rem; }
.adm-top__brand img { height: 40px; width: auto; }
.adm-badge {
  font-family: var(--font-head); font-weight: 700; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--teal-700); background: #e2f1f3; border: 1px solid #bfe3e6;
  padding: .3rem .65rem; border-radius: 999px;
}
.adm-top__actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

/* ---------- Main ---------- */
.adm-main {
  max-width: 1100px; margin-inline: auto;
  padding: clamp(1.2rem, 4vw, 2rem) clamp(1rem, 4vw, 2rem) 4rem;
}

.adm-note {
  background: #fff8ef; border: 1px solid #f3ddba; border-left: 4px solid var(--orange-500);
  border-radius: var(--radius-sm); padding: .9rem 1.1rem; color: #7a5518; font-size: .92rem;
  margin-bottom: 1.4rem;
}
.adm-note code { background: #f0e2cb; border-radius: 5px; padding: .05rem .35rem; font-size: .9em; }

/* ---------- Tabs ---------- */
.adm-tabs {
  display: flex; gap: .4rem; margin-bottom: 1.3rem; flex-wrap: wrap;
  background: #fff; padding: .4rem; border-radius: 999px; border: 1px solid var(--line);
  width: fit-content; box-shadow: var(--shadow-sm);
}
.adm-tab {
  font-family: var(--font-head); font-weight: 600; font-size: .95rem;
  color: var(--navy-700); background: transparent; border: none;
  padding: .6rem 1.2rem; border-radius: 999px; transition: background .15s, color .15s;
}
.adm-tab:hover { background: var(--bg-soft); }
.adm-tab.is-active { background: var(--navy-800); color: #fff; }

/* ---------- Panels & layout ---------- */
.adm-panel[hidden] { display: none; }
.adm-grid { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 1.3rem; align-items: start; }

.adm-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.4rem; box-shadow: var(--shadow-sm); min-width: 0;
}
.adm-form h2, .adm-list-head h2 { font-size: 1.15rem; margin-bottom: 1rem; }
.adm-list-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .8rem; }

/* ---------- Form fields ---------- */
.adm-field { margin-bottom: .95rem; }
.adm-field label { display: block; font-weight: 600; color: var(--navy-800); font-size: .88rem; margin-bottom: .35rem; }
.adm-field input,
.adm-field select,
.adm-field textarea {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--bg-soft); border: 1.5px solid var(--line); border-radius: 10px;
  padding: .65rem .8rem; transition: border-color .15s, box-shadow .15s, background .15s;
}
.adm-field textarea { resize: vertical; min-height: 90px; }
.adm-field input:focus,
.adm-field select:focus,
.adm-field textarea:focus {
  outline: none; border-color: var(--teal-600); background: #fff;
  box-shadow: 0 0 0 4px rgba(18,135,147,.14);
}
.adm-field input[type="file"] { padding: .5rem; background: #fff; cursor: pointer; }
.adm-hint { font-size: .8rem; color: var(--ink-soft); margin-top: .3rem; }

.adm-thumb {
  margin-top: .7rem; display: flex; align-items: center; gap: .7rem;
}
.adm-thumb img {
  width: 68px; height: 68px; object-fit: contain;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 4px;
}
.adm-thumb--round img { object-fit: cover; border-radius: 50%; padding: 0; }

.adm-form__actions { display: flex; gap: .6rem; margin-top: 1.1rem; flex-wrap: wrap; }

/* ---------- Lists ---------- */
.adm-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: .6rem; }
.adm-item {
  display: flex; align-items: center; gap: .85rem; min-width: 0;
  border: 1px solid var(--line); border-radius: 12px; padding: .6rem .75rem;
  background: var(--bg-soft);
}
.adm-item__media {
  flex: none; width: 46px; height: 46px; border-radius: 10px; overflow: hidden;
  display: grid; place-items: center; background: #fff; border: 1px solid var(--line);
}
.adm-item__media img { width: 100%; height: 100%; object-fit: cover; }
.adm-mono {
  width: 100%; height: 100%; display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 800; font-size: 1rem; color: #fff;
  background: linear-gradient(135deg, var(--navy-700), var(--teal-600));
}
.adm-item__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.adm-item__text strong { color: var(--navy-800); font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-item__text span { font-size: .82rem; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-item__badge {
  align-self: flex-start; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  padding: .12rem .45rem; border-radius: 6px; margin-top: .15rem;
}
.badge-painel { background: #e6edf6; color: var(--navy-700); }
.badge-marco { background: #fdefe1; color: var(--orange-600); }
.badge-pausa { background: #e7f5ec; color: var(--green-600); }

.adm-item__actions { display: flex; align-items: center; gap: .25rem; flex: none; }
.adm-mini {
  font-family: var(--font-head); font-weight: 600; font-size: .8rem;
  border: 1px solid var(--line); background: #fff; color: var(--navy-700);
  border-radius: 8px; padding: .35rem .55rem; line-height: 1; transition: background .15s, color .15s, border-color .15s;
}
.adm-mini:hover:not(:disabled) { background: var(--navy-800); color: #fff; border-color: var(--navy-800); }
.adm-mini:disabled { opacity: .4; cursor: not-allowed; }
.adm-mini--danger { color: var(--red-600); border-color: #eebbb4; }
.adm-mini--danger:hover { background: var(--red-600); color: #fff; border-color: var(--red-600); }
.adm-empty { color: var(--ink-soft); font-size: .92rem; padding: 1rem; text-align: center; border: 1px dashed var(--line); border-radius: 10px; }

/* ---------- Toast ---------- */
.adm-toast {
  position: fixed; left: 50%; bottom: 1.4rem; transform: translate(-50%, 1.5rem);
  background: var(--navy-800); color: #fff; font-weight: 600; font-size: .92rem;
  padding: .8rem 1.2rem; border-radius: 12px; box-shadow: var(--shadow-md);
  opacity: 0; visibility: hidden; transition: opacity .25s, transform .25s, visibility .25s; z-index: 50; max-width: 90vw;
}
.adm-toast.is-visible { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.adm-toast.is-ok { background: #176b30; }
.adm-toast.is-err { background: var(--red-600); }

/* ---------- Responsive ---------- */
@media (max-width: 800px) {
  .adm-grid { grid-template-columns: 1fr; }
  .adm-tabs { width: 100%; justify-content: space-between; }
  .adm-tab { flex: 1; text-align: center; padding: .6rem .5rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .001ms !important; }
}
