﻿:root {
    --ui-font-base: 16px;
    --ui-font-weight-regular: 400;
    --ui-font-weight-bold: 600;
    --ui-line-height: 1.25;
    --ui-padding-xs: 4px;
    --ui-padding-sm: 6px;
    --ui-padding-md: 12px;
    --ui-padding-lg: 18px;
    --ui-control-height: 42px;
    /* === COLOR SYSTEM (SIMPLIFIED) === */
    --ui-green: #0b3d0b;
    --ui-green-hover: #6fa06f;
    --ui-green-active: #5f8f5f;
    --ui-green-active-hover: #6fa06f;
    --ui-green-light: #d9ead9;
    --ui-green-dark: #19875426;
    --ui-green-gradient-top: #0f380d;
    --ui-green-gradient-bottom: #447a44;
    --ui-border-muted: #d0d0d0;
    --ui-bg-section: #ededed;
    --ui-tab-height: 34px;
    --ui-tab-radius: 6px;
    --grid-border: #e5e5e5;
    --grid-border-strong: #cfcfcf;
}

body.app-body {
    background-color: #e6f2e6 !important;
    font-family: "Segoe UI", sans-serif;
    font-size: var(--ui-font-base);
    font-weight: var(--ui-font-weight-regular);
    line-height: var(--ui-line-height);
    margin: 0;
    min-height: 100vh;
}

.status-alert {
    pointer-events: none;
    font-size: inherit;
    font-weight: 600;
    white-space: nowrap;
    border-radius: 6px;
    opacity: 1;
    transition: opacity 0.6s ease;
}

    .status-alert.fade {
        opacity: 0;
    }

#globalStatusAlert {
    z-index: 9999;
}

.app-body label,
.app-body .form-check-label,
.app-body button,
.app-body .btn,
.app-body h1,
.app-body h2,
.app-body h3,
.app-body h4,
.app-body h5,
.app-body h6 {
    font-size: inherit;
    font-weight: var(--ui-font-weight-bold);
}

.app-body .form-control:focus,
.app-body .form-select:focus,
.app-body textarea:focus {
    border-color: var(--ui-green) !important;
    box-shadow: 0 0 0 0.15rem rgba(11, 61, 11, 0.35) !important;
}

.app-body .btn:focus,
.app-body .btn:active,
.app-body .btn:focus-visible {
    border-color: var(--ui-green) !important;
    box-shadow: 0 0 0 0.15rem rgba(11, 61, 11, 0.35) !important;
}

.app-body .form-check-input:focus {
    border-color: var(--ui-green) !important;
    box-shadow: 0 0 0 0.15rem rgba(11, 61, 11, 0.35) !important;
}

.app-body .form-check-input:checked {
    background-color: var(--ui-green) !important;
    border-color: var(--ui-green) !important;
}

.dropdown-item:hover,
.dropdown-item:focus,
.dropdown-item.active {
    background-color: var(--ui-green-hover) !important;
    color: #fff !important;
}

a:focus-visible {
    outline: 2px solid var(--ui-green);
    outline-offset: 2px;
}

.app-body h1 {
    font-size: var(--ui-font-base);
}

.app-body h2 {
    font-size: calc(var(--ui-font-base) * 1.5);
}

.app-body h3 {
    font-size: calc(var(--ui-font-base) * 2);
}

.app-body h4 {
    font-size: calc(var(--ui-font-base) * 2.5);
}

.app-body h5 {
    font-size: calc(var(--ui-font-base) * 3);
}

.app-body h6 {
    font-size: calc(var(--ui-font-base) * 3.5);
}

.app-body .form-control,
.app-body .form-select,
.app-body textarea {
    font-size: inherit;
    height: var(--ui-control-height);
}

.btn-edit,
.btn-save,
.btn-logout {
    background-color: var(--ui-green) !important;
    color: #fff !important;
    border: none !important;
    font-weight: var(--ui-font-weight-bold);
    padding: var(--ui-padding-sm) var(--ui-padding-md);
    white-space: nowrap;
}

    .btn-edit:hover,
    .btn-save:hover,
    .btn-logout:hover {
        background-color: var(--ui-green-hover) !important;
    }

