:root {
    --white: #ffffff;
    --primary: #36414a;
    --primary-dark: #2c353d;
    --primary-soft: rgba(54, 65, 74, 0.10);
    --primary-border: rgba(54, 65, 74, 0.14);
    --background: #eef3f6;
    --surface: rgba(255, 255, 255, 0.82);
    --surface-solid: #ffffff;
    --border: rgba(54, 65, 74, 0.10);
    --text: #1f2933;
    --muted: #6b7280;
    --shadow-soft: 0 14px 38px rgba(54, 65, 74, 0.10);
}
body {
    background:
        radial-gradient(circle at 12% 8%, rgba(54, 65, 74, 0.08), transparent 30%),
        radial-gradient(circle at 85% 5%, rgba(54, 65, 74, 0.06), transparent 28%),
        linear-gradient(135deg, #eef3f6 0%, #f8fafb 48%, #edf3f5 100%);
        font-family: 'Poppins', sans-serif;
        color: var(--text);
}

.crm-sidebar {
    width: 260px;
    min-height: 100vh;
    background: var(--primary);
    position: fixed;
    top: 0;
    left: 0;
    padding: 24px 18px;
}

.crm-logo {
    max-width: 150px;
    margin-bottom: 32px;
}

.crm-sidebar a {
    color: var(--white);
    text-decoration: none;
    display: block;
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 6px;
    font-size: 15px;
}

.crm-sidebar a:hover,
.crm-sidebar a.active {
    background: rgba(255,255,255,0.12);
}

.crm-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
    padding: 24px;
}

.crm-title {
    font-weight: 600;
    letter-spacing: -0.5px;
}

.table td {
    font-weight: 400;
}

.table td:first-child {
    font-weight: 600;
}


.form-control,
.form-select {
    border-radius: 10px;
    border-color: var(--border);
}

.table th {
    color: var(--primary);
    font-weight: 600;
}

.badge-active {
    background: #d1fae5;
    color: #065f46;
}

.badge-inactive {
    background: #fee2e2;
    color: #991b1b;
}
.table th a {
    color: var(--primary);
    text-decoration: none;
}

.table th a:hover {
    text-decoration: underline;
}

