/* =====================================================================
   Espaço Pizzini — painel admin, login e webapp de terapeutas.
   Visual minimalista compartilhado, com a paleta da marca.
   ===================================================================== */

:root {
  --cream:   #f5efe3;
  --card:    #fffefa;
  --line:    #e6dcc8;
  --line-2:  rgba(60, 49, 34, .08);
  --sage:    #7a8e54;
  --green:   #4d5b3c;
  --green-deep: #3f4b31;
  --terra:   #bf7549;
  --terra-deep: #a5623a;
  --brown:   #3c3122;
  --soft:    #6f5f49;
  --radius:  14px;
  --radius-lg: 20px;
  --shadow:  0 14px 40px rgba(60, 49, 34, .10);
  --shadow-sm: 0 6px 18px rgba(60, 49, 34, .07);
  --serif: "Fraunces", Georgia, serif;
  --sans: "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: var(--sans); background: #f0e9da; color: var(--brown); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--terra); }
h1, h2, h3 { font-family: var(--serif); color: var(--green-deep); font-weight: 600; letter-spacing: -.01em; }

/* ----------------------------- Login / Setup ----------------------------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: linear-gradient(140deg, var(--green-deep), var(--sage)); position: relative; overflow: hidden; }
.synapse-bg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.auth-card { position: relative; z-index: 2; }
.auth-card { background: var(--card); border-radius: var(--radius-lg); box-shadow: 0 30px 70px rgba(0, 0, 0, .28); padding: 42px 38px; width: 100%; max-width: 410px; text-align: center; }
.auth-logo img { height: 52px; margin-bottom: 20px; }
.auth-card h1 { font-size: 1.5rem; margin: 0 0 6px; }
.auth-sub { color: var(--soft); margin: 0 0 24px; font-size: .96rem; }
.auth-card .form-grid { text-align: left; }
.auth-back { display: inline-block; margin-top: 20px; font-size: .9rem; color: var(--soft); }

/* ----------------------------- Botões ----------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1.5px solid transparent; cursor: pointer; font-family: inherit; font-weight: 700; font-size: .95rem; padding: 11px 20px; border-radius: 999px; text-decoration: none; transition: .2s; }
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--terra); color: #fff; }
.btn--primary:hover { background: var(--terra-deep); color: #fff; }
.btn--green { background: var(--sage); color: #fff; }
.btn--green:hover { background: var(--green); color: #fff; }
.btn--ghost { background: #fff; border-color: var(--line); color: var(--green); }
.btn--ghost:hover { background: var(--cream); }
.btn--danger { background: #c0473a; color: #fff; }
.btn--danger:hover { background: #a53b30; color: #fff; }
.btn--sm { padding: 7px 14px; font-size: .84rem; }
.btn--block { width: 100%; margin-top: 6px; }

/* ----------------------------- Top bar do painel ----------------------------- */
.panel-top { background: var(--green-deep); color: #fff; position: sticky; top: 0; z-index: 30; box-shadow: 0 4px 18px rgba(0, 0, 0, .14); }
.panel-top__inner { max-width: 1120px; margin: 0 auto; padding: 12px 22px; display: flex; align-items: center; gap: 18px; }
.panel-brand { display: flex; align-items: center; gap: 11px; color: #fff; text-decoration: none; }
.panel-brand img { height: 32px; }
.panel-brand span { font-family: var(--serif); font-weight: 600; font-size: 1.05rem; }
.panel-nav { display: flex; gap: 3px; flex-wrap: wrap; margin-left: 8px; flex: 1; }
.panel-nav a { color: #e6ecdb; text-decoration: none; padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: .92rem; transition: .2s; }
.panel-nav a:hover { background: rgba(255, 255, 255, .12); }
.panel-nav a.active { background: rgba(255, 255, 255, .2); color: #fff; }
.panel-nav__sec { color: #c7d2b4 !important; }
.panel-user { display: flex; align-items: center; gap: 12px; }
.panel-user__name { color: #cdd6bd; font-size: .9rem; }
.panel-logout button { background: none; border: 1.5px solid rgba(255, 255, 255, .3); color: #ffd9c7; cursor: pointer; font-family: inherit; font-weight: 700; font-size: .88rem; padding: 7px 14px; border-radius: 999px; transition: .2s; }
.panel-logout button:hover { background: rgba(255, 255, 255, .12); }
.panel-burger { display: none; background: rgba(255, 255, 255, .14); border: none; width: 42px; height: 42px; border-radius: 10px; cursor: pointer; }
.panel-burger span, .panel-burger span::before, .panel-burger span::after { content: ""; display: block; width: 20px; height: 2.2px; background: #fff; border-radius: 3px; margin: 0 auto; position: relative; }
.panel-burger span::before { position: absolute; top: -6px; left: 0; }
.panel-burger span::after { position: absolute; top: 6px; left: 0; }

.panel-main { max-width: 1120px; margin: 0 auto; padding: 30px 22px 60px; }

/* ----------------------------- Cabeçalho de página ----------------------------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head h1 { font-size: 1.7rem; margin: 0; }
.page-head__sub { color: var(--soft); margin: 6px 0 0; font-size: .95rem; }

/* ----------------------------- Cards / estatísticas ----------------------------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card.pad { padding: 26px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 30px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; }
.stat b { display: block; font-family: var(--serif); font-size: 2.1rem; color: var(--terra); line-height: 1; margin-bottom: 4px; }
.stat span { color: var(--soft); font-size: .92rem; }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.tile { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 24px; text-decoration: none; color: var(--green); box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s, border-color .2s; position: relative; overflow: hidden; }
.tile::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--sage), var(--terra)); transform: scaleX(0); transform-origin: left; transition: transform .25s; }
.tile:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: transparent; }
.tile:hover::before { transform: scaleX(1); }
.tile__ico { font-size: 1.7rem; width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #fbf6ea, #fff); border: 1px solid var(--line); border-radius: 15px; margin-bottom: 14px; transition: .2s; }
.tile:hover .tile__ico { background: linear-gradient(135deg, var(--sage), var(--green)); transform: scale(1.05); }
.tile h3 { margin: 0 0 6px; font-size: 1.16rem; }
.tile p { margin: 0; color: var(--soft); font-size: .94rem; flex: 1; }
.tile--soon { opacity: .7; cursor: default; }
.tile--soon:hover { transform: none; box-shadow: var(--shadow-sm); border-color: var(--line); }
.tile--soon:hover::before { transform: scaleX(0); }
.tile--soon:hover .tile__ico { background: linear-gradient(135deg, #fbf6ea, #fff); transform: none; }
.tile__badge { display: inline-block; margin-top: 14px; align-self: flex-start; background: #e1eed0; color: #4d5b3c; padding: 4px 12px; border-radius: 999px; font-size: .78rem; font-weight: 800; }
.tile__badge--soon { background: var(--cream); color: var(--soft); }

.note-box { margin-top: 26px; background: #fcf6e9; border: 1px solid var(--line); border-left: 4px solid var(--terra); border-radius: var(--radius); padding: 18px 22px; color: var(--soft); font-size: .95rem; }

/* ----------------------------- Tabelas ----------------------------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; background: var(--card); }
th, td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: #efe6d4; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--soft); }
tr:last-child td { border-bottom: none; }
td .thumb, .thumb { width: 54px; height: 40px; object-fit: cover; border-radius: 8px; background: #eee; display: block; }
.badge { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: .76rem; font-weight: 800; }
.badge.pub { background: #e1eed0; color: #4d5b3c; }
.badge.rasc { background: #f3e2d2; color: #b06a3e; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline { display: inline; }

/* ----------------------------- Formulários ----------------------------- */
.form-grid { display: grid; gap: 18px; }
label { display: block; font-weight: 700; color: var(--green); margin-bottom: 7px; }
.hint { font-weight: 400; color: var(--soft); font-size: .85rem; }
.mb { margin-bottom: 16px; margin-top: -6px; }
.mt { margin-top: 16px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], select, textarea {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 11px; font-family: inherit; font-size: 1rem; background: #fffdf7; color: var(--brown);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sage); box-shadow: 0 0 0 3px rgba(122, 142, 84, .15); }
textarea { min-height: 120px; resize: vertical; }
textarea.short { min-height: 70px; }
textarea.tall { min-height: 220px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-actions { display: flex; gap: 12px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.cur-img { margin-top: 12px; }
.cur-img img { max-width: 200px; border-radius: 10px; border: 1px solid var(--line); }
.check { font-weight: 400; margin-top: 8px; display: flex; gap: 8px; align-items: center; }
.check input { width: auto; }

/* Editor Quill */
#editor { background: #fffdf7; border: 1.5px solid var(--line); border-radius: 0 0 11px 11px; min-height: 300px; }
.ql-toolbar.ql-snow { border-color: var(--line); border-radius: 11px 11px 0 0; background: #fff; }
.ql-container.ql-snow { border-color: var(--line); }

/* ----------------------------- Avisos ----------------------------- */
.flash { padding: 13px 18px; border-radius: 11px; margin-bottom: 18px; font-weight: 700; }
.flash--sucesso { background: #e1eed0; color: #3c5b2f; border: 1px solid #c4d9a8; }
.flash--erro { background: #f6dcd5; color: #9c3b2c; border: 1px solid #e8b6ab; }

/* ----------------------------- Anotações (webapp) ----------------------------- */
.note-new { max-width: 640px; margin-bottom: 30px; }
.note-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.note-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; }
.note-card h3 { margin: 0 0 8px; font-size: 1.12rem; }
.note-card p { margin: 0; color: var(--soft); font-size: .94rem; white-space: pre-wrap; flex: 1; }
.note-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.note-card time { color: var(--soft); font-size: .8rem; }
.empty--panel { background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); padding: 40px 24px; text-align: center; color: var(--soft); }

/* Popover de senha (details) */
.pop { position: relative; }
.pop > summary { list-style: none; }
.pop > summary::-webkit-details-marker { display: none; }
.pop__body { position: absolute; z-index: 5; top: calc(100% + 6px); left: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 14px; display: flex; gap: 8px; min-width: 250px; }

/* ----------------------------- Responsivo ----------------------------- */
@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .tiles { grid-template-columns: 1fr 1fr; }
  .panel-burger { display: block; }
  .panel-nav { display: none; flex-basis: 100%; order: 3; flex-direction: column; margin: 6px 0 0; }
  .panel-nav.open { display: flex; }
  .panel-top__inner { flex-wrap: wrap; }
  .panel-user { margin-left: auto; }
}
@media (max-width: 560px) {
  .row, .stats, .tiles { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  .page-head h1 { font-size: 1.45rem; }
}