.btn-danger {
    background-color: #b02a37 !important;
    color: #fff !important;
    border: none !important;
    font-weight: var(--ui-font-weight-bold);
    padding: var(--ui-padding-sm) var(--ui-padding-md);
    white-space: nowrap;
}

    .btn-danger:hover {
        background-color: #9a2530 !important;
    }

    .btn-danger:active {
        background-color: #84202a !important;
    }

    .btn-danger:focus,
    .btn-danger:focus-visible {
        box-shadow: 0 0 0 0.15rem rgba(176, 42, 55, 0.45) !important;
    }

.app-body .btn-secondary {
    background-color: #6c757d !important;
    color: #fff !important;
    border: none !important;
    font-weight: var(--ui-font-weight-bold);
    padding: var(--ui-padding-sm) var(--ui-padding-md);
}

    .app-body .btn-secondary:hover {
        background-color: #5a6268 !important;
    }

.app-body input:focus,
.app-body select:focus,
.app-body textarea:focus,
.app-body button:focus {
    outline: none !important;
}

.topnav,
.footerbar {
    background: linear-gradient( 145deg, var(--ui-green-gradient-top), var(--ui-green-gradient-bottom) );
    color: #fff;
}

.topnav {
    border-bottom: 1px solid rgba(255,255,255,0.15);
}

.footerbar {
    border-top: 1px solid rgba(255,255,255,0.15);
}

.sidebar {
    width: 220px;
    min-width: 220px;
    max-width: 220px;
    background: linear-gradient(145deg, #1d4d1a 0%, #d9ead9 100%);
    padding-top: var(--ui-padding-sm);
    flex-shrink: 0;
}

    .sidebar .nav-item {
        margin-bottom: var(--ui-padding-md);
    }

    .sidebar .nav-link {
        width: 90%;
        height: 40px;
        margin: 0 auto;
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: var(--ui-green);
        color: #fff !important;
        font-weight: var(--ui-font-weight-bold);
        border-radius: 12px;
        transition: background-color .15s ease, transform .1s ease;
    }

        .sidebar .nav-link:hover {
            background-color: var(--ui-green-hover);
            transform: translateY(-1px);
        }

        .sidebar .nav-link.active {
            background-color: var(--ui-green-active);
        }

    .sidebar .settings-parent {
        position: relative;
    }

        .sidebar .settings-parent .settings-text {
            position: absolute;
            left: 50%;
            transform: translateX(-50%);
            pointer-events: none;
            white-space: nowrap;
        }

        .sidebar .settings-parent .chevron {
            position: absolute;
            right: var(--ui-padding-md);
            font-size: 18px;
            color: #fff;
            transition: transform .3s ease;
        }

        .sidebar .settings-parent.settings-open .chevron {
            transform: rotate(180deg);
        }

.section-box {
    height: 100%;
    border: 1px solid var(--ui-border-muted);
    border-radius: 6px;
    padding: var(--ui-padding-sm);
    background-color: var(--ui-bg-section);
    min-width: 0; /* prevents flex overflow bugs */
}

    .section-box.customer-valid {
        background-color: #e8f6ea;
        border-color: #7fcf90;
    }

.section-divider {
    border-top: 1px solid var(--ui-border-muted);
    margin: var(--ui-padding-sm) 0;
}

.table-green {
    width: 100%;
    min-width: 100%;
    border-collapse: collapse;
    font-size: inherit;
    table-layout: fixed;
}

    .table-green th {
        position: relative; /* REQUIRED for absolute handle */
        background-color: var(--ui-green) !important;
        color: #fff !important;
        font-weight: var(--ui-font-weight-bold);
        padding: var(--ui-padding-sm) var(--ui-padding-md);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        border: 1px solid #ffffff55;
        min-width: 0;
    }

    .table-green td {
        padding: var(--ui-padding-sm) var(--ui-padding-md);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        border: 1px solid #c8d6c8;
        background-color: #ffffff;
        min-width: 0;
    }

    .table-green col {
        min-width: 0;
    }

    .table-green tbody tr:not(.selected):hover td {
        background-color: #d9ead9;
    }

    .table-green tbody tr.selected td,
    .table-green tbody tr.selected:hover td {
        background-color: rgba(25, 135, 84, 0.15) !important;
    }

    .table-green .hide-col {
        visibility: collapse;
    }


    .table-green .action-col {
        width: 140px;
        min-width: 140px;
        max-width: 140px;
        text-align: center;
        padding: 0 !important;
        vertical-align: middle;
    }

    /* ================= LOOKUP TABLE – TRUE COLUMN HIDE ================= */
    .table-green.no-resize th.hide-col,
    .table-green.no-resize td.hide-col {
        display: none !important;
        width: 0 !important;
        min-width: 0 !important;
        max-width: 0 !important;
        padding: 0 !important;
        border: 0 !important;
    }

    /* ensure table does not reserve phantom space */
    .table-green.no-resize {
        table-layout: fixed !important;
        width: 100%;
    }

/* neutralize grid container offsets */
.customer-lookup-gridbox {
    padding-left: 0 !important;
    margin-left: 0 !important;
}

/* ================= DRAG HANDLE (NON-LAYOUT) ================= */
.drag-handle {
    position: absolute; /* DOES NOT affect width calc */
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    cursor: grab;
    opacity: 0.6;
    user-select: none;
    pointer-events: auto;
}

    .drag-handle:hover {
        opacity: 1;
    }

/* Text wrapper so headers align correctly */
.th-text {
    padding-left: 18px; /* space for drag handle */
    display: inline-block;
}

.action-buttons {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.btn-action {
    padding: 2px 8px !important;
    margin: 0 !important;
    font-size: inherit !important;
    line-height: 1.2;
    white-space: nowrap;
}

/* SCHEDULE FILTER DRAWER */
#scheduleFilterDrawer {
    display: flex;
    flex-direction: column;
    flex: .6 0 0;
    min-width: 0;
    padding: var(--ui-padding-xs) var(--ui-padding-sm);
    overflow: hidden;
    max-height: 999px;
    transition: max-height .25s ease;
    background-color: var(--ui-bg-section);
}

    #scheduleFilterDrawer.collapsed {
        max-height: 30px;
    }