/* Sidebar: charcoal brand, but softer and premium */
.crm-sidebar {
    margin: 22px 0 22px 22px;
    height: calc(100vh - 44px);
    min-height: auto;
    border-radius: 28px;
    background: linear-gradient(180deg, #36414a 0%, #2f3941 100%);
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: 0 20px 50px rgba(54, 65, 74, 0.22);
    padding: 26px 16px;
}

.crm-sidebar a {
    color: rgba(255, 255, 255, 0.74);
    font-size: 14px;
    border-radius: 14px;
    font-weight: 500;
}

.crm-sidebar a:hover,
.crm-sidebar a.active {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* Main spacing after floating sidebar */
.crm-main {
    margin-left: 282px;
    padding: 40px 40px 40px 34px;
}

/* Cards: slightly glass, still clean */
.crm-card {
    background: linear-gradient(145deg, rgba(255,255,255,0.92), rgba(255,255,255,0.76));
    border: 1px solid rgba(255,255,255,0.78);
    border-radius: 24px;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px);
}

/* Titles */
.crm-title {
    font-size: 31px;
    letter-spacing: -0.8px;
    color: var(--primary);
}

/* Primary buttons: charcoal, no purple */
.btn-crm {
    height: 45px;
    padding: 0 20px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 999px;

    font-weight: 600;
    text-decoration: none;
}

.btn-crm:hover {
    background: linear-gradient(135deg, #2c353d, #20272d);
    color: #ffffff;
}

/* Secondary buttons */
.btn-outline-secondary,
.btn-outline-primary,
.btn-outline-danger {
    border-radius: 999px;
    font-weight: 700;

    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Inputs */
.form-control,
.form-select {
    border-radius: 14px;
    border: 1px solid rgba(54, 65, 74, 0.12);
    background: rgba(255, 255, 255, 0.84);
    min-height: 45px;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(54, 65, 74, 0.35);
    box-shadow: 0 0 0 0.2rem rgba(54, 65, 74, 0.12);
}

/* Tables */
.table {
    border-collapse: separate;
    border-spacing: 0 8px;
    font-size: 13px;
}

.table th {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 8px 10px;
    border: 0;
}

.table th a {
    color: var(--muted);
    text-decoration: none;
}

.table th a:hover {
    color: var(--primary);
    text-decoration: none;
}

.table td {
    padding: 15px 10px;
    color: #586476;
    background: rgba(255, 255, 255, 0.72);
    border-top: 1px solid rgba(54, 65, 74, 0.06);
    border-bottom: 1px solid rgba(54, 65, 74, 0.06);
}

.table td:first-child {
    color: var(--text);
    font-weight: 800;
    border-left: 1px solid rgba(54, 65, 74, 0.06);
    border-radius: 14px 0 0 14px;
}

.table td:last-child {
    border-right: 1px solid rgba(54, 65, 74, 0.06);
    border-radius: 0 14px 14px 0;
}

/* Badges */
.badge-active,
.badge-inactive {
    display: inline-flex;
    align-items: center;
    height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 11px;
}

.badge-active {
    background: #d1fae5;
    color: #065f46;
}

.badge-inactive {
    background: #fee2e2;
    color: #991b1b;
}

/* Pagination */
.page-link {
    border-radius: 12px;
    margin: 0 3px;
    border: 0;
    color: var(--primary);
}

.page-item.active .page-link {
    background: var(--primary);
    color: #ffffff;
}


/* Sidebar polish */
.crm-logo-wrap {
    margin-bottom: 32px;
}

.crm-nav a {
    margin-bottom: 8px;
}

.crm-logout-form {
    margin-top: 28px;
}

.crm-logout-btn {
    width: 100%;
    border: 0;
    border-radius: 14px;
    padding: 12px 14px;
    background: rgba(255,255,255,0.12);
    color: #ffffff;
    font-weight: 500;
}

.crm-logout-btn:hover {
    background: rgba(255,255,255,0.18);
}

.crm-alert {
    border-radius: 16px;
    border: 0;
}

/* Login page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background:
        radial-gradient(circle at 12% 8%, rgba(54, 65, 74, 0.08), transparent 30%),
        radial-gradient(circle at 85% 5%, rgba(54, 65, 74, 0.06), transparent 28%),
        linear-gradient(135deg, #eef3f6 0%, #f8fafb 48%, #edf3f5 100%);
}

.login-card {
    width: 100%;
    max-width: 460px;
    background: linear-gradient(145deg, rgba(255,255,255,0.94), rgba(255,255,255,0.78));
    border: 1px solid rgba(255,255,255,0.82);
    border-radius: 28px;
    box-shadow: 0 24px 60px rgba(54, 65, 74, 0.16);
    backdrop-filter: blur(18px);
    padding: 38px;
}

.login-logo-wrap {
    width: 92px;
    height: 92px;
    margin: 0 auto 26px;
    border-radius: 26px;
    background: linear-gradient(180deg, #36414a 0%, #2c353d 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 18px 38px rgba(54, 65, 74, 0.22);
}

.login-logo {
    max-width: 68px;
    max-height: 68px;
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-header h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.6px;
    color: var(--primary);
}

.login-header p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.login-card .form-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

.login-card .form-control {
    min-height: 48px;
    border-radius: 14px;
}

.login-link {
    color: var(--primary);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
}

.login-link:hover {
    text-decoration: underline;
}
.patient-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.patient-link:hover {
    text-decoration: underline;
}
.patient-profile-header {
    display: flex;
    align-items: center;
    gap: 18px;
}

.patient-avatar {
    width: 76px;
    height: 76px;
    border-radius: 24px;
    background: linear-gradient(135deg, #ffffff, #e9eef2);
    border: 1px solid rgba(54, 65, 74, 0.10);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-weight: 700;
    font-size: 24px;
    box-shadow: 0 14px 30px rgba(54, 65, 74, 0.10);
}

.profile-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(54, 65, 74, 0.08);
    color: var(--primary);
    font-size: 12px;
    font-weight: 500;
}

.patient-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.patient-tabs a {
    min-height: 40px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    color: var(--muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.48);
    border: 1px solid rgba(255, 255, 255, 0.68);
}

.patient-tabs a.active,
.patient-tabs a:hover {
    color: var(--primary);
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 10px 24px rgba(54, 65, 74, 0.08);
}

.info-item {
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(54, 65, 74, 0.06);
    height: 100%;
}

.info-item span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 6px;
}

.info-item strong {
    display: block;
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
}
.anamnesis-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 12px 14px;
    margin-bottom: 8px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(54, 65, 74, 0.06);
}

.anamnesis-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

.anamnesis-options {
    flex-shrink: 0;
    font-size: 13px;
    color: var(--primary);
    font-weight: 500;
}

.anamnesis-options label {
    display: flex;
    align-items: center;
    gap: 6px;
}

.anamnesis-options input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}
/* Modern iOS-like Calendar, but still charcoal brand */

.crm-card:has(#calendar) {
    padding: 26px;
    background: linear-gradient(145deg, rgba(255,255,255,0.94), rgba(255,255,255,0.78));
    border: 1px solid rgba(255,255,255,0.82);
    box-shadow: 0 20px 50px rgba(54, 65, 74, 0.12);
    border-radius: 28px;
}

#calendar {
    --fc-border-color: rgba(54, 65, 74, 0.08);
    --fc-page-bg-color: transparent;
    --fc-neutral-bg-color: rgba(255,255,255,0.45);
    --fc-today-bg-color: rgba(54, 65, 74, 0.055);
    font-family: 'Poppins', system-ui, sans-serif;
}

.fc .fc-toolbar {
    margin-bottom: 24px;
}

.fc .fc-toolbar-title {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.6px;
    color: var(--primary);
}

.fc .fc-button {
    background: rgba(255,255,255,0.76);
    color: var(--primary);
    border: 1px solid rgba(54,65,74,0.10);
    border-radius: 999px;
    padding: 8px 15px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 8px 22px rgba(54,65,74,0.08);
}

.fc .fc-button:hover {
    background: var(--primary);
    color: #fff;
}

.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.fc .fc-scrollgrid {
    border: 0;
    overflow: hidden;
}

.fc-theme-standard td,
.fc-theme-standard th {
    border-color: rgba(54,65,74,0.075);
}

.fc .fc-col-header-cell {
    background: rgba(255,255,255,0.50);
    padding: 14px 0;
}

.fc .fc-col-header-cell-cushion {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.fc .fc-timegrid-axis-cushion,
.fc .fc-timegrid-slot-label-cushion {
    color: rgba(54,65,74,0.55);
    font-size: 11px;
    font-weight: 500;
}

.fc .fc-timegrid-slot {
    height: 48px;
}

.fc .fc-timegrid-col {
    background: rgba(255,255,255,0.28);
}

.fc .fc-day-today {
    background: rgba(54,65,74,0.045) !important;
}

.fc .fc-timegrid-now-indicator-line {
    border-color: var(--primary);
}

.fc .fc-timegrid-now-indicator-arrow {
    border-color: var(--primary);
}

/* Event blocks */
.fc .fc-event {
    border: 0;
    border-radius: 14px;
    padding: 6px 8px;
    box-shadow: 0 10px 22px rgba(54,65,74,0.16);
    overflow: hidden;
}

.fc-event-custom strong {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    line-height: 1.25;
}

.fc-event-custom span {
    display: block;
    margin-top: 2px;
    font-size: 10.5px;
    color: rgba(255,255,255,.86);
    line-height: 1.25;
}

.fc-event-custom small {
    display: block;
    margin-top: 2px;
    font-size: 10px;
    color: rgba(255,255,255,.70);
    line-height: 1.25;
}

/* Status colors, no purple */
.fc-event.status-scheduled {
    background: linear-gradient(135deg, #36414a, #2c353d);
}

.fc-event.status-completed {
    background: linear-gradient(135deg, #2f8f67, #22784f);
}

.fc-event.status-cancelled {
    background: linear-gradient(135deg, #b94a48, #983a39);
}

.fc-event.status-no_show {
    background: linear-gradient(135deg, #b7791f, #936013);
}

/* Month view polish */
.fc .fc-daygrid-day {
    background: rgba(255,255,255,0.30);
}

.fc .fc-daygrid-day-number {
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    padding: 8px;
}

.fc .fc-daygrid-event {
    border-radius: 12px;
    padding: 4px 6px;
}

.next-appointment-banner {
    background: rgba(54, 65, 74, 0.08);
    border: 1px solid rgba(54, 65, 74, 0.12);

    border-left: 5px solid var(--primary);

    border-radius: 18px;

    padding: 16px 20px;

    display: flex;
    align-items: center;
    gap: 16px;
}

.appointment-icon {
    width: 42px;
    height: 42px;

    border-radius: 12px;

    background: rgba(54, 65, 74, 0.10);

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 18px;
}

.appointment-content {
    flex: 1;
}

.appointment-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);

    margin-bottom: 3px;
}

.appointment-details {
    font-size: 14px;
    color: var(--text);
}

.appointment-actions .btn {
    border-radius: 999px;
    padding: 6px 14px;
}



.upcoming-appointment-row td {
    background: rgba(54, 65, 74, 0.075);
}

.upcoming-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-left: 8px;
    border-radius: 50%;
    background: #27ae60;
    box-shadow: 0 0 0 5px rgba(39,174,96,0.12);
}

.appointment-status {
    display: inline-flex;
    align-items: center;
    height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.appointment-status-scheduled {
    background: rgba(54, 65, 74, 0.10);
    color: var(--primary);
}

.appointment-status-completed {
    background: #d1fae5;
    color: #065f46;
}

.appointment-status-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.appointment-status-no_show {
    background: #fff3cd;
    color: #856404;
}

/* Better select / dropdown style */
.form-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    min-height: 46px;
    border-radius: 16px;
    border: 1px solid rgba(54, 65, 74, 0.12);
    background-color: rgba(255, 255, 255, 0.88);

    background-image:
        linear-gradient(45deg, transparent 50%, #36414a 50%),
        linear-gradient(135deg, #36414a 50%, transparent 50%);
    background-position:
        calc(100% - 18px) 19px,
        calc(100% - 13px) 19px;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;

    padding: 10px 42px 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);

    box-shadow: 0 8px 18px rgba(54, 65, 74, 0.04);
}

.form-select:hover {
    border-color: rgba(54, 65, 74, 0.24);
}

.form-select:focus {
    border-color: rgba(54, 65, 74, 0.38);
    box-shadow: 0 0 0 4px rgba(54, 65, 74, 0.10);
}

/* Better date / datetime style */
input[type="date"],
input[type="datetime-local"],
input[type="time"] {
    min-height: 46px;
    border-radius: 16px;
    border: 1px solid rgba(54, 65, 74, 0.12);
    background: rgba(255, 255, 255, 0.88);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    padding: 10px 14px;
    box-shadow: 0 8px 18px rgba(54, 65, 74, 0.04);
}

input[type="date"]:hover,
input[type="datetime-local"]:hover,
input[type="time"]:hover {
    border-color: rgba(54, 65, 74, 0.24);
}

input[type="date"]:focus,
input[type="datetime-local"]:focus,
input[type="time"]:focus {
    border-color: rgba(54, 65, 74, 0.38);
    box-shadow: 0 0 0 4px rgba(54, 65, 74, 0.10);
}

/* Calendar icon color, Chrome/Edge */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
    opacity: 0.65;
    cursor: pointer;
    filter: grayscale(1);
}

/* Small status dropdown in appointment table */
.appointment-status-select {
    min-height: 36px;
    border-radius: 999px;
    padding: 5px 36px 5px 14px;
    font-size: 12px;
    font-weight: 600;
    background-position:
        calc(100% - 16px) 15px,
        calc(100% - 11px) 15px;
}

/* Softer appointment colors */
.fc-event.status-scheduled {
    background: linear-gradient(135deg, #5c6670, #46515b) !important;
    color: #ffffff;
}

.fc-event.status-completed {
    background: linear-gradient(135deg, #7bc6a4, #55a985) !important;
    color: #ffffff;
}

.fc-event.status-cancelled {
    background: linear-gradient(135deg, #e58b8b, #d46f6f) !important;
    color: #ffffff;
}

.fc-event.status-no_show {
    background: linear-gradient(135deg, #e6bd72, #d6a44f) !important;
    color: #ffffff;
}

/* Month view visibility fix */
.fc .fc-daygrid-event {
    min-height: 30px;
    padding: 5px 8px !important;
    border-radius: 10px !important;
    margin-top: 4px;
}

.fc .fc-daygrid-event .fc-event-custom strong {
    font-size: 11px;
}

.fc .fc-daygrid-event .fc-event-custom span,
.fc .fc-daygrid-event .fc-event-custom small {
    display: none;
}

/* Better hover */
.fc-event {
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.fc-event:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(54,65,74,0.20) !important;
    opacity: .96;
}
/* Month view event visibility fix */
.fc-daygrid-event.status-scheduled,
.fc-daygrid-event.status-completed,
.fc-daygrid-event.status-cancelled,
.fc-daygrid-event.status-no_show {
    color: #ffffff !important;
    opacity: 1 !important;
    border: none !important;
}

.fc-daygrid-event.status-scheduled {
    background: #5c6670 !important;
}

.fc-daygrid-event.status-completed {
    background: #55a985 !important;
}

.fc-daygrid-event.status-cancelled {
    background: #d46f6f !important;
}

.fc-daygrid-event.status-no_show {
    background: #d6a44f !important;
}

.fc-daygrid-event .fc-event-main {
    color: #ffffff !important;
}

.fc-daygrid-event .fc-event-title,
.fc-daygrid-event .fc-event-time {
    color: #ffffff !important;
    font-weight: 600 !important;
}

.fc-daygrid-event .fc-event-custom strong {
    color: #ffffff !important;
    font-size: 11px;
    font-weight: 600;
}

.fc-daygrid-event {
    box-shadow: 0 8px 18px rgba(54, 65, 74, 0.16) !important;
}
.available-slots {
    margin-top: 8px;
}

.slot-chip {
    border: 1px solid rgba(54, 65, 74, 0.12);
    background: rgba(255, 255, 255, 0.82);
    color: var(--primary);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
}

.slot-chip:hover {
    background: var(--primary);
    color: #fff;
}
.btn-calendar-add {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    background: var(--primary);
    color: white;
    text-decoration: none;

    padding: 10px 18px;
    border-radius: 999px;

    font-size: 14px;
    font-weight: 500;

    box-shadow: 0 10px 24px rgba(54,65,74,0.16);

    transition: .2s;
}

.btn-calendar-add:hover {
    background: #2c353d;
    color: white;
    transform: translateY(-1px);
}

.btn-calendar-add span {
    font-size: 18px;
    line-height: 1;
}
.appointment-modal-content {
    border: 1px solid rgba(255, 255, 255, 0.82);
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 30px 80px rgba(54, 65, 74, 0.22);
    overflow: hidden;
}

.appointment-modal-content .modal-header {
    padding: 26px 26px 18px;
}

.appointment-modal-content .modal-body {
    padding: 0 26px 26px;
}

.appointment-modal-label {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.appointment-modal-content .modal-title {
    color: var(--primary);
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -.5px;
}

.appointment-modal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.appointment-modal-item {
    padding: 15px;
    border: 1px solid rgba(54, 65, 74, 0.07);
    border-radius: 16px;
    background: rgba(244, 246, 248, 0.72);
}

.appointment-modal-item span {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
}

.appointment-modal-item strong {
    display: block;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    word-break: break-word;
}

.appointment-modal-actions {
    display: grid;
    gap: 10px;
}

.appointment-action-button {
    min-height: 44px;
    padding: 0 16px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 14px;

    text-decoration: none;
    font-size: 13px;
    font-weight: 600;

    transition:
        transform .15s ease,
        box-shadow .15s ease,
        background .15s ease;
}

.appointment-action-button:hover {
    transform: translateY(-1px);
}

.appointment-action-neutral {
    background: rgba(54, 65, 74, 0.08);
    color: var(--primary);
}

.appointment-action-neutral:hover {
    background: rgba(54, 65, 74, 0.14);
    color: var(--primary);
}

.appointment-action-success {
    background: rgba(72, 199, 142, 0.16);
    color: #18784f;
}

.appointment-action-success:hover {
    background: rgba(72, 199, 142, 0.24);
    color: #12623f;
}

.appointment-action-warning {
    background: rgba(242, 200, 107, 0.23);
    color: #966b14;
}

.appointment-action-warning:hover {
    background: rgba(242, 200, 107, 0.34);
    color: #79530d;
}

.appointment-action-danger {
    background: rgba(244, 118, 118, 0.17);
    color: #b33f3f;
}

.appointment-action-danger:hover {
    background: rgba(244, 118, 118, 0.26);
    color: #943232;
}

@media (max-width: 576px) {
    .appointment-modal-grid {
        grid-template-columns: 1fr;
    }
}
.appointment-completion-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.appointment-completion-summary > div {
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, .78);
    border: 1px solid rgba(54, 65, 74, .08);
    box-shadow: 0 10px 28px rgba(54, 65, 74, .06);
}

.appointment-completion-summary span {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
}

.appointment-completion-summary strong {
    display: block;
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
}

.odontogram-wrapper {
    width: 100%;
}

.odontogram-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
}

.odontogram-header h5,
.section-heading h5 {
    margin: 0 0 5px;
    color: var(--primary);
    font-size: 18px;
    font-weight: 600;
}

.odontogram-header p,
.section-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.odontogram-legend {
    display: flex;
    gap: 16px;
    color: var(--muted);
    font-size: 11px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    display: inline-block;
    border-radius: 999px;
    margin-right: 5px;
}

.legend-dot.selected {
    background: var(--primary);
}

.legend-dot.surface {
    background: #78909c;
}

.jaw-section {
    position: relative;
}

.jaw-label {
    display: block;
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.teeth-row {
    display: grid;
    grid-template-columns: repeat(16, minmax(52px, 1fr));
    gap: 7px;
}

.tooth-card {
    position: relative;
    min-width: 0;
    padding: 8px 5px 7px;
    border: 1px solid rgba(54, 65, 74, .09);
    border-radius: 16px;
    background: rgba(255, 255, 255, .65);
    color: var(--primary);
    transition:
        transform .15s ease,
        background .15s ease,
        border-color .15s ease,
        box-shadow .15s ease;
}

.tooth-card:hover {
    transform: translateY(-2px);
    border-color: rgba(54, 65, 74, .22);
    box-shadow: 0 10px 24px rgba(54, 65, 74, .09);
}

.tooth-card.selected {
    background: rgba(54, 65, 74, .09);
    border-color: rgba(54, 65, 74, .34);
    box-shadow: 0 10px 24px rgba(54, 65, 74, .10);
}

.tooth-number {
    display: block;
    margin-bottom: 5px;
    font-size: 11px;
    font-weight: 600;
}

.tooth-svg {
    width: 100%;
    max-width: 52px;
    display: block;
    margin: auto;
}

.tooth-surface {
    fill: rgba(255, 255, 255, .88);
    stroke: rgba(54, 65, 74, .36);
    stroke-width: 2;
    cursor: pointer;
    transition: fill .15s ease;
}

.tooth-surface:hover {
    fill: rgba(54, 65, 74, .14);
}

.tooth-surface.selected {
    fill: #78909c;
    stroke: #52646d;
}

.tooth-check {
    position: absolute;
    top: 5px;
    right: 7px;
    width: 17px;
    height: 17px;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--primary);
    color: white;
    font-size: 9px;
}

.tooth-card.selected .tooth-check {
    display: flex;
}

.odontogram-midline {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 15px;
    margin: 22px 0;
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.odontogram-midline div {
    height: 1px;
    background: rgba(54, 65, 74, .12);
}

.odontogram-empty-state {
    padding: 30px;
    border: 1px dashed rgba(54, 65, 74, .18);
    border-radius: 18px;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

.treatment-entry {
    margin-bottom: 16px;
    padding: 20px;
    border: 1px solid rgba(54, 65, 74, .08);
    border-radius: 20px;
    background: rgba(255, 255, 255, .60);
}

.treatment-entry:last-child {
    margin-bottom: 0;
}

.treatment-entry-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.treatment-entry-header span {
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.treatment-entry-header strong {
    color: var(--primary);
    font-size: 16px;
    font-weight: 600;
}

.remove-treatment {
    border: 0;
    border-radius: 999px;
    padding: 7px 12px;
    background: rgba(244, 118, 118, .15);
    color: #a83e3e;
    font-size: 11px;
    font-weight: 600;
}

.surface-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.surface-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.surface-chip span {
    min-height: 35px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(54, 65, 74, .11);
    border-radius: 999px;
    background: rgba(255, 255, 255, .80);
    color: var(--primary);
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
}

.surface-chip input:checked + span {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.follow-up-switch {
    min-height: 76px;
    padding: 15px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid rgba(54, 65, 74, .08);
    border-radius: 18px;
    background: rgba(255, 255, 255, .60);
}

.follow-up-switch strong {
    display: block;
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
}

.follow-up-switch span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
}

.form-switch .form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.completion-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 40px;
}

@media (max-width: 1200px) {
    .teeth-row {
        grid-template-columns: repeat(8, minmax(52px, 1fr));
    }

    .appointment-completion-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .teeth-row {
        grid-template-columns: repeat(4, minmax(52px, 1fr));
    }

    .appointment-completion-summary {
        grid-template-columns: 1fr;
    }

    .odontogram-header {
        flex-direction: column;
    }
}
/* Appointment view */

.appointment-view-status {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.appointment-status-scheduled {
    background: rgba(54, 65, 74, 0.1);
    color: #36414a;
}

.appointment-status-completed {
    background: rgba(35, 134, 84, 0.12);
    color: #187044;
}

.appointment-status-cancelled {
    background: rgba(190, 52, 52, 0.12);
    color: #a42d2d;
}

.appointment-status-no-show {
    background: rgba(183, 112, 24, 0.12);
    color: #91580f;
}

.appointment-not-completed {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 10px 0;
}

.appointment-not-completed-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: rgba(54, 65, 74, 0.08);
    color: #36414a;
    font-size: 1.3rem;
}

.odontogram-view-legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    color: #6b7280;
    font-size: 0.82rem;
}

.odontogram-view-legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.odontogram-legend-treated,
.odontogram-legend-empty {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 4px;
}

.odontogram-legend-treated {
    background: #36414a;
}

.odontogram-legend-empty {
    background: #ffffff;
    border: 1px solid #ccd2d7;
}

/* Readonly odontogram */

.odontogram-readonly {
    overflow-x: auto;
    padding: 20px 8px 10px;
}

.odontogram-readonly-row {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-width: 900px;
}

.odontogram-readonly-quadrant {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.odontogram-center-line {
    width: 1px;
    height: 92px;
    margin: 0 16px;
    background: #d8dde1;
}

.odontogram-jaw-separator {
    width: min(100%, 900px);
    height: 1px;
    margin: 22px auto;
    background: #e1e5e8;
}

.odontogram-arch-label {
    color: #8a949c;
    text-align: center;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.readonly-tooth {
    position: relative;
    flex: 0 0 47px;
    width: 47px;
    padding: 5px;
    border: 1px solid transparent;
    border-radius: 12px;
    text-align: center;
}

.readonly-tooth.has-treatment {
    background: rgba(54, 65, 74, 0.06);
    border-color: rgba(54, 65, 74, 0.16);
}

.readonly-tooth-svg {
    display: block;
    width: 37px;
    height: 37px;
    margin: 0 auto;
}

.readonly-tooth-surface {
    fill: #ffffff;
    stroke: #9da6ad;
    stroke-width: 2;
}

.readonly-tooth-surface.is-treated {
    fill: #36414a;
    stroke: #ffffff;
}

.readonly-tooth-number {
    display: block;
    margin-top: 5px;
    color: #6b737a;
    font-size: 0.72rem;
    font-weight: 700;
}

.readonly-tooth.has-treatment .readonly-tooth-number {
    color: #36414a;
}

.readonly-whole-tooth-indicator {
    display: block;
    margin-top: 3px;
    color: #36414a;
    font-size: 0.55rem;
    font-weight: 800;
    text-transform: uppercase;
}

/* Treatment table */

.treatment-tooth-number {
    display: inline-grid;
    place-items: center;
    min-width: 42px;
    height: 42px;
    padding: 0 10px;
    border-radius: 13px;
    background: #36414a;
    color: #ffffff;
    font-weight: 800;
}

.treatment-surface-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.treatment-surface-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(54, 65, 74, 0.09);
    color: #36414a;
    font-size: 0.72rem;
    font-weight: 700;
}

.treatment-notes-text {
    max-width: 360px;
    color: #4f5961;
    line-height: 1.55;
    white-space: pre-line;
}

.appointment-clinical-text {
    color: #3f4850;
    line-height: 1.8;
    white-space: normal;
}

.appointment-detail-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.appointment-detail-item {
    padding: 16px;
    border: 1px solid #e5e8ea;
    border-radius: 15px;
    background: #fafbfb;
}

.appointment-detail-item span {
    display: block;
    margin-bottom: 5px;
    color: #899198;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.appointment-detail-item strong {
    color: #36414a;
    font-size: 0.94rem;
}

@media (max-width: 991px) {
    .appointment-detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575px) {
    .appointment-detail-grid {
        grid-template-columns: 1fr;
    }

    .odontogram-view-legend {
        margin-top: 12px;
    }
}
.calendar-event-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
    min-width: 0;
    padding: 2px 3px;
}

.calendar-event-time {
    font-size: 0.68rem;
    font-weight: 700;
    opacity: 0.9;
}

.calendar-event-title {
    width: 100%;
    overflow: hidden;
    font-size: 0.76rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-event-identifier {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    margin-top: 2px;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 0.58rem;
    font-weight: 800;
    line-height: 1.3;
    text-transform: uppercase;
    white-space: nowrap;
}

.calendar-event-identifier-cancelled {
    background: rgba(255, 255, 255, 0.92);
    color: #b42318;
}

.calendar-event-identifier-no_show {
    background: rgba(255, 255, 255, 0.92);
    color: #a15408;
}

/* Modal status */

.appointment-modal-status {
    display: inline-flex;
    align-items: center;
    padding: 6px 11px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
}

.appointment-modal-status-scheduled {
    background: rgba(54, 65, 74, 0.1);
    color: #36414a;
}

.appointment-modal-status-completed {
    background: rgba(25, 135, 84, 0.12);
    color: #87c6a8;
}

.appointment-modal-status-cancelled {
    background: rgba(220, 53, 69, 0.12);
    color: #b42318;
}

.appointment-modal-status-no_show {
    background: rgba(217, 119, 6, 0.14);
    color: #d7ae84;
}

.crm-modal-content {
    border: 0;
    border-radius: 22px;
    box-shadow: 0 24px 70px rgba(31, 41, 51, 0.18);
}

.postpone-slot-chip.active,
.slot-chip.active {
    background: #36414a;
    border-color: #36414a;
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(54, 65, 74, 0.2);
}
.available-range-label {
    display: inline-flex;
    align-items: center;
    padding: 10px 18px;
    border: 1px solid #dfe3e6;
    border-radius: 999px;
    background: #ffffff;
    color: #36414a;
    font-size: 0.88rem;
    font-weight: 700;
}
.appointment-move-comparison {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 14px;
}

.appointment-move-item {
    padding: 16px;
    border: 1px solid #e3e7ea;
    border-radius: 16px;
    background: #fafbfb;
}

.appointment-move-item span {
    display: block;
    margin-bottom: 5px;
    color: #8a939a;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.appointment-move-item strong {
    color: #36414a;
    font-size: 0.9rem;
}

.appointment-move-item-new {
    border-color: rgba(54, 65, 74, 0.25);
    background: rgba(54, 65, 74, 0.06);
}

.appointment-move-arrow {
    color: #7c858c;
    font-size: 1.1rem;
}

@media (max-width: 575px) {
    .appointment-move-comparison {
        grid-template-columns: 1fr;
    }

    .appointment-move-arrow {
        text-align: center;
        transform: rotate(90deg);
    }
}

.fc .fc-timegrid-event-harness {
    padding-right: 6px;
    margin-top: 3px;
}

.fc .fc-timegrid-event {
    border: none;
    border-radius: 18px;
    padding: 6px 8px;
    box-shadow: 0 8px 18px rgba(31, 41, 51, 0.10);
}

.fc .fc-timegrid-event .fc-event-main {
    padding: 0;
}

.calendar-event-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
    height: 100%;
}

.calendar-event-time {
    font-size: 12px;
    font-weight: 700;
    opacity: 0.95;
    line-height: 1.2;
}

.calendar-event-title {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
    word-break: break-word;
}

.calendar-event-identifier {
    align-self: flex-start;
    font-size: 11px;
    font-weight: 700;
    border-radius: 999px;
    padding: 3px 8px;
    background: rgba(255,255,255,0.9);
    color: #36414a;
}

.calendar-event-identifier-cancelled {
    background: rgba(255,255,255,0.92);
    color: #b42318;
}

.calendar-event-identifier-no_show {
    background: rgba(255,255,255,0.92);
    color: #b54708;
}
.calendar-event-doctor {
    font-size: 12px;
    opacity: 0.92;
    line-height: 1.2;
}

/* ==========================================================================\n   FINAL CALENDAR OVERRIDES\n   Compact events, muted colors, and smaller typography for overlapping events.\n   Keep this block at the very end of the stylesheet.\n   ========================================================================== */

#calendar {
    --fc-border-color: rgba(54, 65, 74, 0.07);
    --fc-today-bg-color: rgba(54, 65, 74, 0.035);
}

.crm-card:has(#calendar) {
    padding: 20px;
}

.fc .fc-toolbar {
    margin-bottom: 18px;
}

.fc .fc-toolbar-title {
    font-size: 21px;
}

.fc .fc-col-header-cell {
    padding: 10px 0;
}

.fc .fc-timegrid-slot {
    height: 42px;
}

.fc .fc-timegrid-event-harness {
    padding-right: 3px;
}

.fc .fc-timegrid-event {
    container-type: inline-size;
    border: 0 !important;
    border-radius: 11px !important;
    padding: 4px 5px !important;
    box-shadow: 0 4px 12px rgba(54, 65, 74, 0.10) !important;
    overflow: hidden;
}

.fc .fc-timegrid-event .fc-event-main {
    padding: 0 !important;
    color: inherit !important;
}

.calendar-event-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    width: 100%;
    min-width: 0;
    height: 100%;
    padding: 0;
    overflow: hidden;
}

.calendar-event-time {
    width: 100%;
    overflow: hidden;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 0.92;
}

.calendar-event-title {
    display: -webkit-box;
    width: 100%;
    overflow: hidden;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1.2;
    word-break: break-word;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.calendar-event-doctor {
    width: 100%;
    overflow: hidden;
    font-size: 8.8px;
    font-weight: 500;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 0.82;
}

.calendar-event-identifier {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    margin-top: 2px;
    padding: 2px 5px;
    border-radius: 999px;
    font-size: 7.5px;
    font-weight: 800;
    line-height: 1.2;
    text-transform: uppercase;
    white-space: nowrap;
    box-shadow: none;
}

.fc-event.calendar-event-scheduled,
.fc-daygrid-event.calendar-event-scheduled {
    background: #7a858e !important;
    border-color: #7a858e !important;
    color: #ffffff !important;
}

.fc-event.calendar-event-completed,
.fc-daygrid-event.calendar-event-completed {
    background: #82a995 !important;
    border-color: #82a995 !important;
    color: #ffffff !important;
}

.fc-event.calendar-event-cancelled,
.fc-daygrid-event.calendar-event-cancelled {
    background: #c38f8f !important;
    border-color: #c38f8f !important;
    color: #ffffff !important;
}

.fc-event.calendar-event-no-show,
.fc-daygrid-event.calendar-event-no-show {
    background: #b8a078 !important;
    border-color: #b8a078 !important;
    color: #ffffff !important;
}

.fc-event.status-scheduled,
.fc-daygrid-event.status-scheduled {
    background: #7a858e !important;
    border-color: #7a858e !important;
}

.fc-event.status-completed,
.fc-daygrid-event.status-completed {
    background: #82a995 !important;
    border-color: #82a995 !important;
}

.fc-event.status-cancelled,
.fc-daygrid-event.status-cancelled {
    background: #c38f8f !important;
    border-color: #c38f8f !important;
}

.fc-event.status-no_show,
.fc-daygrid-event.status-no_show {
    background: #b8a078 !important;
    border-color: #b8a078 !important;
}

.calendar-event-identifier-cancelled {
    background: rgba(255, 255, 255, 0.82);
    color: #8f4d4d;
}

.calendar-event-identifier-no_show {
    background: rgba(255, 255, 255, 0.82);
    color: #816a3e;
}

@container (max-width: 125px) {
    .calendar-event-content {
        gap: 0;
    }

    .calendar-event-time {
        font-size: 8.5px;
        line-height: 1.1;
    }

    .calendar-event-title {
        font-size: 9px;
        line-height: 1.12;
        -webkit-line-clamp: 2;
    }

    .calendar-event-doctor {
        font-size: 7.5px;
        line-height: 1.1;
    }

    .calendar-event-identifier {
        margin-top: 1px;
        padding: 1px 4px;
        font-size: 6.5px;
    }
}

@container (max-width: 85px) {
    .calendar-event-time {
        font-size: 7.5px;
    }

    .calendar-event-title {
        font-size: 8px;
        -webkit-line-clamp: 2;
    }

    .calendar-event-doctor {
        display: none;
    }

    .calendar-event-identifier {
        font-size: 6px;
    }
}

.fc .fc-daygrid-event {
    min-height: 24px;
    margin-top: 2px;
    padding: 3px 5px !important;
    border-radius: 8px !important;
    box-shadow: 0 3px 9px rgba(54, 65, 74, 0.08) !important;
}

.fc .fc-daygrid-event .calendar-event-time {
    font-size: 8px;
}

.fc .fc-daygrid-event .calendar-event-title {
    display: block;
    overflow: hidden;
    font-size: 9px;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fc .fc-daygrid-event .calendar-event-doctor,
.fc .fc-daygrid-event .calendar-event-identifier {
    display: none;
}

.fc .fc-event:hover {
    transform: none;
    opacity: 0.96;
    box-shadow: 0 6px 14px rgba(54, 65, 74, 0.13) !important;
}

/* ==========================================================================
   BABY CALENDAR PALETTE
   Solid pastel colors with clear dark text — light, but not faded.
   Keep this block at the very end of the stylesheet.
   ========================================================================== */

/* Scheduled — baby blue */
.fc-event.calendar-event-scheduled,
.fc-daygrid-event.calendar-event-scheduled,
.fc-event.status-scheduled,
.fc-daygrid-event.status-scheduled {
    background: #b9d9f2 !important;
    border-color: #9fc7e6 !important;
    color: #29485f !important;
}

/* Completed — baby mint */
.fc-event.calendar-event-completed,
.fc-daygrid-event.calendar-event-completed,
.fc-event.status-completed,
.fc-daygrid-event.status-completed {
    background: #bfe4cf !important;
    border-color: #9ed4b6 !important;
    color: #285843 !important;
}

/* Cancelled — baby pink */
.fc-event.calendar-event-cancelled,
.fc-daygrid-event.calendar-event-cancelled,
.fc-event.status-cancelled,
.fc-daygrid-event.status-cancelled {
    background: #f2c4c7 !important;
    border-color: #e5a9ae !important;
    color: #7a3e43 !important;
}

/* No Show — baby peach */
.fc-event.calendar-event-no-show,
.fc-daygrid-event.calendar-event-no-show,
.fc-event.status-no_show,
.fc-daygrid-event.status-no_show {
    background: #f4d39e !important;
    border-color: #e8bd78 !important;
    color: #73501c !important;
}

/* Force readable text because FullCalendar also receives textColor inline */
.fc .fc-event.calendar-event-scheduled .fc-event-main,
.fc .fc-event.calendar-event-completed .fc-event-main,
.fc .fc-event.calendar-event-cancelled .fc-event-main,
.fc .fc-event.calendar-event-no-show .fc-event-main,
.fc .fc-event.status-scheduled .fc-event-main,
.fc .fc-event.status-completed .fc-event-main,
.fc .fc-event.status-cancelled .fc-event-main,
.fc .fc-event.status-no_show .fc-event-main {
    color: inherit !important;
}

.fc .fc-event.calendar-event-scheduled .calendar-event-content,
.fc .fc-event.calendar-event-completed .calendar-event-content,
.fc .fc-event.calendar-event-cancelled .calendar-event-content,
.fc .fc-event.calendar-event-no-show .calendar-event-content,
.fc .fc-event.status-scheduled .calendar-event-content,
.fc .fc-event.status-completed .calendar-event-content,
.fc .fc-event.status-cancelled .calendar-event-content,
.fc .fc-event.status-no_show .calendar-event-content {
    color: inherit !important;
}

/* Status pills inside events */
.calendar-event-identifier-cancelled {
    background: #fff3f4 !important;
    color: #8a4048 !important;
    border: 1px solid rgba(138, 64, 72, 0.16);
}

.calendar-event-identifier-no_show {
    background: #fff7e8 !important;
    color: #7b571e !important;
    border: 1px solid rgba(123, 87, 30, 0.16);
}

/* Keep pastel colors solid on hover */
.fc .fc-event:hover {
    opacity: 1 !important;
    filter: saturate(1.04);
    box-shadow: 0 6px 14px rgba(54, 65, 74, 0.14) !important;
}
.patient-document-row {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 14px;
    margin-bottom: 10px;
    border: 1px solid rgba(54, 65, 74, 0.08);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.68);
}

.patient-document-row:last-child {
    margin-bottom: 0;
}

.patient-document-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: rgba(54, 65, 74, 0.08);
    color: #36414a;
    font-size: 0.66rem;
    font-weight: 800;
}

.patient-document-content {
    min-width: 0;
}

.patient-document-content strong {
    display: block;
    overflow: hidden;
    color: #36414a;
    font-size: 0.86rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.patient-document-content span,
.patient-document-content small {
    display: block;
    margin-top: 3px;
    color: #7a838b;
    font-size: 0.7rem;
}

.patient-document-content p {
    color: #58616a;
    font-size: 0.76rem;
}

.patient-document-actions {
    display: flex;
    align-items: center;
    gap: 7px;
}

.patient-document-actions form {
    margin: 0;
}

@media (max-width: 768px) {
    .patient-document-row {
        grid-template-columns: 44px minmax(0, 1fr);
    }

    .patient-document-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }
}
.completion-document-list {
    display: grid;
    gap: 8px;
}

.completion-document-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 13px;
    border: 1px solid rgba(54, 65, 74, 0.08);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.7);
}

.completion-document-icon {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(54, 65, 74, 0.08);
    color: #36414a;
    font-size: 10px;
    font-weight: 800;
}

.completion-document-info {
    min-width: 0;
}

.completion-document-info strong {
    display: block;
    overflow: hidden;
    color: #36414a;
    font-size: 12px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.completion-document-info span {
    display: block;
    margin-top: 3px;
    color: #7b858d;
    font-size: 10px;
}
#treatments {
    scroll-margin-top: 24px;
}

.patient-treatment-notes {
    max-width: 280px;
    color: #4f5961;
    font-size: 0.76rem;
    line-height: 1.55;
    white-space: pre-line;
}

#treatments .treatment-tooth-number {
    min-width: 38px;
    height: 38px;
    border-radius: 12px;
    font-size: 0.78rem;
}

#treatments .treatment-surface-badge {
    padding: 4px 8px;
    font-size: 0.67rem;
}

#treatments .table td {
    vertical-align: middle;
}

@media (max-width: 768px) {
    .patient-treatment-notes {
        max-width: 220px;
    }
}
#activity {
    scroll-margin-top: 24px;
}

