:root {
  --navy: #17306b; --navy-2: #0e1f4a; --orange: #e8701f; --orange-2: #c4561a;
  --paper: #f6f3ec; --card: #fff; --ink: #161b28; --muted: #5b6273; --line: #e3ddd0; --line-2: #efeae0;
  --green: #18804a; --red: #b8322a; --amber: #a26200;
  --sans: 'Nunito Sans', system-ui, -apple-system, Segoe UI, sans-serif; --serif: 'Fraunces', Georgia, serif;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--sans); font-size: 16px; font-weight: 600; color: var(--ink); background: var(--paper); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--navy); text-decoration: none; }
button { font: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; color: var(--navy-2); line-height: 1.2; }
h1 { font-family: var(--serif); font-weight: 700; font-size: 2rem; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; font-weight: 800; }
h3 { font-size: 1rem; font-weight: 800; }
.ic { width: 18px; height: 18px; flex: none; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-art { display: none; }
.login-form { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 36px; }
.login-form form { display: grid; gap: 18px; }
.login-form img { height: 52px; width: auto; margin-bottom: 8px; }
.login-form h1 { font-size: 1.7rem; }

/* estrutura */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
aside.side { background: #fff; border-right: 1px solid var(--line); padding: 22px 14px 18px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
aside.side .brand { padding: 0 10px 20px; margin-bottom: 10px; border-bottom: 1px solid var(--line-2); }
aside.side .brand img { height: 44px; width: auto; }
aside.side .brand small { display: block; margin-top: 8px; color: var(--muted); font-size: .82rem; font-weight: 700; }
aside.side nav { display: grid; gap: 2px; }
aside.side nav a { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 8px; color: var(--ink); font-weight: 700; font-size: 1rem; }
aside.side nav a .ic { color: var(--muted); }
aside.side nav a:hover { background: var(--paper); }
aside.side nav a.on { background: var(--paper); color: var(--navy-2); font-weight: 900; }
aside.side nav a.on .ic { color: var(--navy-2); }
aside.side nav a .count { margin-left: auto; color: var(--orange-2); font-weight: 900; font-size: .9rem; }
aside.side nav .sep { height: 1px; background: var(--line-2); margin: 10px 4px; }
aside.side .grow { flex: 1; }
aside.side .user { display: flex; gap: 10px; align-items: center; padding: 12px 10px 0; border-top: 1px solid var(--line-2); }
aside.side .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--navy-2); color: #fff; display: grid; place-items: center; font-weight: 900; font-size: .8rem; flex: none; }
aside.side .user b { display: block; font-size: .92rem; }
aside.side .user small { color: var(--muted); font-size: .82rem; }
aside.side .user button { margin-left: auto; background: none; border: 0; color: var(--muted); padding: 6px; border-radius: 6px; }
aside.side .user button:hover { background: var(--paper); color: var(--ink); }
main.main { padding: 32px 40px 64px; min-width: 0; max-width: 1280px; }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.top p { margin: 6px 0 0; color: var(--muted); font-size: 1rem; }
.mobile-bar { display: none; }

/* botões */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 8px; border: 1px solid transparent; font-weight: 800; font-size: .95rem; white-space: nowrap; line-height: 1.2; }
.btn-primary { background: var(--orange-2); color: #fff; }
.btn-primary:hover { background: #a9480f; }
.btn-navy { background: var(--navy-2); color: #fff; }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-danger { background: #fff; border-color: #e7c3bf; color: var(--red); }
.btn-danger:hover { border-color: var(--red); }
.btn-sm { padding: 6px 11px; font-size: .86rem; }
.icon-btn { background: none; border: 0; padding: 7px; border-radius: 6px; color: var(--muted); display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--paper); color: var(--ink); }
.icon-btn.del:hover { color: var(--red); }

/* blocos */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 22px 24px; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; gap: 12px; }
.card-head a { font-weight: 800; font-size: .92rem; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 18px; }
.stat { padding: 18px 22px; border-left: 1px solid var(--line-2); }
.stat:first-child { border-left: 0; }
.stat b { display: block; font-family: var(--serif); font-weight: 700; font-size: 2.3rem; line-height: 1.05; color: var(--navy-2); }
.stat small { color: var(--muted); font-weight: 700; font-size: .92rem; }
.stat .bub { display: none; }
.cols2 { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: .8rem; color: var(--muted); font-weight: 800; padding: 11px 14px; border-bottom: 1px solid var(--line); background: #fbfaf6; white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fbfaf6; }
.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: auto; }
.thumb { width: 72px; height: 48px; border-radius: 6px; object-fit: cover; background: var(--paper); }
.tname b { display: block; color: var(--ink); font-weight: 800; }
.tname small { color: var(--muted); font-weight: 600; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: .86rem; font-weight: 800; white-space: nowrap; color: var(--muted); }
.pill::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.publicado, .pill.respondido { color: var(--green); }
.pill.rascunho { color: var(--muted); }
.pill.esgotado { color: var(--red); }
.pill.novo { color: var(--orange-2); }
.pill.em { color: var(--navy); }
.pill.tag { color: var(--ink); font-weight: 700; }
.pill.tag::before { display: none; }
.switch { position: relative; width: 40px; height: 24px; display: inline-block; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #cfc9bd; border-radius: 99px; transition: .2s; cursor: pointer; }
.switch span::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--navy-2); }
.switch input:checked + span::before { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--orange-2); outline-offset: 2px; }