/* HEADER */
.schedule-filter-header {
    height: 26px;
    display: flex;
    align-items: center;
    gap: var(--ui-padding-xs);
    font-size: .85rem;
    white-space: nowrap;
    flex-shrink: 0;
    overflow: visible;
}

/* TOGGLE */
.schedule-filter-toggle {
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
    transition: transform .2s ease;
}

    .schedule-filter-toggle svg {
        width: 12px;
        height: 12px;
        display: block;
    }

/* BODY */
#scheduleFilterBody {
    margin-top: var(--ui-padding-xs);
}

#scheduleFilterDrawer.collapsed #scheduleFilterBody {
    opacity: 0;
    pointer-events: none;
}

/* CHEVRON */
#scheduleFilterDrawer.collapsed .schedule-filter-toggle {
    transform: rotate(180deg);
}

/* PILLS */
.pill-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.pill {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    /* 🔑 REMOVE hard height */
    height: auto;
    min-height: 32px;
    min-width: 120px;
    padding: 2px 10px;
    border-radius: 6px;
    border: 1px solid var(--ui-border-muted);
    background-color: #f1f3f5;
    color: #495057;
    cursor: pointer;
    user-select: none;
    text-align: center;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease;
    white-space: nowrap;
}

    .pill:hover {
        background-color: #e9ecef;
        border-color: var(--ui-border-muted);
    }

    .pill.selected {
        background-color: rgba(25,135,84,.15);
        border-color: var(--ui-green);
        color: var(--ui-green);
    }

        .pill.selected:hover {
            background-color: rgba(25,135,84,.22);
            border-color: var(--ui-green-hover);
        }

.pill-cc-id {
    color: #000; /* black */
    font-size: 15px; /* a little bigger */
    font-weight: 700; /* bold */
    line-height: 1.1;
    white-space: nowrap;
}

.pill-cc-name {
    color: #000; /* black */
    font-size: 11px;
    font-weight: 400; /* regular */
    line-height: 1.1;
    opacity: .9;
    white-space: nowrap;
}

.pill:focus-visible {
    outline: none;
    box-shadow: 0 0 0 .15rem rgba(11,61,11,.35);
}

#scheduledPills .pill {
    background-color: #bdbdbd;
    color: #000;
}

    #scheduledPills .pill.selected {
        background-color: var(--ui-green-light);
        color: #000;
    }