.activity-timeline {
    position: relative;
}

.activity-timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 14px;
    padding-bottom: 22px;
}

.activity-timeline-item:last-child {
    padding-bottom: 0;
}

.activity-timeline-item:not(:last-child)::before {
    content: "";
    position: absolute;
    top: 18px;
    bottom: 0;
    left: 7px;
    width: 2px;
    background: rgba(54, 65, 74, 0.1);
}

.activity-timeline-marker {
    position: relative;
    z-index: 1;
    width: 16px;
    height: 16px;
    margin-top: 4px;
    border: 4px solid #ffffff;
    border-radius: 50%;
    background: #a9d6f5;
    box-shadow: 0 0 0 1px rgba(54, 65, 74, 0.12);
}

.activity-timeline-content {
    padding: 14px 16px;
    border: 1px solid rgba(54, 65, 74, 0.08);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
}

.activity-timeline-title {
    display: block;
    color: #36414a;
    font-size: 0.84rem;
}

.activity-timeline-user,
.activity-timeline-date {
    color: #7a838b;
    font-size: 0.7rem;
}

.activity-timeline-content p {
    color: #56616a;
    font-size: 0.76rem;
    line-height: 1.55;
}

.activity-change-details summary {
    cursor: pointer;
    color: #36414a;
    font-size: 0.72rem;
    font-weight: 600;
}

