@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-color: #e6eef8;
    --text-color: #3e4a5b;
    --text-muted: #718096;
    --shadow-dark: #b8c6d9;
    --shadow-light: #ffffff;
    --primary-color: #4a90e2;
    --primary-light: #70a9eb;
    --success-color: #4caf50;
    --error-color: #f44336;
    
    --card-shadow: 10px 10px 20px var(--shadow-dark), -10px -10px 20px var(--shadow-light);
    --card-shadow-hover: 5px 5px 10px var(--shadow-dark), -5px -5px 10px var(--shadow-light);
    --inner-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
    --btn-shadow: 6px 6px 12px var(--shadow-dark), -6px -6px 12px var(--shadow-light);
    --btn-shadow-active: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow-x: hidden;
}

/* App Layout & Shell */
header {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chekei-header-logo, .logo img {
    height: 75px;
    max-height: 90px;
    object-fit: contain;
}

.logo span {
    color: var(--text-color);
}

main#app {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 1.5rem 2rem;
    width: 100%;
}

footer {
    padding: 0;
    width: 100%;
}

/* Official Footer (Hidden) */
footer.ts-footer {
    display: none !important;
    background-color: #17212b;
    color: #94a3b8;
    padding: 1.5rem 1.5rem 1.25rem 1.5rem;
    width: 100%;
    margin-top: auto;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    box-sizing: border-box;
}

.ts-footer-container {
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

.ts-footer-divider {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    margin-bottom: 1.25rem;
}

.ts-footer-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.ts-footer-brand {
    display: flex;
    align-items: center;
}

.ts-footer-logo {
    height: 36px;
    width: auto;
    object-fit: contain;
}

.ts-footer-socials {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.ts-social-link {
    color: #94a3b8;
    transition: color 0.2s ease, transform 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.ts-social-link:hover {
    color: #ffffff;
    transform: translateY(-2px);
}

.ts-footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #64748b;
}

.ts-footer-copyright {
    color: #64748b;
}

.ts-footer-legal a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s ease;
}

.ts-footer-legal a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.ts-contact-link {
    color: #94a3b8;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    transition: color 0.2s ease;
    cursor: pointer;
}

.ts-contact-link:hover {
    color: #ffffff;
    text-decoration: underline;
}

@media (max-width: 640px) {
    .ts-footer-top, .ts-footer-bottom {
        flex-direction: column;
        gap: 0.85rem;
        text-align: center;
    }
    .ts-footer-socials {
        justify-content: center;
    }
}

/* Neumorphic Elements */
.nm-card {
    background: var(--bg-color);
    border-radius: 24px;
    box-shadow: var(--card-shadow);
    padding: 2.5rem;
    width: 100%;
    max-width: 480px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: all 0.3s ease;
}

.nm-card-large {
    max-width: 1000px;
}

/* Typography */
h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-color);
}

h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

p {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-color);
    padding-left: 0.5rem;
}

.nm-input {
    background: var(--bg-color);
    border: none;
    outline: none;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    box-shadow: var(--inner-shadow);
    font-size: 1rem;
    color: var(--text-color);
    transition: all 0.3s ease;
    width: 100%;
}

.nm-input::placeholder,
.nm-textarea::placeholder,
input::placeholder,
textarea::placeholder {
    color: #94a3b8 !important;
    opacity: 0.55 !important;
    font-weight: 400 !important;
}

::-webkit-input-placeholder {
    color: #94a3b8 !important;
    opacity: 0.55 !important;
    font-weight: 400 !important;
}

::-moz-placeholder {
    color: #94a3b8 !important;
    opacity: 0.55 !important;
    font-weight: 400 !important;
}

:-ms-input-placeholder {
    color: #94a3b8 !important;
    opacity: 0.55 !important;
    font-weight: 400 !important;
}

.nm-input:focus {
    box-shadow: inset 6px 6px 12px var(--shadow-dark), inset -6px -6px 12px var(--shadow-light);
    border: 1px solid rgba(74, 144, 226, 0.2);
}

.nm-select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%233e4a5b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.2rem;
}

/* Quill Richtext Alignment Classes */
.ql-align-center, [class*="ql-align-center"] { text-align: center !important; }
.ql-align-right, [class*="ql-align-right"] { text-align: right !important; }
.ql-align-justify, [class*="ql-align-justify"] { text-align: justify !important; }

/* Buttons */
.nm-btn {
    border: none;
    outline: none;
    background: var(--bg-color);
    color: var(--text-color);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--btn-shadow);
    transition: all 0.2s ease;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.nm-btn:hover {
    transform: translateY(-2px);
    box-shadow: 8px 8px 16px var(--shadow-dark), -8px -8px 16px var(--shadow-light);
}

.nm-btn:active {
    transform: translateY(1px);
    box-shadow: var(--btn-shadow-active);
}

.nm-btn-primary {
    background: linear-gradient(145deg, #4f9aff, #4382cb);
    color: white;
}

.nm-btn-primary:hover {
    background: linear-gradient(145deg, #5aa4ff, #478bd9);
    box-shadow: 5px 5px 12px var(--shadow-dark), -5px -5px 12px var(--shadow-light);
}

.nm-btn-primary:active {
    box-shadow: inset 4px 4px 8px #2b5687, inset -4px -4px 8px #5ba2eb;
}

.btn-full {
    width: 100%;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    box-shadow: var(--inner-shadow);
    display: none;
}

.alert-success {
    background-color: rgba(76, 175, 80, 0.1);
    color: #2e7d32;
    border: 1px solid rgba(76, 175, 80, 0.2);
}

.alert-error {
    background-color: rgba(244, 67, 54, 0.1);
    color: #c62828;
    border: 1px solid rgba(244, 67, 54, 0.2);
}

.alert-info {
    background-color: rgba(74, 144, 226, 0.1);
    color: #1565c0;
    border: 1px solid rgba(74, 144, 226, 0.2);
}

/* Link Actions */
.link-action {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease;
}

.link-action:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

.form-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* Modal Overlay Blur */
.modal-overlay {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-y: auto;
    padding: 2rem 1rem;
    backdrop-filter: blur(5px);
    transition: opacity 0.3s ease;
    z-index: 10000;
}

/* Mobile Bottom Navigation Bar Styles */
.mobile-nav-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: auto;
    min-height: 62px;
    background: var(--bg-color);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.08), inset 0 1px 2px rgba(255, 255, 255, 0.8);
    display: none; /* Controlled by JS and Media Query */
    justify-content: space-around;
    align-items: center;
    z-index: 998;
    border-top-left-radius: 22px;
    border-top-right-radius: 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.6);
    padding: 0.35rem 0.5rem calc(0.35rem + env(safe-area-inset-bottom, 0px)) 0.5rem;
    box-sizing: border-box;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    flex: 1;
    min-height: 48px;
    padding: 0.25rem 0.2rem;
    border-radius: 12px;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    text-align: center;
}

