:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --ink: #18202b;
    --muted: #6b7280;
    --line: #dfe5ee;
    --sidebar: #1f2930;
    --sidebar-soft: #2c3841;
    --primary: #1f7a8c;
    --primary-dark: #155e6c;
    --accent: #d97757;
    --success: #2f855a;
    --warning: #b7791f;
    --danger: #c2413b;
    --shadow: 0 16px 42px rgba(24, 32, 43, .08);
    --radius: 8px;
    --bs-primary: var(--primary);
    --bs-primary-rgb: 31, 122, 140;
    --bs-border-radius: 8px;
    --bs-border-radius-lg: 8px;
}

* {
    box-sizing: border-box;
}

body {
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

.app-body {
    min-height: 100vh;
    background: var(--bg);
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    flex: 0 0 278px;
    flex-direction: column;
    height: 100vh;
    padding: 22px 18px;
    background: var(--sidebar);
    color: #fff;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.brand-mark {
    display: inline-grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: var(--radius);
    background: var(--accent);
    color: #fff;
    font-weight: 800;
}

.brand-logo {
    display: block;
    width: 92px;
    height: 92px;
    max-width: 92px;
    max-height: 92px;
    flex: 0 0 92px;
    padding: 2px;
    border-radius: var(--radius);
    background: #fff;
    object-fit: contain;
}

.login-logo {
    width: 220px;
    height: 220px;
    max-width: 220px;
    max-height: 220px;
    flex-basis: 220px;
}

.brand strong,
.brand small {
    display: block;
    line-height: 1.1;
}

.brand small {
    color: rgba(255, 255, 255, .68);
    font-size: .78rem;
}

.sidebar-nav {
    display: grid;
    gap: 6px;
    margin-top: 34px;
}

.sidebar-nav a,
.logout-link,
.install-link {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 0;
    border-radius: var(--radius);
    background: transparent;
    color: rgba(255, 255, 255, .78);
    text-decoration: none;
    transition: background .2s ease, color .2s ease;
    cursor: pointer;
}

.sidebar-nav a:hover,
.sidebar-nav a.active,
.logout-link:hover,
.install-link:hover {
    background: var(--sidebar-soft);
    color: #fff;
}

.sidebar-nav i,
.logout-link i,
.install-link i {
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    margin-top: auto;
}

.app-main {
    width: 100%;
    min-width: 0;
    padding: 26px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.topbar h1,
.panel h2,
.schedule-title h3,
.patient-hero h2 {
    margin: 0;
    font-weight: 760;
    letter-spacing: 0;
}

.topbar h1 {
    font-size: clamp(1.5rem, 2vw, 2rem);
}

.eyebrow {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.topbar-user strong,
.topbar-user small {
    display: block;
    line-height: 1.15;
}

.topbar-user small {
    color: var(--muted);
}

.user-chip,
.color-dot {
    display: inline-block;
    flex: 0 0 auto;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: var(--chip-color, var(--dot-color, var(--primary)));
    box-shadow: 0 0 0 3px rgba(31, 122, 140, .1);
}

.color-dot {
    margin-right: 8px;
    vertical-align: -1px;
}

.sidebar-toggle {
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 40;
    display: none;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: var(--radius);
    background: var(--sidebar);
    color: #fff;
    box-shadow: var(--shadow);
}

.panel,
.stat-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.panel {
    padding: 20px;
}

.narrow-panel {
    max-width: 980px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.panel-header h2 {
    font-size: 1.18rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
}

.stats-grid.compact {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.stat-card {
    position: relative;
    min-height: 120px;
    overflow: hidden;
    padding: 18px;
}

.stat-card.small {
    min-height: 94px;
}

.stat-card span {
    display: block;
    max-width: 78%;
    color: var(--muted);
    font-size: .86rem;
    font-weight: 700;
}

.stat-card strong {
    display: block;
    margin-top: 12px;
    font-size: clamp(1.45rem, 2vw, 2rem);
    line-height: 1;
}

.stat-card i {
    position: absolute;
    right: 16px;
    bottom: 14px;
    color: rgba(31, 122, 140, .22);
    font-size: 2.1rem;
}

.stat-card.finance i {
    color: rgba(217, 119, 87, .24);
}

.stat-card.balance {
    border-color: rgba(47, 133, 90, .35);
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, .8fr);
    gap: 18px;
}

.chart-canvas {
    width: 100%;
    max-height: 330px;
}

.empty-state {
    margin: 18px 0 0;
    padding: 16px;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    color: var(--muted);
    text-align: center;
}

.filter-bar {
    display: grid;
    grid-template-columns: minmax(220px, 1.4fr) repeat(auto-fit, minmax(150px, .8fr));
    gap: 10px;
    align-items: center;
}

.search-field {
    position: relative;
}

.search-field i {
    position: absolute;
    top: 50%;
    left: 12px;
    color: var(--muted);
    transform: translateY(-50%);
}

.search-field .form-control {
    padding-left: 38px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: var(--radius);
    font-weight: 700;
}

.btn-primary {
    --bs-btn-bg: var(--primary);
    --bs-btn-border-color: var(--primary);
    --bs-btn-hover-bg: var(--primary-dark);
    --bs-btn-hover-border-color: var(--primary-dark);
}

.icon-btn {
    width: 34px;
    height: 34px;
    padding: 0;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.col-span-2 {
    grid-column: span 2;
}

.recurrence-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.recurrence-grid[hidden] {
    display: none;
}

.section-title {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    color: var(--primary-dark);
    font-size: .84rem;
    font-weight: 800;
    text-transform: uppercase;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 8px;
}

.whatsapp-template-list {
    display: grid;
    gap: 8px;
}

.whatsapp-template-option {
    display: grid;
    gap: 2px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: var(--ink);
    text-align: left;
}

.whatsapp-template-option:hover,
.whatsapp-template-option.active {
    border-color: rgba(31, 122, 140, .42);
    background: rgba(31, 122, 140, .07);
}

.whatsapp-template-option span {
    color: var(--muted);
    font-size: .86rem;
}

.color-input {
    width: 100%;
    min-height: 38px;
}

.table {
    --bs-table-bg: transparent;
    margin-bottom: 0;
}

.table thead th {
    border-bottom-color: var(--line);
    color: var(--muted);
    font-size: .78rem;
    text-transform: uppercase;
}

.table tbody td {
    border-color: #edf1f6;
}

.agenda-list,
.compact-list,
.schedule-list {
    display: grid;
    gap: 10px;
}

.agenda-item,
.compact-item,
.schedule-item {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.agenda-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    border-left: 5px solid var(--employee-color, var(--primary));
    color: inherit;
    text-decoration: none;
}

.agenda-item strong,
.agenda-item span,
.agenda-time span,
.agenda-time strong {
    display: block;
}

.agenda-item span,
.agenda-time span {
    color: var(--muted);
    font-size: .86rem;
}

.agenda-time {
    min-width: 82px;
    text-align: right;
}

.compact-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
}

.compact-item strong,
.compact-item span {
    min-width: 0;
}

.compact-item span span {
    display: inline-block;
}

.schedule-item {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr) auto;
    gap: 16px;
    padding: 16px;
    border-left: 6px solid var(--employee-color, var(--primary));
}

.schedule-date {
    display: grid;
    place-items: center;
    align-content: center;
    min-height: 74px;
    border-radius: var(--radius);
    background: #f0f4f8;
}

.schedule-date strong {
    font-size: 1.7rem;
    line-height: 1;
}

.schedule-date span {
    color: var(--muted);
    font-size: .75rem;
}

.schedule-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.schedule-title h3 {
    font-size: 1rem;
}

.schedule-status-form {
    width: min(100%, 220px);
}

.schedule-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 8px;
    color: var(--muted);
    font-size: .9rem;
}

.schedule-main p {
    margin: 10px 0 0;
    color: var(--muted);
}

.schedule-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: flex-start;
}

.employee-schedule-header h2 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.employee-schedule-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 20px 0 14px;
}

