:root {
    --bg: #eef3f2;
    --surface: #ffffff;
    --surface-soft: #f8fbfa;
    --ink: #17242c;
    --muted: #66747d;
    --line: #d9e3e0;
    --line-strong: #c7d4d0;
    --accent: #087f78;
    --accent-strong: #05645f;
    --mint: #dff1ed;
    --amber: #c47a28;
    --rose: #b84f57;
    --shadow: 0 18px 55px rgba(29, 48, 55, .10);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
}

a { color: inherit; text-decoration: none; }

.app-shell {
    display: grid;
    grid-template-columns: 272px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
    border-right: 1px solid var(--line);
    background: rgba(255, 255, 255, .92);
    padding: 26px 22px;
    box-shadow: 10px 0 40px rgba(34, 52, 59, .04);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 2px 4px;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), #18a08d);
    color: #fff;
    font-weight: 800;
    letter-spacing: .02em;
    box-shadow: 0 12px 28px rgba(8, 127, 120, .24);
}

.brand-mark-logo {
    overflow: hidden;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--accent);
}

.brand-mark img,
.login-brand-card img,
.company-preview-logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand strong,
.brand small { display: block; }

.brand strong {
    font-size: 17px;
    letter-spacing: 0;
}

.brand small,
.muted,
.section-head span,
.user-box small { color: var(--muted); }

.nav {
    display: grid;
    gap: 5px;
}

.nav a,
.nav summary {
    position: relative;
    padding: 12px 13px 12px 15px;
    border-radius: 10px;
    color: #40515b;
    font-size: 14px;
    font-weight: 650;
}

.nav a.active,
.nav a:hover,
.nav summary.active,
.nav summary:hover {
    background: var(--mint);
    color: var(--accent-strong);
}

.nav a.active::before,
.nav summary.active::before {
    content: "";
    position: absolute;
    left: 7px;
    top: 12px;
    bottom: 12px;
    width: 3px;
    border-radius: 99px;
    background: var(--accent);
}

.nav-group {
    display: grid;
    gap: 5px;
}

.nav-group summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    list-style: none;
}

.nav-group summary::-webkit-details-marker {
    display: none;
}

.nav-group summary::after {
    content: "v";
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    transition: transform .16s ease;
}

.nav-group[open] summary::after {
    transform: rotate(180deg);
}

.nav-group > div {
    display: grid;
    gap: 4px;
    padding: 2px 0 4px 12px;
}

.nav-group > div a {
    padding: 10px 12px;
    font-size: 13px;
}

.db-pill {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--muted);
    font-size: 12px;
    background: var(--surface-soft);
}

.db-pill span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--amber);
}

.db-pill.online span { background: var(--accent); }

.content {
    min-width: 0;
    padding: 30px;
}

.topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 26px;
}

.eyebrow {
    margin: 0 0 5px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

h1,
h2,
p { margin-top: 0; }

h1 {
    margin-bottom: 0;
    font-size: 28px;
    line-height: 1.16;
    letter-spacing: 0;
}

h2 {
    margin-bottom: 14px;
    font-size: 18px;
}

.user-box {
    min-width: 190px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    padding: 12px 14px;
    box-shadow: 0 12px 36px rgba(29, 48, 55, .06);
}

.user-box span,
.user-box small { display: block; }

.user-box a {
    display: inline-block;
    margin-top: 7px;
    color: var(--accent-strong);
    font-weight: 700;
    font-size: 13px;
}

.topbar-actions {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 10px;
}

.notification-menu {
    position: relative;
}

.notification-menu summary {
    position: relative;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    color: var(--accent-strong);
    box-shadow: 0 12px 36px rgba(29, 48, 55, .06);
    cursor: pointer;
    list-style: none;
}

.notification-menu summary::-webkit-details-marker {
    display: none;
}

.notification-menu summary svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.notification-menu summary > span {
    position: absolute;
    top: -6px;
    right: -5px;
    display: grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    border: 2px solid #fff;
    border-radius: 999px;
    background: var(--rose);
    color: #fff;
    padding: 0 5px;
    font-size: 10px;
    font-weight: 900;
}

.notification-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 30;
    width: min(390px, calc(100vw - 38px));
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 28px 80px rgba(29, 48, 55, .20);
}

.notification-panel header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--line);
    padding: 13px 14px;
}

.notification-panel header strong {
    font-size: 14px;
}

.notification-panel form {
    margin: 0;
}

.notification-panel button {
    border: 0;
    background: transparent;
    color: var(--accent-strong);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 850;
}

.notification-list {
    display: grid;
    max-height: 370px;
    overflow-y: auto;
}

.notification-list a {
    position: relative;
    display: grid;
    gap: 4px;
    border-bottom: 1px solid var(--line);
    padding: 13px 16px 13px 30px;
}

.notification-list a:hover {
    background: var(--surface-soft);
}

.notification-list a > span {
    position: absolute;
    left: 14px;
    top: 18px;
    width: 7px;
    height: 7px;
    border-radius: 99px;
    background: var(--line-strong);
}

.notification-list a.unread > span {
    background: var(--accent);
}

.notification-list strong {
    font-size: 13px;
}

.notification-list small,
.notification-list p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.notification-list p {
    padding: 18px;
}

.flash,
.alert {
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
    background: #e7f3f1;
    color: var(--accent-strong);
}

.flash.warning { background: #fff4d8; color: #8b5e12; }
.flash.error,
.alert { background: #ffe7e7; color: var(--rose); }

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.metrics-grid article,
.module-panel,
.form-card,
.table-card,
.kanban-column {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.metrics-grid article {
    position: relative;
    min-height: 118px;
    padding: 20px;
    overflow: hidden;
}

.metrics-grid article::after {
    content: "";
    position: absolute;
    right: 18px;
    bottom: 18px;
    width: 46px;
    height: 5px;
    border-radius: 99px;
    background: var(--mint);
}

.metrics-grid strong {
    display: block;
    margin-bottom: 18px;
    font-size: 36px;
    line-height: 1;
}

.metrics-grid span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
}

.dashboard-hero {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .96), rgba(236, 248, 245, .94)),
        radial-gradient(circle at 92% 18%, rgba(8, 127, 120, .14), transparent 30%);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 18px;
}

.dashboard-hero::before {
    content: "";
    position: absolute;
    inset: auto 26px 0 auto;
    width: 220px;
    height: 4px;
    border-radius: 999px 999px 0 0;
    background: linear-gradient(90deg, var(--accent), #52c7b4);
}

.dashboard-hero > * {
    position: relative;
    z-index: 1;
}

.dashboard-hero span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--accent-strong);
    font-size: 12px;
    font-weight: 850;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.dashboard-hero h2 {
    margin: 0 0 8px;
    font-size: 28px;
    line-height: 1.12;
}

.dashboard-hero p {
    max-width: 720px;
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.dashboard-finance-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.dashboard-card {
    min-width: 0;
    padding: 18px;
}

.dashboard-list {
    display: grid;
    gap: 10px;
}

.dashboard-list a {
    display: grid;
    gap: 5px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: linear-gradient(135deg, #fff, var(--surface-soft));
    padding: 12px 14px;
    transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.dashboard-list a:hover {
    border-color: rgba(8, 127, 120, .45);
    background: #eef8f5;
    transform: translateY(-1px);
}

.dashboard-list strong {
    color: #24343d;
    font-size: 14px;
    line-height: 1.25;
}

.dashboard-list span {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.35;
}

.status-bars {
    display: grid;
    gap: 13px;
}

.status-bars div {
    display: grid;
    gap: 8px;
}

.status-bars span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.status-bars strong {
    color: var(--ink);
}

.status-bars i {
    display: block;
    max-width: 100%;
    height: 9px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), #52c7b4);
    box-shadow: 0 6px 14px rgba(8, 127, 120, .12);
}

.mini-chart {
    display: flex;
    align-items: end;
    gap: 12px;
    min-height: 180px;
    padding-top: 8px;
}

.mini-chart div {
    display: grid;
    align-items: end;
    justify-items: center;
    gap: 8px;
    flex: 1;
    min-width: 34px;
    height: 160px;
}

.mini-chart span {
    display: block;
    width: 100%;
    max-width: 30px;
    min-height: 8px;
    border-radius: 9px 9px 3px 3px;
    background: linear-gradient(180deg, var(--accent), #58c8b7);
    box-shadow: 0 10px 24px rgba(8, 127, 120, .14);
}

.mini-chart small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
}

.dashboard-alerts {
    display: grid;
    gap: 10px;
}

.dashboard-alerts div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid #efd9ad;
    border-radius: 12px;
    background: #fff9ec;
    padding: 12px 14px;
}

.dashboard-alerts span {
    color: #6f4e12;
    font-size: 13px;
    font-weight: 800;
}

.dashboard-alerts strong {
    color: #8a5a09;
    white-space: nowrap;
}

.company-settings-card {
    display: grid;
    gap: 18px;
}

.company-brand-preview {
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: linear-gradient(135deg, #fff, var(--surface-soft));
    padding: 16px;
}

.company-preview-logo {
    display: grid;
    place-items: center;
    width: 84px;
    height: 84px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    color: var(--accent-strong);
    box-shadow: 0 16px 36px rgba(29, 48, 55, .08);
}

.company-preview-logo strong {
    font-size: 25px;
    letter-spacing: .04em;
}

.company-brand-preview span,
.company-brand-preview small {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
}

.company-brand-preview strong {
    display: block;
    margin: 4px 0;
    color: var(--ink);
    font-size: 28px;
    line-height: 1;
}

.company-settings-form {
    display: grid;
    gap: 14px;
}

@media (max-width: 920px) {
    .dashboard-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-finance-grid,
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .dashboard-hero {
        padding: 20px;
    }

    .dashboard-hero h2 {
        font-size: 24px;
    }

    .dashboard-card {
        padding: 14px;
    }

    .dashboard-alerts div,
    .status-bars span {
        align-items: flex-start;
        flex-direction: column;
    }
}

.work-grid {
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 16px;
}

.module-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 16px 18px;
    margin-bottom: 16px;
}

.module-toolbar strong,
.module-toolbar span {
    display: block;
}

.module-toolbar span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 13px;
}

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

