:root {
    --bg: #f5f6f8;
    --surface: #ffffff;
    --surface-alt: #eef1f4;
    --text: #17202a;
    --muted: #68727d;
    --line: #dfe3e8;
    --brand: #b7791f;
    --brand-dark: #8b5a17;
    --nav: #14191f;
    --success: #267a4a;
    --danger: #b63b3b;
    --shadow: 0 12px 35px rgba(15, 23, 42, .08);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    color: #fff;
    background: var(--nav);
    border-bottom: 1px solid #2b333c;
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; letter-spacing: -.02em; }
.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    color: #1b1b1b;
    background: #d8a74f;
    font-size: .78rem;
    font-weight: 900;
}
.brand-mark-large { width: 50px; height: 50px; border-radius: 14px; }
.topbar-user { display: flex; align-items: center; gap: 18px; text-align: right; }
.topbar-user span { display: grid; }
.topbar-user small { color: #aeb7c2; }

.app-shell { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: calc(100vh - 68px); }
.sidebar { padding: 30px 18px; color: #d5dbe2; background: #1c232b; }
.sidebar-label { margin: 0 12px 20px; color: #8f9aa7; font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.sidebar a { display: block; margin-bottom: 5px; padding: 11px 13px; border-radius: 9px; font-weight: 650; }
.sidebar a:hover { color: #fff; background: #2a333d; }
.content { min-width: 0; padding: 34px; }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.page-heading.compact { margin-bottom: 18px; }
.page-heading h1 { margin: 2px 0 3px; font-size: clamp(1.8rem, 4vw, 2.45rem); line-height: 1.1; letter-spacing: -.04em; }
.page-heading p { margin: 0; color: var(--muted); }
.page-heading .eyebrow, .eyebrow { color: var(--brand-dark); font-size: .76rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.heading-actions { display: flex; align-items: center; gap: 10px; }

.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 24px; }
.metric-card { display: grid; gap: 10px; min-height: 130px; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow); }
.metric-card span { color: var(--muted); font-weight: 650; }
.metric-card strong { align-self: end; font-size: 2rem; letter-spacing: -.04em; }
.metric-card.accent { color: #fff; background: linear-gradient(135deg, #9b671e, #c38a32); border: 0; }
.metric-card.accent span { color: #fff7e7; }

.panel, .form-card, .login-card { background: var(--surface); border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 22px 24px 15px; }
.panel-heading h2 { margin: 0 0 2px; font-size: 1.15rem; }
.panel-heading p { margin: 0; color: var(--muted); }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px 18px; border-top: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); background: #fafbfc; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; }
.table-detail { display: block; max-width: 280px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; }
.empty-state { padding: 42px; color: var(--muted); text-align: center; }

.badge { display: inline-flex; padding: 5px 9px; border-radius: 999px; font-size: .72rem; font-weight: 800; background: var(--surface-alt); }
.badge-confirmado, .badge-concluido { color: #17663a; background: #dcf4e7; }
.badge-agendado { color: #665115; background: #fff2c7; }
.badge-em_atendimento { color: #174b78; background: #dceeff; }
.badge-cancelado, .badge-faltou { color: #923535; background: #fde4e4; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 9px 15px; border: 1px solid transparent; border-radius: 9px; cursor: pointer; font-weight: 750; }
.btn-primary { color: #fff; background: var(--brand); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-success { color: #fff; background: var(--success); }
.btn-success:hover { background: #1e623b; }
.btn-secondary { color: var(--text); background: var(--surface-alt); border-color: var(--line); }
.btn-danger { color: #fff; background: var(--danger); }
.btn-danger:hover { background: #922f2f; }
.btn-outline-danger { color: var(--danger); background: #fff; border-color: #e5abab; }
.btn-outline-danger:hover { color: #fff; background: var(--danger); }
.btn-ghost { min-height: 34px; padding: 5px 11px; color: #fff; background: transparent; border-color: #48525e; }
.btn-block { width: 100%; }
.text-link { color: var(--brand-dark); font-weight: 800; }
.row-actions { display: flex; align-items: center; gap: 12px; }
.link-danger { padding: 0; color: var(--danger); background: none; border: 0; cursor: pointer; font-weight: 750; }

.form-card { max-width: 720px; padding: 26px; }
.form-stack { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.field label { font-size: .88rem; font-weight: 800; }
.field-checkbox { grid-template-columns: auto 1fr; align-items: center; }
.field-checkbox label { order: 2; }
.form-control, .login-card input, .search-bar input { width: 100%; min-height: 44px; padding: 10px 12px; color: var(--text); background: #fff; border: 1px solid #cdd3da; border-radius: 9px; outline: none; }
textarea.form-control { min-height: 90px; resize: vertical; }
.form-control:focus, .login-card input:focus, .search-bar input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(183, 121, 31, .13); }
.form-check { width: 18px; height: 18px; }
.help-text { color: var(--muted); }
.field-error { color: var(--danger); font-weight: 700; }
.form-errors { padding: 12px 14px; color: #832d2d; background: #fde7e7; border-radius: 9px; }
.form-errors ul { margin: 0; padding-left: 18px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 8px; }

.search-bar { display: flex; gap: 10px; padding: 18px; }
.search-bar input { max-width: 420px; }
.pagination { display: flex; justify-content: center; gap: 18px; margin: 22px 0; color: var(--muted); }
.pagination a { color: var(--brand-dark); font-weight: 800; }
.messages { display: grid; gap: 8px; margin-bottom: 18px; }
.message { padding: 12px 14px; border-radius: 9px; background: #e8eef6; }
.message-success { color: #1d613b; background: #dff3e8; }
.message-error { color: #832d2d; background: #fde7e7; }

.agenda-controls { margin-bottom: 16px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.agenda-filters { display: grid; grid-template-columns: minmax(170px, .8fr) repeat(2, minmax(190px, 1fr)) auto; align-items: end; gap: 14px; }
.agenda-filter-actions { display: flex; align-items: center; gap: 13px; min-height: 44px; }
.agenda-navigation { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 18px; margin-bottom: 14px; padding: 12px 0; }
.agenda-period-nav { display: flex; align-items: center; gap: 8px; }
.icon-button { display: inline-grid; place-items: center; width: 42px; height: 42px; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 9px; font-size: 1.7rem; font-weight: 500; }
.agenda-period-title { display: grid; text-align: center; }
.agenda-period-title strong { font-size: 1.05rem; text-transform: capitalize; }
.agenda-period-title span { color: var(--muted); font-size: .82rem; }
.view-switch { justify-self: end; display: inline-flex; padding: 3px; background: #e5e9ed; border-radius: 10px; }
.view-switch a { min-width: 78px; padding: 7px 12px; border-radius: 8px; color: var(--muted); text-align: center; font-weight: 800; }
.view-switch a.active { color: var(--text); background: #fff; box-shadow: 0 2px 7px rgba(15, 23, 42, .1); }
.status-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 14px; color: var(--muted); font-size: .76rem; font-weight: 700; }
.status-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; }
.status-color-agendado { background: #d69e2e; }
.status-color-confirmado { background: #3182ce; }
.status-color-em_atendimento { background: #7158c7; }
.status-color-concluido { background: #29905a; }
.status-color-cancelado { background: #89929d; }
.status-color-faltou { background: #cf4b4b; }

.agenda-day-scroll, .agenda-week-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.agenda-day-canvas { min-width: var(--agenda-min-width); }
.agenda-grid-header, .agenda-grid-body { display: grid; grid-template-columns: 72px repeat(var(--column-count), minmax(220px, 1fr)); }
.agenda-grid-header { position: sticky; top: 68px; z-index: 10; min-height: 64px; background: #fff; border-bottom: 1px solid var(--line); }
.agenda-time-corner { display: grid; place-items: center; color: var(--muted); background: #fafbfc; border-right: 1px solid var(--line); font-size: .7rem; font-weight: 800; text-transform: uppercase; }
.professional-heading { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-right: 1px solid var(--line); }
.professional-heading:last-child { border-right: 0; }
.professional-heading div { display: grid; min-width: 0; }
.professional-heading strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.professional-heading small { color: var(--muted); }
.professional-avatar { display: inline-grid; flex: 0 0 auto; place-items: center; width: 36px; height: 36px; color: #fff; background: #384553; border-radius: 50%; font-weight: 850; }
.agenda-grid-body { height: var(--grid-height); }
.agenda-time-axis { position: relative; height: var(--grid-height); background: #fafbfc; border-right: 1px solid var(--line); }
.agenda-time-axis span { position: absolute; top: var(--top); right: 10px; transform: translateY(-50%); color: var(--muted); font-size: .7rem; font-weight: 700; }
.professional-day-column { position: relative; height: var(--grid-height); border-right: 1px solid var(--line); background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--hour-step) - 1px), #e6e9ed calc(var(--hour-step) - 1px), #e6e9ed var(--hour-step)); }
.professional-day-column:last-child { border-right: 0; }
.appointment-card { position: absolute; top: var(--top); right: 6px; left: 6px; z-index: 2; display: grid; align-content: start; min-height: 24px; height: var(--height); padding: 6px 8px; overflow: hidden; border: 1px solid transparent; border-left-width: 4px; border-radius: 7px; box-shadow: 0 2px 6px rgba(15, 23, 42, .08); font-size: .74rem; line-height: 1.25; }
.appointment-card strong, .appointment-card span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appointment-card small { margin-top: 2px; font-size: .64rem; font-weight: 800; text-transform: uppercase; }
.appointment-card:hover { z-index: 4; filter: brightness(.98); box-shadow: 0 5px 12px rgba(15, 23, 42, .15); }
.status-card-agendado { color: #634b0b; background: #fff3cc; border-color: #d69e2e; }
.status-card-confirmado { color: #174b78; background: #dceeff; border-color: #3182ce; }
.status-card-em_atendimento { color: #453286; background: #ece7ff; border-color: #7158c7; }
.status-card-concluido { color: #185c38; background: #dcefe4; border-color: #29905a; }
.status-card-cancelado { color: #59616b; background: #edf0f2; border-color: #89929d; opacity: .72; }
.status-card-faltou { color: #812d2d; background: #fbe2e2; border-color: #cf4b4b; }

.agenda-week-grid { display: grid; grid-template-columns: repeat(7, minmax(190px, 1fr)); min-width: 1330px; }
.week-day { min-height: 470px; border-right: 1px solid var(--line); }
.week-day:last-child { border-right: 0; }
.week-day > header { display: flex; align-items: center; justify-content: space-between; min-height: 66px; padding: 12px; background: #fafbfc; border-bottom: 1px solid var(--line); }
.week-day > header span { color: var(--muted); font-size: .72rem; font-weight: 850; text-transform: uppercase; }
.week-day > header strong { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; font-size: 1.05rem; }
.week-day.today > header strong { color: #fff; background: var(--brand); }
.week-day-events { display: grid; align-content: start; gap: 8px; padding: 9px; }
.week-appointment { display: grid; gap: 2px; padding: 9px; border: 1px solid transparent; border-left-width: 4px; border-radius: 8px; font-size: .75rem; }
.week-appointment span, .week-appointment small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.week-appointment small { opacity: .78; }
.week-empty { margin: 20px 0; color: #a0a8b1; text-align: center; font-size: .76rem; }
.agenda-empty { padding: 60px 24px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.agenda-empty h2 { margin: 0; }
.agenda-empty p { color: var(--muted); }

.back-link { display: inline-block; margin-bottom: 17px; color: var(--brand-dark); font-weight: 800; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 18px; }
.team-card { display: grid; gap: 20px; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow); }
.team-card.inactive { opacity: .72; }
.team-card > header { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; }
.team-card h2 { margin: 0; font-size: 1.08rem; }
.team-card header p { margin: 1px 0 0; color: var(--muted); }
.team-avatar { display: inline-grid; place-items: center; width: 46px; height: 46px; color: #fff; background: #384553; border-radius: 13px; font-size: 1.1rem; font-weight: 850; }
.team-avatar.large { width: 58px; height: 58px; border-radius: 16px; font-size: 1.35rem; }
.team-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 0; overflow: hidden; background: var(--line); border: 1px solid var(--line); border-radius: 10px; }
.team-summary div { padding: 12px; background: #fafbfc; }
.team-summary dt { color: var(--muted); font-size: .7rem; font-weight: 800; text-transform: uppercase; }
.team-summary dd { margin: 3px 0 0; font-size: 1.15rem; font-weight: 850; }
.team-summary dd.summary-text { font-size: .92rem; }
.team-next-block { display: grid; margin: 0; padding: 11px; color: #5f4b12; background: #fff7db; border-radius: 9px; font-size: .78rem; }
.team-next-block.muted { color: var(--muted); background: #f4f6f8; }
.team-empty { grid-column: 1 / -1; }
.team-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.team-actions .btn { min-height: 39px; padding: 7px 11px; font-size: .78rem; }
.team-actions form { margin-left: auto; }
.employee-form-card { max-width: 780px; }
.employee-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.employee-form-grid .field:not(.field-half) { grid-column: 1 / -1; }
.employee-help ul { margin: 5px 0 0; padding-left: 18px; }
.employee-password-note { margin: 0; padding: 11px 13px; color: var(--muted); background: #f4f6f8; border-radius: 9px; font-size: .8rem; }
.professional-title { display: flex; align-items: center; gap: 14px; }
.professional-title h1 { margin-top: 2px; }
.availability-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(340px, .8fr); gap: 20px; align-items: start; }
.weekly-schedule { border-top: 1px solid var(--line); }
.schedule-day { display: grid; grid-template-columns: 130px 1fr; gap: 14px; min-height: 70px; padding: 13px 20px; border-bottom: 1px solid var(--line); }
.schedule-day:last-child { border-bottom: 0; }
.schedule-day > strong { padding-top: 8px; font-size: .82rem; }
.schedule-periods { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.schedule-period { display: flex; align-items: center; gap: 10px; padding: 8px 10px; color: #174b36; background: #e2f2e9; border: 1px solid #b9dfc9; border-radius: 9px; font-size: .78rem; font-weight: 800; }
.schedule-period.inactive { color: var(--muted); background: #eff1f3; border-color: var(--line); }
.schedule-period small { color: var(--muted); }
.day-off { padding: 8px 0; color: #9aa2ab; font-size: .78rem; }
.compact-actions { display: inline-flex; gap: 8px; margin-left: auto; font-size: .72rem; font-weight: 800; }
.compact-actions a { color: var(--brand-dark); }
.compact-actions a.danger { color: var(--danger); }
.blocks-list { display: grid; border-top: 1px solid var(--line); }
.block-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 14px 17px; border-bottom: 1px solid var(--line); }
.block-item:last-child { border-bottom: 0; }
.block-item p { margin: 2px 0 0; color: var(--muted); font-size: .76rem; }
.block-date { display: grid; place-items: center; width: 45px; height: 48px; color: #7c2f2f; background: #fbe7e7; border-radius: 9px; line-height: 1; }
.block-date strong { font-size: 1.1rem; }
.block-date small { font-size: .64rem; font-weight: 800; text-transform: uppercase; }
.empty-inline { padding: 35px 20px; color: var(--muted); text-align: center; }
.empty-inline p { margin: 0 0 5px; }
.delete-card { width: min(100%, 590px); margin: 45px auto; padding: 32px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.delete-card h1 { margin: 3px 0 15px; }
.delete-card > p { color: var(--muted); }
.delete-icon { display: inline-grid; place-items: center; width: 52px; height: 52px; color: #fff; background: var(--danger); border-radius: 50%; font-size: 1.45rem; font-weight: 900; }
.delete-warning { margin: 22px 0; padding: 11px; background: #fff0f0; border-radius: 9px; font-size: .82rem; }
.delete-card .form-actions { justify-content: center; }

.barber-day-heading { align-items: center; }
.barber-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    margin-bottom: 20px;
    overflow: hidden;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: 15px;
    box-shadow: var(--shadow);
}
.barber-summary article { display: grid; gap: 6px; padding: 18px 20px; background: var(--surface); }
.barber-summary span { color: var(--muted); font-size: .75rem; font-weight: 800; text-transform: uppercase; }
.barber-summary strong { font-size: 1.55rem; letter-spacing: -.04em; }
.barber-summary .commission-summary { color: #fff; background: linear-gradient(135deg, #236d43, #30935b); }
.barber-summary .commission-summary span { color: #dff5e8; }

.next-service {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    margin-bottom: 20px;
    padding: 18px 22px;
    color: #4e3a09;
    background: linear-gradient(115deg, #fff3cc, #fffaf0);
    border: 1px solid #e3c26c;
    border-radius: 15px;
}
.next-service.in-progress { color: #35256c; background: linear-gradient(115deg, #e9e2ff, #f8f5ff); border-color: #b9a9ea; }
.next-service-time { display: grid; min-width: 96px; padding-right: 18px; border-right: 1px solid rgba(99, 75, 11, .2); }
.next-service-time span { font-size: .67rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.next-service-time strong { font-size: 1.75rem; line-height: 1.15; }
.next-service-main { min-width: 0; }
.next-service-main h2 { margin: 0; overflow: hidden; font-size: 1.18rem; text-overflow: ellipsis; white-space: nowrap; }
.next-service-main p { margin: 1px 0 0; opacity: .78; }

.barber-agenda { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow); }
.barber-agenda-heading { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.barber-agenda-heading h2 { margin: 0; font-size: 1.15rem; }
.barber-agenda-heading p { margin: 2px 0 0; color: var(--muted); }
.barber-appointments { display: grid; }
.barber-appointment { display: grid; grid-template-columns: 84px minmax(0, 1fr); border-bottom: 1px solid var(--line); }
.barber-appointment:last-child { border-bottom: 0; }
.barber-appointment.is-next { box-shadow: inset 4px 0 var(--brand); background: #fffdf8; }
.barber-appointment.is-muted { opacity: .68; }
.barber-appointment > time { display: grid; align-content: start; justify-items: center; gap: 1px; padding: 23px 14px; color: var(--muted); background: #fafbfc; border-right: 1px solid var(--line); }
.barber-appointment > time strong { color: var(--text); font-size: 1.18rem; }
.barber-appointment > time small { font-size: .74rem; }
.barber-appointment-info { min-width: 0; padding: 20px 22px; }
.barber-appointment-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.barber-appointment-title h3 { margin: 0; font-size: 1.05rem; }
.barber-appointment-title p { margin: 2px 0 0; color: var(--muted); }
.barber-appointment-title .badge { flex: 0 0 auto; }
.barber-appointment-contact { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; color: var(--muted); font-size: .8rem; }
.barber-appointment-contact a { color: var(--brand-dark); font-weight: 800; }
.barber-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 16px; }
.barber-actions form { display: inline-flex; }
.barber-actions .btn { min-height: 39px; padding: 7px 12px; font-size: .8rem; }
.service-result { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; width: 100%; padding: 10px 12px; color: #185c38; background: #e7f5ed; border-radius: 9px; }
.service-result strong { margin-left: auto; }
.barber-empty { padding: 55px 20px; text-align: center; }
.barber-empty > span { display: inline-grid; place-items: center; width: 48px; height: 48px; color: #fff; background: var(--success); border-radius: 50%; font-size: 1.3rem; font-weight: 900; }
.barber-empty h2 { margin: 13px 0 3px; }
.barber-empty p { margin: 0; color: var(--muted); }

.completion-layout { display: grid; grid-template-columns: minmax(250px, .7fr) minmax(420px, 1.3fr); gap: 20px; align-items: start; max-width: 950px; }
.completion-service-card { padding: 24px; background: #f7f4ff; border: 1px solid #d8cff4; border-radius: 15px; box-shadow: var(--shadow); }
.completion-service-card h2 { margin: 18px 0 0; font-size: 1.45rem; }
.completion-service-card > p { margin: 2px 0 20px; color: var(--muted); }
.completion-service-card dl { display: grid; gap: 1px; margin: 0; overflow: hidden; background: #d8cff4; border: 1px solid #d8cff4; border-radius: 10px; }
.completion-service-card dl div { padding: 11px 13px; background: #fff; }
.completion-service-card dt { color: var(--muted); font-size: .7rem; font-weight: 800; text-transform: uppercase; }
.completion-service-card dd { margin: 2px 0 0; font-weight: 850; }
.completion-form-card { max-width: none; }
.commission-preview { display: grid; gap: 2px; padding: 17px; color: #185c38; background: #e7f5ed; border: 1px solid #b9dfc9; border-radius: 10px; }
.commission-preview span { font-size: .74rem; font-weight: 850; text-transform: uppercase; }
.commission-preview strong { font-size: 1.45rem; }
.commission-preview small { color: #397354; }

.financial-heading { align-items: center; }
.financial-filters { margin-bottom: 18px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.financial-filter-grid { display: grid; grid-template-columns: repeat(2, minmax(140px, .7fr)) repeat(2, minmax(180px, 1fr)) auto; align-items: end; gap: 13px; }
.financial-filter-actions { display: flex; align-items: center; gap: 13px; min-height: 44px; }
.financial-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 18px; }
.financial-metric { display: grid; gap: 8px; min-height: 135px; padding: 21px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.financial-metric > span { color: var(--muted); font-size: .76rem; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.financial-metric > strong { align-self: end; font-size: clamp(1.35rem, 2.5vw, 1.8rem); letter-spacing: -.04em; }
.financial-metric > small { color: var(--muted); }
.financial-metric.revenue { color: #fff; background: linear-gradient(135deg, #8c5d19, #c1872f); border: 0; }
.financial-metric.revenue > span, .financial-metric.revenue > small { color: #fff4dc; }
.financial-metric.commission { background: #fffaf0; border-color: #ead39f; }
.financial-metric.net { background: #ecf8f1; border-color: #b9dfc9; }
.financial-chart-panel { margin-bottom: 18px; }
.financial-chart-list { display: grid; gap: 12px; padding: 8px 24px 24px; }
.financial-chart-row { display: grid; grid-template-columns: 48px minmax(120px, 1fr) 115px 70px; align-items: center; gap: 12px; }
.financial-chart-row time { color: var(--muted); font-size: .76rem; font-weight: 800; }
.financial-chart-row > strong { text-align: right; font-size: .85rem; }
.financial-chart-row > small { color: var(--muted); font-size: .72rem; }
.financial-chart-track, .payment-progress { height: 11px; overflow: hidden; background: #edf0f3; border-radius: 999px; }
.financial-chart-track span, .payment-progress span { display: block; width: var(--value); height: 100%; background: linear-gradient(90deg, #b7791f, #d5a44b); border-radius: inherit; }
.financial-breakdown-grid { display: grid; grid-template-columns: minmax(330px, .8fr) minmax(520px, 1.2fr); gap: 18px; margin-bottom: 18px; align-items: start; }
.payment-breakdown { display: grid; padding: 0 22px 19px; }
.payment-breakdown article { display: grid; gap: 9px; padding: 14px 2px; border-top: 1px solid var(--line); }
.payment-breakdown-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.payment-breakdown-title > div { display: grid; }
.payment-breakdown-title > div:last-child { text-align: right; }
.payment-breakdown-title small { color: var(--muted); font-size: .72rem; }
.payment-progress { height: 7px; }
.payment-progress span { background: linear-gradient(90deg, #2c7a50, #55ac7a); }
.commission-value { color: var(--success); }
.financial-movements { margin-bottom: 20px; }

.public-link-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
    padding: 17px 20px;
    color: #fff;
    background: #25303a;
    border-radius: 13px;
}
.public-link-panel p { margin: 2px 0 0; color: #c2cbd4; }

.auth-content { min-height: calc(100vh - 68px); display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 10% 10%, #f7e7c8, transparent 35%), var(--bg); }
.login-card { width: min(100%, 430px); padding: 30px; }
.login-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 25px; }
.login-heading h1 { margin: 0; font-size: 1.7rem; letter-spacing: -.03em; }
.login-heading p { margin: 2px 0 0; color: var(--muted); }

.public-page { min-height: 100vh; background: radial-gradient(circle at 10% 0, #f7e4bd, transparent 28%), var(--bg); }
.public-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 76px;
    color: #fff;
    background: var(--nav);
}
.public-header div, .public-brand > span { display: grid; }
.public-header small { color: #aeb7c2; }
.public-brand { display: flex; align-items: center; gap: 11px; }
.public-brand img { width: 42px; height: 42px; object-fit: contain; background: #fff; border-radius: 10px; }
.public-whatsapp { color: #fff; }
.public-main { width: min(100% - 32px, 850px); margin: 0 auto; padding: 48px 0 70px; }
.public-intro { max-width: 650px; margin: 0 auto 25px; text-align: center; }
.public-intro h1 { margin: 5px 0 9px; font-size: clamp(2rem, 7vw, 3.3rem); line-height: 1; letter-spacing: -.055em; }
.public-intro > p:last-child { margin: 0; color: var(--muted); }
.public-booking-card { padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.public-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.public-form-grid .field-wide { grid-column: 1 / -1; }
.public-data-note { display: flex; align-items: flex-start; gap: 10px; padding: 13px; color: var(--muted); background: #f7f8fa; border-radius: 10px; }
.public-data-note input { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 2px; }
.public-data-note label { font-size: .85rem; }
.btn-large { min-height: 50px; }
.public-contact { color: var(--muted); text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.booking-progress { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 30px; padding: 0; list-style: none; color: var(--muted); font-size: .76rem; font-weight: 800; text-align: center; }
.booking-progress li { display: grid; justify-items: center; gap: 5px; position: relative; }
.booking-progress li::before { content: ""; position: absolute; top: 14px; right: 50%; left: -50%; height: 2px; background: var(--line); z-index: 0; }
.booking-progress li:first-child::before { display: none; }
.booking-progress span { position: relative; z-index: 1; display: grid; place-items: center; width: 30px; height: 30px; color: var(--muted); background: #eef1f4; border-radius: 50%; }
.booking-progress .active, .booking-progress .complete { color: var(--brand-dark); }
.booking-progress .active span, .booking-progress .complete span { color: #fff; background: var(--brand); }
.booking-progress .complete::before, .booking-progress .active::before { background: var(--brand); }
.booking-step { min-width: 0; display: grid; gap: 18px; margin: 0; padding: 0; border: 0; }
.js-enabled .booking-step { display: none; }
.js-enabled .booking-step.active { display: grid; }
.booking-step legend { margin: 0; padding: 0; font-size: 1.5rem; font-weight: 850; letter-spacing: -.025em; }
.step-help { margin: -13px 0 0; color: var(--muted); }
.choice-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.choice-card { position: relative; display: grid; align-content: start; gap: 5px; min-height: 125px; padding: 18px; cursor: pointer; background: #fff; border: 2px solid var(--line); border-radius: 13px; transition: border-color .15s, box-shadow .15s, transform .15s; }
.choice-card:hover { border-color: #d1ae73; transform: translateY(-1px); box-shadow: 0 7px 18px rgba(15, 23, 42, .07); }
.choice-card:has(input:focus-visible) { outline: 3px solid rgba(183, 121, 31, .3); outline-offset: 2px; }
.choice-card:has(input:checked) { border-color: var(--brand); background: #fffaf0; }
.choice-card input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.choice-card strong { font-size: 1.05rem; }
.choice-card small { color: var(--muted); }
.choice-card > span:last-child { margin-top: auto; color: var(--brand-dark); font-weight: 800; }
.choice-card .choice-check { position: absolute; top: 13px; right: 13px; display: none; place-items: center; width: 24px; height: 24px; color: #fff; background: var(--brand); border-radius: 50%; font-size: .75rem; }
.choice-card:has(input:checked) .choice-check { display: grid; }
.professional-choice { grid-template-columns: auto minmax(0, 1fr); align-items: center; min-height: 95px; }
.professional-choice img, .professional-placeholder { grid-row: 1; display: grid; place-items: center; width: 56px; height: 56px; object-fit: cover; color: #fff; background: #384553; border-radius: 50%; font-size: 1.2rem; font-weight: 850; }
.professional-choice > span:nth-of-type(2) { display: grid; }
.booking-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 8px; }
.booking-date { max-width: 330px; }
.js-enabled .native-time-field { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.time-option-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 9px; }
.time-option { min-height: 44px; padding: 8px; color: var(--text); cursor: pointer; background: #fff; border: 1px solid #cdd3da; border-radius: 9px; font-weight: 800; }
.time-option:hover, .time-option.selected { color: #fff; background: var(--brand); border-color: var(--brand); }
.booking-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 0; overflow: hidden; background: var(--line); border: 1px solid var(--line); border-radius: 11px; }
.booking-summary div { padding: 12px; background: #fafbfc; }
.booking-summary dt { color: var(--muted); font-size: .7rem; font-weight: 800; text-transform: uppercase; }
.booking-summary dd { margin: 3px 0 0; font-weight: 800; }
.public-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 20px; }
.public-info-grid article { padding: 18px; background: rgba(255,255,255,.72); border: 1px solid var(--line); border-radius: 12px; }
.public-info-grid p { margin: 5px 0; color: var(--muted); font-size: .88rem; }
.public-footer { display: flex; justify-content: center; flex-wrap: wrap; gap: 22px; padding: 30px 0 0; color: var(--muted); font-size: .85rem; font-weight: 750; }
.public-empty-state { text-align: center; }
.public-empty-state h2 { margin-top: 0; }
.public-main.narrow { max-width: 680px; }
.privacy-content h1 { margin-top: 3px; }
.privacy-content h2 { margin-top: 27px; font-size: 1.15rem; }
.privacy-content p { color: var(--muted); }

.confirmation-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.confirmation-card { width: min(100%, 560px); padding: 34px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.confirmation-card h1 { margin: 5px 0; font-size: 2.25rem; letter-spacing: -.04em; }
.confirmation-card > p { color: var(--muted); }
.confirmation-icon { display: inline-grid; place-items: center; width: 58px; height: 58px; margin-bottom: 15px; color: #fff; background: var(--success); border-radius: 50%; font-size: 1.7rem; font-weight: 900; }
.confirmation-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 25px 0; overflow: hidden; background: var(--line); border: 1px solid var(--line); border-radius: 12px; text-align: left; }
.confirmation-details div { padding: 13px; background: #fff; }
.confirmation-details dt { color: var(--muted); font-size: .75rem; font-weight: 800; text-transform: uppercase; }
.confirmation-details dd { margin: 2px 0 0; font-weight: 800; }
.confirmation-note { font-size: .88rem; }
.confirmation-secondary { margin-top: 9px; }
.manage-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.manage-back { display: inline-block; margin-top: 24px; }
.manage-booking-card .messages { text-align: left; }

@media (max-width: 820px) {
    .topbar { padding: 0 16px; }
    .topbar-user span { display: none; }
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { display: flex; gap: 6px; overflow-x: auto; padding: 10px 12px; }
    .sidebar-label { display: none; }
    .sidebar a { flex: 0 0 auto; margin: 0; padding: 8px 11px; }
    .content { padding: 24px 16px; }
    .metric-grid { grid-template-columns: 1fr; }
    .metric-card { min-height: 105px; }
    .agenda-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .agenda-filter-actions { align-self: end; }
    .agenda-grid-header { top: 68px; }
    .availability-layout { grid-template-columns: 1fr; }
    .barber-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .completion-layout { grid-template-columns: 1fr; }
    .financial-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .financial-filter-actions { grid-column: 1 / -1; }
    .financial-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .financial-breakdown-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .page-heading { align-items: stretch; flex-direction: column; }
    .page-heading .btn { width: 100%; }
    .panel-heading { align-items: flex-start; flex-direction: column; }
    .search-bar { flex-direction: column; }
    .search-bar input { max-width: none; }
    .form-card { padding: 19px; }
    .public-link-panel { align-items: stretch; flex-direction: column; }
    .public-form-grid { grid-template-columns: 1fr; }
    .public-form-grid .field-wide { grid-column: auto; }
    .public-booking-card, .confirmation-card { padding: 21px; }
    .confirmation-details { grid-template-columns: 1fr; }
    .choice-card-grid, .booking-summary { grid-template-columns: 1fr; }
    .booking-progress li { font-size: 0; }
    .public-header { padding: 0 16px; }
    .public-whatsapp { min-height: 36px; padding: 5px 9px; font-size: .72rem; }
    .booking-actions .btn { flex: 1; }
    .heading-actions { align-items: stretch; flex-direction: column; }
    .agenda-page-heading .heading-actions, .agenda-page-heading .btn { width: 100%; }
    .agenda-filters { grid-template-columns: 1fr; }
    .agenda-filter-actions { justify-content: space-between; }
    .agenda-navigation { grid-template-columns: 1fr auto; }
    .agenda-period-title { grid-column: 1 / -1; grid-row: 1; }
    .agenda-period-nav { grid-column: 1; grid-row: 2; }
    .view-switch { grid-column: 2; grid-row: 2; }
    .view-switch a { min-width: 66px; }
    .availability-heading .heading-actions { width: 100%; }
    .schedule-day { grid-template-columns: 1fr; gap: 4px; }
    .schedule-day > strong { padding-top: 0; }
    .schedule-period { width: 100%; }
    .block-item { grid-template-columns: auto 1fr; }
    .block-item > .compact-actions { grid-column: 1 / -1; justify-self: end; }
    .employee-form-grid { grid-template-columns: 1fr; }
    .employee-form-grid .field { grid-column: auto; }
    .team-actions form { margin-left: 0; }
    .barber-summary { grid-template-columns: 1fr 1fr; }
    .barber-summary article { padding: 15px; }
    .barber-summary strong { font-size: 1.28rem; }
    .next-service { grid-template-columns: auto minmax(0, 1fr); padding: 16px; }
    .next-service > .badge { grid-column: 2; justify-self: start; }
    .next-service-time { min-width: 76px; padding-right: 13px; }
    .barber-appointment { grid-template-columns: 66px minmax(0, 1fr); }
    .barber-appointment > time { padding: 19px 7px; }
    .barber-appointment-info { padding: 17px 14px; }
    .barber-appointment-title { align-items: flex-start; flex-direction: column; gap: 8px; }
    .barber-actions, .barber-actions form, .barber-actions .btn { width: 100%; }
    .service-result { align-items: flex-start; flex-direction: column; }
    .service-result strong { margin-left: 0; }
    .completion-layout { min-width: 0; }
    .completion-form-card .form-actions { flex-direction: column-reverse; }
    .completion-form-card .form-actions .btn { width: 100%; }
    .financial-filter-grid, .financial-metrics { grid-template-columns: 1fr; }
    .financial-filter-actions { align-items: stretch; flex-direction: column; }
    .financial-filter-actions .btn, .financial-filter-actions .text-link { width: 100%; text-align: center; }
    .financial-chart-list { overflow-x: auto; padding: 4px 14px 19px; }
    .financial-chart-row { grid-template-columns: 42px minmax(120px, 1fr) 105px; min-width: 340px; }
    .financial-chart-row > small { display: none; }
}