.mobile-nav-icon {
    font-size: 1.35rem;
    margin-bottom: 2px;
}

.mobile-nav-item span:last-child {
    font-size: 0.72rem;
    letter-spacing: 0.1px;
    line-height: 1.1;
    white-space: nowrap;
}

.mobile-nav-item:hover, .mobile-nav-item.active {
    color: var(--primary-color);
}

.mobile-nav-item:active {
    transform: scale(0.92);
    background: rgba(0, 0, 0, 0.03);
}

.mobile-nav-item.active .mobile-nav-icon {
    transform: scale(1.12);
    transition: transform 0.2s ease;
}

/* Mobile Bottom Sheet Overlay & Drawer */
.mobile-bottom-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 99999;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.mobile-bottom-sheet-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-bottom-sheet {
    background: var(--bg-color, #e0e5ec);
    width: 100%;
    max-width: 500px;
    border-radius: 26px 26px 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.25);
    border-top: 1px solid rgba(255, 255, 255, 0.7);
    padding: 1.25rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom, 0px)) 1.25rem;
    box-sizing: border-box;
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-bottom-sheet-overlay.active .mobile-bottom-sheet {
    transform: translateY(0);
}

.sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.15rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.sheet-close-btn {
    background: transparent;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    border-radius: 50%;
}

.sheet-menu-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sheet-menu-item {
    background: var(--bg-color, #e0e5ec);
    border-radius: 16px;
    padding: 0.85rem 1.15rem;
    box-shadow: var(--btn-shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.6);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.sheet-menu-item:active {
    transform: scale(0.98);
    box-shadow: var(--inner-shadow);
}

.sheet-item-icon {
    font-size: 1.45rem;
}

.sheet-item-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-color);
}

.sheet-item-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.sheet-item-arrow {
    font-size: 1.25rem;
    color: #94a3b8;
    font-weight: 700;
}

/* Hide on desktop, override inline JS display if desktop width */
@media (min-width: 901px) {
    .mobile-nav-bar {
        display: none !important;
    }
}

@media (max-width: 900px) {
    body {
        padding-bottom: calc(85px + env(safe-area-inset-bottom, 0px)) !important; /* Leave bottom buffer so layout isn't overlapped by the bar */
    }
    main#app {
        padding: 0.85rem 0.6rem !important;
    }
}

/* Header & Mobile Input Ergonomics */
.header-right-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

@media (max-width: 768px) {
    header,
    header.app-main-header {
        padding: 0.75rem 1rem !important;
        gap: 0.5rem;
    }

    .chekei-header-logo,
    .logo img {
        height: 44px !important;
        max-height: 48px !important;
    }

    .header-right-actions {
        gap: 0.4rem !important;
    }

    #active-doctor-select {
        min-width: 130px !important;
        max-width: 170px !important;
        font-size: 0.8rem !important;
        padding: 0.25rem 1.6rem 0.25rem 0.6rem !important;
    }

    #user-display-name {
        max-width: 130px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        font-size: 0.78rem !important;
        padding: 0.25rem 0.55rem !important;
    }

    #btn-header-help {
        padding: 0.25rem 0.6rem !important;
        font-size: 0.78rem !important;
    }

    #btn-header-help .help-btn-text {
        display: none !important;
    }

    /* Prevent mobile browser auto-zoom on inputs */
    .nm-input,
    .nm-select,
    .nm-textarea,
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    input[type="tel"],
    select,
    textarea {
        font-size: 16px !important;
    }
}

@media (max-width: 480px) {
    header,
    header.app-main-header {
        padding: 0.5rem 0.75rem !important;
    }

    .chekei-header-logo,
    .logo img {
        height: 38px !important;
        max-height: 40px !important;
    }

    #app-version-badge {
        display: none !important;
    }

    #user-display-name {
        max-width: 105px !important;
        font-size: 0.74rem !important;
    }
}

/* ==========================================================
 * RESPONSIVE MOBILE MODAL SYSTEM (GLOBAL)
 * ========================================================== */
@media (max-width: 768px) {
    .modal-overlay,
    .modal-overlay-pay,
    .xhm-help-modal-overlay,
    div[id$="-overlay"] {
        padding: 0.75rem 0.5rem !important;
        align-items: flex-start !important;
        justify-content: center !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        z-index: 99999 !important;
    }

    .modal-overlay > .nm-card,
    .modal-overlay > div,
    .modal-overlay-pay > div,
    .xhm-help-modal-overlay > div,
    div[id$="-overlay"] > div,
    .nm-modal-content,
    .chk-modal-card {
        width: 95vw !important;
        max-width: 95vw !important;
        max-height: 90vh !important;
        margin: auto !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        border-radius: 18px !important;
        box-sizing: border-box !important;
    }

    .nm-modal-content {
        padding: 1.15rem !important;
    }

    /* Modal Close Button Accessibility */
    #btn-close-modal,
    #btn-close-help-center,
    .nm-modal-close-btn,
    .close-modal-btn {
        min-width: 42px !important;
        min-height: 42px !important;
        font-size: 1.35rem !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer !important;
        -webkit-tap-highlight-color: transparent !important;
    }

    /* Tab Controls inside Modals (Horizontal Scroll) */
    .xhm-help-modal-overlay div[style*="border-bottom"][style*="flex-wrap: wrap"] {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding-bottom: 0.5rem !important;
        margin-bottom: 1rem !important;
    }

    .xhm-help-modal-overlay .nm-tab {
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        padding: 0.45rem 0.85rem !important;
        font-size: 0.82rem !important;
    }

    /* Agenda Modal Form Columns Collapse on Mobile */
    #evolution-modal form > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.5rem !important;
    }

    #evolution-modal form > div[style*="grid-template-columns"] > div:first-child {
        grid-column: 1 / -1 !important;
    }

    /* Modal Actions Footer */
    .chk-modal-actions {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }

    .chk-modal-btn {
        width: 100% !important;
        min-height: 44px !important;
    }
}

/* ===================================================
   TABS SYSTEM
   =================================================== */
.nm-tabs {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

/* Unified Tabs Dashboard Panel */
.nm-tabs-panel {
    background: rgba(0, 0, 0, 0.02);
    box-shadow: var(--inner-shadow);
    padding: 0.45rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-bottom: 1.25rem;
}

/* Row 1 flex stretching (single line) */
#consultation-tabs {
    display: flex;
    width: 100%;
    gap: 0.45rem;
    flex-wrap: nowrap;
}

#consultation-tabs .nm-tab {
    flex: 1 1 0%;
    padding: 0.65rem 0.4rem;
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-radius: 14px;
}

