/* Dominguez Dental Aesthetics - SaaS Brand CSS */
:root {

    /* ─── Standard Design Tokens (Constitution v1.0) ─── */
    --color-primary: #122A50;
    --color-success: #198754;
    --color-warning: #ffc107;
    --color-danger: #dc3545;

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;

    --font-base: 16px;
    --font-heading: 1.5rem;

    --dda-navy-900: #122A50;
    --dda-navy-700: #354A78;
    --dda-navy-600: #465373;

    --dda-cyan-600: #2897B3;
    --dda-cyan-500: #3091BB;
    --dda-cyan-100: #E7F5F9;

    --dda-silver-500: #8E99A5;
    --dda-border: #DFE6E8;
    --dda-surface: #FFFFFF;
    --dda-background: #F7FAFC;
    --dda-text: #122A50;
    --dda-text-muted: #64748B;
}

body {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: var(--dda-background);
    color: var(--dda-text);
    margin: 0;
    padding: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--dda-navy-900);
}

/* Typography Hierarchy */
.page-title {
    font-size: 1.5rem;
    font-weight: 700;
}

@media (min-width: 768px) {
    .page-title {
        font-size: 1.75rem;
    }
}

.section-title {
    font-size: 1.05rem;
    font-weight: 600;
}

@media (min-width: 768px) {
    .section-title {
        font-size: 1.25rem;
        font-weight: 700;
    }
}

.body-text {
    font-size: 0.9375rem;
}

@media (min-width: 768px) {
    .body-text {
        font-size: 1rem;
    }
}

.table-label {
    font-size: 0.875rem;
}

.supporting-text {
    font-size: 0.8125rem;
}

@media (min-width: 768px) {
    .supporting-text {
        font-size: 0.875rem;
    }
}

/* Cards */
.saas-card {
    background-color: var(--dda-surface);
    border: 1px solid var(--dda-border);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(18, 42, 80, 0.05);
}

/* Buttons */
.btn-primary {
    background-color: var(--dda-navy-700);
    border-color: var(--dda-navy-700);
    color: #ffffff;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--dda-navy-900);
    border-color: var(--dda-navy-900);
    color: #ffffff;
}

.btn-primary:focus {
    box-shadow: 0 0 0 0.25rem rgba(40, 151, 179, 0.35);
}

/* Forms */
.form-control:focus {
    border-color: var(--dda-cyan-600);
    box-shadow: 0 0 0 0.25rem rgba(40, 151, 179, 0.35);
}

/* Links */
a {
    color: var(--dda-cyan-600);
    text-decoration: none;
}

a:hover {
    color: var(--dda-cyan-500);
    text-decoration: underline;
}

/* Focus States */
:focus-visible {
    outline: 2px solid var(--dda-cyan-600);
    outline-offset: 2px;
}

/* Status Colors */
.status-badge {
    display: inline-block;
    padding: 0.25em 0.5em;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 4px;
}

.status-pending {
    background-color: #fef3c7;
    color: #92400e;
}

.status-confirmed {
    background-color: #d1fae5;
    color: #065f46;
}

.status-completed {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-cancelled {
    background-color: #fee2e2;
    color: #b91c1c;
}

.status-noshow {
    background-color: #fee2e2;
    color: #7f1d1d;
}

.status-reschedule {
    background-color: #ffedd5;
    color: #c2410c;
}

.status-emailsent {
    background-color: #d1fae5;
    color: #065f46;
}

.status-emailfailed {
    background-color: #fee2e2;
    color: #b91c1c;
}

.status-emailpending {
    background-color: #fef3c7;
    color: #92400e;
}

.status-emailnotsent {
    background-color: #f1f5f9;
    color: #475569;
}

#patient-intake,
#assigned-patients,
#create-appointment {
    scroll-margin-top: 90px;
}


/* ─── Core SaaS Shell Layout ─── */

/* ─── Shell Layout ─── */
body {
    display: flex;
    min-height: 100vh;
    font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
}

/* ─── Design Tokens ─── */
:root {
    --saas-sidebar-width: 17rem;
    --saas-sidebar-collapsed-width: 4.5rem;
    --saas-header-height: 4rem;
    --saas-ease: cubic-bezier(0.2, 0, 0, 1);
}