.employee-schedule-month {
    min-width: 180px;
    text-align: center;
    font-size: 1.15rem;
}

.employee-schedule-filters {
    align-items: end;
    margin-bottom: 16px;
}

.employee-schedule-filters .form-label {
    margin-bottom: 5px;
}

.employee-schedule-filter-action {
    display: flex;
    align-items: end;
}

.employee-schedule-summary,
.employee-calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    color: var(--muted);
    font-size: .88rem;
}

.employee-schedule-summary {
    margin-bottom: 14px;
}

.employee-schedule-summary i,
.employee-schedule-note i {
    color: var(--primary);
}

.employee-calendar-wrapper {
    overflow-x: auto;
    padding-bottom: 4px;
}

.employee-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(150px, 1fr));
    min-width: 1100px;
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
}

.employee-calendar-weekday {
    padding: 10px 12px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: #f4f7fa;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
}

.employee-calendar-cell {
    min-height: 220px;
    padding: 9px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: #fff;
}

.employee-calendar-cell.is-weekend {
    background: #f8fafc;
}

.employee-calendar-cell.is-empty {
    min-height: 220px;
    background: #f8fafc;
}

.employee-calendar-day {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 8px;
}

.employee-calendar-day strong {
    font-size: 1.05rem;
}

.employee-calendar-day span {
    color: var(--muted);
    font-size: .73rem;
    text-transform: uppercase;
}