/* Row 2 flex stretching */
#consultation-tabs-row2 {
    display: flex;
    width: 100%;
    gap: 0.45rem;
    flex-wrap: nowrap;
}
#consultation-tabs-row2 .nm-tab {
    flex: 1 1 0%;
    padding: 0.65rem 0.5rem;
    font-size: 0.88rem;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

/* All buttons in the panel share the same design */
.nm-tabs-panel .nm-tab {
    background: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: var(--btn-shadow);
    padding: 0.65rem 0.75rem;
    border-radius: 14px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.88rem;
    text-align: center;
    outline: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.nm-tabs-panel .nm-tab:hover {
    box-shadow: var(--inner-shadow);
    color: var(--primary-color);
}

.nm-tabs-panel .nm-tab.active {
    background: var(--bg-color);
    box-shadow: var(--inner-shadow);
    color: var(--primary-color);
    border-color: rgba(74, 144, 226, 0.15);
}

.nm-tab {
    padding: 0.75rem 1.25rem;
    border-radius: 16px;
    background: var(--bg-color);
    box-shadow: var(--btn-shadow);
    border: 1px solid rgba(255, 255, 255, 0.4);
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.25s ease;
    font-size: 0.95rem;
    text-align: center;
    outline: none;
}

.nm-tab:hover {
    box-shadow: var(--inner-shadow);
    color: var(--primary-color);
}

.nm-tab.active {
    box-shadow: var(--inner-shadow);
    color: var(--primary-color);
    background: var(--bg-color);
    border-color: rgba(74, 144, 226, 0.15);
}

.nm-tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.nm-tab-content.active {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===================================================
   ACCORDION SYSTEM
   =================================================== */
.nm-accordion {
    margin-bottom: 1rem;
    border-radius: 16px;
    overflow: hidden;
    background: var(--bg-color);
    box-shadow: var(--btn-shadow);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.nm-accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-color);
    transition: all 0.2s ease;
    user-select: none;
}

.nm-accordion-header:hover {
    color: var(--primary-color);
}

.nm-accordion-arrow {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.nm-accordion.open .nm-accordion-arrow {
    transform: rotate(180deg);
}

.nm-accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
    padding: 0 1.5rem;
}

.nm-accordion:not(.open) > .nm-accordion-body {
    display: none !important;
    max-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
}

.nm-accordion.open .nm-accordion-body {
    display: block;
    max-height: 2000px;
    padding: 0 1.5rem 1.5rem;
}

/* ===================================================
   DENTAL EXAM RADIO TOGGLES
   =================================================== */
.den-radio-group {
    display: inline-flex;
    background: var(--bg-color);
    padding: 3px;
    border-radius: 10px;
    box-shadow: var(--inner-shadow);
    gap: 4px;
}

.den-radio-label {
    margin: 0;
    cursor: pointer;
    user-select: none;
}

.den-radio-label input[type="radio"] {
    display: none;
}

.den-radio-btn {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    font-size: 0.82rem;
    font-weight: 700;
    border-radius: 8px;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.den-radio-label input[type="radio"]:checked + .den-radio-btn {
    background: linear-gradient(145deg, #3b82f6, #2563eb);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
}

.den-radio-label input[type="radio"][value="SLA"]:checked + .den-radio-btn {
    background: linear-gradient(145deg, #f59e0b, #d97706);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(217, 119, 6, 0.35);
}

/* ===================================================
   NEUMORPHIC CHECKBOXES
   =================================================== */
.nm-checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.nm-checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    font-size: 0.9rem;
    color: var(--text-color);
}

.nm-checkbox-item:hover {
    background: rgba(74, 144, 226, 0.04);
}

.nm-checkbox-box {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: var(--bg-color);
    box-shadow: var(--inner-shadow);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
    font-size: 0.75rem;
}

.nm-checkbox-item.checked .nm-checkbox-box,
.nm-checkbox-item input[type="checkbox"]:checked + .nm-checkbox-box {
    background: linear-gradient(145deg, #4f9aff, #4382cb);
    box-shadow: inset 2px 2px 4px #2b5687, inset -2px -2px 4px #5ba2eb;
    color: white;
}

.nm-checkbox-item.checked .nm-checkbox-box::after,
.nm-checkbox-item input[type="checkbox"]:checked + .nm-checkbox-box::after {
    content: '✓';
    color: #ffffff;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
}

.nm-checkbox-item input[type="checkbox"] {
    display: none;
}

/* Global Neumorphic Checkbox Controls */
input[type="checkbox"] {
    accent-color: #4a90e2;
}

input[type="checkbox"]:not(.nm-checkbox-item input[type="checkbox"]) {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 7px;
    background: #ffffff !important;
    border: 2px solid #94a3b8 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08) !important;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    vertical-align: middle;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    outline: none;
    flex-shrink: 0;
    opacity: 1 !important;
    pointer-events: auto !important;
}

input[type="checkbox"]:not(.nm-checkbox-item input[type="checkbox"]):hover {
    border-color: #4a90e2 !important;
    box-shadow: 0 0 0 3.5px rgba(74, 144, 226, 0.25) !important;
    transform: scale(1.1);
}

input[type="checkbox"]:not(.nm-checkbox-item input[type="checkbox"]):checked {
    background: linear-gradient(145deg, #4f9aff, #4382cb) !important;
    box-shadow: 0 3px 8px rgba(67, 130, 203, 0.4) !important;
    border-color: #3b74b3 !important;
}

input[type="checkbox"]:not(.nm-checkbox-item input[type="checkbox"]):checked::after {
    content: '✓';
    color: #ffffff;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    display: block;
}

/* Others textarea inside accordions */
.nm-others-group {
    margin-top: 0.75rem;
}

.nm-others-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    display: block;
}

.nm-textarea {
    background: var(--bg-color);
    border: none;
    outline: none;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    box-shadow: var(--inner-shadow);
    font-size: 0.9rem;
    font-family: 'Outfit', sans-serif;
    color: var(--text-color);
    width: 100%;
    min-height: 70px;
    resize: vertical;
    transition: all 0.3s ease;
}

.nm-textarea:focus {
    box-shadow: inset 6px 6px 12px var(--shadow-dark), inset -6px -6px 12px var(--shadow-light);
}

/* ===================================================
   TOOLBAR (Floating Action Bar - Always Visible)
   =================================================== */
.nm-toolbar {
    position: sticky;
    bottom: 20px;
    z-index: 990;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.5rem;
    margin-top: 1.5rem;
    background: var(--bg-color);
    border-radius: 24px;
    box-shadow: 10px 10px 25px var(--shadow-dark), -10px -10px 25px var(--shadow-light);
    border: 1px solid rgba(255, 255, 255, 0.6);
    flex-wrap: wrap;
    transition: all 0.3s ease;
}

@media (max-width: 900px) {
    .nm-toolbar {
        position: fixed !important;
        bottom: 75px !important;
        left: 12px !important;
        right: 12px !important;
        justify-content: space-around !important;
        padding: 0.65rem 0.85rem !important;
        margin-top: 0 !important;
        z-index: 999 !important;
    }
}

.nm-btn-sm {
    padding: 0.7rem 1.25rem;
    font-size: 0.9rem;
    border-radius: 10px;
}

.nm-btn-success {
    background: linear-gradient(145deg, #56c45a, #43a047);
    color: white;
}

.nm-btn-success:hover {
    background: linear-gradient(145deg, #66d46a, #4caf50);
    box-shadow: 5px 5px 12px var(--shadow-dark), -5px -5px 12px var(--shadow-light);
}

.nm-btn-success:active {
    box-shadow: inset 4px 4px 8px #2e7d32, inset -4px -4px 8px #66bb6a;
}

.nm-btn-danger {
    background: linear-gradient(145deg, #f55a4e, #d43427);
    color: white;
}

.nm-btn-danger:hover {
    background: linear-gradient(145deg, #f76d63, #e53935);
}

/* ===================================================
   CHAT / INTERNAL MESSAGING SYSTEM (NEUMORPHIC)
   =================================================== */
.nm-chat-trigger {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--bg-color);
    box-shadow: var(--btn-shadow);
    border: 1px solid rgba(255, 255, 255, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.6rem;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.25s ease;
    user-select: none;
}

.nm-chat-trigger:hover {
    transform: scale(1.05);
    box-shadow: var(--inner-shadow);
}

.nm-chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ff8a80; /* coral color pastel */
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 2px 2px 4px rgba(0,0,0,0.1), inset 1px 1px 2px rgba(255,255,255,0.3);
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 0 4px;
}

.nm-chat-widget {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 360px;
    max-height: 520px;
    background: var(--bg-color);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15), var(--btn-shadow);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    display: flex;
    flex-direction: column;
    z-index: 1001;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Mobile positioning adjustments so chat trigger floats cleanly above mobile nav bar */
@media (max-width: 900px) {
    .nm-chat-trigger {
        bottom: 85px !important;
        right: 16px !important;
        width: 52px !important;
        height: 52px !important;
        font-size: 1.35rem !important;
        z-index: 1001 !important;
    }

    .nm-chat-widget {
        bottom: 145px !important;
        right: 12px !important;
        left: 12px !important;
        width: auto !important;
        max-width: calc(100vw - 24px) !important;
        max-height: calc(100vh - 160px) !important;
        z-index: 1002 !important;
    }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.nm-chat-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.nm-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    background: rgba(255, 255, 255, 0.2);
}

.nm-chat-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color);
}

.nm-chat-close {
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s ease;
}
.nm-chat-close:hover {
    color: var(--primary-color);
}

.nm-chat-back-btn {
    cursor: pointer;
    font-size: 1.2rem;
    padding-right: 0.5rem;
    transition: transform 0.2s ease;
}
.nm-chat-back-btn:hover {
    transform: translateX(-3px);
}

.nm-inset-container {
    flex: 1;
    background: var(--bg-color);
    box-shadow: var(--inner-shadow);
    margin: 1rem;
    border-radius: 16px;
    overflow-y: auto;
    padding: 0.75rem;
}

/* Contacts layout */
.nm-chat-contact-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    background: var(--bg-color);
    box-shadow: var(--btn-shadow);
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(255,255,255,0.4);
}

.nm-chat-contact-item:hover {
    box-shadow: var(--inner-shadow);
    transform: translateY(1px);
}

.nm-chat-contact-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.nm-chat-contact-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-color);
}

.nm-chat-contact-status {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.nm-chat-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.nm-chat-status-dot.online {
    background: #4db6ac; /* soft green */
    box-shadow: 0 0 4px #4db6ac;
}
.nm-chat-status-dot.offline {
    background: #b0bec5; /* grey */
}

.nm-chat-contact-unread {
    background: #ff8a80;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
}

/* Messages bubbles layout */
.nm-chat-msg-row {
    display: flex;
    width: 100%;
    margin-bottom: 0.75rem;
}
.nm-chat-msg-row.sent {
    justify-content: flex-end;
}
.nm-chat-msg-row.received {
    justify-content: flex-start;
}

.nm-chat-bubble {
    max-width: 75%;
    padding: 0.65rem 0.9rem;
    border-radius: 16px;
    font-size: 0.88rem;
    line-height: 1.35;
    position: relative;
    border: 1px solid rgba(255,255,255,0.4);
}

.nm-chat-msg-row.sent .nm-chat-bubble {
    background: #e1f5fe; /* Soft blue/grey */
    color: #0277bd;
    box-shadow: var(--btn-shadow);
    border-bottom-right-radius: 4px;
}

.nm-chat-msg-row.received .nm-chat-bubble {
    background: #ffffff; /* pure white */
    color: var(--text-color);
    box-shadow: var(--btn-shadow);
    border-bottom-left-radius: 4px;
}

.nm-chat-bubble-time {
    display: block;
    font-size: 0.65rem;
    margin-top: 0.25rem;
    text-align: right;
    opacity: 0.7;
}

/* Input area styling */
.nm-chat-input-bar {
    display: flex;
    padding: 0.75rem 1rem 1rem 1rem;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    align-items: center;
}

.nm-chat-input {
    flex: 1;
    border: none;
    outline: none;
    background: var(--bg-color);
    box-shadow: var(--inner-shadow);
    border-radius: 12px;
    padding: 0.65rem 0.85rem;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-color);
}

.nm-chat-send-btn {
    width: 38px;
    height: 38px;
    border: none;
    outline: none;
    border-radius: 50%;
    background: var(--bg-color);
    box-shadow: var(--btn-shadow);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    border: 1px solid rgba(255,255,255,0.4);
}
.nm-chat-send-btn:hover {
    box-shadow: var(--inner-shadow);
    transform: scale(1.05);
}

/* ===================================================
   QUILL & REPORT EDITOR RESPONSIVE LAYOUT
   =================================================== */
#tab-informes {
    width: 100%;
    box-sizing: border-box;
}

#report-editor-container {
    width: 100%;
    box-sizing: border-box;
}