.row-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.row-actions form {
    margin: 0;
}

.action-icon {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border: 1px solid currentColor;
    border-radius: 8px;
    background: #fff;
    color: #42535c;
    cursor: pointer;
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.action-icon svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.action-icon.view {
    color: #0f766e;
    background: #eefaf7;
}

.action-icon.edit {
    color: #2563eb;
    background: #eff6ff;
}

.action-icon.cancel {
    color: #b42318;
    background: #fff1f2;
}

.action-icon:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(33, 52, 59, .12);
}

.availability-modal {
    width: min(1120px, calc(100vw - 30px));
}

.availability-card {
    display: grid;
    gap: 16px;
    max-width: none;
}

.availability-grid {
    display: grid;
    gap: 10px;
}

.availability-row {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-soft);
    padding: 12px;
}

.availability-day {
    align-self: start;
    min-height: 44px;
    border-radius: 10px;
    background: #fff;
    padding: 12px;
    font-weight: 850;
}

.availability-fields {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    min-width: 0;
}

.availability-fields label,
.availability-note {
    min-width: 0;
}

.availability-note {
    grid-column: 2;
}

.availability-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f2f8f6;
    padding: 13px 14px;
}

.availability-preview strong {
    white-space: nowrap;
}

.availability-preview span {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.professional-history-modal {
    width: min(1180px, calc(100vw - 30px));
}

.professional-history-card {
    max-width: none;
    display: grid;
    gap: 16px;
}

.professional-history-metrics {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.professional-history-metrics article {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-soft);
    padding: 14px;
}

.professional-history-metrics span,
.professional-history-note span,
.professional-history-note small {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.professional-history-metrics strong {
    display: block;
    margin-top: 5px;
    color: var(--ink);
    font-size: 22px;
    line-height: 1.15;
}

.professional-history-note {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    padding: 14px;
}

.professional-history-note strong {
    display: block;
    margin-top: 4px;
    color: var(--ink);
}

.professional-history-note small {
    margin-top: 6px;
}

.professional-history-table {
    max-height: min(52vh, 520px);
}

.professional-history-observation td {
    background: var(--surface-soft);
    color: #465861;
    font-size: 13px;
    line-height: 1.5;
}

.appointment-flow {
    display: grid;
    gap: 14px;
}

.professional-self-booking .appointment-service-step,
.professional-self-booking .appointment-professional-step {
    display: none;
}

.professional-self-booking .appointment-availability {
    background: transparent;
    border: 0;
    padding: 0;
}

.professional-self-booking .professional-select-label {
    display: none;
}

.appointment-step {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-soft);
    padding: 13px;
}

.appointment-availability {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-soft);
    padding: 12px;
}

.appointment-empty {
    grid-column: 1 / -1;
    border: 1px dashed var(--line-strong);
    border-radius: 10px;
    background: #fff;
    color: var(--muted);
    padding: 16px;
    font-size: 13px;
    font-weight: 700;
}

.professional-slot-card {
    display: grid;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
    padding: 13px;
    text-align: left;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.professional-slot-card:has(.professional-slot-trigger:hover),
.professional-slot-card.selected {
    border-color: rgba(8, 127, 120, .45);
    box-shadow: 0 12px 28px rgba(29, 48, 55, .10);
    transform: translateY(-1px);
}

.professional-slot-card.selected {
    background: #f2f8f6;
}

.professional-slot-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    border: 0;
    background: transparent;
    color: inherit;
    padding: 0;
    cursor: pointer;
    text-align: left;
}

.professional-slot-trigger span:first-child {
    display: grid;
    gap: 3px;
}

.professional-slot-card strong,
.professional-slot-trigger small {
    overflow-wrap: anywhere;
}

.professional-slot-trigger small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.professional-select-label {
    flex: 0 0 auto;
    border-radius: 999px;
    background: var(--mint);
    color: var(--accent-strong);
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 900;
}

.professional-slot-card.selected .professional-select-label {
    background: var(--accent);
    color: #fff;
}

.professional-slot-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.professional-slot-list span {
    border-radius: 999px;
    background: var(--surface-soft);
    color: #40515b;
    padding: 5px 8px;
    font-size: 11px;
    font-weight: 750;
}

.professional-next-slots {
    display: grid;
    gap: 7px;
    border-top: 1px solid var(--line);
    padding-top: 10px;
}

.professional-next-slots > strong {
    color: var(--muted);
    font-size: 11px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.professional-next-slots div {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.professional-next-slots span {
    border-radius: 8px;
    background: var(--mint);
    color: var(--accent-strong);
    padding: 5px 7px;
    font-size: 11px;
    font-weight: 850;
}

.professional-calendar {
    display: grid;
    gap: 10px;
    border-top: 1px solid var(--line);
    padding-top: 12px;
}

.professional-calendar-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.professional-calendar-head span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.professional-calendar-days {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.professional-calendar-day {
    display: grid;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    padding: 10px;
}

.professional-calendar-day header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.professional-calendar-day header strong {
    font-size: 13px;
}

.professional-calendar-day header span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
}

.professional-calendar-day div {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.appointment-slot-button {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
    color: #33444f;
    padding: 7px 9px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 850;
}

.appointment-slot-button:hover,
.appointment-slot-button.selected {
    border-color: transparent;
    background: var(--accent);
    color: #fff;
}

.appointment-selection-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid rgba(8, 127, 120, .24);
    border-radius: 12px;
    background: #f2f8f6;
    padding: 12px 14px;
}

.appointment-selection-summary strong {
    white-space: nowrap;
}

.appointment-selection-summary span {
    color: #40515b;
    font-size: 13px;
    font-weight: 750;
    text-align: right;
}

.finance-mini-card {
    display: grid;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-soft);
    padding: 14px;
}

.finance-mini-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.finance-mini-head span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
    text-align: right;
}

.loyalty-record-box {
    display: grid;
    gap: 10px;
}

.loyalty-record-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.loyalty-record-line strong {
    font-size: 16px;
}

.loyalty-record-form {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    gap: 12px;
    align-items: end;
    margin-top: 4px;
    border-top: 1px solid var(--line);
    padding-top: 14px;
}

.loyalty-record-form label {
    margin: 0;
}

.loyalty-record-form .button {
    min-height: 44px;
}

.subnav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: -8px 0 18px;
}

.subnav a,
.filter-bar a {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: #40515b;
    padding: 9px 13px;
    font-size: 13px;
    font-weight: 800;
}

.subnav a.active,
.filter-bar a.active {
    border-color: transparent;
    background: var(--accent);
    color: #fff;
    box-shadow: 0 10px 24px rgba(8, 127, 120, .18);
}

.module-panel,
.form-card,
.table-card {
    padding: 22px;
}

.clean-list {
    display: grid;
    gap: 9px;
    margin: 0;
    padding-left: 18px;
    color: #33434f;
}

.empty-state {
    border: 1px dashed var(--line);
    border-radius: 12px;
    padding: 22px;
    color: var(--muted);
    background: var(--surface-soft);
}

