:root {
    --bg: #f6f8fb;
    --surface: #ffffff;
    --surface-soft: #f9fafb;
    --border: #e5e7eb;
    --text: #111827;
    --muted: #6b7280;

    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-soft: #eff6ff;

    --sidebar-bg: #111827;
    --sidebar-hover: #1f2937;
    --sidebar-text: #e5e7eb;
    --sidebar-muted: #9ca3af;

    --danger: #dc2626;
    --success: #16a34a;
    --warning: #d97706;
    --info: #0284c7;

    --radius: 14px;
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

* {
    box-sizing: border-box;
}

html {
    font-size: 15px;
}

body {
    margin: 0;
    font-family: Inter, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

a {
    color: inherit;
}

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

/* Sidebar */

.sidebar {
    width: 250px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 22px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-logo {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 6px;
    padding: 0 10px;
}

.sidebar-logo::after {
    content: "CRM";
    display: block;
    margin-top: 3px;
    color: var(--sidebar-muted);
    font-size: 11px;
    letter-spacing: 0.12em;
    font-weight: 600;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 28px;
}

.sidebar-menu a {
    color: var(--sidebar-text);
    text-decoration: none;
    padding: 11px 12px;
    border-radius: 10px;
    font-size: 14px;
    transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-menu a:hover {
    background: var(--sidebar-hover);
    color: #ffffff;
}

/* Main layout */

.main {
    flex: 1;
    padding: 30px;
    max-width: calc(100vw - 250px);
}

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

.page-title {
    font-size: 28px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -0.04em;
    margin: 0;
}

h2 {
    font-size: 20px;
    letter-spacing: -0.02em;
    margin: 0;
}

.muted {
    color: var(--muted);
}

/* Cards */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

/* Buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 9px 14px;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: #ffffff;
    color: #374151;
    border-color: var(--border);
}

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

.btn-danger {
    background: var(--danger);
    color: #ffffff;
}

/* Tables */

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table th,
.table td {
    text-align: left;
    padding: 13px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.table th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
    background: #ffffff;
}

.table tr:hover td {
    background: #fafafa;
}

/* Forms */

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

.form-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.form-field label {
    font-weight: 700;
    font-size: 13px;
    color: #374151;
}

.form-field input,
.form-field textarea,
.form-field select {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    color: var(--text);
    background: #ffffff;
    outline: none;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.form-field textarea {
    min-height: 96px;
    resize: vertical;
}

.form-actions {
    margin-top: 22px;
    display: flex;
    gap: 10px;
}

/* Patient detail */

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

.patient-name {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.04em;
    margin: 0 0 8px;
}

/* Dental chart */

.dental-chart {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 14px;
}

.tooth-row {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.tooth {
    width: 58px;
    min-height: 66px;
    border-radius: 12px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.tooth-number {
    font-weight: 800;
    font-size: 15px;
}

.tooth-status {
    font-size: 10px;
    color: var(--muted);
    text-align: center;
    line-height: 1.1;
}

.tooth.healthy {
    border-color: #86efac;
    background: #f0fdf4;
}

.tooth.caries {
    border-color: #fbbf24;
    background: #fffbeb;
}

.tooth.filling {
    border-color: #93c5fd;
    background: #eff6ff;
}

.tooth.missing {
    border-color: #fca5a5;
    background: #fef2f2;
}

.tooth.crown {
    border-color: #c4b5fd;
    background: #f5f3ff;
}

.tooth.implant {
    border-color: #7dd3fc;
    background: #f0f9ff;
}

.tooth.root_canal {
    border-color: #fdba74;
    background: #fff7ed;
}

.tooth.extraction_needed {
    border-color: #fb7185;
    background: #fff1f2;
}

.tooth.other {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.empty-state {
    text-align: center;
    color: var(--muted);
    padding: 34px;
    background: #fafafa;
    border-radius: 12px;
}

/* Login page polish */

form p {
    margin: 0;
}

/* Responsive */

@media (max-width: 900px) {
    .app-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: static;
    }

    .main {
        max-width: none;
        padding: 20px;
    }

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

    .patient-header {
        flex-direction: column;
    }

    .tooth {
        width: 44px;
        min-height: 56px;
    }
}
.tooth-link {
    text-decoration: none;
    color: inherit;
}

.tooth-link .tooth {
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.tooth-link:hover .tooth {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
    border-color: var(--primary);
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 22px;
}

.checkbox-grid label {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f9fafb;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
}

.checkbox-grid input {
    width: auto;
}

@media (max-width: 900px) {
    .checkbox-grid {
        grid-template-columns: 1fr;
    }
}
/* Anatomical dental chart */

.dental-arch-chart {
    position: relative;
    padding: 34px 18px;
    background:
        radial-gradient(circle at 50% 45%, rgba(37, 99, 235, 0.05), transparent 38%),
        #f8fafc;
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: visible;
}

.arch-row {
    display: flex;
    justify-content: center;
    gap: 10px;
    min-height: 92px;
}

.arch-row-1 {
    align-items: flex-end;
    margin-bottom: 4px;
}

.arch-row-2 {
    align-items: flex-start;
    margin-bottom: 22px;
}

.arch-row-3 {
    align-items: flex-end;
    margin-top: 22px;
}

.arch-row-4 {
    align-items: flex-start;
    margin-top: 4px;
}

.arch-row-1 .tooth-wrapper:nth-child(1),
.arch-row-2 .tooth-wrapper:nth-child(8),
.arch-row-3 .tooth-wrapper:nth-child(1),
.arch-row-4 .tooth-wrapper:nth-child(8) {
    transform: translateY(24px) rotate(-10deg);
}

.arch-row-1 .tooth-wrapper:nth-child(2),
.arch-row-2 .tooth-wrapper:nth-child(7),
.arch-row-3 .tooth-wrapper:nth-child(2),
.arch-row-4 .tooth-wrapper:nth-child(7) {
    transform: translateY(15px) rotate(-7deg);
}

.arch-row-1 .tooth-wrapper:nth-child(3),
.arch-row-2 .tooth-wrapper:nth-child(6),
.arch-row-3 .tooth-wrapper:nth-child(3),
.arch-row-4 .tooth-wrapper:nth-child(6) {
    transform: translateY(8px) rotate(-4deg);
}

.arch-row-1 .tooth-wrapper:nth-child(6),
.arch-row-2 .tooth-wrapper:nth-child(3),
.arch-row-3 .tooth-wrapper:nth-child(6),
.arch-row-4 .tooth-wrapper:nth-child(3) {
    transform: translateY(8px) rotate(4deg);
}

.arch-row-1 .tooth-wrapper:nth-child(7),
.arch-row-2 .tooth-wrapper:nth-child(2),
.arch-row-3 .tooth-wrapper:nth-child(7),
.arch-row-4 .tooth-wrapper:nth-child(2) {
    transform: translateY(15px) rotate(7deg);
}

.arch-row-1 .tooth-wrapper:nth-child(8),
.arch-row-2 .tooth-wrapper:nth-child(1),
.arch-row-3 .tooth-wrapper:nth-child(8),
.arch-row-4 .tooth-wrapper:nth-child(1) {
    transform: translateY(24px) rotate(10deg);
}

.tooth-wrapper {
    position: relative;
}

.anatomic-tooth-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.anatomic-tooth {
    position: relative;
    width: 62px;
    min-height: 82px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
    cursor: pointer;
    user-select: none;
}

.tooth-crown-shape {
    width: 48px;
    height: 54px;
    background: #ffffff;
    border: 2px solid #cbd5e1;
    border-radius: 45% 45% 38% 38%;
    box-shadow:
        inset 0 -8px 14px rgba(15, 23, 42, 0.06),
        0 5px 12px rgba(15, 23, 42, 0.08);
    transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

.arch-row-1 .tooth-crown-shape,
.arch-row-2 .tooth-crown-shape {
    border-radius: 38% 38% 45% 45%;
}

.anatomic-tooth-link:hover .tooth-crown-shape {
    transform: translateY(-3px);
    border-color: var(--primary);
}

.anatomic-tooth-number {
    position: absolute;
    top: 16px;
    font-size: 12px;
    font-weight: 800;
    color: #111827;
}

.anatomic-tooth-status {
    font-size: 10px;
    color: var(--muted);
    text-align: center;
    max-width: 70px;
    min-height: 12px;
    line-height: 1.1;
}

.anatomic-tooth.healthy .tooth-crown-shape {
    border-color: #86efac;
    background: #f0fdf4;
}

.anatomic-tooth.caries .tooth-crown-shape {
    border-color: #f59e0b;
    background:
        radial-gradient(circle at 62% 36%, #92400e 0 5px, transparent 6px),
        #fffbeb;
}

.anatomic-tooth.pulpitis .tooth-crown-shape {
    border-color: #fb7185;
    background:
        radial-gradient(circle at 50% 48%, rgba(220, 38, 38, 0.35) 0 9px, transparent 10px),
        #fff1f2;
}

.anatomic-tooth.periodontitis .tooth-crown-shape {
    border-color: #dc2626;
    background:
        linear-gradient(180deg, #ffffff 0%, #fee2e2 100%);
}

.anatomic-tooth.filling .tooth-crown-shape {
    border-color: #60a5fa;
    background:
        radial-gradient(circle at 50% 35%, #bfdbfe 0 10px, transparent 11px),
        #eff6ff;
}

.anatomic-tooth.crown .tooth-crown-shape {
    border-color: #a78bfa;
    background: linear-gradient(135deg, #f5f3ff, #ddd6fe);
}

.anatomic-tooth.root_canal .tooth-crown-shape {
    border-color: #fdba74;
    background:
        linear-gradient(90deg, transparent 44%, rgba(234, 88, 12, 0.45) 45% 55%, transparent 56%),
        #fff7ed;
}

.anatomic-tooth.missing .tooth-crown-shape {
    border-color: #fca5a5;
    background:
        linear-gradient(45deg, transparent 44%, #ef4444 45% 55%, transparent 56%),
        linear-gradient(-45deg, transparent 44%, #ef4444 45% 55%, transparent 56%),
        #fef2f2;
}

.anatomic-tooth.extraction_needed .tooth-crown-shape {
    border-color: #e11d48;
    background:
        linear-gradient(45deg, transparent 47%, rgba(225, 29, 72, 0.75) 48% 52%, transparent 53%),
        #fff1f2;
}

.anatomic-tooth.other .tooth-crown-shape {
    border-color: #94a3b8;
    background: #f8fafc;
}

.jaw-separator {
    display: flex;
    justify-content: center;
    gap: 42px;
    align-items: center;
    margin: 10px auto;
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.jaw-separator::before,
.jaw-separator::after {
    content: "";
    width: 100px;
    height: 1px;
    background: var(--border);
}

/* Radial diagnosis menu */

.tooth-radial-menu {
    position: fixed;
    z-index: 1000;
    width: 260px;
    height: 260px;
    pointer-events: none;
    opacity: 0;
    transform: scale(0.88);
    transition: opacity 0.12s ease, transform 0.12s ease;
}

.tooth-radial-menu.visible {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.tooth-radial-menu button {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 86px;
    min-height: 38px;
    margin-left: -43px;
    margin-top: -19px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    font-size: 11px;
    font-weight: 700;
    color: #111827;
    cursor: pointer;
    transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.tooth-radial-menu button:hover {
    background: var(--primary-soft);
    border-color: var(--primary);
}

.tooth-radial-menu button:nth-child(1) {
    transform: rotate(-90deg) translate(100px) rotate(90deg);
}

.tooth-radial-menu button:nth-child(2) {
    transform: rotate(-50deg) translate(100px) rotate(50deg);
}

.tooth-radial-menu button:nth-child(3) {
    transform: rotate(-10deg) translate(100px) rotate(10deg);
}

.tooth-radial-menu button:nth-child(4) {
    transform: rotate(30deg) translate(100px) rotate(-30deg);
}

.tooth-radial-menu button:nth-child(5) {
    transform: rotate(70deg) translate(100px) rotate(-70deg);
}

.tooth-radial-menu button:nth-child(6) {
    transform: rotate(110deg) translate(100px) rotate(-110deg);
}

.tooth-radial-menu button:nth-child(7) {
    transform: rotate(150deg) translate(100px) rotate(-150deg);
}

.tooth-radial-menu button:nth-child(8) {
    transform: rotate(190deg) translate(100px) rotate(-190deg);
}

.tooth-radial-menu button:nth-child(9) {
    transform: rotate(230deg) translate(100px) rotate(-230deg);
}

@media (max-width: 900px) {
    .dental-arch-chart {
        overflow-x: auto;
        padding: 26px 12px;
    }

    .arch-row {
        min-width: 620px;
    }
}
/* FDI tooth chart v2 */

.fdi-dental-chart {
    position: relative;
    padding: 34px 18px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow-x: auto;
}

.fdi-row {
    display: grid;
    grid-template-columns: repeat(16, 64px);
    justify-content: center;
    gap: 10px;
    min-width: 1120px;
    margin: 16px 0;
}

.jaw-label {
    text-align: center;
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 8px 0 22px;
}

.fdi-tooth-button {
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
    font: inherit;
}

.fdi-tooth {
    position: relative;
    width: 64px;
    height: 98px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    user-select: none;
}

.tooth-svg {
    width: 54px;
    height: 72px;
    overflow: visible;
}

.tooth-body {
    fill: #ffffff;
    stroke: #cbd5e1;
    stroke-width: 2.5;
    filter: drop-shadow(0 5px 8px rgba(15, 23, 42, 0.10));
    transition: fill 0.14s ease, stroke 0.14s ease, transform 0.14s ease;
}

.fdi-tooth-button:hover .tooth-body {
    stroke: var(--primary);
    transform: translateY(-3px);
}

.fdi-tooth-number {
    position: absolute;
    top: 22px;
    font-size: 12px;
    font-weight: 900;
    color: #111827;
    pointer-events: none;
}

.fdi-tooth-diagnosis {
    display: block;
    width: 80px;
    text-align: center;
    font-size: 9px;
    line-height: 1.05;
    color: var(--muted);
    white-space: normal;
    min-height: 22px;
}

/* Diagnosis colors */

.fdi-tooth.healthy .tooth-body {
    fill: #ffffff;
    stroke: #94a3b8;
}

.fdi-tooth.caries .tooth-body {
    fill: #fffbeb;
    stroke: #f59e0b;
}

.fdi-tooth.pulpitis .tooth-body {
    fill: #fff1f2;
    stroke: #fb7185;
}

.fdi-tooth.periodontitis .tooth-body {
    fill: #fee2e2;
    stroke: #dc2626;
}

.fdi-tooth.filling .tooth-body {
    fill: #eff6ff;
    stroke: #60a5fa;
}

.fdi-tooth.crown .tooth-body {
    fill: #f5f3ff;
    stroke: #8b5cf6;
}

.fdi-tooth.root_canal .tooth-body {
    fill: #fff7ed;
    stroke: #f97316;
}

.fdi-tooth.missing .tooth-body {
    fill: #fef2f2;
    stroke: #ef4444;
    stroke-dasharray: 5 4;
}

.fdi-tooth.extraction_needed .tooth-body {
    fill: #fff1f2;
    stroke: #e11d48;
    stroke-width: 3;
}

.fdi-tooth.other .tooth-body {
    fill: #f8fafc;
    stroke: #64748b;
}

/* Radial multi-diagnosis menu */

.diagnosis-radial-menu {
    position: fixed;
    z-index: 1000;
    width: 330px;
    height: 330px;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.9);
    transition: opacity 0.12s ease, transform 0.12s ease;
}

.diagnosis-radial-menu.visible {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

.radial-center {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 118px;
    height: 118px;
    margin-left: -59px;
    margin-top: -59px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 50%;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    text-align: center;
    padding: 10px;
}

.radial-center strong {
    font-size: 15px;
}

.radial-center span {
    font-size: 10px;
    color: var(--muted);
    line-height: 1.15;
}

.diagnosis-radial-menu button,
.diagnosis-radial-menu .radial-edit {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 96px;
    min-height: 38px;
    margin-left: -48px;
    margin-top: -19px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.13);
    font-size: 11px;
    font-weight: 800;
    color: #111827;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}

.diagnosis-radial-menu button:hover,
.diagnosis-radial-menu .radial-edit:hover {
    background: var(--primary-soft);
    border-color: var(--primary);
}

.diagnosis-radial-menu button.active {
    background: #dbeafe;
    border-color: var(--primary);
    color: #1d4ed8;
}

.diagnosis-radial-menu button:nth-of-type(1) {
    transform: rotate(-90deg) translate(132px) rotate(90deg);
}

.diagnosis-radial-menu button:nth-of-type(2) {
    transform: rotate(-45deg) translate(132px) rotate(45deg);
}

.diagnosis-radial-menu button:nth-of-type(3) {
    transform: rotate(0deg) translate(132px) rotate(0deg);
}

.diagnosis-radial-menu button:nth-of-type(4) {
    transform: rotate(45deg) translate(132px) rotate(-45deg);
}

.diagnosis-radial-menu button:nth-of-type(5) {
    transform: rotate(90deg) translate(132px) rotate(-90deg);
}

.diagnosis-radial-menu button:nth-of-type(6) {
    transform: rotate(135deg) translate(132px) rotate(-135deg);
}

.diagnosis-radial-menu button:nth-of-type(7) {
    transform: rotate(180deg) translate(132px) rotate(-180deg);
}

.diagnosis-radial-menu button:nth-of-type(8) {
    transform: rotate(225deg) translate(132px) rotate(-225deg);
}

.diagnosis-radial-menu .radial-clear {
    transform: rotate(270deg) translate(132px) rotate(-270deg);
    background: #fff7ed;
}

.diagnosis-radial-menu .radial-edit {
    transform: rotate(315deg) translate(132px) rotate(-315deg);
    background: #f8fafc;
}

@media (max-width: 900px) {
    .fdi-dental-chart {
        padding: 24px 12px;
    }

    .fdi-row {
        justify-content: flex-start;
    }
}
/* Missing tooth cross */

.fdi-tooth.missing {
    position: relative;
}

.fdi-tooth.missing::before,
.fdi-tooth.missing::after {
    content: "";
    position: absolute;
    top: 34px;
    left: 11px;
    width: 42px;
    height: 4px;
    background: #dc2626;
    border-radius: 999px;
    z-index: 5;
    pointer-events: none;
}

.fdi-tooth.missing::before {
    transform: rotate(45deg);
}

.fdi-tooth.missing::after {
    transform: rotate(-45deg);
}

.fdi-tooth.missing .tooth-body {
    fill: #ffffff;
    stroke: #cbd5e1;
    stroke-dasharray: none;
}
/* Radial menu auto layout fix */

.diagnosis-radial-menu button {
    transform: rotate(var(--angle)) translate(132px) rotate(var(--reverse-angle)) !important;
}

.diagnosis-radial-menu .radial-clear {
    background: #fff7ed;
}
/* Final radial menu layout: 7 items full circle */

.diagnosis-radial-menu button:nth-of-type(1) {
    transform: rotate(-90deg) translate(132px) rotate(90deg) !important;
}

.diagnosis-radial-menu button:nth-of-type(2) {
    transform: rotate(-38.57deg) translate(132px) rotate(38.57deg) !important;
}

.diagnosis-radial-menu button:nth-of-type(3) {
    transform: rotate(12.86deg) translate(132px) rotate(-12.86deg) !important;
}

.diagnosis-radial-menu button:nth-of-type(4) {
    transform: rotate(64.29deg) translate(132px) rotate(-64.29deg) !important;
}

.diagnosis-radial-menu button:nth-of-type(5) {
    transform: rotate(115.71deg) translate(132px) rotate(-115.71deg) !important;
}

.diagnosis-radial-menu button:nth-of-type(6) {
    transform: rotate(167.14deg) translate(132px) rotate(-167.14deg) !important;
}

.diagnosis-radial-menu button:nth-of-type(7) {
    transform: rotate(218.57deg) translate(132px) rotate(-218.57deg) !important;
}

.diagnosis-radial-menu .radial-clear {
    background: #fff7ed !important;
}
/* Schedule */

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

.schedule-date-form {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.schedule-date-form label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
}

.schedule-date-form input {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 14px;
}

.schedule-card {
    padding: 0;
    overflow: hidden;
}

.schedule-table-wrapper {
    overflow-x: auto;
}

.schedule-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
}

.schedule-table th,
.schedule-table td {
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    padding: 8px;
    vertical-align: top;
}

.schedule-table th {
    background: #f8fafc;
    color: #374151;
    font-size: 13px;
    font-weight: 800;
    text-align: center;
}

.schedule-time-column {
    width: 90px;
    min-width: 90px;
    background: #f8fafc;
    color: var(--muted);
    font-weight: 800;
    text-align: center;
    position: sticky;
    left: 0;
    z-index: 2;
}

.schedule-cell {
    height: 74px;
    min-width: 170px;
    background: #ffffff;
}

.empty-schedule-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 58px;
    border: 1px dashed #d1d5db;
    border-radius: 10px;
    color: #9ca3af;
    text-decoration: none;
    font-size: 20px;
    font-weight: 700;
}

.empty-schedule-slot:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-soft);
}

.appointment-card {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-height: 58px;
    padding: 9px 10px;
    border-radius: 10px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1e3a8a;
    text-decoration: none;
}

.appointment-card strong {
    font-size: 13px;
}

.appointment-card span,
.appointment-card small,
.appointment-card em {
    font-size: 11px;
}

.appointment-card em {
    font-style: normal;
    color: #475569;
}

.appointment-planned {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e3a8a;
}

.appointment-arrived {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

.appointment-completed {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #334155;
}

.appointment-cancelled {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.appointment-no_show {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #9a3412;
}

.form-errors {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 18px;
}

@media (max-width: 900px) {
    .schedule-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .schedule-date-form {
        flex-direction: column;
        align-items: stretch;
    }
}
/* Schedule redesign */

.schedule-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 22px;
}

.schedule-control-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
    box-shadow: var(--shadow);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.schedule-date-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.schedule-current-date {
    font-size: 24px;
    font-weight: 900;
    letter-spacing: -0.04em;
    color: #111827;
}

.schedule-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.schedule-legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 12px;
    color: #4b5563;
    font-size: 13px;
    font-weight: 700;
}

.legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
}

.legend-dot.planned {
    background: #2563eb;
}

.legend-dot.arrived {
    background: #16a34a;
}

.legend-dot.completed {
    background: #64748b;
}

.legend-dot.cancelled {
    background: #dc2626;
}

.legend-dot.no-show {
    background: #f97316;
}

.schedule-date-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.schedule-date-form input {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 14px;
    background: #f9fafb;
}

.schedule-card {
    padding: 0;
    overflow: hidden;
    border-radius: 18px;
}

.schedule-table-wrapper {
    overflow-x: auto;
    background: #ffffff;
}

.modern-schedule-table {
    width: 100%;
    min-width: 1000px;
    border-collapse: separate;
    border-spacing: 0;
}

.modern-schedule-table th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    padding: 14px 12px;
    text-align: center;
}

.modern-schedule-table td {
    border-bottom: 1px solid #eef2f7;
    border-right: 1px solid #eef2f7;
    padding: 8px;
    vertical-align: top;
}

.doctor-column-title {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.doctor-column-title span {
    font-size: 14px;
    font-weight: 900;
    color: #111827;
}

.doctor-column-title small {
    font-size: 11px;
    color: var(--muted);
    font-weight: 600;
}

.schedule-time-column {
    width: 96px;
    min-width: 96px;
    background: #f8fafc !important;
    position: sticky;
    left: 0;
    z-index: 4;
    text-align: center;
}

.time-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 10px;
    color: #374151;
    font-size: 13px;
    font-weight: 900;
}

.schedule-cell {
    height: 78px;
    min-width: 190px;
    background: #ffffff;
    transition: background 0.12s ease;
}

.schedule-cell:hover {
    background: #f8fafc;
}

.empty-schedule-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
    border: 1px dashed #d5dbe5;
    border-radius: 12px;
    color: #cbd5e1;
    text-decoration: none;
    background: #fbfdff;
    transition: all 0.12s ease;
}

.empty-schedule-slot span {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 800;
}

.empty-schedule-slot:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary);
}

.appointment-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 62px;
    padding: 10px 11px;
    border-radius: 13px;
    text-decoration: none;
    border: 1px solid transparent;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.appointment-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.10);
}

.appointment-card strong {
    font-size: 13px;
    line-height: 1.15;
}

.appointment-time {
    font-size: 11px;
    font-weight: 800;
    opacity: 0.85;
}

.appointment-card small {
    font-size: 11px;
    opacity: 0.85;
}

.appointment-card em {
    align-self: flex-start;
    margin-top: 3px;
    font-style: normal;
    font-size: 10px;
    font-weight: 900;
    border-radius: 999px;
    padding: 3px 7px;
    background: rgba(255, 255, 255, 0.65);
}

/* Appointment statuses */

.appointment-planned {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border-color: #bfdbfe;
    color: #1e3a8a;
}

.appointment-arrived {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-color: #bbf7d0;
    color: #166534;
}

.appointment-completed {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    border-color: #cbd5e1;
    color: #334155;
}

.appointment-cancelled {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border-color: #fecaca;
    color: #991b1b;
}

.appointment-no_show {
    background: linear-gradient(135deg, #fff7ed, #ffedd5);
    border-color: #fed7aa;
    color: #9a3412;
}

@media (max-width: 900px) {
    .schedule-page-header,
    .schedule-control-card {
        flex-direction: column;
        align-items: stretch;
    }

    .schedule-date-center {
        align-items: stretch;
    }

    .schedule-date-form {
        flex-direction: column;
        align-items: stretch;
    }

    .schedule-current-date {
        text-align: center;
    }
}
/* IDent-inspired schedule */

.ident-schedule-shell {
    background: #eef1f4;
    border-radius: 18px;
    padding: 18px;
    min-height: calc(100vh - 70px);
}

.ident-schedule-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    background: #2f3338;
    color: #ffffff;
    border-radius: 14px 14px 0 0;
    padding: 14px 18px;
}

.ident-title-block h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.ident-title-block span {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    color: #cbd5e1;
}

.ident-schedule-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ident-nav-btn,
.ident-add-btn,
.ident-date-form button {
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: #444a52;
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    height: 36px;
    padding: 0 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    cursor: pointer;
}

.ident-nav-btn {
    width: 38px;
    font-size: 26px;
    line-height: 1;
}

.ident-add-btn {
    background: #16a34a;
    border-color: #16a34a;
}

.ident-date-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ident-date-form input {
    height: 36px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0 10px;
    font-size: 14px;
}

.ident-filterbar {
    display: flex;
    gap: 10px;
    background: #f7f7f7;
    border: 1px solid #d5d8dd;
    border-top: 0;
    padding: 10px;
}

.ident-filter {
    min-width: 145px;
    background: #ffffff;
    border: 1px solid #cfd3d8;
    border-radius: 4px;
    padding: 8px 12px;
    color: #6b7280;
    font-size: 14px;
    text-align: center;
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.04);
}

.ident-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: #ffffff;
    border-left: 1px solid #d5d8dd;
    border-right: 1px solid #d5d8dd;
    padding: 10px;
}

.ident-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
    color: #4b5563;
}

.ident-schedule-board {
    background: #ffffff;
    border: 1px solid #d5d8dd;
    border-radius: 0 0 14px 14px;
    padding: 12px;
}

.ident-table-scroll {
    overflow: auto;
    max-height: calc(100vh - 260px);
    border: 1px solid #cfd3d8;
    background: #ffffff;
}

.ident-schedule-table {
    width: 100%;
    min-width: 1050px;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 12px;
}

.ident-schedule-table thead th {
    position: sticky;
    top: 0;
    z-index: 6;
    border: 1px solid #aeb5bd;
    padding: 0;
    height: 42px;
    color: #ffffff;
    text-align: center;
}

.ident-time-head {
    width: 62px;
    min-width: 62px;
    background: #f3f4f6 !important;
    z-index: 8 !important;
}

.ident-time-cell {
    width: 62px;
    min-width: 62px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    color: #374151;
    font-weight: 700;
    text-align: center;
    font-size: 12px;
    position: sticky;
    left: 0;
    z-index: 4;
}

.ident-time-head:first-child {
    position: sticky;
    left: 0;
}

.right-time {
    position: sticky;
    right: 0;
    z-index: 4;
}

.ident-doctor-room {
    height: 18px;
    line-height: 18px;
    font-size: 10px;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.16);
}

.ident-doctor-name {
    height: 24px;
    line-height: 24px;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 6px;
}

.ident-schedule-cell {
    height: 38px;
    border: 1px solid #cfd3d8;
    padding: 0;
    vertical-align: top;
    position: relative;
}

.ident-empty-slot {
    display: block;
    width: 100%;
    height: 38px;
    text-decoration: none;
}

.ident-empty-slot:hover {
    background: rgba(37, 99, 235, 0.12);
    outline: 2px solid rgba(37, 99, 235, 0.25);
    outline-offset: -2px;
}

.ident-appointment {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
    min-height: 38px;
    padding: 3px 6px 3px 20px;
    color: #111827;
    text-align: center;
    text-decoration: none;
    border: 1px solid rgba(0, 0, 0, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.ident-appointment:hover {
    filter: brightness(0.97);
    outline: 2px solid rgba(0, 0, 0, 0.15);
    outline-offset: -2px;
}

.ident-appointment strong {
    font-size: 11px;
    line-height: 1.1;
    font-weight: 900;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ident-appointment small {
    font-size: 10px;
    line-height: 1.1;
    color: rgba(17, 24, 39, 0.78);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ident-appointment em {
    font-size: 9px;
    font-style: normal;
    color: rgba(17, 24, 39, 0.68);
}

.ident-check {
    position: absolute;
    left: 6px;
    top: 6px;
    font-weight: 900;
    font-size: 11px;
}

/* Doctor column colors */

.doctor-color-1 {
    background: #7fb33f;
}

.doctor-color-2 {
    background: #a83c5d;
}

.doctor-color-3 {
    background: #43c943;
}

.doctor-color-4 {
    background: #5ba7c7;
}

.doctor-color-5 {
    background: #e13ac6;
}

.doctor-color-6 {
    background: #6b9e21;
}

.doctor-color-7 {
    background: #d99a22;
}

.doctor-color-8 {
    background: #38a3a5;
}

.doctor-column-1 {
    background: #d9edbd;
}

.doctor-column-2 {
    background: #c88fa0;
}

.doctor-column-3 {
    background: #9be59a;
}

.doctor-column-4 {
    background: #b7d8e8;
}

.doctor-column-5 {
    background: #f5a1e7;
}

.doctor-column-6 {
    background: #b6d28a;
}

.doctor-column-7 {
    background: #ead089;
}

.doctor-column-8 {
    background: #8ed0d2;
}

/* Appointment statuses inside colored columns */

.ident-appointment.appointment-planned {
    background: rgba(255, 255, 255, 0.25);
}

.ident-appointment.appointment-arrived {
    background: rgba(187, 247, 208, 0.7);
}

.ident-appointment.appointment-completed {
    background: rgba(226, 232, 240, 0.75);
}

.ident-appointment.appointment-cancelled {
    background: rgba(254, 202, 202, 0.85);
}

.ident-appointment.appointment-no_show {
    background: rgba(254, 215, 170, 0.85);
}

@media (max-width: 900px) {
    .ident-schedule-topbar,
    .ident-schedule-actions,
    .ident-filterbar {
        flex-direction: column;
        align-items: stretch;
    }

    .ident-filter {
        width: 100%;
    }

    .ident-table-scroll {
        max-height: none;
    }
}
/* Appointment resize, hover popover and slot context menu */

.ident-appointment-wrap {
    position: relative;
    height: 100%;
    min-height: 38px;
}

.ident-appointment-wrap .ident-appointment {
    height: 100%;
    min-height: 38px;
}

.appointment-resize-handle {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 7px;
    cursor: ns-resize;
    z-index: 5;
    background: rgba(0, 0, 0, 0.08);
    opacity: 0;
    transition: opacity 0.12s ease;
}

.ident-appointment-wrap:hover .appointment-resize-handle {
    opacity: 1;
}

.ident-appointment-wrap.is-resizing {
    z-index: 20;
}

body.is-schedule-resizing {
    cursor: ns-resize;
    user-select: none;
}

.appointment-hover-popover {
    display: none;
    position: absolute;
    left: calc(100% + 8px);
    top: 0;
    width: 270px;
    background: #ffffff;
    color: #111827;
    border: 1px solid #cfd3d8;
    border-radius: 10px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.22);
    padding: 12px;
    z-index: 100;
    text-align: left;
}

.appointment-hover-popover strong {
    display: block;
    font-size: 14px;
    margin-bottom: 8px;
}

.appointment-hover-popover p {
    margin: 5px 0;
    font-size: 12px;
    line-height: 1.35;
}

.ident-appointment-wrap:hover .appointment-hover-popover {
    display: block;
}

.slot-context-menu {
    display: none;
    position: fixed;
    z-index: 2000;
    min-width: 190px;
    background: #ffffff;
    border: 1px solid #cfd3d8;
    border-radius: 10px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.2);
    overflow: hidden;
}

.slot-context-menu.visible {
    display: block;
}

.slot-context-menu button {
    width: 100%;
    border: 0;
    background: #ffffff;
    padding: 11px 13px;
    text-align: left;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    color: #111827;
}

.slot-context-menu button:hover {
    background: #eff6ff;
    color: #1d4ed8;
}

.patient-search-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(15, 23, 42, 0.45);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.patient-search-modal.visible {
    display: flex;
}

.patient-search-dialog {
    width: 520px;
    max-width: 100%;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.35);
    padding: 20px;
}

.patient-search-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 18px;
}

.patient-search-header h2 {
    margin: 0;
    font-size: 22px;
}

.patient-search-header p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.modal-close {
    border: 0;
    background: #f3f4f6;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
}

.patient-search-results {
    max-height: 220px;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin: 12px 0;
}

.patient-result-item {
    width: 100%;
    border: 0;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    padding: 10px 12px;
    text-align: left;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.patient-result-item:last-child {
    border-bottom: 0;
}

.patient-result-item:hover,
.patient-result-item.selected {
    background: #eff6ff;
}

.patient-result-item strong {
    font-size: 14px;
}

.patient-result-item span,
.patient-result-item small {
    font-size: 12px;
    color: var(--muted);
}

.patient-result-empty {
    padding: 14px;
    color: var(--muted);
    font-size: 13px;
}

.legend-dot.blocked {
    background: #111827;
}

.ident-appointment.appointment-blocked {
    background: rgba(17, 24, 39, 0.16);
    color: #111827;
    border-style: dashed;
}
/* Hide doctor column color inside truly empty slots */

.ident-schedule-cell {
    position: relative;
}

.ident-empty-slot {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 38px;
    background: #eeeeee;
    display: block;
    text-decoration: none;
}

.ident-empty-slot:hover {
    background: #dfeaff;
    outline: 2px solid rgba(37, 99, 235, 0.28);
    outline-offset: -2px;
}

/* Keep real appointments and blocked time above empty-slot layer */

.ident-appointment-wrap {
    position: relative;
    z-index: 2;
}
/* Appointment patient context menu */

.appointment-context-menu {
    display: none;
    position: fixed;
    z-index: 2500;
    min-width: 220px;
    background: #ffffff;
    border: 1px solid #cfd3d8;
    border-radius: 10px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.25);
    overflow: hidden;
}

.appointment-context-menu.visible {
    display: block;
}

.appointment-context-menu button {
    width: 100%;
    border: 0;
    background: #ffffff;
    padding: 11px 13px;
    text-align: left;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    color: #111827;
}

.appointment-context-menu button:hover {
    background: #eff6ff;
    color: #1d4ed8;
}

.appointment-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 3500;
    background: rgba(15, 23, 42, 0.45);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.appointment-modal.visible {
    display: flex;
}

.appointment-modal-dialog {
    width: 540px;
    max-width: 100%;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.35);
    padding: 20px;
}

.appointment-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 18px;
}

.appointment-modal-header h2 {
    margin: 0;
    font-size: 22px;
}

.appointment-modal-header p {
    margin: 5px 0 0;
    color: var(--muted);
    font-
    /* Schedule density mini calendar */

.schedule-month-panel {
    background: #ffffff;
    border-left: 1px solid #d5d8dd;
    border-right: 1px solid #d5d8dd;
    border-bottom: 1px solid #d5d8dd;
    padding: 12px;
    display: grid;
    grid-template-columns: 210px 1fr;
    gap: 14px;
    align-items: start;
}

.schedule-month-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.schedule-month-header strong {
    font-size: 15px;
    font-weight: 900;
    color: #111827;
}

.schedule-month-header span {
    font-size: 12px;
    color: var(--muted);
}

.schedule-mini-calendar {
    max-width: 430px;
}

.mini-calendar-weekdays,
.mini-calendar-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.mini-calendar-weekdays {
    margin-bottom: 4px;
}

.mini-calendar-weekdays span {
    text-align: center;
    font-size: 10px;
    font-weight: 900;
    color: #6b7280;
}

.mini-calendar-week {
    margin-bottom: 4px;
}

.mini-calendar-day {
    min-height: 34px;
    border-radius: 8px;
    border: 1px solid transparent;
    text-decoration: none;
    color: #111827;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    font-size: 12px;
    font-weight: 900;
}

.mini-calendar-day small {
    font-size: 9px;
    font-weight: 800;
    opacity: 0.8;
}

.mini-calendar-day.current {
    outline: 2px solid #2563eb;
    outline-offset: 1px;
}

.mini-calendar-day:hover {
    filter: brightness(0.96);
}

.mini-calendar-day.density-outside {
    background: #f3f4f6;
    color: #cbd5e1;
}

.mini-calendar-day.density-empty {
    background: #f8fafc;
    border-color: #e5e7eb;
    color: #94a3b8;
}

.mini-calendar-day.density-light {
    background: #dcfce7;
    border-color: #86efac;
}

.mini-calendar-day.density-medium {
    background: #fef9c3;
    border-color: #fde047;
}

.mini-calendar-day.density-high {
    background: #ffedd5;
    border-color: #fdba74;
}

.mini-calendar-day.density-full {
    background: #fee2e2;
    border-color: #fca5a5;
}

.density-legend {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.density-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    color: #4b5563;
}

.density-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
}

.density-dot.empty {
    background: #e5e7eb;
}

.density-dot.light {
    background: #22c55e;
}

.density-dot.medium {
    background: #eab308;
}

.density-dot.high {
    background: #f97316;
}

.density-dot.full {
    background: #ef4444;
}

@media (max-width: 900px) {
    .schedule-month-panel {
        grid-template-columns: 1fr;
    }

    .schedule-mini-calendar {
        max-width: none;
    }
}
/* Schedule density mini calendar - fixed */

.schedule-month-panel {
    background: #ffffff !important;
    border-left: 1px solid #d5d8dd !important;
    border-right: 1px solid #d5d8dd !important;
    border-bottom: 1px solid #d5d8dd !important;
    padding: 12px !important;
    display: grid !important;
    grid-template-columns: 210px 1fr !important;
    gap: 14px !important;
    align-items: start !important;
}

.schedule-month-header {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
}

.schedule-month-header strong {
    font-size: 15px !important;
    font-weight: 900 !important;
    color: #111827 !important;
}

.schedule-month-header span {
    font-size: 12px !important;
    color: #6b7280 !important;
}

.schedule-mini-calendar {
    max-width: 430px !important;
}

.mini-calendar-weekdays,
.mini-calendar-week {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    gap: 4px !important;
}

.mini-calendar-weekdays {
    margin-bottom: 4px !important;
}

.mini-calendar-weekdays span {
    text-align: center !important;
    font-size: 10px !important;
    font-weight: 900 !important;
    color: #6b7280 !important;
}

.mini-calendar-week {
    margin-bottom: 4px !important;
}

.mini-calendar-day {
    min-height: 34px !important;
    border-radius: 8px !important;
    border: 1px solid transparent !important;
    text-decoration: none !important;
    color: #111827 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 1px !important;
    font-size: 12px !important;
    font-weight: 900 !important;
}

.mini-calendar-day small {
    font-size: 9px !important;
    font-weight: 800 !important;
    opacity: 0.8 !important;
}

.mini-calendar-day.current {
    outline: 2px solid #2563eb !important;
    outline-offset: 1px !important;
}

.mini-calendar-day:hover {
    filter: brightness(0.96) !important;
}

.mini-calendar-day.density-outside {
    background: #f3f4f6 !important;
    color: #cbd5e1 !important;
}

.mini-calendar-day.density-empty {
    background: #f8fafc !important;
    border-color: #e5e7eb !important;
    color: #94a3b8 !important;
}

.mini-calendar-day.density-light {
    background: #dcfce7 !important;
    border-color: #86efac !important;
}

.mini-calendar-day.density-medium {
    background: #fef9c3 !important;
    border-color: #fde047 !important;
}

.mini-calendar-day.density-high {
    background: #ffedd5 !important;
    border-color: #fdba74 !important;
}

.mini-calendar-day.density-full {
    background: #fee2e2 !important;
    border-color: #fca5a5 !important;
}

.density-legend {
    grid-column: 1 / -1 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin-top: 4px !important;
}

.density-legend span {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #4b5563 !important;
}

.density-dot {
    width: 9px !important;
    height: 9px !important;
    border-radius: 50% !important;
    display: inline-block !important;
}

.density-dot.empty {
    background: #e5e7eb !important;
}

.density-dot.light {
    background: #22c55e !important;
}

.density-dot.medium {
    background: #eab308 !important;
}

.density-dot.high {
    background: #f97316 !important;
}

.density-dot.full {
    background: #ef4444 !important;
}
/* Schedule grid normalization */

.ident-schedule-table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    table-layout: fixed !important;
}