#report-quill-editor-wrapper {
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

#report-quill-editor-wrapper .ql-toolbar.ql-snow {
    border: none;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

#report-quill-editor-wrapper .ql-container.ql-snow {
    border: none;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    width: 100%;
    box-sizing: border-box;
}

#report-quill-editor-wrapper .ql-editor {
    font-size: 0.98rem;
    line-height: 1.6;
    min-height: 280px;
    box-sizing: border-box;
    color: #1e293b;
}

#report-preview-paper {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Fullscreen Maximized Mode for Report Template Editor */
#report-editor-container.report-editor-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    z-index: 999999 !important;
    border-radius: 0 !important;
    border: none !important;
    padding: 1.25rem 2rem !important;
    margin: 0 !important;
    overflow-y: auto !important;
    background: #f1f5f9 !important;
    box-shadow: none !important;
}

#report-editor-container.report-editor-fullscreen #report-quill-editor-wrapper {
    min-height: calc(100vh - 260px) !important;
}

#report-editor-container.report-editor-fullscreen #report-quill-editor {
    height: calc(100vh - 320px) !important;
}

#report-editor-container.report-editor-fullscreen #report-floating-vars-panel {
    z-index: 1000000 !important;
}

/* =========================================================
   VIRTUAL ASSISTANT & ONBOARDING HELP CENTER STYLES
   ========================================================= */