/* formulários */
.filters { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
input, select, textarea { font: inherit; font-weight: 600; padding: 10px 12px; border: 1px solid #d6cfc0; border-radius: 8px; background: #fff; color: var(--ink); width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(23,48,107,.12); }
.filters input, .filters select { width: auto; min-width: 210px; }
label.f { display: grid; gap: 6px; font-weight: 800; font-size: .92rem; color: var(--ink); }
label.f small { font-weight: 600; color: var(--muted); }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.fgrid .full { grid-column: 1 / -1; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid #d6cfc0; border-radius: 8px; font-weight: 700; font-size: .92rem; cursor: pointer; background: #fff; }
.checks input { width: auto; margin: 0; accent-color: var(--navy-2); }
.checks label:has(input:checked) { border-color: var(--navy-2); background: #eef1f8; color: var(--navy-2); }
.drop { border: 1px dashed #cfc7b7; border-radius: 10px; padding: 12px; display: flex; gap: 14px; align-items: center; background: #fbfaf6; }
.drop img { width: 120px; height: 80px; object-fit: cover; border-radius: 6px; }
.drop.tall img { width: 80px; height: 108px; }
.imglist { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.imglist div { position: relative; }
.imglist img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.imglist button { position: absolute; top: 4px; right: 4px; background: rgba(22,27,40,.75); color: #fff; border: 0; border-radius: 6px; width: 26px; height: 26px; display: grid; place-items: center; }
.imglist button .ic { width: 14px; height: 14px; }
.upl { position: relative; overflow: hidden; }
.upl input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* gaveta de edição */
.modal-bg { position: fixed; inset: 0; background: rgba(22,27,40,.35); z-index: 80; display: flex; justify-content: flex-end; }
.modal { background: #fff; width: min(760px, 100%); height: 100%; display: flex; flex-direction: column; border-left: 1px solid var(--line); animation: slide .2s ease; }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
.modal header { padding: 20px 28px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal header h2 { font-family: var(--serif); font-size: 1.5rem; font-weight: 700; }
.modal .mb { padding: 24px 28px; overflow: auto; flex: 1; display: grid; gap: 16px; align-content: start; }
.modal footer { padding: 14px 28px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; background: #fbfaf6; }
.sec-title { font-size: .95rem; color: var(--navy-2); font-weight: 900; margin-top: 10px; padding-top: 16px; border-top: 1px solid var(--line-2); }

/* listas do painel */
.list-item { display: flex; gap: 14px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.list-item:last-child { border: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item b { display: block; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item small { color: var(--muted); }
.date-chip { width: 52px; flex: none; color: var(--muted); font-size: .8rem; font-weight: 800; line-height: 1.1; }
.date-chip b { font-family: var(--serif); font-size: 1.35rem; color: var(--navy-2) !important; }
.note { color: var(--muted); font-size: .92rem; margin: 18px 2px 0; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 150%); opacity: 0; background: var(--navy-2); color: #fff; padding: 12px 18px; border-radius: 8px; z-index: 120; transition: transform .25s, opacity .25s; font-weight: 800; display: flex; gap: 8px; align-items: center; }
.toast.on { transform: translate(-50%, 0); opacity: 1; }
.tip { color: var(--muted); font-size: .95rem; display: flex; gap: 10px; align-items: flex-start; margin-bottom: 16px; }
.tip .ic { margin-top: 3px; }
.repeat { display: grid; gap: 10px; }
.repeat .row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: start; }

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  aside.side { position: fixed; left: 0; top: 0; z-index: 90; width: 270px; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.15); }
  aside.side.open { transform: none; }
  .mobile-bar { display: flex; align-items: center; justify-content: space-between; background: #fff; border-bottom: 1px solid var(--line); padding: 10px 16px; }
  .mobile-bar img { height: 36px; }
  .mobile-bar button { background: none; border: 0; color: var(--ink); }
  main.main { padding: 22px 16px 50px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line-2); }
  .cols2, .fgrid { grid-template-columns: 1fr; }
  .hide-m { display: none; }
}
.cols2 { align-items: start; }
.cols2 > .card { margin-top: 0; }
aside.side .user > div { min-width: 0; }
aside.side .user small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