.schedule-cell:hover {
    background-color: var(--ui-green-light);
}

.schedule-cell.selected {
    background-color: rgba(31, 111, 63, 0.18);
}

/* TAB STRIP */
.tab-strip {
    display: flex;
    gap: var(--ui-padding-xs);
    height: var(--ui-tab-height);
    border-bottom: 1px solid var(--ui-border-muted);
    overflow-x: auto;
}

.record-tab {
    display: inline-flex;
    align-items: center;
    padding: 0 var(--ui-padding-md);
    font-size: inherit;
    font-weight: var(--ui-font-weight-bold);
    background-color: var(--ui-bg-section);
    border-radius: var(--ui-tab-radius) var(--ui-tab-radius) 0 0;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

    .record-tab.active {
        background-color: var(--ui-green);
        color: #fff;
    }

    .record-tab .close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 22px;
        height: 22px;
        margin-left: var(--ui-padding-xs);
        font-size: 16px;
        font-weight: bold;
        line-height: 1;
        border-radius: 4px;
        cursor: pointer;
        user-select: none;
    }

        .record-tab .close:hover {
            background-color: rgba(0,0,0,0.12);
        }

/* DRAGGABLE MODAL */
.modal-dialog.draggable-modal {
    max-width: none;
}

    .modal-dialog.draggable-modal .modal-header {
        background-color: var(--ui-green);
        color: #fff;
        cursor: move;
        padding: var(--ui-padding-sm) var(--ui-padding-md);
        min-height: var(--ui-control-height);
        display: flex;
        align-items: center;
        font-size: inherit;
        font-weight: var(--ui-font-weight-bold);
        position: relative;
        white-space: nowrap;
    }

    .modal-dialog.draggable-modal .modal-title {
        font-size: inherit;
        font-weight: inherit;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .modal-dialog.draggable-modal .btn-close {
        position: absolute;
        top: 70%;
        right: var(--ui-padding-md);
        transform: translateY(-50%) scale(1.5);
        padding: var(--ui-padding-xs);
        filter: invert(1);
        opacity: 0.85;
        line-height: 1;
    }

        .modal-dialog.draggable-modal .btn-close:hover {
            opacity: 1;
        }

.modal-dialog.center-hidden {
    opacity: 0 !important;
}

/* CHECKBOX */
.checkbox-fill {
    transform: scale(2);
    margin: 0 !important;
    vertical-align: middle;
    flex-shrink: 0;
}

/* NOTES EXPAND ICON */
.notes-expand {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--ui-border-muted);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    transition: background-color .15s ease, border-color .15s ease;
    flex-shrink: 0;
}

    .notes-expand::before {
        content: "";
        width: 7px;
        height: 7px;
        border-top: 2px solid var(--ui-green-dark);
        border-right: 2px solid var(--ui-green-dark);
        transform: translate(1px,-1px);
    }

    .notes-expand:hover {
        background-color: var(--ui-green-light);
        border-color: var(--ui-green);
    }

        .notes-expand:hover::before {
            border-color: var(--ui-green);
        }

    .notes-expand.disabled {
        opacity: .4;
        cursor: default;
        pointer-events: none;
    }

/* SUBLAYOUT NAV*/
.sublayout1-nav {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 4px 2px;
    flex-wrap: nowrap;
    overflow-x: auto;
}

.sublayout1-tab {
    position: relative;
    font-size: 1rem;
    font-weight: 600;
    color: #212529;
    text-decoration: none;
    padding-bottom: 6px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

    .sublayout1-tab:not(.disabled):hover {
        color: #000;
    }

    .sublayout1-tab.active {
        font-weight: 700;
    }

        .sublayout1-tab.active::after {
            content: "";
            position: absolute;
            left: 0;
            right: 0;
            bottom: 0;
            height: 2px;
            background-color: #212529;
        }

    .sublayout1-tab.disabled {
        color: #adb5bd;
        pointer-events: none;
        text-decoration: none;
    }

    .sublayout1-tab:not(:last-child)::before {
        content: "";
        position: absolute;
        right: -12px;
        top: 50%;
        transform: translateY(-50%);
        width: 1px;
        height: 14px;
        background-color: #6c757d;
    }

.sublayout1-nav-underline {
    display: none;
}

/* PILLS */
.pill-container {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ui-padding-sm);
    min-width: 0;
}