/* Fixed Centered Overlay for Help Center Modal */
#modal-help-center.xhm-help-modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(15, 23, 42, 0.55) !important;
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
    z-index: 999999 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
}

/* Floating Help Button */
.xhm-help-floating-btn {
    position: fixed;
    bottom: 24px;
    right: 96px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.1rem;
    background: linear-gradient(135deg, #ffffff, #f1f5f9);
    border: 2px solid var(--primary-color);
    border-radius: 30px;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.25), var(--shadow);
    cursor: pointer;
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.25s, right 0.25s, bottom 0.25s;
    user-select: none;
}

@media (max-width: 900px) {
    .xhm-help-floating-btn {
        bottom: 85px !important;
        right: 76px !important;
        padding: 0.6rem 0.85rem !important;
        z-index: 1001 !important;
    }
    
    .xhm-help-floating-label {
        display: none !important;
    }
}

.xhm-help-floating-btn:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.35);
}

.xhm-help-floating-icon {
    font-size: 1.35rem;
}

.xhm-help-floating-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-color);
}

.xhm-help-badge-pulse {
    width: 9px;
    height: 9px;
    background-color: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: xhmPulse 1.8s infinite;
}

@keyframes xhmPulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Driver.js Neumorphic Popover Customizations */
.driver-popover.xhm-driver-popover {
    background: #ffffff !important;
    border-radius: 18px !important;
    border: 2px solid var(--primary-color) !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22) !important;
    color: #1e293b !important;
    padding: 1.25rem !important;
    font-family: inherit !important;
    max-width: 380px !important;
}

.driver-popover.xhm-driver-popover .driver-popover-title {
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    color: var(--primary-color) !important;
    margin-bottom: 0.5rem !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.4rem !important;
}

.driver-popover.xhm-driver-popover .driver-popover-description {
    font-size: 0.88rem !important;
    line-height: 1.5 !important;
    color: #334155 !important;
    margin-bottom: 1rem !important;
}

.driver-popover.xhm-driver-popover .driver-popover-footer {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-top: 0.8rem !important;
}

.driver-popover.xhm-driver-popover .driver-popover-btn {
    border-radius: 10px !important;
    font-weight: 700 !important;
    font-size: 0.8rem !important;
    padding: 0.4rem 0.9rem !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    text-shadow: none !important;
}

.driver-popover.xhm-driver-popover .driver-popover-next-btn {
    background: var(--primary-color) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3) !important;
}

.driver-popover.xhm-driver-popover .driver-popover-prev-btn {
    background: rgba(0, 0, 0, 0.06) !important;
    color: #475569 !important;
}

.driver-popover.xhm-driver-popover .driver-popover-close-btn {
    background: transparent !important;
    color: #94a3b8 !important;
}

/* Help Center Guide Cards */
.xhm-guide-card {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: var(--shadow);
}

.xhm-guide-num {
    width: 2rem;
    height: 2rem;
    min-width: 2rem;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    box-shadow: 0 3px 8px rgba(37, 99, 235, 0.3);
}

/* FAQ Accordion */
.xhm-faq-item {
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: background 0.2s;
}

.xhm-faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text-color);
    cursor: pointer;
    user-select: none;
}

.xhm-faq-question:hover {
    background: rgba(59, 130, 246, 0.05);
}

.xhm-faq-arrow {
    transition: transform 0.25s ease;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.xhm-faq-item.active .xhm-faq-arrow {
    transform: rotate(180deg);
}

.xhm-faq-answer {
    display: none;
    padding: 0 1rem 0.85rem 1rem;
    font-size: 0.83rem;
    color: var(--text-muted);
    line-height: 1.5;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.xhm-faq-item.active .xhm-faq-answer {
    display: block;
}

/* ===================================================
   ODONTODIAGRAMA INTERACTIVO STYLES
   =================================================== */

.odon-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 1024px) {
    .odon-layout {
        grid-template-columns: 1fr;
    }
}

.odon-palette-card {
    background: var(--bg-color);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.odon-section-header {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: 0.6px;
    text-transform: uppercase;
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    user-select: none;
}

.odon-tool-grid-4col {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    width: 100%;
}

@media (max-width: 900px) {
    .odon-tool-grid-4col {
        grid-template-columns: repeat(2, 1fr);
    }
}

.odon-tool-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 0.6rem;
    height: 38px;
    box-sizing: border-box;
    width: 100%;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.09);
    background: #ffffff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04);
    font-size: 0.78rem;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    white-space: nowrap;
}

.odon-tool-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    border-color: rgba(37, 99, 235, 0.4);
}

.odon-tool-btn.active {
    background: #eff6ff;
    border-color: #2563eb;
    color: #1e40af;
    font-weight: 700;
    box-shadow: inset 0 2px 4px rgba(37, 99, 235, 0.12), 0 0 0 1px #2563eb;
}

.odon-tool-icon {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 800;
}

.odon-board-card {
    background: var(--bg-color);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 1.25rem 0.75rem;
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
}

.odon-quadrant-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.8rem;
    flex-wrap: nowrap;
}

.odon-quadrant-block {
    display: flex;
    align-items: flex-end;
    gap: 0;
}

.odon-interdental-slot {
    width: 9px;
    height: 31px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    user-select: none;
    cursor: default;
    border-radius: 3px;
    transition: background 0.15s ease;
    flex-shrink: 0;
    z-index: 5;
}

.odon-midline-container {
    display: flex;
    align-items: flex-end;
    margin: 0 0.12rem;
}

.odon-interdental-slot.is-midline {
    width: 12px;
}

.odon-interdental-slot.is-midline .odon-midline-line {
    position: absolute;
    top: -12px;
    bottom: 0;
    width: 2px;
    background: rgba(59, 130, 246, 0.3);
    z-index: 1;
}