.login-panel {
    min-height: calc(100vh - 160px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 430px;
    align-items: center;
    gap: 42px;
}

.login-copy {
    max-width: 650px;
}

.login-brand-card {
    display: inline-grid;
    place-items: center;
    min-width: 132px;
    max-width: 220px;
    height: 76px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, .82);
    box-shadow: 0 20px 48px rgba(29, 48, 55, .10);
    padding: 14px 18px;
}

.login-brand-card strong {
    color: var(--accent-strong);
    font-size: 24px;
    font-weight: 950;
    letter-spacing: .04em;
}

.login-copy h2 {
    margin: 14px 0 14px;
    max-width: 620px;
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1;
    letter-spacing: 0;
}

.login-copy p {
    max-width: 560px;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.7;
}

.product-badge {
    display: inline-flex;
    align-items: center;
    height: 32px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    padding: 0 12px;
    background: rgba(255, 255, 255, .72);
    color: var(--accent-strong);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.form-card {
    display: grid;
    gap: 13px;
    width: 100%;
    max-width: 430px;
}

.form-card p {
    color: var(--muted);
    line-height: 1.5;
}

label {
    display: grid;
    gap: 6px;
    color: #31414c;
    font-size: 13px;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
    font: 14px Arial, Helvetica, sans-serif;
    padding: 11px 12px;
    transition: border-color .16s ease, box-shadow .16s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(8, 127, 120, .55);
    box-shadow: 0 0 0 4px rgba(8, 127, 120, .11);
}

input[readonly],
textarea[readonly] {
    background: var(--surface-soft);
    color: #596a73;
    cursor: not-allowed;
}

textarea { resize: vertical; }

.check {
    grid-template-columns: 18px 1fr;
    align-items: center;
    font-weight: 400;
}

.check input { width: 16px; }

.option-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-soft);
    padding: 12px;
}

.option-grid .check {
    border-radius: 8px;
    padding: 8px;
    background: #fff;
}

.button {
    border: 0;
    border-radius: 10px;
    padding: 12px 15px;
    cursor: pointer;
    font-weight: 800;
}

.button:disabled {
    cursor: not-allowed;
    opacity: .55;
    box-shadow: none;
}

.button.compact {
    padding: 8px 11px;
    font-size: 12px;
}

.button.primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 10px 24px rgba(8, 127, 120, .22);
}

.button.primary:hover { background: var(--accent-strong); }

.button.secondary {
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: #33444f;
}

.button.secondary:hover {
    background: var(--surface-soft);
}

.button.whatsapp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #1f9d55;
    color: #fff;
    box-shadow: 0 10px 24px rgba(31, 157, 85, .20);
}

.button.whatsapp:hover {
    background: #177d43;
}

.button.whatsapp svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    fill: currentColor;
}

.icon-button {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.icon-button:hover {
    color: var(--ink);
    background: var(--surface-soft);
}

.split {
    display: grid;
    grid-template-columns: 390px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.stack {
    display: grid;
    gap: 16px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

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

.section-head h2 { margin: 0; }

.section-head > div {
    display: grid;
    gap: 4px;
}

.table-wrap {
    overflow-x: auto;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    justify-content: flex-end;
    margin-top: 16px;
}

.pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: #40515b;
    padding: 8px 11px;
    font-size: 13px;
    font-weight: 850;
}

.pagination a.active {
    border-color: transparent;
    background: var(--accent);
    color: #fff;
    box-shadow: 0 10px 24px rgba(8, 127, 120, .16);
}

.pagination a.disabled {
    pointer-events: none;
    opacity: .45;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 13px 10px;
    text-align: left;
    font-size: 14px;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.tag {
    display: inline-flex;
    border-radius: 999px;
    background: var(--mint);
    color: var(--accent-strong);
    padding: 4px 9px;
    font-size: 12px;
    font-weight: 700;
}

.kanban {
    display: grid;
    grid-template-columns: repeat(6, minmax(210px, 1fr));
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.kanban-column {
    min-height: 330px;
    padding: 14px;
    border-top: 4px solid var(--stage-color, var(--accent));
    transition: border-color .16s ease, background-color .16s ease;
}

.kanban-column.drag-over {
    background: color-mix(in srgb, var(--stage-color, var(--accent)) 7%, white);
    border-color: color-mix(in srgb, var(--stage-color, var(--accent)) 60%, var(--line));
}

.kanban-column h2 {
    font-size: 15px;
}

.kanban-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.kanban-head h2 {
    margin-bottom: 4px;
}

.kanban-head span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.add-lead {
    border-color: transparent;
    background: color-mix(in srgb, var(--stage-color, var(--accent)) 14%, white);
    color: var(--stage-color, var(--accent));
    font-weight: 900;
}

.lead-card {
    display: grid;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
    margin-top: 10px;
    background: var(--surface-soft);
}

.lead-card-button {
    width: 100%;
    color: inherit;
    cursor: pointer;
    font: inherit;
    text-align: left;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.lead-card-button[draggable="true"] {
    user-select: none;
}

.lead-card-button.dragging {
    opacity: .55;
    transform: rotate(.4deg);
}

.lead-card-button:hover {
    border-color: color-mix(in srgb, var(--stage-color, var(--accent)) 48%, var(--line));
    box-shadow: 0 12px 26px rgba(29, 48, 55, .10);
    transform: translateY(-1px);
}

.lead-card span,
.lead-card small { color: var(--muted); }

.lead-card em {
    display: inline-flex;
    width: fit-content;
    margin-top: 4px;
    border-radius: 999px;
    background: #fff4d8;
    color: #8b5e12;
    padding: 3px 7px;
    font-size: 11px;
    font-style: normal;
    font-weight: 800;
}

.flow-list,
.priority-list {
    display: grid;
    gap: 12px;
}

.flow-list div,
.priority-list span {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-soft);
    padding: 14px;
}

.flow-list strong {
    display: block;
    margin-bottom: 5px;
}

.flow-list span,
.priority-list span {
    color: var(--muted);
}

.priority-list span {
    display: block;
    color: #33444f;
    font-weight: 650;
}

.settings-layout {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.settings-menu {
    display: grid;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 12px;
}

.settings-menu a,
.settings-menu span {
    border-radius: 10px;
    padding: 11px 12px;
    color: #40515b;
    font-size: 14px;
    font-weight: 700;
}

.settings-menu a.active {
    background: var(--mint);
    color: var(--accent-strong);
}

.settings-menu span {
    color: #9aa6ad;
}

.color-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    background: var(--stage-color);
    vertical-align: -1px;
}

.tag.success {
    background: #dff4e7;
    color: #176234;
}

.tag.danger {
    background: #ffe7e9;
    color: var(--rose);
}

.tag.open {
    background: #fff4d8;
    color: #8b5e12;
}

.tag.done {
    background: #dff4e7;
    color: #176234;
}

.tag.cancelled {
    background: #edf1f2;
    color: #64727b;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.search-bar {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto auto;
    gap: 10px;
    align-items: end;
    margin: 0 0 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-soft);
    padding: 12px;
}

.search-bar label {
    min-width: 0;
}

.modal {
    width: min(760px, calc(100vw - 30px));
    max-height: min(860px, calc(100vh - 30px));
    border: 0;
    border-radius: 16px;
    padding: 0;
    overflow: visible;
    background: transparent;
}

.modal::backdrop {
    background: rgba(12, 23, 28, .78);
}

.modal-card {
    max-width: none;
    max-height: min(860px, calc(100vh - 30px));
    overflow: auto;
    border-radius: 16px;
    padding: 24px;
    background: #fff;
    box-shadow: 0 24px 80px rgba(8, 24, 31, .24);
}

.modal-head {
    border-bottom: 1px solid var(--line);
    padding-bottom: 14px;
    margin-bottom: 4px;
}

.modal-head h2 {
    margin-bottom: 6px;
    font-size: 21px;
}

.modal-head p {
    margin-bottom: 0;
    color: var(--muted);
}

.modal-actions {
    position: sticky;
    bottom: -24px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin: 4px -24px -24px;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, .94);
    padding: 16px 24px;
}

.modal-actions form {
    margin: 0;
}

.modal-close-form {
    position: absolute;
    z-index: 2;
    top: 14px;
    right: 14px;
    margin: 0;
}

.lead-detail-modal {
    width: min(980px, calc(100vw - 30px));
}

.patient-record-modal {
    width: min(980px, calc(100vw - 30px));
}

.lead-detail-card {
    display: grid;
    gap: 18px;
    padding: 0;
}

.patient-record-card {
    display: grid;
    gap: 18px;
    padding: 0;
    overflow-x: hidden;
}

.patient-record-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 1px solid var(--line);
    padding: 26px 76px 20px 28px;
}

.patient-record-head > div {
    min-width: 0;
}

.patient-record-head h2 {
    margin: 5px 0 6px;
    font-size: 28px;
    overflow-wrap: anywhere;
}

.patient-record-head p {
    margin: 0;
    color: var(--muted);
}

.patient-record-head .tag {
    flex: 0 0 auto;
    margin-top: 4px;
}

.patient-record-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    margin: 0 28px;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
}

