:root {
  --ink: #2c2630;
  --muted: #746b74;
  --plum: #6f3d58;
  --plum-dark: #4f293e;
  --rose: #c47d91;
  --rose-soft: #f7e9ed;
  --blush: #fff7f8;
  --sand: #f5eee7;
  --sage: #e5efea;
  --white: #ffffff;
  --line: #eadfe3;
  --success: #39705a;
  --warning: #a6652a;
  --danger: #a54450;
  --shadow: 0 18px 50px rgba(74, 42, 59, 0.08);
  --shadow-small: 0 8px 24px rgba(74, 42, 59, 0.07);
  --radius: 22px;
  --radius-small: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: #faf7f8; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 256px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; z-index: 20; display: flex; flex-direction: column; padding: 28px 20px 22px; color: #fff; background: linear-gradient(165deg, #5f344d 0%, #48273b 100%); }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 30px; }
.brand > span:last-child { display: grid; gap: 1px; }
.brand strong { font-family: Georgia, serif; font-size: 22px; letter-spacing: -.4px; }
.brand small { color: #d9bec9; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.brand-mark { width: 42px; height: 42px; border-radius: 50% 50% 50% 12px; display: grid; place-items: center; flex: 0 0 auto; color: var(--plum-dark); background: #f5d9e1; font-family: Georgia, serif; font-size: 24px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.55); }
.brand-mark.large { width: 58px; height: 58px; font-size: 32px; }
.main-nav { display: grid; gap: 6px; }
.main-nav a { display: flex; align-items: center; gap: 13px; min-height: 48px; padding: 0 14px; border-radius: 13px; color: #e5d5dc; font-size: 14px; font-weight: 600; transition: .18s ease; }
.main-nav a:hover { color: #fff; background: rgba(255,255,255,.07); }
.main-nav a.active { color: var(--plum-dark); background: #fff; box-shadow: 0 8px 20px rgba(32,14,24,.18); }
.nav-icon { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 8px; font-size: 17px; }
.main-nav a.active .nav-icon { color: var(--plum); background: var(--rose-soft); }
.sidebar-note { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 14px; border: 1px solid rgba(255,255,255,.11); border-radius: 14px; background: rgba(255,255,255,.05); }
.sidebar-note div { display: grid; gap: 2px; }
.sidebar-note strong { font-size: 12px; }
.sidebar-note small { color: #cdb7c0; font-size: 10px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #89d1ad; box-shadow: 0 0 0 5px rgba(137,209,173,.12); }
.logout-button { width: 100%; margin-top: 12px; padding: 10px; border: 0; color: #ceb8c1; background: transparent; cursor: pointer; font-size: 12px; }
.logout-button:hover { color: #fff; }

.main-area { min-width: 0; }
.topbar { height: 88px; position: sticky; top: 0; z-index: 15; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 clamp(24px, 4vw, 52px); border-bottom: 1px solid rgba(111,61,88,.08); background: rgba(250,247,248,.9); backdrop-filter: blur(16px); }
.topbar-greeting { display: grid; gap: 2px; }
.topbar-greeting strong { font-size: 16px; }
.topbar-actions, .heading-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.today-pill { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: #fff; font-size: 12px; font-weight: 700; }
.mobile-menu { display: none; border: 0; background: none; font-size: 24px; cursor: pointer; }
.content { max-width: 1540px; margin: auto; padding: 36px clamp(24px, 4vw, 52px) 56px; }
.eyebrow { display: block; color: var(--rose); font-size: 10px; font-weight: 800; letter-spacing: .16em; line-height: 1.4; text-transform: uppercase; }
.eyebrow.light { color: #ecc9d4; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-heading h1 { margin: 5px 0 6px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(29px, 3vw, 43px); font-weight: 500; letter-spacing: -.04em; line-height: 1.08; }
.page-heading p { margin: 0; color: var(--muted); font-size: 14px; }
.back-link { display: inline-flex; margin-bottom: 22px; color: var(--plum); font-size: 13px; font-weight: 700; }
.muted { color: var(--muted); }

.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 18px; border: 1px solid transparent; border-radius: 12px; cursor: pointer; font-size: 13px; font-weight: 750; transition: transform .15s ease, background .15s ease, box-shadow .15s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: #fff; background: var(--plum); box-shadow: 0 8px 18px rgba(111,61,88,.18); }
.button.primary:hover { background: var(--plum-dark); }
.button.ghost { border-color: var(--line); background: #fff; }
.button.soft { color: var(--plum); background: var(--rose-soft); }
.button.success { color: #fff; background: var(--success); }
.button.danger-ghost { color: var(--danger); border-color: #ecd2d6; background: #fff8f8; }
.button.compact { min-height: 35px; padding: 0 13px; font-size: 12px; border-radius: 10px; }
.button.wide { width: 100%; }
.text-link { border: 0; padding: 0; color: var(--plum); background: none; font-size: 12px; font-weight: 750; cursor: pointer; }
.text-link.danger { color: var(--danger); }
.icon-button { width: 35px; height: 35px; display: inline-grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
.icon-button:hover { color: var(--plum); background: var(--rose-soft); }

.panel { padding: 24px; border: 1px solid rgba(111,61,88,.09); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-small); }
.panel.slim { padding: 14px 18px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.panel-heading h2, .panel h2 { margin: 4px 0 0; font-family: Georgia, serif; font-size: 22px; font-weight: 500; letter-spacing: -.02em; }
.panel-heading > a { color: var(--plum); font-size: 12px; font-weight: 750; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.metric-card { min-height: 146px; position: relative; overflow: hidden; display: flex; align-items: flex-start; gap: 15px; padding: 22px; border: 1px solid rgba(111,61,88,.07); border-radius: 20px; }
.metric-card::after { content: ""; width: 95px; height: 95px; position: absolute; right: -30px; bottom: -35px; border-radius: 50%; background: rgba(255,255,255,.35); }
.metric-card.rose { background: #f8e8ed; }
.metric-card.plum { color: #fff; background: var(--plum); }
.metric-card.sand { background: var(--sand); }
.metric-card.sage { background: var(--sage); }
.metric-icon { width: 37px; height: 37px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; background: rgba(255,255,255,.65); font-weight: 900; }
.metric-card.plum .metric-icon { background: rgba(255,255,255,.14); }
.metric-card > div { display: grid; gap: 3px; min-width: 0; }
.metric-card small { opacity: .72; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.metric-card strong { margin-top: 3px; font-family: Georgia, serif; font-size: clamp(26px, 2.3vw, 34px); font-weight: 500; letter-spacing: -.03em; }
.metric-card p { margin: 2px 0 0; opacity: .72; font-size: 11px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .8fr); gap: 22px; }
.dashboard-side { display: grid; gap: 22px; align-content: start; }
.schedule-panel { min-height: 480px; }
.timeline { display: grid; }
.timeline-item { display: grid; grid-template-columns: 55px 12px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 15px 4px; border-bottom: 1px solid #f1e9ec; }
.timeline-item:hover strong { color: var(--plum); }
.timeline-item time { font-family: Georgia, serif; font-size: 17px; }
.timeline-dot { width: 10px; height: 10px; border: 3px solid #fff; border-radius: 50%; background: var(--rose); box-shadow: 0 0 0 1px var(--rose); }
.timeline-item div { min-width: 0; }
.timeline-item div > strong { font-size: 14px; }
.timeline-item p { overflow: hidden; margin: 3px 0 0; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.finance-total { display: block; margin-top: 4px; color: var(--plum); font-family: Georgia, serif; font-size: 34px; font-weight: 500; }
.finance-card > p { margin: 4px 0 20px; color: var(--muted); font-size: 12px; }
.fine-row { display: flex; justify-content: space-between; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12px; }
.mini-appointment { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f1e9ec; }
.mini-appointment:last-child { border-bottom: 0; }
.mini-appointment time { width: 44px; height: 48px; display: grid; place-items: center; align-content: center; border-radius: 11px; color: var(--plum); background: var(--rose-soft); }
.mini-appointment time strong { font-size: 18px; line-height: 1; }
.mini-appointment time small { font-size: 9px; text-transform: uppercase; }
.mini-appointment > div { min-width: 0; display: grid; gap: 3px; }
.mini-appointment > div strong { font-size: 12px; }
.mini-appointment > div small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.empty-state { min-height: 320px; display: grid; place-items: center; align-content: center; text-align: center; }
.empty-state > span { width: 55px; height: 55px; display: grid; place-items: center; border-radius: 18px; color: var(--rose); background: var(--rose-soft); font-size: 25px; }
.empty-state h3 { margin: 15px 0 5px; font-family: Georgia, serif; font-size: 21px; font-weight: 500; }
.empty-state p { margin: 0 0 16px; color: var(--muted); font-size: 12px; }
.empty-state.full { grid-column: 1/-1; min-height: 260px; }

.badge { min-height: 25px; display: inline-flex; align-items: center; justify-content: center; padding: 0 9px; border-radius: 999px; color: var(--muted); background: #f1ecee; font-size: 9px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.badge.active, .badge.realizado, .badge.enviada, .badge.recebida { color: #2e6751; background: #e2f1e9; }
.badge.inactive, .badge.cancelado, .badge.nao_compareceu, .badge.cancelada, .badge.falha { color: #9b4350; background: #f8e4e7; }
.badge.agendado, .badge.pending, .badge.programada, .badge.confirmation { color: #7b5262; background: #f5e6eb; }
.badge.large { min-height: 34px; padding: 0 14px; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.search-form { flex: 1; display: flex; align-items: center; gap: 10px; }
.search-form > span { color: var(--muted); font-size: 19px; }
.search-form input { width: min(430px, 100%); border: 0; outline: 0; background: transparent; }
.result-count { color: var(--muted); font-size: 11px; font-weight: 700; }
.table-panel { padding: 0; overflow: hidden; }
.table-panel > .panel-heading { padding: 24px 24px 0; }
.responsive-table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 13px 20px; color: #8c8188; background: #fcfafb; font-size: 9px; letter-spacing: .09em; text-align: left; text-transform: uppercase; }
td { padding: 16px 20px; border-top: 1px solid #f0e8eb; color: #5f565d; font-size: 12px; }
td strong { color: var(--ink); }
.actions-cell { text-align: right; white-space: nowrap; }
.actions-cell form, .actions-cell button, .actions-cell a { display: inline-grid; }
.person-cell { display: inline-flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: var(--plum); background: var(--rose-soft); font-family: Georgia, serif; font-size: 15px; }
.avatar.small { width: 30px; height: 30px; font-size: 12px; }
.empty-row { height: 130px; text-align: center; color: var(--muted); }

.service-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.service-card { padding: 23px; border: 1px solid rgba(111,61,88,.09); border-radius: 20px; background: #fff; box-shadow: var(--shadow-small); }
.service-card.disabled { opacity: .62; }
.service-top { display: flex; justify-content: space-between; align-items: center; }
.service-symbol { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 13px; color: var(--plum); background: var(--rose-soft); }
.service-card h2 { margin: 19px 0 5px; font-family: Georgia, serif; font-size: 22px; font-weight: 500; }
.service-card > strong { color: var(--plum); font-family: Georgia, serif; font-size: 25px; font-weight: 500; }
.service-card > p { margin: 5px 0 20px; color: var(--muted); font-size: 11px; }
.card-actions { display: flex; align-items: center; gap: 8px; padding-top: 15px; border-top: 1px solid #f0e8eb; }
.info-banner { display: flex; align-items: center; gap: 12px; margin-top: 22px; padding: 15px 18px; border: 1px solid #e7d8de; border-radius: 15px; color: #684e5a; background: #f9f1f4; }
.info-banner > span { width: 25px; height: 25px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid #d7b8c4; border-radius: 50%; font-family: Georgia, serif; }
.info-banner p { margin: 0; font-size: 11px; line-height: 1.55; }

.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.calendar-navigation { display: flex; align-items: center; gap: 12px; }
.calendar-navigation > div { display: grid; min-width: 145px; }
.calendar-navigation strong { font-size: 13px; }
.calendar-navigation input { min-height: 35px; border: 1px solid var(--line); border-radius: 9px; padding: 0 8px; background: #fff; }
.calendar-legend { display: flex; align-items: center; gap: 15px; color: var(--muted); font-size: 10px; }
.calendar-legend span { display: flex; align-items: center; gap: 6px; }
.view-switch { display: flex; gap: 3px; padding: 3px; border-radius: 10px; background: #f1e9ec; }
.view-switch a { padding: 7px 11px; border-radius: 8px; color: var(--muted); font-size: 10px; font-weight: 750; }
.view-switch a.active { color: var(--plum); background: #fff; box-shadow: 0 3px 8px rgba(74,42,59,.08); }
.agenda-filters { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: -5px 0 15px; }
.agenda-filters form { display: flex; align-items: center; gap: 8px; }
.agenda-filters input, .agenda-filters select { width: auto; min-height: 35px; font-size: 10px; }
.agenda-filters input { width: 190px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.legend-dot.booked { background: var(--rose); }.legend-dot.done { background: var(--success); }.legend-dot.cancelled { background: #bd6670; }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(132px, 1fr)); gap: 8px; overflow-x: auto; padding-bottom: 8px; }
.day-column { min-height: 545px; padding: 10px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.7); }
.dia-grid { grid-template-columns: minmax(280px, 760px); }
.dia-grid .day-column { min-height: 500px; }
.mes-grid { grid-template-columns: repeat(7, minmax(120px, 1fr)); }
.mes-grid .day-column { min-height: 225px; }
.mes-grid .day-column > header { min-height: 65px; }
.mes-grid .appointment-card { min-height: 74px; padding: 9px; }
.mes-grid .appointment-card p { display: none; }
.day-column.today { border-color: #cfa7b5; box-shadow: inset 0 3px 0 var(--rose); }
.day-column > header { min-height: 86px; display: grid; place-items: center; align-content: center; gap: 1px; border-bottom: 1px solid #efe5e8; }
.day-column > header span { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.day-column > header strong { font-family: Georgia, serif; font-size: 25px; font-weight: 500; }
.day-column > header small { color: #9d9298; font-size: 9px; }
.day-slots { display: grid; gap: 8px; padding-top: 10px; }
.appointment-card { min-height: 112px; padding: 12px; border-left: 3px solid var(--rose); border-radius: 11px; background: #f9edf1; transition: transform .15s ease; }
.appointment-card:hover { transform: translateY(-2px); }
.appointment-card.realizado { border-color: var(--success); background: #eaf4ef; }
.appointment-card.cancelado, .appointment-card.nao_compareceu { border-color: #b85c69; background: #f7e9eb; opacity: .68; }
.appointment-card time { display: block; margin-bottom: 8px; color: var(--plum); font-size: 9px; font-weight: 850; }
.appointment-card strong { font-size: 11px; }
.appointment-card p { display: -webkit-box; overflow: hidden; margin: 4px 0 8px; color: var(--muted); font-size: 9px; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.appointment-card > small { font-weight: 800; font-size: 9px; }
.free-day { min-height: 115px; display: grid; place-items: center; align-content: center; color: #b8adb2; }
.free-day span { font-size: 21px; }.free-day small { font-size: 9px; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(290px, .75fr); gap: 20px; }
.detail-main, .detail-side { display: grid; gap: 20px; align-content: start; }
.summary-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.summary-list > div { display: grid; gap: 4px; }
.summary-list small, .charge-row small, .charge-values small { color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.summary-list strong { font-size: 12px; line-height: 1.45; }
.status-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.charge-row { display: grid; grid-template-columns: 100px repeat(3, 1fr) auto; align-items: center; gap: 15px; padding: 15px 0; border-top: 1px solid var(--line); }
.charge-row:first-of-type { border-top: 0; }
.charge-row > div { display: grid; gap: 3px; }
.charge-type { width: fit-content; padding: 6px 9px; border-radius: 8px; color: var(--plum); background: var(--rose-soft); font-size: 9px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.charge-type.multa { color: #98583b; background: #faebdf; }
.stack-form { display: grid; gap: 10px; margin-top: 16px; }
.history-list { display: grid; margin-top: 18px; }
.history-list > div { position: relative; display: grid; grid-template-columns: 12px 1fr; gap: 10px; padding-bottom: 17px; }
.history-list > div::before { content: ""; width: 1px; position: absolute; top: 10px; bottom: 0; left: 4px; background: #eadde2; }
.history-list > div:last-child::before { display: none; }
.history-list > div > span { width: 9px; height: 9px; margin-top: 3px; border: 2px solid #fff; border-radius: 50%; background: var(--rose); box-shadow: 0 0 0 1px var(--rose); }
.history-list p { display: grid; gap: 3px; margin: 0; }
.history-list strong { font-size: 10px; line-height: 1.4; }.history-list small { color: var(--muted); font-size: 9px; }
.message-list { display: grid; gap: 10px; margin-top: 16px; }
.message-list > div { display: grid; grid-template-columns: auto 1fr; gap: 4px 8px; padding: 10px; border-radius: 11px; background: #faf6f7; }
.message-list p { margin: 0; font-size: 10px; font-weight: 750; }.message-list small { grid-column: 2; color: var(--muted); font-size: 9px; }

.filter-tabs { width: fit-content; display: flex; gap: 4px; margin: -8px 0 20px; padding: 4px; border-radius: 12px; background: #efe7ea; }
.filter-tabs a { padding: 8px 14px; border-radius: 9px; color: var(--muted); font-size: 11px; font-weight: 750; }
.filter-tabs a.active { color: var(--plum); background: #fff; box-shadow: 0 3px 10px rgba(74,42,59,.08); }
.charge-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.charge-card-top { display: flex; align-items: center; justify-content: space-between; }
.charge-card h2 { margin: 18px 0 4px; }
.charge-card > p { margin: 0 0 18px; color: var(--muted); font-size: 10px; }
.charge-values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; padding: 14px; border-radius: 13px; background: #faf6f7; }
.charge-values > div { display: grid; gap: 4px; }.charge-values strong { font-size: 12px; }
.section-gap { margin-top: 22px; }

.compact-metrics .metric-card { min-height: 130px; }
.reports-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.chart-panel { min-height: 360px; }
.bar-chart { height: 235px; display: flex; align-items: stretch; justify-content: space-around; gap: 12px; padding: 20px 8px 0; border-bottom: 1px solid var(--line); }
.bar-item { min-width: 50px; flex: 1; display: grid; grid-template-rows: 18px 1fr 20px; justify-items: center; gap: 5px; }
.bar-value { color: var(--muted); font-size: 8px; }
.bar-track { width: min(42px, 80%); position: relative; display: flex; align-items: end; border-radius: 8px 8px 0 0; background: #f8eef1; }
.bar-track i { width: 100%; min-height: 5px; display: block; border-radius: 8px 8px 2px 2px; background: linear-gradient(180deg, var(--rose), var(--plum)); }
.bar-item small { color: var(--muted); font-size: 9px; }
.chart-note { margin: 14px 0 0; color: var(--muted); font-size: 9px; }
.ranking-list { display: grid; gap: 13px; }
.ranking-list > div { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 11px; }
.ranking-list > div > span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 8px; color: var(--plum); background: var(--rose-soft); font-size: 10px; font-weight: 800; }
.ranking-list p { display: grid; gap: 5px; margin: 0; }
.ranking-list p strong { font-size: 11px; }.ranking-list p small { color: var(--muted); font-size: 9px; }
.ranking-list i { height: 4px; overflow: hidden; border-radius: 5px; background: #f1e7ea; }.ranking-list i b { height: 100%; display: block; border-radius: 5px; background: var(--rose); }
.ranking-list > div > small { font-size: 11px; font-weight: 800; }.ranking-list > div > a { color: var(--plum); }
.pending-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); }
.pending-row > div { min-width: 0; flex: 1; display: grid; gap: 2px; }.pending-row > div strong { font-size: 11px; }.pending-row > div small { color: var(--muted); font-size: 9px; }.pending-row > strong { font-size: 11px; }
.forecast-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.forecast-grid > div { padding: 17px; border-radius: 14px; background: #faf5f7; }
.forecast-grid small { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.forecast-grid strong { display: block; margin: 8px 0 4px; color: var(--plum); font-family: Georgia, serif; font-size: 25px; font-weight: 500; }
.forecast-grid p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
td form { display: inline; }

.modal { width: min(560px, calc(100% - 28px)); max-height: calc(100vh - 28px); padding: 0; border: 0; border-radius: 22px; color: var(--ink); background: #fff; box-shadow: 0 28px 90px rgba(42,20,33,.28); }
.modal.modal-wide { width: min(720px, calc(100% - 28px)); }
.modal::backdrop { background: rgba(43,28,37,.52); backdrop-filter: blur(3px); }
.modal > form { padding: 25px; }
.modal-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.modal-heading h2 { margin: 4px 0 0; font-family: Georgia, serif; font-size: 27px; font-weight: 500; }
.modal-heading > button { width: 34px; height: 34px; border: 0; border-radius: 50%; color: var(--muted); background: #f5eff1; cursor: pointer; font-size: 20px; }
.modal label, .login-card label, .stack-form label { display: grid; gap: 7px; margin-bottom: 15px; font-size: 11px; font-weight: 750; }
input, select, textarea { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid #dfd3d8; border-radius: 11px; color: var(--ink); background: #fff; outline: none; transition: border .15s, box-shadow .15s; }
textarea { padding-top: 11px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--rose); box-shadow: 0 0 0 3px rgba(196,125,145,.12); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.form-hint { margin: -4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.optional { color: var(--muted); font-weight: 500; }
.check-row { display: flex !important; grid-template-columns: auto 1fr; align-items: center; gap: 9px !important; font-weight: 500 !important; }
.check-row input { width: 17px; min-height: 17px; accent-color: var(--plum); }
.service-picker { margin: 4px 0 15px; padding: 0; border: 0; }
.service-picker legend { margin-bottom: 8px; font-size: 11px; font-weight: 750; }
.service-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.service-option { min-height: 58px; display: flex !important; align-items: center; gap: 9px !important; margin: 0 !important; padding: 10px; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; }
.service-option:has(input:checked) { border-color: var(--rose); background: var(--blush); }
.service-option input { width: 16px; min-height: 16px; accent-color: var(--plum); }
.service-option span { display: grid; gap: 2px; }.service-option strong { font-size: 10px; }.service-option small { color: var(--muted); font-size: 9px; }
.appointment-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 15px; padding: 14px; border-radius: 13px; background: var(--sand); }
.appointment-summary > div { display: grid; gap: 4px; }.appointment-summary small { color: var(--muted); font-size: 8px; text-transform: uppercase; }.appointment-summary strong { font-size: 11px; }
.balance-callout { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; padding: 14px; border-radius: 13px; background: var(--rose-soft); }.balance-callout small { font-weight: 750; }.balance-callout strong { color: var(--plum); font-family: Georgia, serif; font-size: 22px; }

.flash-stack { position: fixed; top: 100px; right: 26px; z-index: 80; width: min(390px, calc(100% - 36px)); display: grid; gap: 8px; }
.flash { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 15px; border: 1px solid #e5d7dc; border-radius: 13px; color: #624954; background: #fff; box-shadow: var(--shadow); font-size: 11px; font-weight: 650; }
.flash.success { border-color: #c9e3d7; color: #2f624e; background: #eef8f3; }.flash.error { border-color: #eccfd4; color: #8d3f4b; background: #fff3f4; }.flash.warning { border-color: #ecd9bc; color: #8a5a28; background: #fff8ee; }
.flash button { border: 0; background: none; cursor: pointer; font-size: 19px; }

.login-body { min-height: 100vh; background: #fff; }
.login-layout { min-height: 100vh; display: grid; grid-template-columns: 1.08fr .92fr; }
.login-visual { min-height: 100vh; position: relative; overflow: hidden; display: flex; flex-direction: column; padding: clamp(35px, 6vw, 76px); color: #fff; background: linear-gradient(145deg, #543048, #7e4a64); }
.login-visual::before, .login-visual::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,.1); }
.login-visual::before { width: 520px; height: 520px; right: -170px; top: -170px; box-shadow: 0 0 0 70px rgba(255,255,255,.025), 0 0 0 140px rgba(255,255,255,.018); }
.login-visual::after { width: 270px; height: 270px; left: -100px; bottom: -80px; background: rgba(255,255,255,.025); }
.login-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 13px; font-family: Georgia, serif; font-size: 26px; }
.login-copy { position: relative; z-index: 1; max-width: 620px; margin: auto 0; }
.login-copy h1 { margin: 12px 0 18px; font-family: Georgia, serif; font-size: clamp(44px, 5vw, 72px); font-weight: 400; letter-spacing: -.05em; line-height: .98; }
.login-copy p { max-width: 520px; margin: 0; color: #eadde3; font-size: 16px; line-height: 1.65; }
.login-quote { position: relative; z-index: 1; color: #d8c2cc; font-family: Georgia, serif; font-style: italic; font-size: 14px; }
.login-panel { display: grid; place-items: center; padding: 35px; background: #fffafa; }
.login-card { width: min(410px, 100%); padding: 38px; border: 1px solid var(--line); border-radius: 25px; background: #fff; box-shadow: var(--shadow); }
.login-card h2 { margin: 8px 0 7px; font-family: Georgia, serif; font-size: 32px; font-weight: 500; }.login-card > p { margin: 0 0 24px; color: var(--muted); font-size: 12px; }.login-card > small { display: block; margin-top: 15px; color: var(--muted); font-size: 9px; text-align: center; }.mobile-login-logo { display: none; }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .service-grid, .charge-grid { grid-template-columns: repeat(2, 1fr); }
  .week-grid { grid-template-columns: repeat(7, 150px); }
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { width: 260px; position: fixed; transform: translateX(-105%); transition: transform .2s ease; box-shadow: 15px 0 50px rgba(35,18,28,.25); }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu { display: block; }
  .topbar { height: 74px; }
  .topbar-greeting .eyebrow { display: none; }
  .dashboard-grid, .detail-grid { grid-template-columns: 1fr; }
  .dashboard-side { grid-template-columns: 1fr 1fr; }
  .login-layout { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-panel { min-height: 100vh; }
  .mobile-login-logo { display: block; margin-bottom: 25px; color: var(--plum); font-family: Georgia, serif; font-size: 26px; }
}

@media (max-width: 680px) {
  .content { padding: 26px 16px 45px; }
  .topbar { padding: 0 16px; }
  .topbar-actions .today-pill { display: none; }
  .topbar-actions .button { min-height: 37px; padding: 0 11px; font-size: 10px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-heading .button { width: 100%; }
  .metric-grid, .dashboard-side, .service-grid, .charge-grid, .reports-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 125px; }
  .toolbar, .calendar-toolbar { align-items: stretch; flex-direction: column; }
  .search-form { flex-wrap: wrap; }.search-form input { flex: 1; min-width: 180px; }
  .calendar-legend { flex-wrap: wrap; }
  .agenda-filters { align-items: stretch; flex-direction: column; }
  .agenda-filters form { flex-wrap: wrap; }
  .summary-list { grid-template-columns: 1fr 1fr; }
  .charge-row { grid-template-columns: 1fr 1fr; }.charge-row .charge-type, .charge-row .button, .charge-row .badge { grid-column: span 2; }
  .form-grid, .service-options { grid-template-columns: 1fr; }
  .modal > form { padding: 20px; }
  .modal-actions { flex-direction: column-reverse; }.modal-actions .button { width: 100%; }
  .appointment-summary { grid-template-columns: 1fr; }
  .login-panel { padding: 16px; }.login-card { padding: 27px 22px; }
  .flash-stack { top: 82px; right: 18px; }
}

@media print {
  .sidebar, .topbar, .heading-actions, .button, .filter-tabs { display: none !important; }
  .app-shell { display: block; }.content { max-width: none; padding: 0; }.panel, .metric-card { box-shadow: none; break-inside: avoid; }
}