.odon-interdental-slot.is-midline .odon-diastema-symbol {
    position: relative;
    z-index: 2;
    background: var(--bg-color, #ffffff);
    border-radius: 2px;
}

/* Interdental slot interaction */
.odon-board-card[data-active-tool="diastema"] .odon-interdental-slot {
    cursor: pointer;
}

.odon-board-card[data-active-tool="diastema"] .odon-interdental-slot:hover {
    background: rgba(37, 99, 235, 0.15);
}

.odon-board-card[data-active-tool="diastema"] .odon-interdental-slot:not(.has-diastema):hover::after {
    content: ')(';
    font-size: 10.5px;
    font-weight: 800;
    color: rgba(37, 99, 235, 0.7);
    letter-spacing: -2px;
    line-height: 1;
}

.odon-board-card[data-active-tool="eraser"] .odon-interdental-slot.has-diastema {
    cursor: pointer;
}

.odon-board-card[data-active-tool="eraser"] .odon-interdental-slot.has-diastema:hover path {
    stroke: #dc2626 !important;
}

.odon-interdental-slot.has-diastema:hover path {
    stroke: #1d4ed8;
}

.odon-diastema-symbol {
    width: 9px;
    height: 29px;
    pointer-events: none;
}

.odon-tooth-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    user-select: none;
}

.odon-tooth-number {
    font-size: 0.70rem;
    font-weight: 700;
    color: var(--primary-color);
    padding: 1px 4px;
    border-radius: 50%;
    margin-bottom: 2px;
    position: relative;
    cursor: pointer;
}

.odon-tooth-number.has-fistula::after {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    border: 2px solid #dc2626;
    border-radius: 50%;
    pointer-events: none;
}

.odon-tooth-svg {
    width: 31px;
    height: 31px;
    cursor: pointer;
}

.odon-surface-polygon {
    fill: #ffffff;
    stroke: #64748b;
    stroke-width: 1;
    transition: fill 0.15s ease, stroke 0.15s ease;
    cursor: pointer;
}

.odon-surface-polygon:hover {
    stroke: #2563eb;
    stroke-width: 1.5;
}

/* Surface fills */
.odon-surface-polygon.fill-restoration { fill: #2563eb !important; }
.odon-surface-polygon.fill-caries { fill: #dc2626 !important; }
.odon-surface-polygon.fill-temp_restoration { fill: #f59e0b !important; }
.odon-surface-polygon.fill-defective_restoration { fill: #2563eb !important; stroke: #dc2626 !important; stroke-width: 2 !important; }
.odon-surface-polygon.fill-prepathogenic { fill: url(#odon-pattern-prepathogenic) !important; stroke: #dc2626 !important; stroke-width: 1.5 !important; }

/* Tooth overlays */
.odon-overlay-layer {
    position: absolute;
    top: 20px;
    left: 0;
    width: 38px;
    height: 38px;
    pointer-events: none;
}

.odon-bridge-svg-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.odon-bridge-group {
    pointer-events: auto;
    cursor: pointer;
}

.odon-bridge-group:hover circle {
    fill: #dc2626 !important;
}

.odon-bridge-group:hover line,
.odon-bridge-group:hover path {
    stroke: #dc2626 !important;
}

.odon-tool-grid-5col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.5rem;
    width: 100%;
}

/* ===================================================
   MODULO ICDAS EPIDEMIOLOGICO STYLES
   =================================================== */

.icdas-board-card {
    background: var(--bg-color);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 1.25rem 0.75rem;
    position: relative;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(67, 97, 238, 0.25) transparent;
}

.icdas-board-card::-webkit-scrollbar {
    height: 5px;
}

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

.icdas-board-card::-webkit-scrollbar-thumb {
    background: rgba(67, 97, 238, 0.25);
    border-radius: 10px;
}

.icdas-board-card::-webkit-scrollbar-thumb:hover {
    background: rgba(67, 97, 238, 0.45);
}

.icdas-quadrant-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
    flex-wrap: nowrap;
}

.icdas-quadrant-block {
    display: flex;
    gap: 0.25rem;
}

.icdas-tooth-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.icdas-tooth-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary-color);
}

.icdas-select-box {
    width: 36px;
    height: 32px;
    padding: 0 10px 0 2px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.14);
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath fill='%2364748b' d='M0 0l4 5 4-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 3px center;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    text-align-last: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.icdas-select-box:hover {
    border-color: var(--primary-color, #4361ee);
}

.icdas-select-box.val-00 {
    background-color: #dcfce7 !important;
    color: #15803d !important;
    border-color: #86efac !important;
}

.icdas-select-box.val-caries {
    background-color: #fef9c3 !important;
    color: #a16207 !important;
    border-color: #fde047 !important;
}

.icdas-reference-card {
    background: var(--bg-color);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 1.25rem;
}

.icdas-ref-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.icdas-ref-table th {
    background: rgba(59, 130, 246, 0.08);
    color: var(--primary-color);
    font-weight: 700;
    padding: 0.6rem 0.8rem;
    text-align: left;
    border-bottom: 2px solid rgba(0,0,0,0.08);
}

.icdas-ref-table td {
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.icdas-row-sano {
    background: rgba(220, 252, 231, 0.6);
    color: #166534;
}

.icdas-row-caries {
    background: rgba(254, 249, 195, 0.6);
    color: #854d0e;
}

.icdas-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 800;
    font-size: 0.8rem;
}

.icdas-badge-00 {
    background: #22c55e;
    color: #ffffff;
}

.icdas-badge-caries {
    background: #eab308;
    color: #ffffff;
}

/* ==========================================================
   CHEKEI GLOBAL POP-UP MODAL & TOAST SYSTEM
   ========================================================== */
.chk-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.25rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.chk-modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.chk-modal-card {
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.8) inset;
    width: 100%;
    max-width: 440px;
    padding: 2rem 1.75rem 1.5rem 1.75rem;
    text-align: center;
    transform: scale(0.9) translateY(15px);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.chk-modal-backdrop.active .chk-modal-card {
    transform: scale(1) translateY(0);
}

.chk-modal-icon-badge {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    margin: 0 auto 1.25rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    box-shadow: inset 2px 2px 5px rgba(255,255,255,0.8), 0 8px 20px -6px rgba(0,0,0,0.12);
}

.chk-modal-icon-badge.success {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #15803d;
    border: 2px solid #86efac;
}

.chk-modal-icon-badge.error {
    background: linear-gradient(135deg, #ffe4e6 0%, #fecdd3 100%);
    color: #be123c;
    border: 2px solid #fda4af;
}

.chk-modal-icon-badge.warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #b45309;
    border: 2px solid #fcd34d;
}

.chk-modal-icon-badge.confirm {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1d4ed8;
    border: 2px solid #93c5fd;
}

.chk-modal-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 0.6rem;
    line-height: 1.3;
}

.chk-modal-message {
    font-size: 0.95rem;
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 1.75rem;
    word-wrap: break-word;
}

.chk-modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.chk-modal-btn {
    flex: 1;
    padding: 0.75rem 1.25rem;
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.chk-modal-btn-confirm {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.chk-modal-btn-confirm:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45);
}

.chk-modal-btn-danger {
    background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(225, 29, 72, 0.35);
}

.chk-modal-btn-cancel {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.chk-modal-btn-cancel:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* Floating Toast Notifications */
#chk-toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 1000000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
    max-width: 380px;
    width: calc(100% - 3rem);
}

.chk-toast {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    padding: 0.85rem 1.25rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    opacity: 0;
}

.chk-toast.active {
    transform: translateX(0);
    opacity: 1;
}

.chk-toast-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.chk-toast.success {
    border-left: 4px solid #10b981;
}

.chk-toast.error {
    border-left: 4px solid #f43f5e;
}

.chk-toast.info {
    border-left: 4px solid #3b82f6;
}

/* ==========================================================
 * AUTH REGISTER SCREEN REDESIGN (FondoChekeiBlanco & Modern Card)
 * ========================================================== */
body.auth-register-bg {
    background-color: #f1f5f9 !important;
    height: 100vh !important;
    max-height: 100vh !important;
    position: relative;
    overflow: hidden !important;
}

body.auth-register-bg footer,
body.auth-register-bg .ts-footer {
    display: none !important;
}

body.auth-register-bg::before {
    content: '';
    position: fixed;
    top: 0;
    left: -8vw;
    width: 118vw;
    height: 100vh;
    background: url('../img/fondoChekeiBlanco.png') no-repeat center center;
    background-size: cover;
    pointer-events: none;
    z-index: 0;
    will-change: transform;
    animation: chekeiLogoDrift 16s ease-in-out infinite alternate;
}

@keyframes chekeiLogoDrift {
    0% {
        transform: translate3d(0, 0, 0);
    }
    100% {
        transform: translate3d(8vw, 0, 0);
    }
}

body.auth-register-bg header {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 1.5rem 2.5rem;
    position: relative;
    z-index: 5;
}

body.auth-register-bg header .logo img {
    height: 90px;
    max-height: 100px;
    object-fit: contain;
}

body.auth-register-bg header > div:last-child {
    display: none !important; /* Hide v1.0 (Beta) on register screen */
}

body.auth-register-bg main#app {
    display: flex;
    justify-content: center;
    align-items: center;
    height: calc(100vh - 120px);
    min-height: auto;
    padding: 0 1.5rem;
    position: relative;
    z-index: 5;
}

