/* =============================================================================
   AI Beauty — estilo base (sem framework)
   ========================================================================== */
:root {
    --brand: #d6477f;
    --brand-dark: #b83368;
    --lilac: #8b5cf6;
    --bg: #faf7fb;
    --card: #ffffff;
    --ink: #2b2230;
    --muted: #8a8090;
    --line: #ece6ef;
    --ok-bg: #e8f7ee; --ok-ink: #1d7a44;
    --err-bg: #fdecec; --err-ink: #c0392b;
    --radius: 14px;
    --shadow: 0 6px 24px rgba(120, 50, 90, .08);
}

* { box-sizing: border-box; }
body {
    margin: 0; background: var(--bg); color: var(--ink);
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
}
a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0 0 .25rem; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* ---- Topbar ---- */
.topbar {
    display: flex; align-items: center; gap: 1.5rem;
    padding: .75rem 1.25rem; background: var(--card);
    border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; }
.brand img { height: 44px; width: auto; display: block; }
.nav { display: flex; gap: 1rem; flex: 1; flex-wrap: wrap; }
.nav a { color: var(--ink); font-weight: 500; }
.nav a:hover { color: var(--brand); text-decoration: none; }
.user { display: flex; align-items: center; gap: .75rem; }
.uname { color: var(--muted); font-size: .9rem; }

.container { max-width: 980px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }

/* ---- Cards / grid ---- */
.card {
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); margin-bottom: 1rem;
}
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.cards.stats { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 720px) { .grid2, .cards.stats { grid-template-columns: 1fr 1fr; } }

.stat { text-align: center; padding: 1rem .5rem; }
.stat .num { display: block; font-size: 1.8rem; font-weight: 800; color: var(--brand); }
.stat .num.small { font-size: 1.2rem; }
.stat .lbl { color: var(--muted); font-size: .85rem; }

.row { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.right { text-align: right; }
.hint { background: #fff8e6; border: 1px solid #f5e3b3; padding: .85rem 1rem; border-radius: var(--radius); margin-top: 1rem; }

/* ---- Provider cards ---- */
.provider-card { display: flex; flex-direction: column; gap: .35rem; transition: transform .12s; }
.provider-card:hover { transform: translateY(-2px); text-decoration: none; }
.avatar {
    width: 52px; height: 52px; border-radius: 50%;
    background: linear-gradient(135deg, var(--brand), var(--lilac));
    color: #fff; font-weight: 800; font-size: 1.4rem;
    display: flex; align-items: center; justify-content: center; margin-bottom: .35rem;
}
.rating { color: #e0a800; font-weight: 600; font-size: .9rem; }
.back { display: inline-block; margin-bottom: .5rem; color: var(--muted); }

/* ---- Forms ---- */
.form label { display: block; margin-bottom: .9rem; font-weight: 600; font-size: .92rem; }
.form input, .form select, .form textarea {
    width: 100%; margin-top: .3rem; padding: .65rem .75rem;
    border: 1px solid var(--line); border-radius: 10px; font: inherit; background: #fff; font-weight: 400;
}
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--brand); border-color: var(--brand); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.check input { width: auto; margin: 0; }

.btn {
    background: var(--brand); color: #fff; border: 0; padding: .7rem 1.2rem;
    border-radius: 10px; font: inherit; font-weight: 700; cursor: pointer; width: 100%;
}
.btn:hover { background: var(--brand-dark); }
.btn-sm { background: var(--brand); color: #fff; border: 0; padding: .35rem .7rem; border-radius: 8px; font-size: .85rem; cursor: pointer; }
.btn-ghost { background: transparent; border: 1px solid var(--line); padding: .4rem .8rem; border-radius: 8px; color: var(--ink); cursor: pointer; }
.btn-ghost.danger { color: var(--err-ink); border-color: #f3c9c4; }
.inline { display: flex; gap: .35rem; align-items: center; }
.inline select { padding: .3rem; border: 1px solid var(--line); border-radius: 8px; }

/* ---- Auth ---- */
.auth-bg { background: linear-gradient(135deg, #f7e8f0, #efeaff); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.auth-card { background: #fff; border-radius: 20px; box-shadow: var(--shadow); padding: 2rem; width: 100%; max-width: 400px; }
.auth-brand { text-align: center; font-weight: 800; font-size: 1.5rem; color: var(--brand); margin-bottom: 1.25rem; }
.auth-logo { display: block; width: 170px; max-width: 60%; height: auto; margin: 0 auto 1.25rem; }
.role-switch { display: flex; gap: .5rem; margin-bottom: 1rem; }
.role-opt { flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: .5rem; text-align: center; font-weight: 600; cursor: pointer; font-size: .9rem; }

/* ---- Availability ---- */
.day-row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.day-toggle { width: 130px; font-weight: 600; margin: 0; }
.times { display: flex; align-items: center; gap: .4rem; }
.times input, .slot input { width: auto; margin: 0; display: inline-block; }
.slot { font-weight: 500; margin: 0; }

/* ---- Table ---- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--line); font-size: .92rem; }
.table th { color: var(--muted); font-weight: 600; }

/* ---- Badges ---- */
.badge { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: #eee; }
.badge.s-CONFIRMED { background: #e6f0ff; color: #2b6cb0; }
.badge.s-IN_PROGRESS { background: #fff3e0; color: #b7791f; }
.badge.s-COMPLETED { background: var(--ok-bg); color: var(--ok-ink); }
.badge.s-NO_SHOW, .badge.s-CANCELLED_PROVIDER, .badge.s-CANCELLED_CLIENT { background: var(--err-bg); color: var(--err-ink); }

/* ---- Alerts ---- */
.alert { padding: .75rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-weight: 500; }
.alert.ok { background: var(--ok-bg); color: var(--ok-ink); }
.alert.err { background: var(--err-bg); color: var(--err-ink); }

.list .appt .when { font-weight: 600; }

/* ---- Avaliações (estrelas) ---- */
.rating { color: #f5b301; font-weight: 600; }
.stars-static { color: #f5b301; letter-spacing: 1px; }
.review-form { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--line); }
.rate-label { font-weight: 600; font-size: .9rem; }
.stars { display: inline-flex; flex-direction: row-reverse; }
.stars input { display: none; }
.stars label { font-size: 1.4rem; color: #ddd; cursor: pointer; line-height: 1; padding: 0 1px; }
.stars input:checked ~ label,
.stars label:hover,
.stars label:hover ~ label { color: #f5b301; }
.review-comment { flex: 1; min-width: 150px; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.review-done { margin-top: .6rem; padding-top: .6rem; border-top: 1px solid var(--line); font-size: .9rem; color: var(--muted); }
.review-item { padding: .6rem 0; border-bottom: 1px solid var(--line); }
.review-item:last-child { border-bottom: 0; }
.review-item p { margin: .25rem 0 0; }

/* ---- Carteira ---- */
.amount-pos { color: var(--ok-ink); font-weight: 700; }
.amount-neg { color: var(--err-ink); font-weight: 700; }

/* ---- Chat IA ---- */
.chat-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.chat { display: flex; flex-direction: column; gap: .5rem; margin: 1rem 0; }
.bubble { max-width: 80%; padding: .6rem .85rem; border-radius: 14px; line-height: 1.4; }
.bubble.bot { background: #fff; border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble.me  { background: var(--brand); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.chat-input { display: flex; gap: .5rem; position: sticky; bottom: 1rem; }
.chat-input input { flex: 1; padding: .7rem .85rem; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: #fff; }