/* ═══════════════════════════════════════
           SIDEBAR
        ═══════════════════════════════════════ */
.saas-sidebar {
    width: var(--saas-sidebar-width);
    min-width: var(--saas-sidebar-width);
    background-color: var(--dda-navy-900);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: visible;
    /* allow edge-toggle to straddle right border */
    border-right: 1px solid rgba(255, 255, 255, 0.07);
    transition: width 300ms var(--saas-ease), min-width 300ms var(--saas-ease);
    z-index: 1050;
    flex-shrink: 0;
}

.saas-sidebar.collapsed {
    width: var(--saas-sidebar-collapsed-width);
    min-width: var(--saas-sidebar-collapsed-width);
}

/* ─── Brand Panel ─── */
.saas-brand-panel {
    height: var(--saas-header-height);
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: transparent;
    flex-shrink: 0;
    gap: 0.5rem;
    transition: padding 300ms var(--saas-ease);
    overflow: hidden;
}

.saas-sidebar.collapsed .saas-brand-panel {
    padding: 0;
    justify-content: center;
}

.saas-brand-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    transition: justify-content 200ms ease;
}

.saas-sidebar.collapsed .saas-brand-link {
    justify-content: center;
}

.saas-brand-icon-wrap {
    width: 2.125rem;
    height: 2.125rem;
    border-radius: 0.5rem;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    padding: 0.25rem;
    transition: transform 200ms ease;
}

.saas-brand-icon-wrap:hover {
    transform: scale(1.05);
}

.saas-brand-icon-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    flex-shrink: 0;
}

/* Brand text: fades + collapses width when sidebar collapses */
.saas-brand-text {
    color: #ffffff;
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.15;
    white-space: nowrap;
    display: block;
    max-width: 160px;
    transition: opacity 250ms var(--saas-ease), max-width 300ms var(--saas-ease);
    flex-shrink: 1;
    overflow: hidden;
}

.saas-sidebar.collapsed .saas-brand-text {
    opacity: 0;
    max-width: 0;
    pointer-events: none;
}

/* Shared chevron base (expand btn in nav) */
.saas-chevron-btn {
    width: 1.875rem;
    height: 1.875rem;
    border: none;
    background: transparent;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    transition: background 200ms ease, opacity 200ms ease;
}

/* ─── Edge Toggle (circle on sidebar right border) ─── */
.saas-edge-toggle {
    position: absolute;
    /* vertically centred with the brand-panel row */
    top: calc(var(--saas-header-height) / 2);
    right: -0.8125rem;
    /* straddles the right border */
    transform: translateY(-50%);
    width: 1.625rem;
    height: 1.625rem;
    border-radius: 50%;
    background: #ffffff;
    border: 1.5px solid rgba(15, 32, 67, 0.16);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12), 0 0 0 0 transparent;
    color: var(--dda-navy-900, #0f2043);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 60;
    padding: 0;
    transition: box-shadow 200ms ease, background 200ms ease, transform 200ms ease;
}

.saas-edge-toggle:hover {
    background: #f4f6f8;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
}

.saas-edge-toggle i {
    transition: transform 300ms var(--saas-ease);
}

/* Rotate chevron to point right when collapsed */
.saas-sidebar.collapsed .saas-edge-toggle i {
    transform: rotate(180deg);
}

/* ─── Sidebar Inner — clips overflow during width animation ─── */
.saas-sidebar-inner {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* ─── Nav Scroller (inside .saas-nav-clip) ─── */
.saas-nav-scroller {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    scrollbar-width: none;
}

.saas-nav-scroller::-webkit-scrollbar {
    display: none;
}

/* ─── Section headers ─── */
.saas-nav-section {
    margin-bottom: 0.125rem;
}

.saas-nav-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.5rem 0.25rem;
    overflow: hidden;
    transition: height 250ms var(--saas-ease), opacity 200ms ease, padding 250ms var(--saas-ease);
    height: auto;
}

.saas-nav-section-header .section-label {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: rgba(255, 255, 255, 0.32);
    white-space: nowrap;
}

.saas-nav-section-header .section-badge {
    font-size: 0.5625rem;
    font-weight: 600;
    padding: 0.1rem 0.375rem;
    border-radius: 0.25rem;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.45);
}

