/* =========================================================================
   Área do profissional — painel. Reaproveita os tokens do design.css.
   ========================================================================= */
@import url("/static/design.css");

body { background: var(--bg-alt); }

/* ---------------- login ---------------- */
.admin-login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.admin-login { width: 100%; max-width: 360px; padding: 32px; text-align: center; }
.admin-login .brand { justify-content: center; margin-bottom: 20px; }
.admin-login h1 { font-family: var(--font); font-size: 1.3rem; font-weight: 680; margin-bottom: 6px; }
.admin-login p.muted { margin-bottom: 20px; font-size: .9rem; }
.admin-login .input { margin-bottom: 12px; text-align: left; }

/* ---------------- shell ---------------- */
.admin-shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.admin-side {
  background: var(--surface); border-right: 1px solid var(--line);
  padding: 20px 14px; display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh;
}
.admin-side .brand { padding: 6px 10px 18px; font-size: 1.05rem; }
.admin-side nav { display: grid; gap: 2px; }
.admin-side nav button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 10px 12px; border: 0; border-radius: 10px; background: transparent;
  color: var(--ink-2); font-size: .93rem; font-weight: 550; cursor: pointer;
}
.admin-side nav button:hover { background: var(--surface-2); color: var(--ink); }
.admin-side nav button.active { background: var(--accent-soft); color: var(--accent); }
.admin-side .side-foot { margin-top: auto; display: grid; gap: 8px; padding: 10px; }
.admin-side .side-foot a, .admin-side .side-foot button {
  font-size: .85rem; color: var(--ink-3); background: none; border: 0; text-align: left; padding: 4px 0; cursor: pointer;
}
.admin-side .side-foot a:hover, .admin-side .side-foot button:hover { color: var(--ink); }

.admin-main { padding: 28px clamp(20px, 4vw, 44px); max-width: 1000px; }
.admin-main > header { margin-bottom: 22px; }
.admin-main > header h1 { font-family: var(--font); font-size: 1.5rem; font-weight: 700; }
.admin-main > header p { color: var(--ink-3); margin-top: 4px; font-size: .92rem; }

.prof-switch { display: inline-flex; gap: 4px; padding: 3px; background: var(--surface-2); border-radius: 999px; margin-bottom: 20px; }
.prof-switch button {
  border: 0; background: transparent; padding: 7px 16px; border-radius: 999px;
  font-size: .88rem; font-weight: 600; color: var(--ink-3); cursor: pointer;
}
.prof-switch button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

@media (max-width: 800px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: static; height: auto; flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .admin-side .brand, .admin-side .side-foot { display: none; }
  .admin-side nav { display: flex; }
  .admin-side nav button { white-space: nowrap; }
}