.ident-schedule-table tbody tr {
    height: 40px !important;
}

.ident-schedule-table th,
.ident-schedule-table td {
    box-sizing: border-box !important;
}

.ident-schedule-cell {
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    padding: 0 !important;
    border: 0 !important;
    border-right: 1px solid #9ca3af !important;
    border-bottom: 1px solid #9ca3af !important;
    position: relative !important;
    overflow: visible !important;
}

.ident-time-cell {
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    padding: 0 !important;
    border: 0 !important;
    border-right: 1px solid #9ca3af !important;
    border-bottom: 1px solid #9ca3af !important;
    line-height: 40px !important;
}

.ident-doctor-head {
    border: 0 !important;
    border-right: 1px solid #9ca3af !important;
    border-bottom: 1px solid #9ca3af !important;
}

.ident-time-head {
    border: 0 !important;
    border-right: 1px solid #9ca3af !important;
    border-bottom: 1px solid #9ca3af !important;
}

/* Empty slots should fill the cell exactly */

.ident-empty-slot {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    border: 0 !important;
    outline: none !important;
    box-sizing: border-box !important;
}

/* Appointments should not stretch table rows */

.ident-appointment-wrap {
    position: absolute !important;
    inset: 0 !important;
    height: 100% !important;
    min-height: 0 !important;
    box-sizing: border-box !important;
    overflow: visible !important;
}