.patient-record-grid div {
    display: grid;
    gap: 5px;
    min-width: 0;
    padding: 14px;
    background: var(--surface-soft);
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.patient-record-grid div:nth-child(4n) {
    border-right: 0;
}

.patient-record-grid div:nth-last-child(-n + 4) {
    border-bottom: 0;
}

.patient-record-grid span,
.patient-record-notes span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.patient-record-grid strong {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 13px;
}

.patient-record-notes {
    display: grid;
    gap: 8px;
    margin: 0 28px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-soft);
    padding: 14px;
}

.patient-record-notes p {
    margin: 0;
    color: #33444f;
    line-height: 1.55;
}

.patient-history {
    display: grid;
    gap: 12px;
    border-top: 1px solid var(--line);
    padding: 22px 28px 28px;
}

.patient-history-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

.patient-history-head h3 {
    margin: 0;
    font-size: 16px;
}

.patient-history-head span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.patient-timeline {
    display: grid;
    gap: 12px;
}

.patient-timeline article {
    display: grid;
    grid-template-columns: 14px minmax(0, 1fr);
    gap: 12px;
}

.timeline-marker {
    width: 10px;
    height: 10px;
    margin-top: 16px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--mint);
}

.timeline-content {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-soft);
    padding: 13px 14px;
}

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

.timeline-content header > div {
    min-width: 0;
}

.timeline-content header strong,
.timeline-content header span {
    display: block;
    overflow-wrap: anywhere;
}

.timeline-content header > div span,
.timeline-meta {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.timeline-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-top: 8px;
}

.timeline-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.inline-payment-form {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) auto;
    gap: 8px;
    align-items: center;
    margin-top: 12px;
}

.payout-payment-form {
    display: grid;
    grid-template-columns: 140px minmax(150px, 1fr) auto;
    gap: 8px;
    align-items: center;
    min-width: 420px;
}

.payout-payment-form input,
.payout-payment-form select {
    min-height: 36px;
}

.care-note-form {
    display: grid;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-soft);
    margin-top: 12px;
    padding: 12px;
}

.care-note-form label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.care-note-form textarea {
    min-height: 92px;
    resize: vertical;
}

.care-note-form .button {
    justify-self: end;
}

.timeline-content p {
    margin: 10px 0 0;
    color: #33444f;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.finance-metrics strong {
    font-size: 26px;
    line-height: 1.12;
}

.patient-record-card > .modal-actions {
    bottom: 0;
    margin: 0;
    border-radius: 0 0 16px 16px;
    padding: 16px 28px;
}

.activity-form {
    display: grid;
    gap: 12px;
}

.lead-profile-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 1px solid var(--line);
    padding: 26px 28px 20px;
}

.lead-profile-head h2 {
    margin: 5px 0 6px;
    font-size: 28px;
}

.lead-profile-head p {
    margin: 0;
    color: var(--muted);
}

.profile-kicker {
    color: var(--accent);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.stage-badge {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--stage-color, var(--accent)) 14%, white);
    color: var(--stage-color, var(--accent));
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.lead-summary-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0 28px;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
}

.lead-summary-strip div {
    display: grid;
    gap: 5px;
    min-width: 0;
    padding: 14px;
    background: var(--surface-soft);
}

.lead-summary-strip div + div {
    border-left: 1px solid var(--line);
}

.lead-summary-strip span,
.lead-notes span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.lead-summary-strip strong {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 13px;
}

.lead-action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 28px;
}

.stage-inline-form {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.stage-inline-form select {
    min-width: 210px;
}

.lead-workspace {
    display: grid;
    grid-template-columns: minmax(300px, .9fr) minmax(0, 1.1fr);
    gap: 18px;
    border-top: 1px solid var(--line);
    padding: 22px 28px 28px;
}

.lead-compose,
.lead-history {
    min-width: 0;
}

.lead-compose h3,
.lead-history h3 {
    margin: 0 0 12px;
    font-size: 16px;
}

.activity-list {
    display: grid;
    gap: 10px;
}

.activity-list article {
    border-left: 3px solid var(--accent);
    border-radius: 0 12px 12px 0;
    background: var(--surface-soft);
    padding: 13px 14px;
}

.activity-list header,
.activity-list footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.activity-list header span,
.activity-list footer small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.activity-list p {
    margin: 9px 0;
    color: #344651;
    line-height: 1.5;
}

.activity-meta-line {
    color: var(--muted) !important;
    font-size: 12px;
    font-weight: 800;
}

.task-kanban {
    display: grid;
    grid-template-columns: repeat(6, minmax(270px, 1fr));
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.task-column {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.task-column.late { border-top: 4px solid var(--rose); }
.task-column.today { border-top: 4px solid var(--accent); }
.task-column.upcoming { border-top: 4px solid #3b82f6; }
.task-column.no_due { border-top: 4px solid var(--amber); }
.task-column.done { border-top: 4px solid #176234; }
.task-column.cancelled { border-top: 4px solid #8b98a0; }

.task-column-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--line);
    padding: 14px;
}

.task-column-head h2 {
    margin: 0 0 4px;
    font-size: 15px;
}

.task-column-head span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.task-column-head strong {
    display: grid;
    place-items: center;
    min-width: 28px;
    height: 28px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--ink);
    font-size: 13px;
}

.task-column-body {
    display: grid;
    gap: 10px;
    min-height: 320px;
    padding: 12px;
}

.task-card {
    display: grid;
    gap: 12px;
    align-items: start;
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent);
    border-radius: 12px;
    background: var(--surface-soft);
    padding: 13px;
}

.task-card.late {
    border-left-color: var(--rose);
}

.task-card.upcoming {
    border-left-color: #3b82f6;
}

.task-card.no_due {
    border-left-color: var(--amber);
}

.task-card.done {
    border-left-color: #176234;
}

.task-card.cancelled {
    border-left-color: #8b98a0;
}

.task-card h2 {
    margin: 4px 0 7px;
    font-size: 15px;
}

.task-card p {
    margin-bottom: 12px;
    color: #344651;
    line-height: 1.5;
}

.task-date {
    color: var(--accent-strong);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.task-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.task-card-top .tag {
    flex: 0 0 auto;
}

.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.task-meta span {
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    padding: 5px 9px;
    font-size: 12px;
    font-weight: 750;
}

.task-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
    align-items: center;
}

.task-actions form {
    margin: 0;
}

.task-empty {
    border: 1px dashed var(--line);
    border-radius: 12px;
    margin: 0;
    padding: 18px;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

.calendar-board {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.calendar-weekdays,
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(145px, 1fr));
}

.calendar-weekdays {
    border-bottom: 1px solid var(--line);
    background: var(--surface-soft);
}

.calendar-weekdays span {
    padding: 12px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.calendar-grid {
    overflow-x: auto;
}

.calendar-day {
    min-height: 150px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 10px;
    background: #fff;
}

.calendar-day:nth-child(7n) {
    border-right: 0;
}

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

.calendar-day header strong {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    color: #33444f;
}

.calendar-day header span {
    border-radius: 999px;
    background: var(--mint);
    color: var(--accent-strong);
    padding: 3px 7px;
    font-size: 11px;
    font-weight: 900;
}

.calendar-day.today header strong {
    background: var(--accent);
    color: #fff;
}

.calendar-day.muted-day {
    background: #f5f8f7;
}

.calendar-day.muted-day header strong {
    color: #9aa6ad;
}

.calendar-events {
    display: grid;
    gap: 6px;
}

.calendar-event {
    display: grid;
    gap: 2px;
    width: 100%;
    border: 0;
    border-left: 3px solid var(--accent);
    border-radius: 0 8px 8px 0;
    background: var(--surface-soft);
    padding: 7px 8px;
    cursor: pointer;
    font: inherit;
    text-align: left;
    transition: box-shadow .16s ease, transform .16s ease;
}

.calendar-event:hover {
    box-shadow: 0 10px 22px rgba(29, 48, 55, .10);
    transform: translateY(-1px);
}

.calendar-event.open {
    border-left-color: var(--accent);
}

.calendar-event.success {
    border-left-color: #176234;
    background: #eef8f0;
}

.calendar-event.danger {
    border-left-color: #b84f57;
    background: #fff3f4;
}

.calendar-event.done {
    border-left-color: #176234;
}

.calendar-event.cancelled {
    border-left-color: #8b98a0;
    opacity: .72;
}

.calendar-event span {
    color: var(--accent-strong);
    font-size: 11px;
    font-weight: 900;
}

.calendar-event strong {
    color: var(--ink);
    font-size: 12px;
    line-height: 1.25;
}

.calendar-event small {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.25;
}

.professional-appointments-calendar .calendar-day {
    min-height: 168px;
}

.task-detail-modal {
    width: min(860px, calc(100vw - 30px));
    max-height: calc(100vh - 44px);
}

.task-detail-card {
    padding: 0;
    overflow: visible;
    max-height: none;
}

.task-detail-card .lead-profile-head {
    padding-right: 72px;
}

.task-detail-card .lead-profile-head .tag {
    margin-right: 20px;
    align-self: flex-start;
}

.task-summary-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 4px;
    margin-bottom: 18px;
}

.task-summary-strip div {
    min-height: 74px;
    align-content: center;
}

.task-detail-body {
    margin: 0 28px 22px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-soft);
    padding: 18px;
}

.task-detail-body.edit {
    display: grid;
    gap: 12px;
}

.task-detail-body span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.task-detail-body p {
    margin: 7px 0 0;
    color: #344651;
    line-height: 1.55;
}

.task-detail-card .modal-actions {
    position: static;
    margin: 0;
    border-radius: 0 0 16px 16px;
    background: #fff;
    padding-top: 14px;
    padding-bottom: 14px;
}

.task-edit-form {
    display: grid;
}

.compact-actions {
    justify-content: flex-end;
    border-top: 0;
    padding-top: 0;
    margin-top: -8px !important;
}

.activity-list footer .button {
    margin-left: auto;
}

.lead-action-bar > .button {
    flex: 0 0 auto;
}

.lead-action-bar > form:not(.stage-inline-form) {
    flex: 0 0 auto;
    margin: 0;
}

.stage-inline-form {
    flex-wrap: wrap;
}

.select-search-field,
[data-professional-link-field] {
    position: relative;
    display: grid;
    gap: 8px;
}

.select-search-field input[type="search"],
[data-professional-link-field] input[type="search"] {
    border-color: rgba(8, 127, 120, .28);
    background: #fff;
}

.select-search-field select,
[data-professional-link-field] select {
    min-height: 44px;
}

.select-search-results {
    display: grid;
    gap: 6px;
    border: 1px solid rgba(8, 127, 120, .18);
    border-radius: 8px;
    background: #fff;
    padding: 8px;
    box-shadow: 0 16px 32px rgba(34, 51, 59, .10);
}

.select-search-results[hidden] {
    display: none;
}

.select-search-option {
    display: grid;
    gap: 2px;
    width: 100%;
    border: 1px solid transparent;
    border-radius: 8px;
    background: #f8fbfa;
    padding: 9px 10px;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.select-search-option:hover,
.select-search-option.selected {
    border-color: rgba(8, 127, 120, .25);
    background: rgba(8, 127, 120, .08);
}

.select-search-option strong {
    font-size: 13px;
}

.select-search-option span,
.select-search-empty {
    color: var(--muted);
    font-size: 12px;
}

.modal-card::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.modal-card::-webkit-scrollbar-track {
    background: transparent;
}

.modal-card::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(102, 116, 125, .24);
}

.modal-card::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 116, 125, .36);
}