.employee-calendar-event,
.employee-calendar-free,
.employee-calendar-empty {
    margin-bottom: 5px;
    border-radius: 6px;
    font-size: .74rem;
    line-height: 1.25;
}

.employee-calendar-event {
    padding: 6px 7px;
    border-left: 3px solid var(--employee-color, var(--primary));
    background: rgba(31, 122, 140, .1);
}

.employee-calendar-event strong,
.employee-calendar-event span,
.employee-calendar-event small {
    display: block;
}

.employee-calendar-event span {
    margin-top: 2px;
    font-weight: 700;
}

.employee-calendar-event small {
    margin-top: 2px;
    color: var(--muted);
}

.employee-calendar-event.is-canceled {
    border-left-color: #94a3b8;
    background: #f1f5f9;
    color: #64748b;
    text-decoration: line-through;
}

.employee-calendar-free {
    padding: 5px 7px;
    border: 1px dashed #7ab69e;
    background: #f0faf5;
    color: #28704e;
}

.employee-calendar-free i {
    margin-right: 3px;
}

.employee-calendar-empty {
    padding: 8px 6px;
    color: var(--muted);
    font-size: .76rem;
    font-style: italic;
}

.legend-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-right: 4px;
    border-radius: 50%;
    background: var(--primary);
}

.legend-dot.is-free {
    background: #7ab69e;
}

.legend-dot.is-canceled {
    background: #94a3b8;
}

.legend-dot.is-blocked {
    background: var(--warning);
}

/* Agenda mensal do funcionário */
.employee-schedule-page {
    padding: 26px;
    border: 0;
    box-shadow: 0 18px 48px rgba(24, 32, 43, .09);
}

.employee-schedule-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
    padding-bottom: 22px;
    border-bottom: 1px solid #edf1f6;
}

.employee-profile {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.employee-avatar {
    display: grid;
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    place-items: center;
    border-radius: 18px;
    background: linear-gradient(145deg, var(--employee-color, var(--primary)), var(--primary-dark));
    color: #fff;
    font-size: 1.35rem;
    font-weight: 800;
    box-shadow: 0 8px 18px rgba(31, 122, 140, .22);
}

.employee-profile h2 {
    font-size: clamp(1.25rem, 2vw, 1.6rem);
}

.employee-profile-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 5px;
    color: var(--muted);
    font-size: .88rem;
}

.employee-status-dot {
    width: 7px;
    height: 7px;
    margin-left: 5px;
    border-radius: 50%;
    background: var(--success);
}

.employee-schedule-toolbar {
    justify-content: center;
    gap: 10px;
    margin: 0 0 20px;
    padding: 14px;
    border: 1px solid #e8edf3;
    border-radius: 16px;
    background: linear-gradient(135deg, #f8fbfd, #fff);
}

.employee-schedule-toolbar .btn {
    min-width: 38px;
    min-height: 38px;
    border-radius: 10px;
}

.employee-schedule-month-wrap {
    min-width: 210px;
    text-align: center;
}

.employee-schedule-month-wrap .eyebrow {
    margin-bottom: 2px;
    font-size: .68rem;
}

.employee-schedule-month {
    min-width: 0;
    font-size: 1.15rem;
}

.employee-schedule-today {
    margin-left: 8px;
    border: 1px solid #e1e7ef;
    color: var(--ink);
}

.employee-schedule-filters {
    gap: 12px;
    align-items: end;
    margin-bottom: 18px;
    padding: 16px;
    border: 1px solid #e8edf3;
    border-radius: 16px;
    background: #fbfcfe;
}

.employee-schedule-filters > div {
    min-width: 0;
}

.employee-schedule-filters .form-label {
    margin-bottom: 5px;
    color: var(--muted);
    font-size: .75rem;
    font-weight: 700;
}

.employee-schedule-filters .form-control,
.employee-schedule-filters .form-select {
    min-height: 40px;
    border-color: #dfe6ef;
    border-radius: 10px;
    background-color: #fff;
}

.employee-schedule-filters .btn {
    min-height: 40px;
    border-radius: 10px;
}

.employee-schedule-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.employee-summary-card {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 78px;
    padding: 14px 16px;
    border: 1px solid #e6ebf2;
    border-radius: 14px;
    background: #fff;
}

.employee-summary-card > i {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 11px;
    font-size: 1.1rem;
}

.employee-summary-card strong,
.employee-summary-card span {
    display: block;
}

.employee-summary-card strong {
    font-size: 1.35rem;
    line-height: 1;
}

.employee-summary-card span {
    margin-top: 4px;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 700;
}

.employee-summary-card.is-booked {
    border-color: rgba(31, 122, 140, .25);
}

.employee-summary-card.is-booked > i {
    background: rgba(31, 122, 140, .1);
    color: var(--primary);
}

.employee-summary-card.is-free {
    border-color: rgba(47, 133, 90, .25);
}

.employee-summary-card.is-free > i {
    background: rgba(47, 133, 90, .1);
    color: var(--success);
}

.employee-summary-card.is-days > i {
    background: rgba(217, 119, 87, .12);
    color: var(--accent);
}

.employee-schedule-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    padding: 0 4px;
    color: var(--muted);
    font-size: .78rem;
}