.activity-change-grid {
    display: grid;
    grid-template-columns: repeat(
        2,
        minmax(0, 1fr)
    );
    gap: 12px;
    margin-top: 12px;
}

.activity-change-grid span {
    display: block;
    margin-bottom: 5px;
    color: #7a838b;
    font-size: 0.67rem;
    font-weight: 600;
}

.activity-change-grid pre {
    max-height: 260px;
    margin: 0;
    padding: 12px;
    overflow: auto;
    border-radius: 12px;
    background: #f4f6f8;
    color: #36414a;
    font-size: 0.68rem;
    white-space: pre-wrap;
    word-break: break-word;
}

@media (max-width: 768px) {
    .activity-change-grid {
        grid-template-columns: 1fr;
    }
}
.calendar-filter-card {
    border: 1px solid #e6e9ed;
    border-radius: 20px;
    background: #ffffff;
}

.calendar-filter-card .form-label {
    margin-bottom: 7px;
    color: #36414a;
    font-size: 0.76rem;
    font-weight: 600;
}

.calendar-filter-toggle {
    display: flex;
    min-height: 74px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 15px 17px;
    border: 1px solid #e6e9ed;
    border-radius: 16px;
    background: #f8fafb;
}

.calendar-filter-toggle strong {
    display: block;
    margin-bottom: 3px;
    color: #36414a;
    font-size: 0.78rem;
}

.calendar-filter-toggle span {
    display: block;
    color: #7a838b;
    font-size: 0.68rem;
    line-height: 1.45;
}

.calendar-filter-toggle .form-check-input {
    width: 42px;
    height: 22px;
    cursor: pointer;
}

.calendar-filter-toggle .form-check-input:checked {
    border-color: #36414a;
    background-color: #36414a;
}

.calendar-filter-results {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid #edf0f2;
    color: #7a838b;
    font-size: 0.7rem;
}

.calendar-active-filters {
    color: #36414a;
    font-weight: 500;
}

@media (max-width: 767px) {
    .calendar-filter-toggle {
        min-height: auto;
    }

    .calendar-filter-results {
        align-items: flex-start;
        flex-direction: column;
    }
}