.lead-notes {
    margin: -8px 28px 28px;
    border-top: 1px solid var(--line);
    padding-top: 16px;
}

.lead-notes p {
    margin: 6px 0 0;
    color: #344651;
    line-height: 1.55;
}

.is-guest .app-shell {
    grid-template-columns: 1fr;
}

.is-guest .sidebar {
    position: absolute;
    inset: 0 0 auto 0;
    height: 92px;
    flex-direction: row;
    align-items: center;
    border-right: 0;
    border-bottom: 1px solid rgba(217, 227, 224, .75);
    background: rgba(255, 255, 255, .68);
    backdrop-filter: blur(18px);
}

.is-guest .db-pill {
    margin: 0 0 0 auto;
}

.is-guest .content {
    min-height: 100vh;
    padding: 116px 7vw 44px;
    background:
        linear-gradient(135deg, rgba(8, 127, 120, .10), rgba(196, 122, 40, .08) 42%, rgba(255, 255, 255, 0) 70%),
        var(--bg);
}

.is-guest .topbar {
    display: none;
}

.is-guest .form-card {
    max-width: none;
}

@media (max-width: 920px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: static;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }
    .nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .db-pill { margin-top: 0; }
    .metrics-grid,
    .work-grid,
    .split,
    .lead-workspace,
    .login-panel,
    .settings-layout { grid-template-columns: 1fr; }

    .availability-row {
        grid-template-columns: 1fr;
    }

    .availability-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .appointment-availability {
        grid-template-columns: 1fr;
    }

    .professional-calendar-days {
        grid-template-columns: 1fr;
    }

    .availability-note {
        grid-column: auto;
    }

    .lead-summary-strip,
    .patient-record-grid { grid-template-columns: 1fr 1fr; }

    .patient-record-grid div:nth-child(4n) { border-right: 1px solid var(--line); }
    .patient-record-grid div:nth-child(2n) { border-right: 0; }
    .patient-record-grid div:nth-last-child(-n + 4) { border-bottom: 1px solid var(--line); }
    .patient-record-grid div:nth-last-child(-n + 2) { border-bottom: 0; }

    .login-copy h2 { font-size: 38px; }
}