.pill {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 32px;
    min-width: 120px;
    padding: 2px 10px;
    border-radius: 6px;
    border: 1px solid var(--ui-border-muted);
    background-color: var(--ui-bg-section);
    color: var(--ui-green-dark);
    cursor: pointer;
    user-select: none;
    text-align: center;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease;
    white-space: nowrap;
}

    .pill:hover {
        background-color: var(--ui-green-light);
    }

    .pill.selected {
        background-color: var(--ui-green-light);
        border-color: var(--ui-green);
        color: var(--ui-green-dark);
    }

        .pill.selected:hover {
            background-color: rgba(31,111,63,.22);
        }

.pill-cc-id {
    font-size: 13px;
    font-weight: var(--ui-font-weight-bold);
    line-height: 1.1;
}

.pill-cc-name {
    font-size: 11px;
    font-weight: var(--ui-font-weight-regular);
    line-height: 1.1;
    opacity: .9;
}

.pill:focus-visible {
    outline: none;
    box-shadow: 0 0 0 .15rem rgba(31,111,63,.35);
}

/* ICON BUTTONS*/
.magnifier-btn,
.calendar-btn {
    width: 38px;
    min-width: 38px;
    height: 38px;
    background: var(--ui-green);
    border: none;
    border-radius: 4px;
    position: relative;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

    .magnifier-btn::before {
        content: "";
        width: 14px;
        height: 14px;
        border: 2px solid #fff;
        border-radius: 50%;
        position: absolute;
        top: 9px;
        left: 9px;
    }

    .magnifier-btn::after {
        content: "";
        width: 10px;
        height: 2px;
        background: #fff;
        position: absolute;
        bottom: 8px;
        right: 7px;
        transform: rotate(45deg);
    }

    .calendar-btn::before {
        content: "";
        position: absolute;
        top: 10px;
        left: 8px;
        width: 22px;
        height: 18px;
        border: 2px solid #fff;
        border-radius: 2px;
        box-sizing: border-box;
    }

    .calendar-btn::after {
        content: "";
        position: absolute;
        top: 10px;
        left: 8px;
        width: 22px;
        height: 6px;
        background: #fff;
    }

    .magnifier-btn:hover,
    .calendar-btn:hover {
        filter: brightness(1.08);
    }

    .magnifier-btn:focus,
    .calendar-btn:focus {
        outline: none;
        box-shadow: 0 0 0 2px rgba(31,111,63,.45);
    }

    .magnifier-btn:active,
    .calendar-btn:active {
        transform: translateY(1px);
    }

    /* ICON BUTTON DISABLED*/
    .magnifier-btn:disabled,
    .calendar-btn:disabled {
        background: var(--ui-border-muted);
        cursor: not-allowed;
        opacity: 0.65;
        filter: none;
        box-shadow: none;
    }

        .magnifier-btn:disabled::before,
        .magnifier-btn:disabled::after,
        .calendar-btn:disabled::before,
        .calendar-btn:disabled::after {
            opacity: 0.6;
        }

        .magnifier-btn:disabled:hover,
        .magnifier-btn:disabled:active,
        .calendar-btn:disabled:hover,
        .calendar-btn:disabled:active {
            filter: none;
            transform: none;
        }

/* SCHEDULED DATETIME */
.scheduled-datetime-group {
    max-width: 300px;
    min-width: 0;
}

    .scheduled-datetime-group .scheduled-datetime {
        min-width: 150px;
        text-align: center;
    }

/* AUTOFILL BUTTON */
.autofill-btn {
    width: 38px;
    min-width: 38px;
    height: 38px;
    background: var(--ui-green);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: .5px;
}

    .autofill-btn:hover {
        filter: brightness(1.08);
    }

    .autofill-btn:focus {
        outline: none;
        box-shadow: 0 0 0 2px rgba(31,111,63,.45);
    }

    .autofill-btn:active {
        transform: translateY(1px);
    }

    .autofill-btn:disabled {
        background: var(--ui-border-muted);
        cursor: not-allowed;
        opacity: 0.65;
        filter: none;
        box-shadow: none;
    }

        .autofill-btn:disabled:hover,
        .autofill-btn:disabled:active {
            filter: none;
            transform: none;
        }

/* CONTRACT LINE COMPACTING*/
.contract-line .row {
    margin-bottom: var(--ui-padding-xs);
}

.contract-line label {
    margin-bottom: 2px;
    white-space: nowrap;
}

.contract-line .form-control,
.contract-line .form-select {
    padding-top: 4px;
    padding-bottom: 4px;
    font-size: .9rem;
}

.contract-line-header {
    margin-bottom: var(--ui-padding-xs);
    position: relative;
}

/* CONTRACT LINE ACTIONS */
.contract-line-actions {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    gap: var(--ui-padding-xs);
    margin-left: auto;
    white-space: nowrap;
}

.contract-line .toggle-line {
    min-width: 28px;
    flex-shrink: 0;
}

.line-body {
    margin-top: var(--ui-padding-xs);
}

.contract-line.collapsed {
    padding-bottom: var(--ui-padding-sm);
}

/* TEXT OVERFLOW SAFETY*/
.summary-label,
.small.fw-bold.text-muted,
.contract-line-header span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* MOBILE BEHAVIOR */
@media (max-width: 768px) {
    .contract-lines-header {
        flex-direction: column;
        align-items: stretch;
        gap: var(--ui-padding-sm);
    }

        .contract-lines-header > h2 {
            text-align: center;
        }

    .contract-summary-header {
        justify-content: flex-start;
    }

    .contract-lines-header .rounded.border {
        width: 100%;
        justify-content: space-around;
    }

    #addContractLineBtn {
        align-self: center;
    }

    .contract-line-actions {
        padding-top: var(--ui-padding-sm);
    }
}