.ident-appointment {
    height: 100% !important;
    min-height: 0 !important;
    box-sizing: border-box !important;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 4px 8px 4px 20px !important;
    display: flex !important;
    justify-content: center !important;
    overflow: hidden !important;
}

/* Make text compact so it does not change row height */

.ident-appointment strong {
    font-size: 11px !important;
    line-height: 1.05 !important;
}

.ident-appointment small {
    font-size: 9px !important;
    line-height: 1.05 !important;
}

.ident-appointment em {
    font-size: 9px !important;
    line-height: 1.05 !important;
}

.ident-check {
    top: 5px !important;
}

/* Resize handle should not visually thicken the grid */

.appointment-resize-handle {
    bottom: 0 !important;
    height: 5px !important;
    background: transparent !important;
}

.ident-appointment-wrap:hover .appointment-resize-handle {
    background: rgba(0, 0, 0, 0.12) !important;
}

/* Hover should not add thick outlines */

.ident-empty-slot:hover {
    outline: none !important;
    box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.25) !important;
}

.ident-appointment:hover {
    outline: none !important;
    filter: brightness(0.97);
}

/* Expense selection */
.expense-select-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.expense-quantity-input {
    width: 110px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 7px 9px;
    font-size: 13px;
}

.expense-quantity-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    outline: none;
}