/* Hide section headers when collapsed */
.saas-sidebar.collapsed .saas-nav-section-header {
    opacity: 0;
    height: 0;
    padding: 0;
    pointer-events: none;
}

/* ─── Separator ─── */
.saas-nav-sep {
    height: 1px;
    background: rgba(255, 255, 255, 0.07);
    margin: 0.375rem 0.25rem;
}

/* ─── Nav Link ─── */
.saas-nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    color: rgba(255, 255, 255, 0.72) !important;
    text-decoration: none !important;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    transition: background 200ms ease, color 200ms ease;
    white-space: nowrap;
    overflow: visible;
}

.saas-nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff !important;
}

.saas-nav-link.active {
    background: var(--dda-gold, #c5a059);
    color: #fff !important;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(197, 160, 89, 0.38);
}

.saas-nav-link i {
    font-size: 1rem;
    flex-shrink: 0;
    width: 1rem;
    text-align: center;
    line-height: 1;
}

.saas-nav-link-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.saas-nav-link-soon {
    font-size: 0.5625rem;
    opacity: 0.55;
    margin-left: auto;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Collapsed: icon only, centered */
.saas-sidebar.collapsed .saas-nav-link {
    justify-content: center;
    padding: 0.625rem 0;
    gap: 0;
}

.saas-sidebar.collapsed .saas-nav-link-label,
.saas-sidebar.collapsed .saas-nav-link-soon {
    display: none;
}

/* ─── Tooltip (right side, CSS-only) ─── */
.saas-nav-link::after,
.saas-logout-btn::after {
    content: attr(data-tip);
    position: absolute;
    left: calc(100% + 0.625rem);
    top: 50%;
    transform: translateY(-50%) scale(0.92);
    background: rgba(15, 32, 67, 0.97);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.3125rem 0.65rem;
    border-radius: 0.375rem;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 150ms ease, transform 150ms ease;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    z-index: 9999;
}

/* Only render tooltip when sidebar is collapsed */
.saas-sidebar.collapsed .saas-nav-link:hover::after,
.saas-sidebar.collapsed .saas-logout-btn:hover::after {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

/* ─── Footer (Sign Out) ─── */
.saas-sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.5rem;
    flex-shrink: 0;
}

.saas-logout-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    color: rgba(255, 100, 100, 0.75) !important;
    text-decoration: none !important;
    font-size: 0.875rem;
    font-weight: 500;
    width: 100%;
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: left;
    transition: background 200ms ease, color 200ms ease;
    white-space: nowrap;
    overflow: visible;
}

.saas-logout-btn:hover {
    background: rgba(255, 80, 80, 0.12);
    color: rgba(255, 130, 130, 1) !important;
}

.saas-logout-btn i {
    font-size: 1rem;
    flex-shrink: 0;
    width: 1rem;
    text-align: center;
}

.saas-logout-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.saas-sidebar.collapsed .saas-logout-btn {
    justify-content: center;
    padding: 0.625rem 0;
    gap: 0;
}

.saas-sidebar.collapsed .saas-logout-label {
    display: none;
}

/* ═══════════════════════════════════════
           MAIN CONTENT
        ═══════════════════════════════════════ */
.saas-main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--dda-background);
    min-width: 0;
}

.saas-topbar {
    background-color: var(--dda-surface);
    height: var(--saas-header-height);
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--dda-border);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.saas-topbar-title {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--dda-navy-900);
    letter-spacing: -0.01em;
}

.saas-content-area {
    padding: 1.5rem;
    flex: 1;
}

/* ═══════════════════════════════════════
           MOBILE DRAWER
        ═══════════════════════════════════════ */
.saas-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1049;
}

.saas-sidebar-backdrop.active {
    display: block;
    animation: saasNavFadeIn 200ms ease;
}



@keyframes saasNavFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Pending Confirmation Bulk Action Bar */
/* Floating Action Bar styling */
#bulkActionBar {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dda-navy-900, #122A50);
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: bottom 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1050;
}

#bulkActionBar.visible {
    bottom: 30px;
}

/* ═══════════════════════════════════════
   PREMIUM CALENDAR & DATE PICKER STYLES
   ═══════════════════════════════════════ */