/* ---------------- overview cards ---------------- */
.ov-card { padding: 22px; margin-bottom: 18px; }
.ov-card > header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.ov-card > header .dot { width: 10px; height: 10px; border-radius: 50%; }
.ov-card > header h2 { font-family: var(--font); font-size: 1.1rem; font-weight: 680; }
.ov-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.ov-stat { background: var(--surface-2); border-radius: var(--r); padding: 14px; }
.ov-stat .n { font-size: 1.5rem; font-weight: 700; font-family: var(--font); }
.ov-stat .l { font-size: .78rem; color: var(--ink-3); margin-top: 2px; }
@media (max-width: 620px) { .ov-stats { grid-template-columns: repeat(2, 1fr); } }
.ov-next { display: grid; gap: 6px; }
.ov-next .row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: .9rem; }
.ov-next .row:first-child { border-top: 0; }
.ov-next .row .when { font-weight: 600; min-width: 128px; }
.ov-next .row .who { color: var(--ink-2); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------- appointments list ---------------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.filters select { width: auto; padding: 8px 12px; font-size: .88rem; }

.appt {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px 16px; margin-bottom: 10px;
}
.appt.live { border-color: #e0736f; box-shadow: 0 0 0 1px #e0736f inset; }
.appt.live .appt-head .when { color: #c0413c; }
.appt-head { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.appt-head .when { font-weight: 650; font-size: .93rem; min-width: 132px; }
.appt-head .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.appt-head .chev { color: var(--ink-3); transition: transform .15s; }
.appt.open .appt-head .chev { transform: rotate(90deg); }
.appt-body { display: none; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.appt.open .appt-body { display: block; }
.appt-body dl { display: grid; grid-template-columns: 92px 1fr; gap: 6px 12px; margin: 0 0 14px; font-size: .9rem; }
.appt-body dt { color: var(--ink-3); }
.appt-body dd { margin: 0; }
.appt-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.appt-actions .btn { padding: 8px 14px; font-size: .85rem; box-shadow: none; }

.st { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: .74rem; font-weight: 650; }
.st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st.confirmed { background: #e5f4ea; color: #1c6b3f; }
.st.pending_confirmation { background: #fde9d9; color: #a34e10; }
.st.pending_payment { background: #fbf1de; color: #9a6414; }
.st.cancelled, .st.expired, .st.no_show { background: #f2f0f0; color: #7a7370; }
.st.completed { background: #e7f0fb; color: #1b62b3; }
.st.live { background: #fbe2e1; color: #c0413c; }
.st.live::before { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.ov-next .row.live .when { color: #c0413c; font-weight: 700; }

/* ---------------- availability ---------------- */
.avail-day { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); align-items: start; }
.avail-day:first-child { border-top: 0; }
.avail-day > .wd { font-weight: 650; font-size: .9rem; padding-top: 8px; }
.avail-ranges { display: grid; gap: 8px; }
.avail-range { display: flex; align-items: center; gap: 8px; }
.avail-range input[type=time] { width: auto; padding: 8px 10px; font-size: .88rem; }
.avail-range .sep { color: var(--ink-3); }
.avail-range .rm { background: none; border: 0; color: var(--danger); cursor: pointer; font-size: .82rem; }
.avail-add { background: none; border: 1px dashed var(--line-2); border-radius: 8px; padding: 6px 12px; font-size: .82rem; color: var(--ink-2); cursor: pointer; }
.avail-add:hover { border-color: var(--accent); color: var(--accent); }
.avail-day.empty .avail-add { color: var(--ink-3); }

.exc-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.exc-row input, .exc-row select { width: auto; padding: 7px 10px; font-size: .85rem; }
.exc-row .note { flex: 1; min-width: 140px; }

/* ---------------- profile editor (reaproveitado) ---------------- */
.pf-form fieldset { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; margin-bottom: 16px; background: var(--surface); }
.pf-form legend { font-weight: 680; font-size: .95rem; padding: 0 8px; }
.pf-form label { display: grid; gap: 5px; margin-bottom: 12px; font-size: .86rem; font-weight: 600; color: var(--ink-2); }
.pf-form label.inline { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink); }
.pf-form input, .pf-form textarea, .pf-form select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--r-sm);
  font-family: inherit; font-size: .92rem; font-weight: 400; background: var(--surface); color: var(--ink);
}
.pf-form input:focus, .pf-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pf-form input[type=color] { padding: 4px; height: 40px; }
.pf-form .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pf-form .grid2 > label { margin-bottom: 0; }
@media (max-width: 560px) { .pf-form .grid2 { grid-template-columns: 1fr; } }
.pf-form .hint { font-size: .82rem; color: var(--ink-3); font-weight: 400; }
.repeat-row { border: 1px solid var(--line); border-radius: var(--r); padding: 12px; margin-bottom: 10px; position: relative; }
.repeat-row .rm { position: absolute; top: 8px; right: 10px; background: none; border: 0; color: var(--danger); font-size: .78rem; cursor: pointer; }
.add-btn { background: none; border: 1px dashed var(--line-2); border-radius: 8px; padding: 8px 14px; font-size: .85rem; color: var(--ink-2); cursor: pointer; }
.avatar-edit { display: flex; align-items: center; gap: 16px; }
.avatar-edit img, .avatar-edit .ph {
  width: 84px; height: 84px; border-radius: 50%; object-fit: cover;
  display: grid; place-items: center; background: var(--accent); color: #fff; font-size: 2rem; font-weight: 700;
}

/* ---------------- sticky save bar ---------------- */
.save-bar {
  position: sticky; bottom: 0; margin-top: 20px; padding: 14px 0;
  background: linear-gradient(transparent, var(--bg-alt) 30%);
  display: flex; align-items: center; gap: 14px;
}
.save-bar .saved { color: var(--ok); font-size: .88rem; font-weight: 600; }

/* ---------------- integrations ---------------- */
.integ { padding: 20px; margin-bottom: 14px; }
.integ h3 { font-size: 1rem; margin-bottom: 12px; }
.integ .line { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: .9rem; border-top: 1px solid var(--line); }
.integ .line:first-of-type { border-top: 0; }
.integ .line .k { flex: 1; color: var(--ink-2); }
.integ input { width: 100%; padding: 9px 11px; border: 1px solid var(--line-2); border-radius: var(--r-sm); font: inherit; font-size: .9rem; margin-top: 4px; }
.integ .inline { display: flex; align-items: center; gap: 8px; font-size: .88rem; font-weight: 500; }
.integ .inline input { width: auto; margin: 0; }
.integ .hint { font-size: .8rem; color: var(--ink-3); }

/* ---------------- pacotes / cupons (abas novas) ---------------- */
.admin-main fieldset { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; background: var(--surface); }
.admin-main fieldset > legend { font-weight: 680; font-size: .95rem; padding: 0 8px; }
.admin-main fieldset label { display: grid; gap: 5px; margin-bottom: 12px; font-size: .84rem; font-weight: 600; color: var(--ink-2); }
.admin-main fieldset label.inline { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink); }
.admin-main fieldset input, .admin-main fieldset select {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line-2); border-radius: var(--r-sm);
  font: inherit; font-size: .9rem; font-weight: 400; background: var(--surface); color: var(--ink);
}
.admin-main fieldset input.inline, .admin-main fieldset label.inline input { width: auto; }
.admin-main fieldset input:focus, .admin-main fieldset select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.admin-main .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.admin-main .grid2 > label { margin-bottom: 0; }
@media (max-width: 560px) { .admin-main .grid2 { grid-template-columns: 1fr; } }
.admin-main .hint { font-size: .82rem; color: var(--ink-3); font-weight: 400; margin-top: 8px; }

.pkg-edit { border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-bottom: 12px; position: relative; }
.pkg-edit .rm { position: absolute; top: 8px; right: 10px; background: none; border: 0; color: var(--danger); font-size: .78rem; cursor: pointer; }

.purch-list { display: grid; gap: 10px; }
.purch { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; display: grid; gap: 3px; }
.purch-head { display: flex; align-items: center; gap: 10px; }

.coupon-list { display: grid; gap: 10px; }
.coupon-line { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.coupon-line > div:first-child { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.coupon-edit { margin-top: 12px; }