@media (max-width: 560px) {
    .content,
    .sidebar { padding: 18px; }
    .topbar { display: grid; }
    .nav { grid-template-columns: 1fr 1fr; }
    .metrics-grid { grid-template-columns: 1fr 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .search-bar { grid-template-columns: 1fr; }
    .availability-fields { grid-template-columns: 1fr; }
    .availability-preview { align-items: flex-start; flex-direction: column; }
    .appointment-selection-summary,
    .professional-calendar-head { align-items: flex-start; flex-direction: column; }
    .appointment-selection-summary span { text-align: left; }
    .inline-payment-form { grid-template-columns: 1fr; }
    .loyalty-record-form { grid-template-columns: 1fr; }
    .lead-profile-head,
    .patient-record-head,
    .lead-action-bar,
    .stage-inline-form,
    .toolbar-actions { align-items: stretch; flex-direction: column; }
    .task-detail-card .lead-profile-head { padding-right: 28px; }
    .patient-record-head { padding-right: 28px; }
    .task-detail-card .lead-profile-head .tag { margin-right: 0; width: fit-content; }
    .lead-summary-strip,
    .patient-record-grid { grid-template-columns: 1fr; }
    .lead-summary-strip div + div {
        border-left: 0;
        border-top: 1px solid var(--line);
    }
    .patient-record-grid div,
    .patient-record-grid div:nth-child(2n),
    .patient-record-grid div:nth-child(4n),
    .patient-record-grid div:nth-last-child(-n + 2),
    .patient-record-grid div:nth-last-child(-n + 4) {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }
    .patient-record-grid div:last-child { border-bottom: 0; }
    .stage-inline-form,
    .stage-inline-form select { width: 100%; }
    .activity-list header,
    .activity-list footer,
    .module-toolbar { align-items: flex-start; flex-direction: column; }
    .task-kanban { grid-template-columns: repeat(6, minmax(250px, 1fr)); }
    .calendar-board { overflow-x: auto; }
    .calendar-weekdays,
    .calendar-grid { min-width: 900px; }
    .task-actions { justify-content: flex-start; }
}

/* Modern interface layer */
:root {
    --bg: #edf3f1;
    --surface: rgba(255, 255, 255, .94);
    --surface-soft: #f6faf9;
    --ink: #14242b;
    --muted: #64737c;
    --line: rgba(174, 196, 191, .55);
    --line-strong: rgba(135, 164, 158, .66);
    --accent: #087f78;
    --accent-strong: #055f5b;
    --mint: #ddf4ef;
    --amber: #bf7829;
    --rose: #b84f57;
    --tech-cyan: #1fa6b8;
    --tech-lime: #6aa84f;
    --text: #14242b;
    --shadow: 0 20px 60px rgba(27, 48, 56, .11);
    --shadow-hover: 0 24px 70px rgba(14, 55, 66, .16);
    --ease-out: cubic-bezier(.2, .8, .2, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    background:
        linear-gradient(90deg, rgba(8, 127, 120, .045) 1px, transparent 1px),
        linear-gradient(0deg, rgba(31, 166, 184, .04) 1px, transparent 1px),
        linear-gradient(135deg, #f4f8f7 0%, #e9f1f0 42%, #f8faf6 100%);
    background-size: 44px 44px, 44px 44px, auto;
    font-family: "Inter", "Segoe UI", Arial, Helvetica, sans-serif;
    text-rendering: geometricPrecision;
}

.app-shell {
    grid-template-columns: 286px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    border-right: 1px solid rgba(229, 238, 235, .14);
    background:
        linear-gradient(180deg, rgba(7, 67, 67, .98), rgba(13, 47, 51, .99) 56%, rgba(26, 39, 39, .98)),
        repeating-linear-gradient(135deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 11px);
    box-shadow: 18px 0 55px rgba(17, 47, 51, .18);
    color: #eaf8f5;
}

.brand {
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 16px;
    background: rgba(255, 255, 255, .07);
    padding: 10px;
    backdrop-filter: blur(16px);
}

.brand-mark {
    border: 1px solid rgba(255, 255, 255, .16);
    background: linear-gradient(135deg, #08a193, #1fa6b8 58%, #6aa84f);
    box-shadow: 0 16px 34px rgba(0, 0, 0, .20), inset 0 1px 0 rgba(255, 255, 255, .34);
}

.brand-mark-logo {
    overflow: hidden;
    border-color: rgba(255, 255, 255, .28);
    background: #fff;
    padding: 5px;
}

.brand small {
    color: rgba(234, 248, 245, .66);
}

.nav {
    gap: 7px;
    padding-bottom: 8px;
}

.nav a,
.nav summary {
    border: 1px solid transparent;
    border-radius: 12px;
    color: rgba(234, 248, 245, .72);
    transition: transform .18s var(--ease-out), background .18s var(--ease-out), border-color .18s var(--ease-out), color .18s var(--ease-out), box-shadow .18s var(--ease-out);
}

.nav a:hover,
.nav summary:hover {
    border-color: rgba(255, 255, 255, .10);
    background: rgba(255, 255, 255, .08);
    color: #fff;
    transform: translateX(3px);
}

.nav a.active,
.nav summary.active {
    border-color: rgba(102, 216, 206, .28);
    background: linear-gradient(135deg, rgba(10, 155, 144, .28), rgba(31, 166, 184, .18));
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .13), 0 12px 28px rgba(0, 0, 0, .12);
}

.nav a.active::before,
.nav summary.active::before {
    left: 8px;
    top: 11px;
    bottom: 11px;
    background: #79e2d5;
    box-shadow: 0 0 14px rgba(121, 226, 213, .74);
}

.nav-group > div {
    border-left: 1px solid rgba(255, 255, 255, .10);
    margin-left: 10px;
    padding-left: 10px;
}

.nav-group summary::after {
    color: rgba(234, 248, 245, .62);
}

.db-pill {
    border-color: rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .07);
    color: rgba(234, 248, 245, .70);
    backdrop-filter: blur(16px);
    flex: 0 0 auto;
}

.db-pill.online span {
    background: #79e2d5;
    box-shadow: 0 0 0 5px rgba(121, 226, 213, .12), 0 0 18px rgba(121, 226, 213, .70);
}

.content {
    padding: 34px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 9;
    margin: -34px -34px 28px;
    border-bottom: 1px solid rgba(174, 196, 191, .42);
    background: rgba(237, 243, 241, .78);
    padding: 24px 34px 18px;
    backdrop-filter: blur(22px);
}

.eyebrow {
    color: var(--accent);
    font-weight: 850;
}

h1 {
    font-size: 31px;
    font-weight: 850;
}

h2 {
    color: #162b32;
    font-weight: 850;
}

.user-box,
.module-toolbar,
.metrics-grid article,
.module-panel,
.form-card,
.table-card,
.kanban-column,
.settings-menu,
.search-bar,
.finance-mini-card,
.appointment-availability,
.availability-row,
.task-detail-body,
.patient-record-notes {
    border-color: rgba(174, 196, 191, .52);
    background: rgba(255, 255, 255, .86);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.module-toolbar,
.table-card,
.module-panel,
.form-card {
    border-radius: 18px;
}

.module-toolbar,
.section-head {
    animation: rise-in .42s var(--ease-out) both;
}

.metrics-grid article,
.kanban-column,
.table-card,
.module-panel,
.form-card {
    animation: card-in .44s var(--ease-out) both;
}

.metrics-grid article {
    border-radius: 18px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .96), rgba(246, 250, 249, .88)),
        linear-gradient(90deg, rgba(8, 127, 120, .10), transparent);
    transition: transform .18s var(--ease-out), box-shadow .18s var(--ease-out), border-color .18s var(--ease-out);
}

.metrics-grid article:hover,
.module-panel:hover,
.table-card:hover {
    border-color: rgba(8, 127, 120, .22);
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.metrics-grid article::after {
    right: 20px;
    bottom: 20px;
    width: 56px;
    height: 6px;
    background: linear-gradient(90deg, var(--accent), var(--tech-cyan), var(--tech-lime));
    box-shadow: 0 0 22px rgba(31, 166, 184, .22);
}

.metrics-grid strong {
    color: #10272f;
    font-weight: 900;
}

button,
.button,
.pagination a,
.filter-bar a,
.subnav a {
    transition: transform .16s var(--ease-out), box-shadow .16s var(--ease-out), border-color .16s var(--ease-out), background .16s var(--ease-out), color .16s var(--ease-out);
}

.button.primary {
    border-color: transparent;
    background: linear-gradient(135deg, var(--accent), #10998e 55%, var(--tech-cyan));
    color: #fff;
    box-shadow: 0 12px 28px rgba(8, 127, 120, .22);
}

.button.primary:hover {
    box-shadow: 0 16px 34px rgba(8, 127, 120, .30);
    transform: translateY(-1px);
}

.button.secondary,
.pagination a,
.filter-bar a,
.subnav a {
    background: rgba(255, 255, 255, .76);
}

.button.secondary:hover,
.pagination a:hover,
.filter-bar a:hover,
.subnav a:hover {
    border-color: rgba(8, 127, 120, .28);
    color: var(--accent-strong);
    transform: translateY(-1px);
}

input,
select,
textarea {
    border-color: rgba(146, 171, 166, .62);
    border-radius: 11px;
    background: rgba(255, 255, 255, .95);
    color: var(--ink);
    transition: border-color .16s var(--ease-out), box-shadow .16s var(--ease-out), background .16s var(--ease-out);
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(8, 127, 120, .66);
    box-shadow: 0 0 0 4px rgba(8, 127, 120, .12), 0 12px 28px rgba(29, 48, 55, .08);
    outline: 0;
}

.search-bar {
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255, 255, 255, .90), rgba(238, 248, 246, .82));
}

table {
    border-collapse: separate;
    border-spacing: 0;
}

th {
    background: rgba(246, 250, 249, .84);
    color: #60717a;
    font-weight: 900;
}

tbody tr {
    transition: background .16s var(--ease-out);
}

tbody tr:hover {
    background: rgba(221, 244, 239, .38);
}

.tag {
    border: 1px solid rgba(8, 127, 120, .10);
    font-weight: 850;
}

.kanban {
    gap: 14px;
    padding: 2px 2px 12px;
}

.kanban-column {
    border-top-width: 0;
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(246, 250, 249, .88));
    overflow: hidden;
}

.kanban-column::before {
    content: "";
    display: block;
    height: 4px;
    margin: -14px -14px 13px;
    background: linear-gradient(90deg, var(--stage-color, var(--accent)), rgba(31, 166, 184, .58));
}

.kanban-column.drag-over {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--stage-color, var(--accent)) 18%, transparent), var(--shadow-hover);
    transform: translateY(-2px);
}

.lead-card,
.professional-slot-card,
.calendar-event,
.activity-list article,
.task-card,
.select-search-option {
    transition: transform .16s var(--ease-out), box-shadow .16s var(--ease-out), border-color .16s var(--ease-out), background .16s var(--ease-out);
}

.lead-card,
.professional-slot-card,
.activity-list article,
.task-card {
    border-color: rgba(174, 196, 191, .52);
    background: rgba(255, 255, 255, .88);
}

.lead-card:hover,
.professional-slot-card:hover,
.activity-list article:hover,
.task-card:hover {
    border-color: rgba(8, 127, 120, .24);
    box-shadow: 0 16px 36px rgba(30, 55, 62, .12);
    transform: translateY(-2px);
}

.modal::backdrop {
    background:
        linear-gradient(135deg, rgba(8, 29, 34, .86), rgba(9, 61, 62, .76)),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, .04) 0 1px, transparent 1px 18px);
    backdrop-filter: blur(8px);
}

.modal-card {
    border: 1px solid rgba(255, 255, 255, .74);
    border-radius: 20px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(248, 252, 251, .95));
    box-shadow: 0 32px 90px rgba(4, 23, 28, .30);
    animation: modal-in .22s var(--ease-out) both;
}

.modal-head {
    position: relative;
}