.fc {
    font-family: 'Inter', ui-sans-serif, system-ui, sans-serif !important;
    --fc-border-color: #EBF0F6 !important;
    --fc-button-bg-color: #122A50 !important;
    --fc-button-border-color: #122A50 !important;
    --fc-button-hover-bg-color: #1B386A !important;
    --fc-button-hover-border-color: #1B386A !important;
    --fc-button-active-bg-color: #C5A059 !important;
    --fc-button-active-border-color: #C5A059 !important;
    --fc-today-bg-color: rgba(197, 160, 89, 0.08) !important;
}

.fc .fc-toolbar {
    margin-bottom: 1.5rem !important;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.fc .fc-toolbar-title {
    font-size: 1.35rem !important;
    font-weight: 700 !important;
    color: #122A50 !important;
    letter-spacing: -0.02em;
}

.fc .fc-button {
    border-radius: 50px !important;
    padding: 0.45rem 1rem !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    text-transform: capitalize !important;
    box-shadow: 0 2px 4px rgba(18, 42, 80, 0.08) !important;
    transition: all 0.2s ease !important;
}

.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
    background-color: #122A50 !important;
    border-color: #122A50 !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

.fc .fc-button-group {
    background: #F4F6F9;
    padding: 3px;
    border-radius: 50px;
}

.fc .fc-button-group > .fc-button {
    background: transparent !important;
    border: none !important;
    color: #556987 !important;
    box-shadow: none !important;
}

.fc .fc-button-group > .fc-button.fc-button-active {
    background: #122A50 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(18, 42, 80, 0.15) !important;
}

.fc .fc-daygrid-day-number {
    font-size: 0.85rem;
    font-weight: 600;
    color: #122A50;
    padding: 8px 12px !important;
    text-decoration: none !important;
}

.fc .fc-col-header-cell {
    background-color: #F8FAFC;
    padding: 10px 0 !important;
}

.fc .fc-col-header-cell-cushion {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748B;
    text-decoration: none !important;
}

.fc .fc-event {
    border-radius: 6px !important;
    border: none !important;
    padding: 3px 6px !important;
    font-size: 0.8rem !important;
    font-weight: 500 !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.fc .fc-event:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.fc-day-today {
    background-color: rgba(197, 160, 89, 0.06) !important;
}

.fc-day-today .fc-daygrid-day-number {
    background-color: #C5A059;
    color: #ffffff !important;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 4px;
    padding: 0 !important;
}

/* Date input styling across app */
input[type="date"].form-control,
input[type="datetime-local"].form-control {
    border-radius: 8px;
    border: 1px solid #E2E8F0;
    padding: 0.5rem 0.75rem;
    font-weight: 500;
    color: #122A50;
    background-color: #ffffff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="date"].form-control:focus,
input[type="datetime-local"].form-control:focus {
    border-color: #122A50;
    box-shadow: 0 0 0 3px rgba(18, 42, 80, 0.12);
}

/* ═══════════════════════════════════════
   MOBILE & TABLET RESPONSIVE CALENDAR
   ═══════════════════════════════════════ */
@media (max-width: 767.98px) {
    .fc .fc-toolbar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.5rem !important;
    }
    .fc .fc-toolbar-chunk {
        display: flex;
        justify-content: center;
        width: 100%;
    }
    .fc .fc-toolbar-title {
        font-size: 1.1rem !important;
        text-align: center;
    }
    .fc .fc-button {
        padding: 0.35rem 0.75rem !important;
        font-size: 0.75rem !important;
    }
    .fc .fc-daygrid-day-number {
        font-size: 0.75rem !important;
        padding: 4px 6px !important;
    }
    .fc .fc-col-header-cell-cushion {
        font-size: 0.7rem !important;
    }
    .fc .fc-event {
        font-size: 0.7rem !important;
        padding: 2px 4px !important;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .fc .fc-toolbar-title {
        font-size: 1.2rem !important;
    }
    .fc .fc-button {
        padding: 0.4rem 0.85rem !important;
        font-size: 0.8rem !important;
    }
}

#appointmentsCalendar,
.fc-header-toolbar {
    width: 100%;
    min-width: 0;
}

/* TomSelect custom fixes for Walk-in Check-in form */
.ts-wrapper {
    width: 100% !important;
}
.ts-control {
    border-radius: 50px !important;
    padding: 0.45rem 1rem !important;
    border-color: #E2E8F0 !important;
}