.employee-schedule-summary > span:not(.employee-schedule-note) {
    display: none;
}

.employee-schedule-note {
    display: flex;
    align-items: center;
    gap: 6px;
}

.employee-schedule-note i {
    color: var(--primary);
}

.employee-calendar-wrapper {
    padding: 3px;
    border: 1px solid #e6ebf2;
    border-radius: 16px;
    background: #f8fafc;
}

.employee-calendar-grid {
    gap: 5px;
    min-width: 1120px;
    border: 0;
}

.employee-calendar-weekday {
    padding: 9px 12px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #8490a0;
    font-size: .7rem;
    letter-spacing: .06em;
}

.employee-calendar-cell {
    min-height: 222px;
    padding: 11px;
    border: 1px solid #e7ecf2;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(24, 32, 43, .025);
}

.employee-calendar-cell.is-weekend,
.employee-calendar-cell.is-empty {
    background: #f4f7fa;
    box-shadow: none;
}

.employee-calendar-day {
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #edf1f6;
}

.employee-calendar-day strong {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 9px;
    background: #f0f5f8;
    color: var(--ink);
    font-size: .84rem;
}

.employee-calendar-event,
.employee-calendar-free,
.employee-calendar-empty {
    margin-bottom: 6px;
    border-radius: 8px;
    font-size: .72rem;
}

.employee-calendar-event {
    padding: 7px 8px;
    border: 1px solid rgba(31, 122, 140, .14);
    border-left: 3px solid var(--employee-color, var(--primary));
    background: #f3fafb;
}

.employee-calendar-event span {
    margin-top: 3px;
    color: #263746;
}

.employee-calendar-event small {
    margin-top: 3px;
    font-size: .67rem;
}

.employee-calendar-free {
    padding: 6px 8px;
    border: 1px dashed #9bcbb3;
    background: #f3fbf6;
    color: #28704e;
}

a.employee-calendar-free {
    display: block;
    text-decoration: none;
    transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

a.employee-calendar-free:hover {
    border-color: #4e9d76;
    background: #e6f7ed;
    color: #1f6041;
    transform: translateX(2px);
}

.employee-calendar-empty {
    padding: 10px 7px;
}

.employee-calendar-legend {
    gap: 8px 16px;
    padding: 0 4px;
    font-size: .78rem;
}

.segmented-control {
    display: flex;
    min-width: 240px;
}

.segmented-control .btn {
    flex: 1;
}

.patient-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.patient-hero h2 {
    font-size: 1.55rem;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-top: 10px;
    color: var(--muted);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.detail-list {
    display: grid;
    gap: 10px;
    margin: 0;
}

.detail-list div {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #edf1f6;
}

.detail-list dt {
    color: var(--muted);
    font-weight: 700;
}

.detail-list dd {
    margin: 0;
}

.timeline {
    position: relative;
    display: grid;
    gap: 16px;
}

.timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 12px;
}

.timeline-dot {
    width: 14px;
    height: 14px;
    margin-top: 6px;
    border: 3px solid rgba(31, 122, 140, .22);
    border-radius: 999px;
    background: var(--primary);
}

.timeline-content {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.timeline-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.timeline-head strong,
.timeline-head span {
    display: block;
}

.timeline-head span {
    color: var(--muted);
    font-size: .88rem;
}

.timeline-content p {
    margin: 12px 0 0;
}

.attachment-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    color: var(--primary-dark);
    font-weight: 700;
    text-decoration: none;
}

.inline-create,
.inline-edit {
    display: flex;
    gap: 8px;
}

.inline-edit {
    flex: 1;
}

.compact-form {
    gap: 12px;
}

.login-body {
    min-height: 100vh;
    background: #eef3f5;
}

.login-screen {
    display: grid;
    grid-template-columns: minmax(320px, 460px) minmax(0, 1fr);
    min-height: 100vh;
}

.login-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(28px, 6vw, 64px);
    background: #fff;
}