.modal-head::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 84px;
    height: 2px;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--accent), var(--tech-cyan), var(--tech-lime));
}

.modal-actions {
    background: rgba(255, 255, 255, .84);
    backdrop-filter: blur(16px);
}

.icon-button {
    box-shadow: 0 10px 24px rgba(24, 44, 52, .10);
}

.select-search-results {
    border-radius: 12px;
    box-shadow: 0 18px 42px rgba(29, 48, 55, .14);
}

.calendar-board,
.task-kanban {
    animation: rise-in .42s var(--ease-out) both;
}

.calendar-event {
    background: rgba(255, 255, 255, .88);
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    border: 3px solid transparent;
    border-radius: 999px;
    background: rgba(83, 112, 117, .26);
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(8, 127, 120, .42);
    background-clip: padding-box;
}

@keyframes card-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: translateY(14px) scale(.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}

@media (max-width: 920px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
    }

    .topbar {
        position: static;
        margin: 0 0 24px;
        border-radius: 18px;
    }
}

@media (max-width: 560px) {
    .content,
    .sidebar {
        padding: 18px;
    }

    .topbar {
        display: grid;
        padding: 18px;
    }

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

    .nav {
        grid-template-columns: 1fr 1fr;
    }
}

/* Premium motion layer */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        linear-gradient(115deg, transparent 0 22%, rgba(31, 166, 184, .10) 30%, transparent 42%),
        linear-gradient(245deg, transparent 0 34%, rgba(106, 168, 79, .08) 46%, transparent 58%),
        linear-gradient(180deg, rgba(255, 255, 255, .38), transparent 38%);
    background-size: 180% 180%, 170% 170%, auto;
    animation: ambient-shift 16s ease-in-out infinite alternate;
}

.sidebar::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, transparent, rgba(121, 226, 213, .10), transparent),
        linear-gradient(180deg, rgba(255, 255, 255, .10), transparent 24%);
    mask-image: linear-gradient(180deg, black, transparent 72%);
}

.sidebar {
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-gutter: stable;
}

.brand {
    position: relative;
}

.brand::after {
    content: "";
    position: absolute;
    inset: auto 12px -1px 12px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(121, 226, 213, .75), transparent);
}

.brand strong {
    color: #fff;
    font-size: 18px;
}

.nav a,
.nav summary {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav a::after,
.nav summary::before {
    content: "";
    position: static;
    flex: 0 0 auto;
    order: -1;
    width: 8px;
    height: 8px;
    border: 1px solid currentColor;
    border-radius: 3px;
    opacity: .58;
    transform: rotate(45deg);
    transition: opacity .18s var(--ease-out), box-shadow .18s var(--ease-out), background .18s var(--ease-out);
}

.nav a.active::after,
.nav a:hover::after,
.nav summary.active::before,
.nav summary:hover::before {
    background: #79e2d5;
    border-color: #79e2d5;
    box-shadow: 0 0 16px rgba(121, 226, 213, .82);
    opacity: 1;
}

.nav summary::after {
    margin-left: auto;
}

.topbar {
    box-shadow: 0 18px 44px rgba(30, 52, 58, .07);
}

.topbar h1 {
    background: linear-gradient(135deg, #10272f, #087f78 52%, #1f7f91);
    background-clip: text;
    color: transparent;
}

.user-box {
    position: relative;
    overflow: hidden;
}

.user-box::before,
.module-toolbar::before,
.table-card::before,
.module-panel::before,
.form-card::before,
.metrics-grid article::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255, 255, 255, .52), transparent 34%, rgba(31, 166, 184, .06));
}

.module-toolbar,
.table-card,
.module-panel,
.form-card,
.metrics-grid article {
    position: relative;
    overflow: hidden;
}

.module-toolbar::after,
.table-card::after,
.module-panel::after,
.form-card::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(8, 127, 120, .28), rgba(31, 166, 184, .10), rgba(106, 168, 79, .24));
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
}

.section-head h2 {
    font-size: 20px;
}

.section-head span,
.module-toolbar span {
    line-height: 1.45;
}

.metrics-grid article {
    isolation: isolate;
}

.metrics-grid article strong {
    position: relative;
    z-index: 1;
    font-size: 42px;
}

.metrics-grid article span {
    position: relative;
    z-index: 1;
    color: #536872;
}

.button {
    position: relative;
    isolation: isolate;
    overflow: hidden;
}

.button::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(110deg, transparent, rgba(255, 255, 255, .28), transparent);
    transform: translateX(-120%);
    transition: transform .42s var(--ease-out);
}

.button:hover::before {
    transform: translateX(120%);
}

.button.primary:active,
.button.secondary:active,
.icon-button:active {
    transform: translateY(1px) scale(.99);
}

.table-wrap {
    border: 1px solid rgba(174, 196, 191, .42);
    border-radius: 14px;
    overflow: auto;
    background: rgba(255, 255, 255, .72);
}

th:first-child,
td:first-child {
    padding-left: 16px;
}

th:last-child,
td:last-child {
    padding-right: 16px;
}

thead th:first-child {
    border-top-left-radius: 14px;
}

thead th:last-child {
    border-top-right-radius: 14px;
}

.tag {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .50);
}

.kanban-column {
    min-width: 260px;
}

.kanban-head h2 {
    font-size: 16px;
}

.add-lead {
    min-width: 34px;
    min-height: 34px;
    border-radius: 10px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .62);
}

.lead-card,
.task-card,
.professional-slot-card,
.calendar-event {
    border-radius: 14px;
}

.lead-card {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .95), rgba(246, 250, 249, .86)),
        linear-gradient(90deg, color-mix(in srgb, var(--stage-color, var(--accent)) 12%, transparent), transparent);
}

.lead-card-button:hover {
    box-shadow: 0 18px 44px rgba(23, 55, 64, .15);
}

.appointment-slot-button,
.professional-select-label,
.professional-slot-list span,
.professional-next-slots span {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55);
}

.modal {
    animation: modal-shell-in .20s var(--ease-out) both;
}

.modal-card {
    position: relative;
    overflow: auto;
}

.modal-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 92px;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(8, 127, 120, .075), transparent);
    border-radius: 20px 20px 0 0;
}

.modal-card > * {
    position: relative;
}

.modal-close-form .icon-button {
    border-color: rgba(255, 255, 255, .78);
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(12px);
}

.search-bar input {
    min-height: 46px;
    font-size: 15px;
}

.select-search-results {
    animation: result-pop .16s var(--ease-out) both;
}

.select-search-option:hover {
    transform: translateX(2px);
}

.patient-record-card,
.task-detail-card {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(247, 252, 251, .95));
}

.patient-record-head,
.lead-profile-head {
    background:
        linear-gradient(135deg, rgba(8, 127, 120, .08), rgba(31, 166, 184, .05), transparent);
}

.patient-record-grid div,
.lead-summary-strip div,
.task-summary-strip div {
    background: rgba(255, 255, 255, .54);
}

.calendar-grid,
.calendar-weekdays {
    border-color: rgba(174, 196, 191, .45);
}

.calendar-day {
    background: rgba(255, 255, 255, .64);
}

.calendar-day:hover {
    background: rgba(221, 244, 239, .46);
}

@keyframes ambient-shift {
    from {
        background-position: 0% 20%, 100% 60%, center;
    }
    to {
        background-position: 100% 55%, 0% 20%, center;
    }
}