/* DISABLED SECTION */
.section-disabled {
    pointer-events: none;
    opacity: 0.75;
    filter: grayscale(100%);
    user-select: none;
}

    .section-disabled input,
    .section-disabled select,
    .section-disabled button {
        cursor: not-allowed;
    }

/* CALENDAR CONTAINER*/
.calendar-container {
    display: grid;
    grid-template-rows: auto auto 1fr;
    width: 100%;
    height: 100%;
    min-height: 0;
    background-color: #fff;
    border: 1px solid var(--ui-border-muted);
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,.1);
    overflow: hidden;
}

/* CALENDAR HEADER*/
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--ui-padding-sm);
    background-color: var(--ui-green);
    font-size: 1.4rem;
    font-weight: var(--ui-font-weight-bold);
    color: #fff;
    flex-shrink: 0;
}

/* CALENDAR NAV */
.calendar-nav {
    cursor: pointer;
    background: transparent;
    border: none;
    font-size: 1.4rem;
    padding: var(--ui-padding-xs);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .calendar-nav:hover {
        background-color: rgba(255,255,255,.15);
    }

/* WEEKDAYS*/
.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7,1fr);
    height: var(--ui-control-height);
    background: #f2f2f2;
    font-weight: var(--ui-font-weight-bold);
    color: #000;
    border-bottom: 1px solid var(--ui-border-muted);
}

    .calendar-weekdays div {
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: inset 0 0 0 1px var(--ui-border-muted);
    }

        .calendar-weekdays div:last-child {
            border-right: none;
        }


/* CALENDAR BODY */
.calendar-body {
    display: grid;
    grid-template-columns: repeat(7,1fr);
    grid-template-rows: repeat(6,minmax(0,1fr));
    min-height: 0;
    background-color: var(--ui-green-light);
}

/* CALENDAR DAY*/
.calendar-day {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    font-weight: 500;
    user-select: none;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px var(--ui-border-muted);
}

    .calendar-day.empty {
        background-color: #d6d6d6;
        color: #6c757d;
        cursor: default;
        pointer-events: none;
    }

    .calendar-day:not(.empty):not(.selected):hover {
        background-color: var(--ui-green-light);
    }

    .calendar-day.selected {
        background-color: var(--ui-green);
        color: #fff;
        font-weight: 600;
    }

/* SCHEDULE GRID */
#scheduleGrid th, #scheduleGrid td {
    box-sizing: border-box;
    background-clip: padding-box;
}

#scheduleGrid .schedule-header-row, #scheduleGrid .schedule-body-row {
    height: 42px;
}