.login-brand {
    color: var(--ink);
    margin-bottom: 34px;
}

.login-brand small {
    color: var(--muted);
}

.login-panel h1 {
    margin: 0 0 8px;
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 800;
}

.login-panel p {
    margin-bottom: 28px;
    color: var(--muted);
}

.login-hint {
    margin-top: 18px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--muted);
    font-size: .9rem;
}

.login-visual {
    display: grid;
    align-content: center;
    gap: 18px;
    padding: clamp(28px, 8vw, 96px);
    background:
        linear-gradient(135deg, rgba(31, 122, 140, .95), rgba(31, 41, 48, .96)),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cpath d='M0 80h160M80 0v160' stroke='%23ffffff' stroke-opacity='.09'/%3E%3C/svg%3E");
}

.metric-card {
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: 360px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .12);
    color: #fff;
    backdrop-filter: blur(10px);
}

.metric-card i {
    font-size: 1.6rem;
}

.metric-card span {
    font-weight: 800;
}

.form-control:focus,
.form-select:focus,
.btn:focus {
    border-color: rgba(31, 122, 140, .55);
    box-shadow: 0 0 0 .2rem rgba(31, 122, 140, .16);
}

.was-invalid,
.form-control.is-invalid {
    border-color: var(--danger);
}

@media (max-width: 1100px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 991px) {
    .sidebar-toggle {
        display: inline-grid;
        place-items: center;
    }

    .sidebar {
        position: fixed;
        left: 0;
        transform: translateX(-105%);
        transition: transform .2s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .app-main {
        padding: 74px 16px 20px;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar-user {
        width: 100%;
    }

    .login-screen {
        grid-template-columns: 1fr;
    }

    .login-visual {
        min-height: 280px;
    }
}

@media (max-width: 720px) {
    .panel {
        padding: 16px;
    }

    .panel-header,
    .patient-hero,
    .schedule-title {
        align-items: flex-start;
        flex-direction: column;
    }

    .filter-bar,
    .form-grid,
    .recurrence-grid {
        grid-template-columns: 1fr;
    }

    .col-span-2 {
        grid-column: auto;
    }

    .schedule-item {
        grid-template-columns: 1fr;
    }

    .schedule-status-form {
        width: 100%;
    }

    .schedule-date {
        grid-template-columns: auto auto;
        justify-content: start;
        gap: 8px;
        min-height: auto;
        padding: 10px;
    }

    .schedule-actions,
    .hero-actions {
        justify-content: flex-start;
    }

    .detail-list div {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .segmented-control {
        min-width: 0;
        width: 100%;
    }

    .table-responsive {
        border: 1px solid var(--line);
        border-radius: var(--radius);
    }
}

@media (max-width: 720px) {
    .employee-schedule-page {
        padding: 16px;
    }

    .employee-schedule-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .employee-schedule-header .hero-actions {
        width: 100%;
    }

    .employee-schedule-header .hero-actions .btn {
        flex: 1;
    }

    .employee-schedule-month-wrap {
        min-width: 0;
        flex: 1;
    }

    .employee-schedule-today {
        margin-left: 4px;
    }

    .employee-schedule-metrics {
        grid-template-columns: 1fr;
    }

    .employee-schedule-filters {
        grid-template-columns: 1fr;
    }

    .employee-schedule-filters .btn {
        width: 100%;
    }
}

.appointments-directory-page {
    padding: 28px;
}

.appointments-directory-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #edf1f6;
}

.appointments-directory-header h2 {
    font-size: clamp(1.35rem, 2vw, 1.7rem);
}

.appointments-directory-intro {
    max-width: 650px;
    margin: 7px 0 0;
    color: var(--muted);
    line-height: 1.55;
}

.appointments-new-button {
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 11px;
    white-space: nowrap;
}

.appointments-directory-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    color: var(--muted);
    font-size: .86rem;
}

.appointments-directory-toolbar > div {
    display: flex;
    align-items: center;
    gap: 7px;
}

.appointments-directory-toolbar i {
    color: var(--primary);
}

.employee-agenda-directory {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.employee-agenda-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 112px;
    padding: 18px;
    border: 1px solid #e5ebf2;
    border-left: 4px solid var(--employee-color, var(--primary));
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 7px 20px rgba(24, 32, 43, .045);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.employee-agenda-card:hover {
    border-color: color-mix(in srgb, var(--employee-color, var(--primary)) 45%, #e5ebf2);
    box-shadow: 0 12px 26px rgba(24, 32, 43, .09);
    transform: translateY(-2px);
}

.employee-agenda-card-main,
.employee-agenda-card-actions {
    display: flex;
    align-items: center;
}

.employee-agenda-card-main {
    min-width: 0;
    gap: 12px;
}

.employee-agenda-avatar {
    display: grid;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    place-items: center;
    border-radius: 14px;
    background: color-mix(in srgb, var(--employee-color, var(--primary)) 15%, #fff);
    color: var(--employee-color, var(--primary));
    font-size: 1.15rem;
    font-weight: 800;
}

.employee-agenda-info {
    min-width: 0;
}

.employee-agenda-info h3 {
    overflow: hidden;
    margin: 0;
    font-size: 1rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.employee-agenda-info p {
    margin: 5px 0 0;
    overflow: hidden;
    color: var(--muted);
    font-size: .8rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.employee-agenda-info p i {
    margin-right: 3px;
}

.employee-agenda-card-actions {
    flex-shrink: 0;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.employee-agenda-card-actions .btn {
    min-height: 36px;
    border-radius: 10px;
    white-space: nowrap;
}

.employee-agenda-status {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 700;
}

.appointments-directory-empty {
    display: grid;
    gap: 5px;
    place-items: center;
    padding: 42px 20px;
}

.appointments-directory-empty i {
    margin-bottom: 4px;
    color: var(--primary);
    font-size: 2rem;
}

.appointments-directory-empty strong {
    color: var(--ink);
}

.appointments-directory-empty span {
    color: var(--muted);
    font-size: .88rem;
}

@media (max-width: 820px) {
    .employee-agenda-directory {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .appointments-directory-page {
        padding: 16px;
    }

    .appointments-directory-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .appointments-new-button {
        width: 100%;
    }

    .appointments-directory-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .employee-agenda-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .employee-agenda-card-actions {
        width: 100%;
        align-items: stretch;
        flex-direction: row;
        justify-content: space-between;
    }
}

.employee-blocks-panel {
    margin-top: 18px;
}

.employee-block-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
    padding: 16px;
    border: 1px solid #e8edf3;
    border-radius: 14px;
    background: #fbfcfe;
}

.employee-block-form .form-label {
    margin-bottom: 5px;
    color: var(--muted);
    font-size: .76rem;
    font-weight: 700;
}

.employee-block-form .form-control,
.employee-block-form .form-select {
    min-height: 40px;
    border-radius: 10px;
}

.employee-block-all-day {
    display: flex;
    align-items: center;
    min-height: 40px;
    margin: 0;
}

.employee-block-reason {
    grid-column: span 2;
}

.employee-block-submit {
    display: flex;
    justify-content: flex-end;
}

.employee-block-submit .btn {
    min-height: 40px;
    border-radius: 10px;
}

.employee-block-list {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.employee-block-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #e8edf3;
    border-left: 4px solid var(--warning);
    border-radius: 11px;
    background: #fffaf0;
}

.employee-block-item strong,
.employee-block-item span {
    display: block;
}

.employee-block-item strong {
    font-size: .88rem;
}

.employee-block-item span {
    margin-top: 3px;
    color: var(--muted);
    font-size: .78rem;
}

.employee-block-item span i {
    margin-right: 3px;
}

.employee-calendar-block {
    margin-bottom: 6px;
    padding: 6px 8px;
    border: 1px solid #f0d08a;
    border-left: 3px solid var(--warning);
    border-radius: 8px;
    background: #fff8e7;
    color: #8a651b;
    font-size: .72rem;
}

.employee-calendar-block i {
    margin-right: 3px;
}

@media (max-width: 720px) {
    .employee-block-form {
        grid-template-columns: 1fr;
    }

    .employee-block-reason {
        grid-column: auto;
    }

    .employee-block-submit {
        justify-content: stretch;
    }

    .employee-block-submit .btn {
        width: 100%;
    }

    .employee-block-item {
        align-items: flex-start;
    }
}