@keyframes result-pop {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modal-shell-in {
    from {
        opacity: .6;
    }
    to {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    body::before {
        animation: none !important;
    }
}

/* Performance balance layer */
body::before {
    background:
        linear-gradient(115deg, transparent 0 24%, rgba(31, 166, 184, .055) 34%, transparent 48%),
        linear-gradient(180deg, rgba(255, 255, 255, .22), transparent 38%);
    background-size: auto;
    animation: none;
}

.sidebar::before {
    opacity: .45;
    mask-image: none;
}

.topbar,
.brand,
.db-pill,
.modal-actions,
.modal-close-form .icon-button {
    backdrop-filter: none;
}

.modal::backdrop {
    background: rgba(8, 29, 34, .72);
    backdrop-filter: none;
}

.user-box,
.module-toolbar,
.metrics-grid article,
.module-panel,
.form-card,
.table-card,
.kanban-column,
.settings-menu,
.search-bar,
.finance-mini-card,
.appointment-availability,
.availability-row,
.task-detail-body,
.patient-record-notes {
    box-shadow: 0 10px 28px rgba(27, 48, 56, .07);
}

.modal-card {
    box-shadow: 0 22px 52px rgba(4, 23, 28, .22);
    animation: none;
}

.module-toolbar,
.section-head,
.metrics-grid article,
.kanban-column,
.table-card,
.module-panel,
.form-card,
.calendar-board,
.task-kanban,
.select-search-results,
.modal {
    animation: none;
}

.module-toolbar::after,
.table-card::after,
.module-panel::after,
.form-card::after {
    display: none;
}

.button::before {
    display: none;
}

.metrics-grid article:hover,
.module-panel:hover,
.table-card:hover,
.lead-card:hover,
.professional-slot-card:hover,
.activity-list article:hover,
.task-card:hover {
    box-shadow: 0 14px 34px rgba(14, 55, 66, .10);
}

/* CRM kanban: clear side-by-side columns */
.kanban {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(280px, 1fr);
    grid-template-columns: none;
    gap: 16px;
    align-items: start;
    overflow-x: auto;
    padding: 2px 2px 14px;
}

.kanban-column {
    position: relative;
    min-width: 280px;
    overflow: visible;
    transform: none;
}

.kanban-column:hover {
    transform: none;
}

.kanban-column::before {
    margin: 0 0 13px;
    border-radius: 999px;
}

.kanban-head {
    position: relative;
    z-index: 2;
    align-items: center;
    min-height: 44px;
}

.kanban-head > div {
    min-width: 0;
}

.kanban-head h2 {
    overflow-wrap: anywhere;
}

.add-lead {
    position: relative;
    z-index: 3;
    flex: 0 0 34px;
}

.lead-card {
    position: relative;
    z-index: 1;
}

.public-schedule-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 18% 0%, rgba(8, 127, 120, .16), transparent 30%),
        linear-gradient(135deg, #eef6f3 0%, #f7faf8 48%, #edf2f7 100%);
}

.public-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 34px 0 54px;
}

.public-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 26px;
    align-items: end;
    padding: 34px 0 28px;
}

.public-brand {
    display: inline-flex;
    align-items: center;
    height: 34px;
    border: 1px solid rgba(8, 127, 120, .18);
    border-radius: 999px;
    padding: 0 14px;
    background: rgba(255, 255, 255, .72);
    color: var(--accent-strong);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

.public-hero h1 {
    max-width: 760px;
    margin: 18px 0 10px;
    font-size: clamp(34px, 5vw, 68px);
    line-height: .96;
    letter-spacing: 0;
}

.public-hero p {
    max-width: 660px;
    margin: 0;
    color: #53646d;
    font-size: 18px;
    line-height: 1.55;
}

.public-hero-panel,
.public-search-card,
.public-patient-form,
.public-success,
.public-professional-card,
.public-alert {
    border: 1px solid rgba(188, 205, 200, .82);
    border-radius: 8px;
    background: rgba(255, 255, 255, .86);
    box-shadow: 0 22px 70px rgba(31, 50, 58, .10);
}

.public-hero-panel {
    display: grid;
    gap: 8px;
    padding: 22px;
}

.public-hero-panel strong {
    color: var(--accent-strong);
    font-size: 20px;
}

.public-hero-panel span {
    color: var(--muted);
    line-height: 1.45;
}

.public-alert {
    margin-bottom: 18px;
    padding: 14px 16px;
    color: #7f1d1d;
    background: #fff1f2;
}

.public-success {
    display: grid;
    gap: 12px;
    padding: 28px;
}

.public-success span {
    color: var(--accent);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

.public-success h2 {
    margin: 0;
    font-size: 28px;
}

.public-success p {
    max-width: 760px;
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.public-scheduler {
    display: grid;
    gap: 18px;
}

.public-search-card {
    position: sticky;
    top: 14px;
    z-index: 5;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
    gap: 18px;
    align-items: end;
    padding: 18px;
}

.public-search-card label,
.public-patient-form label,
.public-professional-card label {
    display: grid;
    gap: 8px;
    color: #53646d;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.public-search-card input,
.public-patient-form input,
.public-patient-form textarea,
.public-professional-card select {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    outline: none;
}

.public-search-card input {
    min-height: 56px;
    padding: 0 18px;
    font-size: 17px;
    font-weight: 700;
}

.public-patient-form input,
.public-professional-card select {
    min-height: 44px;
    padding: 0 12px;
}

.public-patient-form textarea {
    resize: vertical;
    min-height: 86px;
    padding: 12px;
}

.public-selected {
    min-height: 56px;
    border-radius: 8px;
    padding: 14px 16px;
    background: #eef7f5;
    color: var(--accent-strong);
    font-weight: 800;
    line-height: 1.35;
}

.public-results {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.public-results > section,
.public-service-list,
.public-professional-list,
.public-professional-card,
.public-patient-form {
    display: grid;
    gap: 12px;
}

.public-section-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: end;
}

.public-section-head h2 {
    margin: 0;
    font-size: 20px;
}

.public-section-head span {
    max-width: 420px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.public-service-chip {
    width: 100%;
    border: 1px solid rgba(8, 127, 120, .18);
    border-radius: 8px;
    padding: 13px 14px;
    background: rgba(255, 255, 255, .88);
    color: #27444b;
    font: inherit;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
    transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.public-service-chip:hover,
.public-service-chip.active {
    transform: translateY(-1px);
    border-color: rgba(8, 127, 120, .44);
    background: #e5f4f1;
    color: var(--accent-strong);
}

.public-empty {
    border: 1px dashed var(--line-strong);
    border-radius: 8px;
    padding: 22px;
    background: rgba(255, 255, 255, .56);
    color: var(--muted);
    font-weight: 700;
}

.public-professional-card {
    padding: 18px;
}

.public-professional-card.selected {
    border-color: rgba(8, 127, 120, .42);
    box-shadow: 0 26px 76px rgba(8, 127, 120, .14);
}

.public-professional-card header {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
}

.public-professional-card strong {
    display: block;
    font-size: 18px;
}

.public-professional-card header span {
    color: var(--muted);
    font-size: 13px;
}

.public-professional-details {
    display: grid;
    gap: 14px;
    border-top: 1px solid var(--line);
    padding-top: 14px;
}

.public-professional-card [data-public-professional-toggle] {
    border-color: transparent;
    background: var(--accent);
    color: #fff;
    box-shadow: 0 12px 28px rgba(8, 127, 120, .20);
}

.public-professional-card [data-public-professional-toggle]:hover {
    background: var(--accent-strong);
    color: #fff;
}

.public-slot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    gap: 10px;
}

.public-slot-grid button {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 11px 12px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.public-slot-grid button:hover,
.public-slot-grid button.active {
    transform: translateY(-1px);
    border-color: var(--accent);
    box-shadow: 0 12px 26px rgba(8, 127, 120, .14);
}

.public-slot-grid span,
.public-slot-grid strong {
    display: block;
}

.public-slot-grid span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.public-slot-grid strong {
    margin-top: 3px;
    color: var(--accent-strong);
    font-size: 17px;
}

.public-patient-form {
    padding: 20px;
}

.public-form-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 6px;
}

.public-loyalty-form {
    max-width: none;
}

.public-plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.public-plan-card {
    position: relative;
    display: grid;
    gap: 7px;
    min-height: 154px;
    border: 1px solid rgba(8, 127, 120, .18);
    border-radius: 8px;
    background: #fff;
    padding: 16px;
    cursor: pointer;
    text-transform: none;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.public-plan-card input {
    position: absolute;
    inset: 14px 14px auto auto;
    width: 18px;
    height: 18px;
}

.public-plan-card span {
    max-width: calc(100% - 32px);
    color: var(--accent-strong);
    font-size: 16px;
    font-weight: 900;
}

.public-plan-card strong {
    color: var(--ink);
    font-size: 24px;
}

.public-plan-card small,
.public-plan-card em {
    color: var(--muted);
    font-size: 13px;
    font-style: normal;
    line-height: 1.4;
}

.public-plan-card:has(input:checked),
.public-plan-card:hover {
    transform: translateY(-1px);
    border-color: var(--accent);
    box-shadow: 0 16px 36px rgba(8, 127, 120, .14);
}

.public-plan-grid-single {
    grid-template-columns: minmax(0, 1fr);
}

.public-plan-card-static {
    cursor: default;
}

.public-plan-card-static:hover {
    transform: none;
}

@media (max-width: 900px) {
    .public-hero,
    .public-search-card,
    .public-results {
        grid-template-columns: 1fr;
    }

    .public-search-card {
        position: static;
    }
}

@media (max-width: 560px) {
    .public-shell {
        width: min(100% - 20px, 1180px);
        padding-top: 16px;
    }

    .public-hero {
        padding-top: 18px;
    }

    .public-hero h1 {
        font-size: 38px;
    }

    .public-section-head,
    .public-professional-card header {
        align-items: flex-start;
        flex-direction: column;
    }

    .public-form-actions .button {
        width: 100%;
    }
}