/* Register Card */
.register-card-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 480px;
    position: relative;
    z-index: 5;
    margin-top: -3.5rem; /* Eleva el panel para que quede más centrado */
}

.register-card {
    background: #ffffff !important;
    border-radius: 28px !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
    padding: 2.75rem 2.5rem !important;
    width: 100%;
    max-width: 460px;
    box-sizing: border-box;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.register-card h2 {
    font-size: 1.95rem;
    font-weight: 800;
    color: #2b3649;
    margin: 0 0 0.4rem 0;
    letter-spacing: -0.5px;
}

.register-card p.register-subtitle {
    font-size: 0.92rem;
    color: #64748b;
    margin: 0 0 1.75rem 0;
    line-height: 1.45;
}

.register-card .form-group {
    margin-bottom: 1.25rem;
}

.register-card .form-group label {
    display: block;
    font-size: 0.84rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.4rem;
    padding-left: 0.2rem;
}

/* Gradient Action Button matching image 2 */
.btn-register-gradient {
    width: 100%;
    padding: 0.85rem 1.5rem;
    background: linear-gradient(90deg, #b82767 0%, #a22974 35%, #4667a9 75%, #2a76b7 100%);
    color: #ffffff !important;
    font-weight: 700;
    font-size: 1rem;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 6px 18px rgba(184, 39, 103, 0.25), 0 3px 8px rgba(42, 118, 183, 0.2);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 1.5rem;
}

.btn-register-gradient:hover {
    filter: brightness(1.06);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(184, 39, 103, 0.35), 0 4px 12px rgba(42, 118, 183, 0.28);
}

.btn-register-gradient:active {
    transform: translateY(0);
    filter: brightness(0.96);
    box-shadow: 0 3px 10px rgba(184, 39, 103, 0.2);
}

/* Form Footer Links */
.register-card .form-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.88rem;
    color: #64748b;
}

.register-card .form-footer a.link-action {
    color: #2b76b9;
    text-decoration: underline;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease;
}

.register-card .form-footer a.link-action:hover {
    color: #1d4ed8;
}

@media (max-width: 900px) {
    .register-card-wrapper {
        margin-top: -1rem;
    }
    body.auth-register-bg header {
        padding: 1rem 1.25rem;
    }
    .register-card {
        padding: 2rem 1.5rem !important;
        border-radius: 22px !important;
    }
}

/* ==========================================================
 * ESTILOS DE FACTURACIÓN MÚLTIPLE Y MÉTODOS DE PAGO
 * ========================================================== */
.issued-invoice-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.issued-invoice-card:hover {
    box-shadow: 0 6px 18px rgba(0,0,0,0.06) !important;
}

.issued-invoice-header:hover {
    background: #f1f5f9 !important;
}

.pay-method-row {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.pay-method-row:focus-within {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ==========================================================
 * PERIODONTOGRAMA CLÍNICO COMPLETO (ODONTOLOGÍA)
 * ========================================================== */
.perio-arch-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.25rem 0 0.75rem 0;
}
.perio-arch-divider::before,
.perio-arch-divider::after {
    content: '';
    flex: 1;
    border-bottom: 2px solid #3b82f6;
}
.perio-arch-title {
    padding: 0 1rem;
    font-size: 0.85rem;
    font-weight: 800;
    color: #2563eb;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}
.perio-grid-table {
    display: flex;
    flex-direction: column;
    width: 100%;
}
.perio-row {
    display: flex;
    align-items: center;
    min-height: 24px;
    border-bottom: 1px solid #f1f5f9;
}
.perio-label-cell {
    width: 180px;
    min-width: 180px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #475569;
    text-align: right;
    padding-right: 12px;
    box-sizing: border-box;
    text-transform: uppercase;
}
.perio-quadrant {
    display: flex;
    align-items: center;
}
.perio-midline-sep {
    width: 2px;
    background: #2563eb;
    align-self: stretch;
    margin: 0 4px;
    flex-shrink: 0;
}
.perio-tooth-col {
    width: 74px;
    min-width: 74px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2px 2px;
    box-sizing: border-box;
    position: relative;
}
.perio-tooth-header {
    font-size: 0.9rem;
    font-weight: 800;
    color: #2563eb;
}
.perio-input-3-group {
    display: flex;
    gap: 3px;
    justify-content: center;
}
.perio-num-input {
    width: 19px;
    height: 20px;
    padding: 0;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    border-radius: 3px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #1e293b;
    outline: none;
    -moz-appearance: textfield;
    appearance: textfield;
}
.perio-num-input::-webkit-outer-spin-button,
.perio-num-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.perio-margin-input {
    border-color: #38bdf8 !important;
}
.perio-depth-input {
    border-color: #475569 !important;
}
.perio-depth-input.is-pocket {
    border-color: #dc2626 !important;
    background-color: #fee2e2 !important;
    color: #b91c1c !important;
    font-weight: 800 !important;
}
.perio-select-sm {
    width: 50px;
    height: 22px;
    font-size: 11px;
    font-weight: 600;
    padding: 0 2px;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    text-align: center;
    outline: none;
}
.perio-check-3-group {
    display: flex;
    gap: 4px;
    justify-content: center;
    align-items: center;
    width: 100%;
}
input[type="checkbox"].perio-chk {
    width: 14px !important;
    height: 14px !important;
    min-width: 14px !important;
    min-height: 14px !important;
    border-radius: 4px !important;
    border: 1.5px solid #94a3b8 !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
    display: inline-flex !important;
    justify-content: center !important;
    align-items: center !important;
    cursor: pointer;
}
input[type="checkbox"].perio-chk:hover {
    transform: scale(1.15) !important;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2) !important;
}
input[type="checkbox"].perio-chk:checked::after {
    font-size: 9px !important;
}
input[type="checkbox"].perio-chk-bleeding:checked {
    background: linear-gradient(145deg, #ef4444, #dc2626) !important;
    border-color: #b91c1c !important;
}
input[type="checkbox"].perio-chk-plaque:checked {
    background: linear-gradient(145deg, #3b82f6, #2563eb) !important;
    border-color: #1d4ed8 !important;
}
input[type="checkbox"].perio-chk-suppuration:checked {
    background: linear-gradient(145deg, #eab308, #ca8a04) !important;
    border-color: #a16207 !important;
}
input[type="checkbox"].perio-chk-absent,
input[type="checkbox"].perio-chk-implant {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    border-radius: 5px !important;
}
input[type="checkbox"].perio-chk-absent:checked {
    background: linear-gradient(145deg, #ef4444, #dc2626) !important;
    border-color: #b91c1c !important;
}
input[type="checkbox"].perio-chk-absent:checked::after,
input[type="checkbox"].perio-chk-implant:checked::after {
    font-size: 11px !important;
}
.perio-single-input {
    width: 38px;
    height: 20px;
    padding: 0 2px;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    border-radius: 3px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
}
.perio-tooth-absent {
    opacity: 0.28 !important;
    pointer-events: none !important;
}
.perio-tooth-implant-badge {
    font-size: 8px;
    font-weight: 800;
    color: #0f766e;
    background: #ccfbf1;
    border-radius: 3px;
    padding: 1px 3px;
}
.perio-svg-tooth-container {
    width: 74px;
    height: 98px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}
.perio-svg-tooth {
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* Modal Panorámico Emergente para Periodontograma */
.perio-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
    z-index: 99990;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.75rem;
    box-sizing: border-box;
}
.perio-modal-window {
    width: 98vw;
    max-width: 1540px;
    height: 95vh;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.8);
}
.perio-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.5rem;
    background: #f8fafc;
    border-bottom: 1.5px solid #e2e8f0;
}
.perio-modal-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    padding: 1rem 1.5rem;
    background: #ffffff;
}
.perio-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: #f8fafc;
    border-top: 1.5px solid #e2e8f0;
}

/* ==========================================================================
   App Sliding Navigation Drawer (Left Sidebar) & Edge Tab
   ========================================================================== */
.app-drawer-tab {
    position: fixed;
    left: 0;
    top: 195px;
    z-index: 1040;
    display: none !important;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 1.3rem 0.75rem 0.95rem;
    border-radius: 0 18px 18px 0;
    background: var(--bg-color);
    color: var(--text-color);
    box-shadow: 5px 5px 14px var(--shadow-dark), 0 -2px 8px var(--shadow-light);
    border: none;
    font-weight: 700;
    font-size: 1.05rem;
    cursor: pointer;
    transition: transform 0.25s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.2s ease, color 0.2s ease, top 0.3s ease;
    user-select: none;
    outline: none;
}

body.has-debt-banner .app-drawer-tab {
    top: 255px;
}

.app-drawer-tab .drawer-tab-icon {
    font-size: 1.35rem;
    line-height: 1;
    color: var(--primary-color);
    transition: transform 0.2s ease;
}

.app-drawer-tab .drawer-tab-label {
    font-size: 1.02rem;
    font-weight: 700;
}

.app-drawer-tab:hover {
    transform: translateX(6px);
    box-shadow: 7px 7px 18px var(--shadow-dark), 0 -2px 10px var(--shadow-light);
    color: var(--primary-color);
}

.app-drawer-tab:hover .drawer-tab-icon {
    transform: scale(1.15);
}

.app-drawer-tab:active {
    box-shadow: var(--btn-shadow-active);
    transform: translateX(3px);
}

.app-drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.25, 1, 0.5, 1), visibility 0.3s ease;
    z-index: 1050;
}