#scheduleGrid .schedule-header-date-col {
    width: 150px;
    min-width: 150px;
    max-width: 150px;
    background: var(--ui-green);
    color: #fff;
    font-weight: 700;
    font-size: 1.3rem;
    text-align: center;
    border-right: 1px solid var(--grid-border);
    position: sticky;
    top: 0;
    left: 0;
    z-index: 30;
}

#scheduleGrid .schedule-header-user-col {
    width: 230px;
    min-width: 230px;
    max-width: 230px;
    background: var(--ui-green);
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    text-align: center;
    border-right: 1px solid var(--grid-border);
    position: sticky;
    top: 0;
    z-index: 20;
}

#scheduleGrid .schedule-body-date-cell {
    width: 150px;
    min-width: 150px;
    max-width: 150px;
    text-align: center;
    background: var(--ui-bg-section);
    border: 1px solid var(--grid-border-strong);
    position: sticky;
    left: 0;
    z-index: 10;
}

#scheduleGrid .hour-row .schedule-body-date-cell {
    font-weight: 700;
    font-size: 1.15rem;
}

#scheduleGrid .quarter-row .schedule-body-date-cell {
    font-style: italic;
    font-size: 1.05rem;
}

#scheduleGrid .schedule-body-user-cell {
    width: 230px;
    min-width: 230px;
    max-width: 230px;
    background: #fff;
    border: 1px solid var(--grid-border);
    cursor: pointer;
}

    #scheduleGrid .schedule-body-user-cell:hover {
        background: rgba(0,0,0,0.03);
    }

    #scheduleGrid .schedule-body-user-cell.selected {
        background: var(--ui-green-light);
        outline: 2px solid var(--ui-green);
        outline-offset: -2px;
    }

/* SCHEDULE TILES */
#scheduleGrid .schedule-tiles-layer {
    position: absolute;
    top: 42px;
    left: 0;
    right: 0;
    pointer-events: none;
}

#scheduleGrid .schedule-tile {
    position: absolute;
    border-radius: 6px;
    padding: var(--ui-padding-sm);
    color: #fff;
    pointer-events: auto;
    cursor: pointer;
    box-sizing: border-box;
    transform: none;
    overflow: hidden;
    contain: paint;
    border: 1px solid rgba(0,0,0,0.22);
    box-shadow: 0 6px 16px rgba(0,0,0,0.32),0 2px 6px rgba(0,0,0,0.24);
}

    #scheduleGrid .schedule-tile.selected {
        outline: none;
        border: 3px solid var(--tile-selected-border,#00ffff);
        box-shadow: 0 0 0 2px rgba(255,255,255,0.25) inset,0 8px 10px rgba(0,0,0,0.32),0 1px 8px rgba(0,0,0,0.24),0 0 10px var(--tile-selected-glow,rgba(0,255,255,0.9)),0 0 14px var(--tile-selected-glow,rgba(0,255,255,0.9));
    }



    #scheduleGrid .schedule-tile * {
        max-width: 100%;
    }

#scheduleGrid .schedule-tile-header span, #scheduleGrid .schedule-tile-line {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#scheduleGrid .schedule-tile-header {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.1;
    letter-spacing: -0.2px;
    gap: 6px;
}

#scheduleGrid .schedule-tile-duration {
    font-style: italic;
    font-size: .95em;
    font-weight: 400;
    letter-spacing: -0.2px;
    font-variant-numeric: tabular-nums;
}

/* hover highlight for cell under tile top edge (during drag) */
#scheduleGrid .schedule-body-user-cell.hover {
    background: rgba(0,0,0,0.03);
    outline: 2px dashed rgba(0,0,0,0.35);
    outline-offset: -2px;
}

#scheduleGrid.tile-dragging .schedule-body-user-cell:hover {
    outline: none !important;
    background: inherit !important;
}

/* Details smaller */
.schedule-tile-details {
    font-size: 12px;
    line-height: 1.15;
}

    .schedule-tile-details .schedule-tile-line {
        font-size: 12px;
    }

.customer-topnav-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 42px;
    padding: 0 2px;
}

.customer-nav-details {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 1rem;
}

.customer-topnav-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

    .customer-topnav-actions.is-hidden {
        visibility: hidden;
        pointer-events: none;
    }