/* Staff accounts */
.staff-filter-form {
    display: grid;
    grid-template-columns: 1fr 220px 140px;
    gap: 16px;
    align-items: end;
}

.staff-form-grid {
    margin-top: 14px;
}

.staff-checkbox-field {
    justify-content: flex-end;
}

.staff-checkbox-field label {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 11px 12px;
}

.staff-checkbox-field input {
    width: auto;
}

.staff-status {
    display: inline-flex;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 800;
}

.staff-status.active {
    background: #dcfce7;
    color: #166534;
}

.staff-status.inactive {
    background: #fee2e2;
    color: #991b1b;
}

@media (max-width: 900px) {
    .staff-filter-form {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   LúnaCRM Hybrid Luxury Theme
   Deep navy + warm gold + ivory working surface.
   No external fonts: optimized for Windows/clinic workstations.
   ========================================================= */
:root {
    --bg: #f6f1e8;
    --surface: #fffdf8;
    --surface-soft: #fbf7ef;
    --border: #e7dac8;
    --text: #111827;
    --muted: #667085;

    --primary: #b9853b;
    --primary-hover: #9d6f2f;
    --primary-soft: #f6ead7;

    --sidebar-bg: #07111f;
    --sidebar-hover: rgba(201, 148, 74, 0.14);
    --sidebar-text: #f7ead6;
    --sidebar-muted: #aab3c2;

    --gold: #c8944a;
    --gold-soft: #ead4ad;
    --navy: #07111f;
    --navy-2: #0f1d2e;
    --ivory: #f6f1e8;

    --danger: #c2413d;
    --success: #2e9f6e;
    --warning: #d98b24;
    --info: #2f80a7;

    --radius: 16px;
    --shadow: 0 18px 45px rgba(7, 17, 31, 0.08);
    --shadow-soft: 0 10px 30px rgba(7, 17, 31, 0.06);
}

* {
    scrollbar-width: thin;
    scrollbar-color: rgba(184, 133, 59, 0.5) rgba(7, 17, 31, 0.08);
}

body {
    font-family: "Segoe UI", Inter, Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(184, 133, 59, 0.12), transparent 34%),
        linear-gradient(135deg, #fbf7ef 0%, #f3eee6 54%, #eef1f5 100%);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

.app-layout {
    background: transparent;
}

.sidebar {
    width: 258px;
    background:
        radial-gradient(circle at 20% 0%, rgba(201, 148, 74, 0.18), transparent 30%),
        linear-gradient(180deg, #07111f 0%, #0b1829 58%, #06101d 100%);
    border-right: 1px solid rgba(201, 148, 74, 0.22);
    box-shadow: 14px 0 40px rgba(7, 17, 31, 0.18);
    padding: 24px 16px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px 18px;
    border-bottom: 1px solid rgba(201, 148, 74, 0.22);
}

.sidebar-brand-mark,
.login-brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(145deg, rgba(201, 148, 74, 0.95), rgba(238, 200, 128, 0.92));
    color: #07111f;
    font-weight: 900;
    font-size: 24px;
    line-height: 1;
    box-shadow: 0 14px 28px rgba(201, 148, 74, 0.24);
    font-family: Georgia, "Times New Roman", serif;
}

.sidebar-brand-text {
    color: #f6d9a2;
    font-size: 23px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.sidebar-logo {
    color: #f6d9a2;
}

.sidebar-logo::after {
    content: "" !important;
    display: none !important;
}

.sidebar-menu {
    gap: 6px;
    margin-top: 22px;
}

.sidebar-menu a {
    color: rgba(247, 234, 214, 0.86);
    border-radius: 13px;
    padding: 11px 13px;
    font-size: 14px;
    font-weight: 650;
    letter-spacing: -0.01em;
    border: 1px solid transparent;
}

.sidebar-menu a:hover {
    background: rgba(201, 148, 74, 0.14);
    border-color: rgba(201, 148, 74, 0.22);
    color: #fff7e7;
}

.main {
    padding: 32px;
    max-width: calc(100vw - 258px);
}

.page-title,
.patient-name,
.ident-title-block h1 {
    font-weight: 850;
    letter-spacing: -0.045em;
    color: #08111f;
}

h2, h3 {
    color: #101827;
    letter-spacing: -0.03em;
}

.muted {
    color: #697386;
}

.card,
.patient-tabs-card,
.patient-photo-upload-card,
.patient-photo-group,
.schedule-log-panel,
.ident-schedule-board,
.ident-filterbar,
.ident-legend,
.schedule-month-panel,
.finance-summary-card,
.appointment-modal-dialog,
.patient-search-dialog {
    background: rgba(255, 253, 248, 0.92) !important;
    border: 1px solid rgba(184, 133, 59, 0.18) !important;
    box-shadow: var(--shadow-soft) !important;
    backdrop-filter: blur(10px);
}

.card {
    border-radius: 20px;
    padding: 24px;
}

.topbar {
    margin-bottom: 24px;
}

.btn,
button,
input,
select,
textarea {
    font-family: inherit;
}

.btn {
    border-radius: 12px;
    font-weight: 800;
}

.btn-primary,
.ident-add-btn,
.ident-date-form button {
    background: linear-gradient(135deg, #c8944a, #a97832) !important;
    border-color: rgba(168, 118, 49, 0.95) !important;
    color: #fffaf0 !important;
    box-shadow: 0 10px 22px rgba(184, 133, 59, 0.20);
}

.btn-primary:hover,
.ident-add-btn:hover,
.ident-date-form button:hover {
    background: linear-gradient(135deg, #d49c54, #a97832) !important;
    transform: translateY(-1px);
}

.btn-secondary,
.ident-nav-btn {
    background: #fffdf8 !important;
    border-color: rgba(184, 133, 59, 0.24) !important;
    color: #223047 !important;
}

.btn-secondary:hover,
.ident-nav-btn:hover {
    background: #f7ecd9 !important;
    color: #07111f !important;
}

.btn-danger {
    background: #c2413d !important;
    color: #fff !important;
}

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

.table th {
    background: #fbf7ef !important;
    color: #6d5f4c;
    border-bottom: 1px solid rgba(184, 133, 59, 0.20);
}

.table td {
    border-bottom: 1px solid rgba(184, 133, 59, 0.14);
}

.table tr:hover td {
    background: rgba(246, 234, 215, 0.38) !important;
}

.form-field label {
    color: #4a5568;
    font-weight: 800;
}

.form-field input,
.form-field textarea,
.form-field select,
.schedule-date-form input,
.ident-date-form input,
.room-shift-select,
.expense-quantity-input {
    border-color: rgba(184, 133, 59, 0.24) !important;
    background: #fffdf8 !important;
    border-radius: 12px !important;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus,
.schedule-date-form input:focus,
.ident-date-form input:focus,
.room-shift-select:focus,
.expense-quantity-input:focus {
    border-color: #c8944a !important;
    box-shadow: 0 0 0 4px rgba(200, 148, 74, 0.15) !important;
}

.empty-state {
    background: rgba(255, 253, 248, 0.62) !important;
    border: 1px dashed rgba(184, 133, 59, 0.24);
    color: #748094;
}

/* Patient card tabs */
.patient-tabs-card {
    border-radius: 20px !important;
}

.patient-tabs {
    gap: 8px !important;
}

.patient-tab-button {
    border-radius: 999px !important;
    border: 1px solid rgba(184, 133, 59, 0.22) !important;
    background: #fffdf8 !important;
    color: #3f4b5f !important;
    font-weight: 850 !important;
}

.patient-tab-button:hover {
    background: #f6ead7 !important;
    color: #07111f !important;
}

.patient-tab-button.active {
    background: linear-gradient(135deg, #07111f, #102033) !important;
    border-color: rgba(201, 148, 74, 0.58) !important;
    color: #f6d9a2 !important;
    box-shadow: 0 12px 26px rgba(7, 17, 31, 0.14);
}

/* Dental chart */
.fdi-dental-chart,
.dental-arch-chart,
.dental-chart {
    background:
        radial-gradient(circle at 50% 0%, rgba(200, 148, 74, 0.10), transparent 45%),
        #fffdf8 !important;
    border-color: rgba(184, 133, 59, 0.20) !important;
}

.tooth-body,
.tooth-crown-shape {
    stroke: #aeb8c7;
}

.fdi-tooth-button:hover .tooth-body,
.anatomic-tooth-link:hover .tooth-crown-shape {
    stroke: #c8944a !important;
}

/* Menus and modals */
.slot-context-menu,
.appointment-context-menu,
.appointment-hover-popover {
    background: #fffdf8 !important;
    border-color: rgba(184, 133, 59, 0.24) !important;
    border-radius: 16px !important;
    box-shadow: 0 24px 55px rgba(7, 17, 31, 0.24) !important;
}

.slot-context-menu button,
.appointment-context-menu button {
    color: #172033 !important;
    font-weight: 800 !important;
}

.slot-context-menu button:hover,
.appointment-context-menu button:hover {
    background: #f6ead7 !important;
    color: #7c541e !important;
}

.appointment-modal,
.patient-search-modal {
    background: rgba(7, 17, 31, 0.52) !important;
}

.modal-close {
    background: #f6ead7 !important;
    color: #07111f !important;
}

/* Login */
.login-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 20% 10%, rgba(201, 148, 74, 0.20), transparent 34%),
        radial-gradient(circle at 80% 80%, rgba(201, 148, 74, 0.10), transparent 30%),
        linear-gradient(135deg, #07111f 0%, #0f1d2e 62%, #07111f 100%);
}

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(280px, 430px) minmax(340px, 500px);
    gap: 34px;
    align-items: center;
    justify-content: center;
    padding: 36px;
}

.login-brand-card {
    color: #f6d9a2;
    padding: 34px;
}

.login-brand-card h1 {
    margin: 18px 0 0;
    font-size: 52px;
    line-height: 1;
    letter-spacing: -0.06em;
}

.login-card {
    background: rgba(255, 253, 248, 0.96) !important;
    border-color: rgba(201, 148, 74, 0.28) !important;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.30) !important;
}

.login-card .form-actions .btn {
    width: 100%;
}

@media (max-width: 900px) {
    .sidebar {
        width: 100%;
        height: auto;
    }

    .main {
        max-width: none;
        padding: 20px;
    }

    .login-shell {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .login-brand-card {
        padding: 10px;
        text-align: center;
    }

    .login-brand-card h1 {
        font-size: 38px;
    }
}


/* LunaCRM 27.2.15 schedule block hard fixes */
.ident-appointment, .ident-appointment-wrap, .ident-appointment-wrap > .ident-appointment, .ident-appointment-wrap .ident-appointment {
  border-radius: 0 !important;
  clip-path: inset(0) !important;
  -webkit-clip-path: inset(0) !important;
}
.ident-appointment-wrap > .ident-appointment, .ident-appointment-wrap .ident-appointment {
  position: absolute !important; inset: 0 !important; width: 100% !important; height: 100% !important; margin: 0 !important;
}
.ident-appointment.appointment-confirmed { padding-left: 52px !important; padding-right: 52px !important; }
.ident-appointment .ident-check + .appointment-confirm-badge + strong, .ident-appointment .appointment-confirm-badge + strong { padding-right: 0 !important; }
.appointment-patient-no-show { text-decoration: line-through !important; text-decoration-thickness: 1.5px !important; }
@media (max-width: 980px) { .appointment-confirm-badge { display: none !important; } .ident-check { display: inline-block !important; } body.luna-schedule-mobile-page .ident-appointment.appointment-confirmed { padding-left: 18px !important; padding-right: 6px !important; } }



/* LunaCRM 27.2.15 FINAL: square appointment blocks, centered confirmed text, mobile confirmation mark, no-show strike only */
.ident-schedule-table .ident-appointment-wrap,
.ident-schedule-table .ident-appointment-wrap::before,
.ident-schedule-table .ident-appointment-wrap::after,
.ident-schedule-table .ident-appointment,
.ident-schedule-table .ident-appointment::before,
.ident-schedule-table .ident-appointment::after,
.ident-schedule-table .ident-schedule-cell.appointment-span-cell,
.ident-schedule-table .appointment-planned,
.ident-schedule-table .appointment-arrived,
.ident-schedule-table .appointment-completed,
.ident-schedule-table .appointment-cancelled,
.ident-schedule-table .appointment-no_show,
.ident-schedule-table .appointment-blocked {
    border-radius: 0 !important;
    background-clip: border-box !important;
}

.ident-schedule-table .ident-appointment-wrap {
    inset: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
}

.ident-schedule-table .ident-appointment-wrap > .ident-appointment,
.ident-schedule-table .ident-appointment-wrap .ident-appointment {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
}

.ident-schedule-table .ident-appointment,
.ident-schedule-table .ident-appointment.appointment-confirmed {
    padding-left: 8px !important;
    padding-right: 8px !important;
    align-items: center !important;
    text-align: center !important;
}

.ident-schedule-table .ident-appointment strong,
.ident-schedule-table .ident-appointment small,
.ident-schedule-table .ident-appointment em {
    width: 100% !important;
    text-align: center !important;
    padding: 0 !important;
}

.ident-schedule-table .ident-check {
    position: absolute !important;
    left: 5px !important;
    top: 4px !important;
    z-index: 5 !important;
    pointer-events: none !important;
}

.ident-schedule-table .appointment-confirm-badge {
    position: absolute !important;
    right: 4px !important;
    top: 3px !important;
    z-index: 5 !important;
    pointer-events: none !important;
    border-radius: 0 !important;
}

.ident-schedule-table .ident-appointment .ident-check + .appointment-confirm-badge + strong,
.ident-schedule-table .ident-appointment .appointment-confirm-badge + strong {
    padding-right: 0 !important;
}

.ident-schedule-table .appointment-patient-no-show {
    text-decoration: line-through !important;
    text-decoration-thickness: 1.5px !important;
    text-decoration-color: currentColor !important;
}

.ident-schedule-table .appointment-no_show .appointment-status-note {
    display: none !important;
}

@media (max-width: 980px) {
    body.luna-schedule-mobile-page .ident-schedule-table .appointment-confirm-badge {
        display: none !important;
    }

    body.luna-schedule-mobile-page .ident-schedule-table .ident-appointment,
    body.luna-schedule-mobile-page .ident-schedule-table .ident-appointment.appointment-confirmed {
        padding-left: 7px !important;
        padding-right: 7px !important;
    }

    body.luna-schedule-mobile-page .ident-schedule-table .ident-appointment.appointment-confirmed {
        box-shadow: inset 0 0 0 2px rgba(22, 163, 74, 0.72) !important;
    }

    body.luna-schedule-mobile-page .ident-schedule-table .ident-appointment.appointment-confirmed::after {
        content: "✓" !important;
        position: absolute !important;
        right: 4px !important;
        top: 2px !important;
        width: 14px !important;
        height: 14px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: #dcfce7 !important;
        color: #166534 !important;
        border: 1px solid #86efac !important;
        border-radius: 0 !important;
        font-size: 10px !important;
        line-height: 1 !important;
        font-weight: 700 !important;
        z-index: 6 !important;
        pointer-events: none !important;
    }

    body.luna-schedule-mobile-page .ident-schedule-table .ident-check {
        display: none !important;
    }

    body.luna-schedule-mobile-page .ident-schedule-table .appointment-no_show strong,
    body.luna-schedule-mobile-page .ident-schedule-table .appointment-patient-no-show {
        text-decoration: line-through !important;
        text-decoration-thickness: 1.5px !important;
    }
}




/* LunaCRM 27.2.16 FINAL external override */
.ident-schedule-table .appointment-patient-no-show,
.ident-schedule-table .appointment-no_show strong,
.appointment-patient-no-show,
.appointment-no_show strong {
    text-decoration: line-through !important;
    text-decoration-thickness: 1px !important;
    text-decoration-color: currentColor !important;
    text-decoration-skip-ink: auto !important;
}

.ident-schedule-table .appointment-arrived .appointment-status-note,
.ident-schedule-table .appointment-arrived .appointment-status-note,
.appointment-arrived .appointment-status-note {
    display: none !important;
}

.ident-schedule-table .appointment-arrived-mark {
    position: absolute !important;
    left: 5px !important;
    top: 4px !important;
    width: 13px !important;
    height: 13px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    background: #dcfce7 !important;
    color: #15803d !important;
    border: 1px solid #86efac !important;
    border-radius: 0 !important;
    font-size: 9px !important;
    line-height: 1 !important;
    font-weight: 700 !important;
    z-index: 6 !important;
    pointer-events: none !important;
}

.ident-schedule-table .appointment-arrived:not(.appointment-confirmed) {
    box-shadow: inset 0 0 0 1px rgba(22, 163, 74, 0.42) !important;
}

.ident-schedule-table .appointment-arrived .appointment-arrived-mark + strong {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

@media (max-width: 980px) {
    body.luna-schedule-mobile-page .ident-schedule-table .appointment-patient-no-show,
    body.luna-schedule-mobile-page .ident-schedule-table .appointment-no_show strong,
    body.luna-schedule-mobile-page .appointment-patient-no-show,
    body.luna-schedule-mobile-page .appointment-no_show strong {
        text-decoration: line-through !important;
        text-decoration-thickness: 1px !important;
    }

    body.luna-schedule-mobile-page .ident-schedule-table .appointment-arrived-mark {
        left: 4px !important;
        top: 3px !important;
        width: 14px !important;
        height: 14px !important;
        font-size: 9px !important;
    }
}


/* LunaCRM 27.2.16: keep arrived mark separate from confirmation check on desktop */
.ident-schedule-table .ident-appointment.appointment-confirmed .appointment-arrived-mark {
    left: 21px !important;
}
@media (max-width: 980px) {
    body.luna-schedule-mobile-page .ident-schedule-table .ident-appointment.appointment-confirmed .appointment-arrived-mark {
        left: 4px !important;
    }
}


/* LunaCRM 27.2.19 FINAL: exact resize + truly square appointment blocks */
@media (min-width: 981px) {
    :root { --schedule-row-height: 13px !important; }
}

.ident-schedule-table,
.ident-schedule-table tbody,
.ident-schedule-table tr,
.ident-schedule-table td.ident-schedule-cell,
.ident-schedule-table td.ident-schedule-cell.appointment-span-cell,
.ident-schedule-table .is-resizing-cell,
.ident-schedule-table .is-resizing-row {
    overflow: visible !important;
}

.ident-schedule-table td.ident-schedule-cell.appointment-span-cell {
    position: relative !important;
    padding: 0 !important;
    background-clip: border-box !important;
}

.ident-schedule-table td.ident-schedule-cell.appointment-span-cell > .ident-appointment-wrap,
.ident-schedule-table .ident-appointment-wrap,
.ident-schedule-table .ident-appointment-wrap.appointment-planned,
.ident-schedule-table .ident-appointment-wrap.appointment-arrived,
.ident-schedule-table .ident-appointment-wrap.appointment-completed,
.ident-schedule-table .ident-appointment-wrap.appointment-cancelled,
.ident-schedule-table .ident-appointment-wrap.appointment-no_show,
.ident-schedule-table .ident-appointment-wrap.appointment-blocked {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    -webkit-border-radius: 0 !important;
    clip-path: none !important;
    -webkit-clip-path: none !important;
    background-clip: border-box !important;
}

.ident-schedule-table .ident-appointment-wrap > .ident-appointment,
.ident-schedule-table .ident-appointment-wrap .ident-appointment,
.ident-schedule-table .ident-appointment,
.ident-schedule-table .ident-appointment.appointment-planned,
.ident-schedule-table .ident-appointment.appointment-arrived,
.ident-schedule-table .ident-appointment.appointment-completed,
.ident-schedule-table .ident-appointment.appointment-cancelled,
.ident-schedule-table .ident-appointment.appointment-no_show,
.ident-schedule-table .ident-appointment.appointment-blocked,
.ident-schedule-table .ident-appointment.appointment-confirmed,
.appointment-resize-live-preview,
.appointment-resize-live-preview .ident-appointment {
    border-radius: 0 !important;
    -webkit-border-radius: 0 !important;
    clip-path: none !important;
    -webkit-clip-path: none !important;
    background-clip: border-box !important;
    margin: 0 !important;
}

.ident-schedule-table .ident-appointment-wrap > .ident-appointment,
.ident-schedule-table .ident-appointment-wrap .ident-appointment {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
}

body.is-schedule-resizing .ident-schedule-table .ident-appointment-wrap.is-resizing,
.ident-schedule-table .ident-appointment-wrap.is-resizing {
    z-index: 100000 !important;
    opacity: 0.38 !important;
}

body.is-schedule-resizing .ident-schedule-table td.ident-schedule-cell.is-resizing-cell,
body.is-schedule-resizing .ident-schedule-table tr.is-resizing-row,
.ident-schedule-table td.ident-schedule-cell.is-resizing-cell {
    position: relative !important;
    z-index: 99999 !important;
}

.appointment-resize-live-preview {
    position: fixed !important;
    z-index: 2147483000 !important;
    pointer-events: none !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    opacity: 0.96 !important;
    filter: drop-shadow(0 8px 14px rgba(15, 23, 42, 0.20)) !important;
}

.appointment-resize-live-preview .ident-appointment {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    box-sizing: border-box !important;
    display: flex !important;
}


/* LunaCRM 27.2.20 FINAL: fixed resize preview + hard rectangular appointment blocks */
@media (min-width: 981px) {
    :root,
    .ident-schedule-shell {
        --schedule-row-height: 13px !important;
    }
}
.ident-schedule-table td.ident-schedule-cell,
.ident-schedule-table td.ident-schedule-cell.appointment-span-cell {
    position: relative !important;
    padding: 0 !important;
    background-clip: border-box !important;
    border-radius: 0 !important;
    -webkit-border-radius: 0 !important;
}
.ident-schedule-table td.ident-schedule-cell.appointment-span-cell > .ident-appointment-wrap,
.ident-schedule-table .ident-appointment-wrap,
.ident-schedule-table .ident-appointment-wrap.appointment-planned,
.ident-schedule-table .ident-appointment-wrap.appointment-arrived,
.ident-schedule-table .ident-appointment-wrap.appointment-completed,
.ident-schedule-table .ident-appointment-wrap.appointment-cancelled,
.ident-schedule-table .ident-appointment-wrap.appointment-no_show,
.ident-schedule-table .ident-appointment-wrap.appointment-blocked {
    position: absolute !important;
    top: var(--appointment-top-px, 0px) !important;
    left: 0 !important;
    right: 0 !important;
    bottom: auto !important;
    width: 100% !important;
    height: var(--appointment-px-height, var(--schedule-row-height)) !important;
    min-height: var(--appointment-px-height, var(--schedule-row-height)) !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    -webkit-border-radius: 0 !important;
    clip-path: inset(0 round 0) !important;
    -webkit-clip-path: inset(0 round 0) !important;
    background-clip: border-box !important;
    overflow: visible !important;
}
.ident-schedule-table .ident-appointment-wrap > .ident-appointment,
.ident-schedule-table .ident-appointment-wrap .ident-appointment,
.ident-schedule-table .ident-appointment,
.ident-schedule-table .ident-appointment.appointment-planned,
.ident-schedule-table .ident-appointment.appointment-arrived,
.ident-schedule-table .ident-appointment.appointment-completed,
.ident-schedule-table .ident-appointment.appointment-cancelled,
.ident-schedule-table .ident-appointment.appointment-no_show,
.ident-schedule-table .ident-appointment.appointment-blocked,
.ident-schedule-table .ident-appointment.appointment-confirmed {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
    -webkit-border-radius: 0 !important;
    clip-path: inset(0 round 0) !important;
    -webkit-clip-path: inset(0 round 0) !important;
    background-clip: border-box !important;
    box-sizing: border-box !important;
}
body.is-schedule-resizing .ident-schedule-table .ident-appointment-wrap.is-resizing,
.ident-schedule-table .ident-appointment-wrap.is-resizing {
    z-index: 100000 !important;
    opacity: 0.22 !important;
    outline: 0 !important;
    box-shadow: none !important;
}
.appointment-resize-live-preview,
.appointment-resize-live-preview .ident-appointment {
    border-radius: 0 !important;
    -webkit-border-radius: 0 !important;
    clip-path: inset(0 round 0) !important;
    -webkit-clip-path: inset(0 round 0) !important;
}
.appointment-resize-live-preview {
    position: fixed !important;
    z-index: 2147483000 !important;
    pointer-events: none !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    opacity: 0.96 !important;
    filter: drop-shadow(0 8px 14px rgba(15, 23, 42, 0.20)) !important;
}
.appointment-resize-live-preview .ident-appointment {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    box-sizing: border-box !important;
    display: flex !important;
}


/* LunaCRM 27.2.20: keep original appointment still while live-preview follows the cursor */
body.is-schedule-resizing .ident-schedule-table td.ident-schedule-cell.is-resizing-cell .ident-appointment-wrap.is-resizing,
body.is-schedule-resizing .ident-schedule-table .ident-appointment-wrap.is-resizing {
    transform: none !important;
    top: var(--appointment-top-px, 0px) !important;
    height: var(--appointment-px-height, var(--schedule-row-height)) !important;
    opacity: 0.18 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background-image: none !important;
}
body.is-schedule-resizing .ident-schedule-table td.ident-schedule-cell.is-resizing-cell .ident-appointment-wrap.is-resizing > .ident-appointment,
body.is-schedule-resizing .ident-schedule-table .ident-appointment-wrap.is-resizing > .ident-appointment {
    transform: none !important;
    height: 100% !important;
    min-height: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background-image: none !important;
}