.app-drawer-backdrop.open {
    opacity: 1;
    visibility: visible;
}

.app-drawer-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    max-width: 85vw;
    height: 100vh;
    background: var(--bg-color);
    box-shadow: 10px 0 25px rgba(0, 0, 0, 0.15), 5px 0 10px var(--shadow-dark);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.5rem 1.25rem;
    z-index: 1060;
    transform: translateX(-105%);
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

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

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    margin-bottom: 1.25rem;
}

.drawer-brand img {
    height: 48px;
    object-fit: contain;
}

.drawer-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-color);
    box-shadow: 2px 2px 5px var(--shadow-dark), -2px -2px 5px var(--shadow-light);
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.drawer-close-btn:hover {
    color: var(--error-color);
    box-shadow: var(--btn-shadow-active);
}

.drawer-menu {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    flex: 1;
}

.drawer-menu-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1.15rem;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-color);
    box-shadow: 3px 3px 6px var(--shadow-dark), -3px -3px 6px var(--shadow-light);
    transition: all 0.2s ease;
    white-space: nowrap;
    user-select: none;
}

.drawer-menu-item:hover,
.drawer-menu-item.active {
    box-shadow: var(--inner-shadow);
    color: var(--primary-color);
}

.drawer-footer {
    padding-top: 1.25rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    margin-top: 1rem;
}

@media (max-width: 600px) {
    .app-drawer-tab {
        top: 140px;
        padding: 0.6rem 0.85rem 0.6rem 0.65rem;
        border-radius: 0 14px 14px 0;
    }
    body.has-debt-banner .app-drawer-tab {
        top: 205px;
    }
    .app-drawer-tab .drawer-tab-label {
        display: none;
    }
}



