.delivery-module {
    font-family: "Segoe UI", Arial, sans-serif;
    height: var(--delivery-module-height, calc(100vh - 96px));
    min-height: 0;
    overflow: hidden;
}

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

.delivery-body {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: minmax(0, 1fr);
    gap: 20px;
    height: 100%;
    min-height: 0;
}

.delivery-pane {
    background: #fff;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    max-height: none;
    min-height: 0;
    overflow: hidden;
}

.delivery-pane-header {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.delivery-pane-header-right {
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.delivery-calendar-toolbar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding-bottom: 12px;
}

.date-nav {
    flex: 0 0 auto;
}

#delivery-date-picker {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    color: inherit;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    height: 24px;
    padding: 0 8px;
}

#delivery-date-picker::-webkit-calendar-picker-indicator {
    cursor: pointer;
    filter: invert(1);
}

.delivery-view-switcher {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.delivery-view-button {
    align-items: center;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    color: #4b5563;
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 700;
    gap: 6px;
    height: 34px;
    justify-content: center;
    min-width: 34px;
    padding: 0 10px;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, min-width 0.15s ease;
}

.delivery-view-button:hover,
.delivery-view-button:focus-visible {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #111827;
}

.delivery-view-button.is-active {
    background: #111827;
    border-color: #111827;
    color: #fff;
    min-width: 88px;
}

.delivery-view-button.is-active:hover,
.delivery-view-button.is-active:focus-visible {
    background: #111827;
    border-color: #111827;
    color: #fff;
}

.delivery-view-button.delivery-weekend-toggle {
    min-width: 138px;
}

.delivery-weekend-toggle:not(.is-active) {
    border-color: #f97316;
    color: #9a3412;
}

.delivery-weekend-toggle:not(.is-active):hover,
.delivery-weekend-toggle:not(.is-active):focus-visible {
    background: #fff7ed;
    border-color: #ea580c;
    color: #7c2d12;
}

.delivery-day-view-button {
    min-width: 190px;
}

.delivery-schedule-view {
    flex: 1;
    min-height: 0;
}

.delivery-pane > .delivery-list {
    align-content: start;
    flex: 1;
    min-height: 0;
}

.delivery-schedule-view > .delivery-calendar-grid {
    height: 100%;
}

.delivery-calendar-grid {
    display: grid;
    gap: 8px;
    min-height: 0;
}

.delivery-schedule-week .delivery-calendar-grid,
.delivery-schedule-month .delivery-calendar-grid {
    grid-template-columns: repeat(var(--delivery-calendar-columns, 7), minmax(0, 1fr));
}

.delivery-schedule-month .delivery-calendar-grid {
    --delivery-calendar-columns: 7;
}

.delivery-schedule-month .delivery-calendar-grid {
    grid-auto-rows: minmax(92px, 1fr);
}

.delivery-calendar-day {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    min-height: 0;
    padding: 8px;
}

.delivery-schedule-week .delivery-calendar-day,
.delivery-schedule-month .delivery-calendar-day {
    cursor: pointer;
}

.delivery-schedule-week .delivery-calendar-day:hover,
.delivery-schedule-month .delivery-calendar-day:hover,
.delivery-calendar-day:focus-visible {
    border-color: #93c5fd;
    box-shadow: inset 0 0 0 1px #93c5fd;
    outline: none;
}

.delivery-calendar-day.is-selected {
    border-color: #2563eb;
    box-shadow: inset 0 0 0 1px #2563eb;
}

.delivery-calendar-day.is-today .delivery-calendar-day-header strong {
    background: #dbeafe;
    border-radius: 999px;
    color: #1d4ed8;
    padding: 2px 6px;
}

.delivery-calendar-day-header {
    align-items: center;
    display: flex;
    gap: 6px;
    justify-content: space-between;
    min-width: 0;
}

.delivery-calendar-day-header span {
    color: #6b7280;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.delivery-calendar-day-header strong {
    color: #111827;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.delivery-calendar-appointments {
    display: grid;
    gap: 5px;
    min-height: 0;
    overflow: hidden auto;
}

.delivery-calendar-empty {
    color: #9ca3af;
    font-size: 11px;
    line-height: 1.2;
}

.delivery-ticket-compact {
    border-radius: 8px;
    padding: 6px;
}

.delivery-ticket-compact .ticket-type {
    font-size: 9px;
    line-height: 1;
    padding: 3px 5px;
}

.delivery-compact-time {
    color: #2563eb;
    font-size: 11px;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.delivery-compact-main {
    align-items: center;
    display: flex;
    gap: 4px;
    min-width: 0;
}

.delivery-compact-main strong,
.delivery-compact-main span:last-child {
    color: #111827;
    font-size: 11px;
    line-height: 1.2;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.delivery-day-summary {
    margin: 14px 0 10px;
    font-weight: 600;
    color: #111827;
}

.delivery-list {
    display: grid;
    gap: 12px;
    min-width: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

#delivery-day-list.delivery-schedule-day {
    align-content: start;
    background: #e2e8f0;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    padding: 12px;
}

#delivery-day-list.delivery-schedule-day .delivery-empty {
    background: rgba(255, 255, 255, 0.58);
    border-color: #94a3b8;
    color: #475569;
}

.delivery-list > .delivery-ticket {
    min-width: 0;
    width: 100%;
}

#delivery-unscheduled-list {
    grid-template-columns: minmax(0, 1fr);
}

.delivery-ticket {
    background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);	
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);	
    box-sizing: border-box;
    cursor: pointer;	
    max-width: 100%;
    min-width: 0;
    padding: 12px;
    position: relative;
}


.delivery-ticket .ticket-items {
    margin: 8px 0 4px;
}

.delivery-ticket h4 {
    margin: 8px 0 6px;
    font-size: 16px;
}

.ticket-header {
    align-items: flex-start;
    border-bottom: 0;
    display: flex;
    font-size: 12px;
    gap: 14px;
    justify-content: space-between;	
    min-width: 0;
    padding-bottom: 0;
}

.delivery-ticket.is-expanded .ticket-header {
    border-bottom: 1px solid #eef2f7;
    padding-bottom: 8px;	
}

.ticket-heading-main,
.ticket-heading-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.ticket-heading-main {
    align-items: flex-start;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 3px;
}

.ticket-heading-actions {
    align-items: flex-start;	
    flex: 1 1 auto;
    justify-content: flex-end;
}

.ticket-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    min-width: 0;
}

.ticket-id {
    font-weight: 700;
    color: #111827;
    white-space: nowrap;
}

.ticket-billing-name {
    color: #111827;
    font-size: 12px;
    font-weight: 700;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ticket-billing-locality {
    color: #64748b;
    display: block;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.25;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ticket-header-timeframe,
.ticket-header-carrier {
    align-items: center;
    color: #64748b;
    display: inline-flex;
    font-size: 11px;
    font-weight: 700;
    gap: 5px;
    white-space: nowrap;
}

.ticket-header-carrier::before {
    color: #cbd5e1;
    content: '|';
    font-weight: 600;
}

.ticket-header-carrier-warning {
    color: #dc2626;
}

.ticket-customer-name {
    color: #111827;
    flex: 1 1 auto;
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ticket-top-item {
    color: #6b7280;
    display: block;
    font-size: 11px;
    line-height: 1.25;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ticket-product-summary {
    align-items: flex-start;
    display: flex;
    flex: 1 1 auto;
    gap: 8px;
    justify-content: flex-end;
    min-width: 0;
}

.ticket-type-stack {
    align-items: flex-end;
    display: inline-flex;
    flex: 0 0 auto;
    flex-direction: column;
    gap: 2px;
    margin-left: auto;
}

.ticket-primary-product {
    color: #111827;
    font-size: 12px;
    font-weight: 700;
    min-width: 0;
    overflow: hidden;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;	
}

.ticket-age {
    color: #6b7280;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.ticket-age-overdue {
    color: #dc2626;
}

.ticket-type {
    align-self: center;
    border-radius: 999px;
    font-size: 11px;	
    font-weight: 600;
    line-height: 1.25;
    padding: 0 6px;	
    background: #e0f2fe;
    color: #0369a1;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.delivery-ticket-toggle {
    border: 0;
    background: transparent;
    color: #4b5563;
    cursor: pointer;
    padding: 4px;
}

.delivery-ticket-toggle:hover {
    color: #111827;
}

.delivery-service-alert {
    align-items: center;
    align-self: flex-start;
    background: #dc2626;
    border: 0;
    border-radius: 999px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    height: 22px;
    flex: 0 0 auto;	
    justify-content: center;
    width: 22px;
}

.delivery-service-alert:hover {
    background: #b91c1c;
}

.ticket-type-move {
    background: #fef3c7;
    color: #b45309;
}

.ticket-type-pickup {
    background: #ede9fe;
    color: #6d28d9;
}

.ticket-type-transfer {
    background: #d1fae5;
    color: #047857;
}

.ticket-meta-row {
    align-items: center;
    color: #4b5563;
    display: flex;
    flex-wrap: wrap;
    font-size: 12px;
    gap: 6px 12px;
    margin: 6px 0 0;
}

.ticket-location,
.ticket-carrier,
.ticket-schedule,
.ticket-notes {
    color: #4b5563;
    font-size: 12px;
    margin: 0;
}

.ticket-location,
.ticket-schedule {
    align-items: center;
    display: inline-flex;
    gap: 5px;	
}

.ticket-items-inline,
.ticket-items-empty {
    font-size: 12px;
    color: #4b5563;
}

.ticket-info-cards {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 10px 0 0;
}

.ticket-info-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
    color: #374151;
    min-width: 0;
    padding: 8px 9px;
}

.ticket-info-card-label {
    align-items: center;
    color: #2563eb;
    display: flex;
    font-size: 10px;
    font-weight: 800;
    gap: 5px;
    letter-spacing: 0.05em;
    margin-bottom: 4px;	
    text-transform: uppercase;
    white-space: nowrap;
}

.ticket-info-card-pickup .ticket-info-card-label {
    color: #7c3aed;
}

.ticket-info-card-delivery .ticket-info-card-label {
    color: #059669;
}




.ticket-info-card strong,
.ticket-info-card-address,
.ticket-info-card-address span,
.ticket-info-card-detail {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ticket-info-card strong {
    color: #111827;
    display: block;	
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;	
}

.ticket-info-card-address {
    color: #4b5563;
    display: block;	
    font-size: 12px;
    line-height: 1.25;
}

.ticket-info-card-address span {
    display: block;
    white-space: nowrap;
}

.ticket-info-card-detail {
    align-items: center;
    color: #64748b;
    display: inline-flex;
    font-size: 11px;
    font-weight: 700;
    gap: 5px;	
}

.ticket-items-table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 11px;
    color: #374151;
}

.ticket-items-more {
    margin-top: 6px;
    font-size: 12px;
    color: #6b7280;
}

.delivery-ticket-edit-items {
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.ticket-items-table th,
.ticket-items-table td {
    border: 1px solid #e5e7eb;
    padding: 3px 5px;
    text-align: left;
    vertical-align: top;
    word-break: break-word;
}

.ticket-items-table thead th {
    background: #f3f4f6;
    font-weight: 600;
}

.ticket-notes {
    font-style: italic;
    color: #6b7280;
}

.ticket-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0;
}

.ticket-tags span {
    background: #111827;
    color: #fff;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 11px;
}

.delivery-empty {
    padding: 18px;
    text-align: center;
    color: #9ca3af;
    border: 1px dashed #d1d5db;
    border-radius: 10px;
}

.delivery-filters {
    display: flex;
    gap: 10px;
}

.delivery-filter,
.delivery-refresh {
    align-items: center;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 10px;	
    color: #6b7280;
    cursor: pointer;
    display: inline-flex;
    height: 36px;
    justify-content: center;
    padding: 0;
    width: 36px;	
}

.delivery-filter.is-active {
    background: #111827;
    color: #fff;
    border-color: #111827;
}

.delivery-add {
    align-items: center;
    background: #2563eb;
    border: none;
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font-weight: 600;
    gap: 6px;
    height: 36px;
    justify-content: center;
    padding: 0 12px;
}

.delivery-pane-header-right .delivery-add {
    padding: 0;
    width: 36px;
}

.delivery-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 1200;
}

.delivery-modal {
    background: #fff;
    border-radius: 16px;
    width: min(1100px, 100%);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.2);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 48px);
}

.delivery-items-modal {
    background: #fff;
    border-radius: 16px;
    width: min(900px, 100%);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.2);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 48px);
}

.delivery-items-modal-actions {
    margin-bottom: 10px;
}

.delivery-items-editor-table {
    width: 100%;
    border-collapse: collapse;
}

.delivery-items-editor-table th,
.delivery-items-editor-table td {
    border: 1px solid #e5e7eb;
    padding: 6px;
    text-align: left;
}

.delivery-items-editor-table th {
    background: #f3f4f6;
}

.delivery-items-editor-table input {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 6px;
    font-size: 13px;
}

.delivery-items-remove-row {
    border: none;
    background: #fee2e2;
    color: #991b1b;
    border-radius: 6px;
    padding: 5px 8px;
    font-size: 12px;
    cursor: pointer;
}

.delivery-items-empty {
    text-align: center;
    color: #9ca3af;
}

.delivery-ticket-items-preview .ticket-items {
    margin: 8px 0 10px;
}

.delivery-ticket-items-edit-trigger {
    align-self: flex-start;
}

.delivery-ticket-items-edit-trigger:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.delivery-modal-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.delivery-modal-header {
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
	gap: 12px;
}

.delivery-modal-close {
    border: none;
    background: none;
    font-size: 24px;
    cursor: pointer;
    color: #6b7280;
}

.delivery-modal-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    text-align: left;
}

.delivery-modal-body {
    padding: 12px 20px;
    overflow-y: auto;
	display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    min-height: 0;
}

.delivery-modal-footer {
    border-top: 1px solid #e5e7eb;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.delivery-modal-primary {
    border: none;
    border-radius: 10px;
    padding: 10px 18px;
    font-weight: 600;
    cursor: pointer;
    background: #2563eb;
    color: #fff;
}

.delivery-modal-delete {
    border: none;
    border-radius: 10px;
    padding: 10px 14px;
    font-weight: 600;
    cursor: pointer;
    background: #fee2e2;
    color: #991b1b;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.delivery-modal-delete:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.delivery-form-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.delivery-form-section-header h4,
.delivery-address-header h5 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}

.delivery-form-addresses {
    gap: 10px;
}

.delivery-address-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.delivery-address-column {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.delivery-address-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    background: #e5e7eb;
    padding: 4px 8px;
    border-radius: 8px;
}

.delivery-address-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.delivery-chip {
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 999px;
    padding: 2px 6px;
    font-size: 10px;
    cursor: pointer;
    white-space: nowrap;
}

.delivery-field label,
.delivery-form-row > label,
.delivery-note-block label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #111827;
}

.delivery-field input,
.delivery-form-row input,
.delivery-form-row select,
.delivery-note-block textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 13px;
	height: 28px;
    min-width: 0;
	box-sizing: border-box;
}


.delivery-address-footer {
    border-top: 1px solid #e5e7eb;
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 2px;
    padding-top: 6px;
}

.delivery-field-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 70px 110px;
    gap: 8px;
}

.delivery-form-addresses .delivery-field input {
    padding: 2px 6px;
    font-size: 13px;
    box-sizing: border-box;
}

.delivery-field--state input {
    max-width: 70px;
}

.delivery-field--zip input {
    max-width: 110px;
}

.delivery-form-details {
    gap: 12px;
}

.delivery-details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.delivery-details-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.delivery-form-row {
    display: grid;
    grid-template-columns: minmax(140px, 180px) minmax(0, 1fr);
    gap: 8px;
    align-items: center;
}

.delivery-form-row--compact input,
.delivery-form-row--compact select {
    padding: 2px 6px;
    font-size: 13px;
}

.delivery-date-input-group {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.delivery-date-input-group input {
    flex: 1 1 auto;
}

.delivery-selected-date-copy {
    flex: 0 0 auto;
    padding: 4px 8px;
    font-size: 10px;
}

.delivery-form-row > label {
    margin-bottom: 0;
}

.delivery-form-toggle-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.delivery-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    background: #fff;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.delivery-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.delivery-toggle input:focus-visible + span {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
    border-radius: 999px;
}

.delivery-toggle:has(input:checked) {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.delivery-toggle input:checked + span {
    color: #fff;
}

.delivery-toggle input:checked + span::before {
    opacity: 1;
}

.delivery-toggle span {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.delivery-toggle span::before {
    content: '';
    position: absolute;
    inset: -6px -10px;
    border-radius: 999px;
    background: #2563eb;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.2s ease;
}

.delivery-form-timeframe {
    align-items: flex-start;
}
.delivery-timeframe-label {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.delivery-timeframe-label label {
    margin-bottom: 0;
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #111827;
}

.delivery-timeframe-inputs {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.delivery-timeframe-inputs input {
    max-width: 120px;
}

.delivery-timeframe-separator {
    font-size: 13px;
    color: #6b7280;
}

.delivery-timeframe-presets {
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
}

.delivery-timeframe-presets .delivery-chip {
    padding: 2px 6px;
    font-size: 10px;
    line-height: 1;
}

.delivery-form-emphasis input {
    border-color: #2563eb;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.2);
}


.delivery-details-notes {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.delivery-note-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.delivery-note-block textarea {
    height: auto;
    min-height: 64px;
    padding: 4px 6px;
}

.delivery-note-helper {
    margin-left: 8px;
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
    display: inline;
}

@media (max-width: 1100px) {
    .delivery-body {
		grid-template-columns: 1fr;
        grid-template-rows: repeat(2, minmax(0, 1fr));
    }

    .delivery-address-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
     .delivery-modal {
        border-radius: 12px;
    }

    .delivery-address-grid {
        grid-template-columns: 1fr;
    }

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

    .delivery-timeframe-inputs {
        flex-wrap: wrap;
    }

    .delivery-schedule-week .delivery-calendar-grid,
    .delivery-schedule-month .delivery-calendar-grid {
        grid-template-columns: 1fr;
    }
}
.delivery-list,
.ticket-items-table,
.delivery-items-editor-table {
    font-family: inherit;
    font-size: var(--app-list-font-size);
    line-height: var(--app-list-line-height);
    letter-spacing: var(--app-list-letter-spacing);
    color: var(--app-list-color);
}
.delivery-search-control {
    align-items: center;
    display: inline-flex;
    flex: 0 1 220px;
    min-width: 180px;
    position: relative;
}

.delivery-search-control input {
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    color: #111827;
    font-size: 13px;
    font-weight: 600;
    height: 34px;
    min-width: 0;
    padding: 0 38px 0 12px;
    width: 100%;
}

.delivery-search-control input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
    outline: none;
}

.delivery-search-submit {
    align-items: center;
    background: #111827;
    border: 0;
    border-radius: 999px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    height: 26px;
    justify-content: center;
    position: absolute;
    right: 4px;
    width: 26px;
}

.delivery-schedule-week .delivery-calendar-grid {
    grid-auto-rows: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
}

.delivery-schedule-week .delivery-calendar-day {
    height: 100%;
}

.delivery-calendar-day-label {
    align-items: center;
    display: inline-flex;
    gap: 5px;
    min-width: 0;
}

.delivery-calendar-type-badges {
    align-items: center;
    display: inline-flex;
    gap: 3px;
    min-height: 12px;
}

.delivery-ticket-type-badge {
    align-items: center;
    background: #e0f2fe;
    border-radius: 999px;
    color: #0369a1;
    display: inline-flex;
    font-size: 9px;
    font-weight: 800;
    height: 12px;
    justify-content: center;
    line-height: 1;
    min-width: 12px;
    padding: 0 3px;
}

.delivery-ticket-type-badge-total {
    background: #111827;
    color: #fff;
    min-width: 18px;
}

.delivery-search-modal {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.2);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 48px);
    width: min(1000px, 100%);
}

.delivery-search-summary {
    color: #374151;
    font-size: 13px;
    font-weight: 600;
}

.delivery-search-table-wrap {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: auto;
}

.delivery-search-table {
    border-collapse: collapse;
    font-size: 13px;
    min-width: 760px;
    width: 100%;
}

.delivery-search-table th,
.delivery-search-table td {
    border-bottom: 1px solid #e5e7eb;
    padding: 9px 10px;
    text-align: left;
    vertical-align: top;
}

.delivery-search-table th {
    background: #f3f4f6;
    color: #374151;
    font-weight: 700;
    position: sticky;
    top: 0;
}

.delivery-search-table tbody tr {
    cursor: pointer;
}

.delivery-search-table tbody tr:hover,
.delivery-search-table tbody tr:focus-visible {
    background: #eff6ff;
    outline: none;
}

.delivery-ticket-type-badge.ticket-type-move {
    background: #fef3c7;
    color: #b45309;
}

.delivery-ticket-type-badge.ticket-type-pickup {
    background: #ede9fe;
    color: #6d28d9;
}

.delivery-ticket-type-badge.ticket-type-transfer {
    background: #d1fae5;
    color: #047857;
}
@media (max-width: 1100px) {
    .ticket-info-cards {
        grid-template-columns: 1fr;
    }

    .ticket-header {
        align-items: flex-start;
    }

    .ticket-product-summary {
        align-items: flex-end;
        flex-direction: column;
        gap: 4px;
    }
}
.delivery-ticket-print-area,
.delivery-print-spool {
    display: none;
}

.delivery-modal-footer-actions {
    align-items: center;
    display: inline-flex;
    gap: 10px;
}

.delivery-carrier-copy-option {
    align-items: center;
    color: #374151;
    cursor: pointer;
    display: inline-flex;
    font-size: 12px;
    font-weight: 600;
    gap: 6px;
    white-space: nowrap;
}

.delivery-carrier-copy-option input {
    margin: 0;
}

.delivery-modal-print {
    align-items: center;
    background: #111827;
    border: none;
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font-weight: 600;
    gap: 8px;
    padding: 10px 16px;
}

.delivery-modal-print:hover,
.delivery-modal-print:focus-visible {
    background: #1f2937;
}

.delivery-modal-print:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.delivery-print-sheet {
    background: #fff;
    color: #111827;
    font-family: "Segoe UI", Arial, sans-serif;
    line-height: 1.35;
    margin: 0 auto;
    max-width: 8.5in;
    min-height: 11in;
    padding: 0.35in;
}

.delivery-print-sheet *,
.delivery-print-sheet *::before,
.delivery-print-sheet *::after {
    box-sizing: border-box;
}

.delivery-print-header {
    align-items: flex-start;
    border-bottom: 3px solid #d1d5db;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    margin-left: -0.35in;
    margin-right: -0.35in;
    padding: 0 0.35in 18px;
    width: calc(100% + 0.7in);
}

.delivery-print-brand {
    color: #6b7280;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.delivery-print-header h1 {
    color: #111827;
    font-size: 22px;
    letter-spacing: 0.02em;
    margin: 4px 0 8px;
}

.delivery-print-header p {
    color: #374151;
    font-size: 15px;
    font-weight: 700;
    margin: 0;
}

.delivery-print-ticket-meta {
    border: 2px solid #111827;
    border-radius: 14px;
    min-width: 118px;
    padding: 12px 16px;
    text-align: center;
}

.delivery-print-ticket-meta span {
    color: #6b7280;
    display: block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.delivery-print-ticket-meta strong {
    color: #111827;
    display: block;
    font-size: 24px;
    margin-top: 4px;
}

.delivery-print-card-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 18px;
}

.delivery-print-card,
.delivery-print-panel,
.delivery-print-schedule-panel,
.delivery-print-footer {
    border: 1px solid #d1d5db;
    border-radius: 14px;
    overflow: hidden;
}

.delivery-print-card {
    min-height: 132px;
    padding: 14px;
}

.delivery-print-card h2,
.delivery-print-panel h2,
.delivery-print-footer h2 {
    color: #111827;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.11em;
    margin: 0 0 10px;
    text-transform: uppercase;
}

.delivery-print-card strong {
    display: block;
    font-size: 15px;
    margin-bottom: 8px;
}

.delivery-print-card span {
    color: #374151;
    display: block;
    font-size: 12px;
}

.delivery-print-schedule-panel {
    background: #fff;
    color: #000;
    margin-top: 18px;
    padding: 24px 28px;
    text-align: center;
}

.delivery-print-date {
    font-size: 44px;
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1.05;
}

.delivery-print-timeframe {
    font-size: 30px;
    font-weight: 800;
    margin-top: 8px;
}

.delivery-print-carrier {
    color: #000;
    font-size: 22px;
    font-weight: 800;
    margin-top: 4px;
}

.delivery-print-panel {
    margin-top: 18px;
    padding: 16px;
}

.delivery-print-items-table {
    border-collapse: collapse;
    font-size: 12px;
    width: 100%;
}

.delivery-print-items-table th,
.delivery-print-items-table td {
    border: 1px solid #d1d5db;
    padding: 9px 10px;
    text-align: left;
    vertical-align: top;
}

.delivery-print-items-table th {
    background: #f3f4f6;
    color: #111827;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.delivery-print-empty {
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    color: #64748b;
    padding: 16px;
    text-align: center;
}

.delivery-print-instructions ul {
    margin: 0;
    padding-left: 20px;
}

.delivery-print-instructions li {
    font-size: 14px;
    margin: 8px 0;
}

.delivery-print-footer {
    margin-top: 22px;
    padding: 16px;
}

.delivery-print-signature-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: 2fr 1.4fr 0.9fr;
    margin-top: 34px;
}

.delivery-print-signature-grid div {
    border-top: 1.5px solid #111827;
    min-height: 36px;
    padding-top: 8px;
}

.delivery-print-signature-grid span {
    color: #4b5563;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

@media print {
    @page {
        margin: 0.25in;
        size: letter;
    }

    body.delivery-ticket-printing {
        background: #fff !important;
    }

    body.delivery-ticket-printing > :not(.delivery-print-spool) {
        display: none !important;
    }

    .delivery-print-spool {
        display: block !important;
    }

    .delivery-print-spool .delivery-print-sheet {
        box-shadow: none;
        margin: 0;
        max-width: none;
        min-height: auto;
        padding: 0;
        width: 100%;
    }

    .delivery-print-card,
    .delivery-print-panel,
    .delivery-print-schedule-panel,
    .delivery-print-footer {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}
.delivery-module-nav {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding: 0 0 14px;
}

.delivery-module-nav-button {
    align-items: center;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    color: #4b5563;
    cursor: pointer;
    display: inline-flex;
    font-size: 13px;
    font-weight: 700;
    gap: 7px;
    min-height: 36px;
    padding: 0 13px;
}

.delivery-module-nav-button.is-active {
    background: #111827;
    border-color: #111827;
    color: #fff;
}

.delivery-secondary-body {
    height: 100%;
    min-height: 0;
}

.delivery-report-pane,
.delivery-rolodex-pane,
.delivery-placeholder-pane {
    height: 100%;
}

.delivery-report-header {
    align-items: flex-start;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    padding-bottom: 14px;
}

.delivery-report-header h3,
.delivery-carrier-form h3,
.delivery-placeholder-pane h3 {
    margin: 0 0 4px;
}

.delivery-report-header p,
.delivery-placeholder-pane p {
    color: #6b7280;
    margin: 0;
}

.delivery-report-controls {
    align-items: end;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.delivery-report-controls label,
.delivery-carrier-form label {
    color: #4b5563;
    display: flex;
    flex-direction: column;
    font-size: 12px;
    font-weight: 700;
    gap: 4px;
    text-transform: uppercase;
}

.delivery-report-controls input,
.delivery-report-controls select,
.delivery-carrier-form input,
.delivery-carrier-form textarea {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 8px 10px;
    text-transform: none;
}

.delivery-report-table .delivery-report-status {
    background: #eef2ff;
    border-radius: 999px;
    color: #3730a3;
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    margin: 1px;
    padding: 2px 7px;
}

.delivery-rolodex-pane {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 18px;
}

.delivery-carrier-list {
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: auto;
    padding-right: 18px;
}

.delivery-carrier-list-item {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 12px;
    text-align: left;
}

.delivery-carrier-list-item.is-active {
    border-color: #2563eb;
    box-shadow: inset 0 0 0 1px #2563eb;
}

.delivery-carrier-list-item span {
    color: #6b7280;
    font-size: 12px;
}

.delivery-carrier-form {
    display: grid;
    gap: 12px;
    max-width: 620px;
}

.delivery-carrier-form textarea {
    min-height: 110px;
}

.delivery-placeholder-pane {
    align-items: center;
    color: #374151;
    justify-content: center;
    text-align: center;
}

.delivery-placeholder-pane > i {
    color: #9ca3af;
    font-size: 46px;
    margin-bottom: 12px;
}

.delivery-rolodex-pane {
    gap: 14px;
}

.delivery-carrier-table-wrap {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

.delivery-carrier-table {
    font-size: 12px;
    min-width: 780px;
}

.delivery-carrier-table th,
.delivery-carrier-table td {
    padding: 7px 9px;
    vertical-align: middle;
}

.delivery-carrier-table-row {
    cursor: pointer;
}

.delivery-carrier-table-row:hover,
.delivery-carrier-table-row:focus-visible {
    background: #eff6ff;
    outline: none;
}

.delivery-carrier-table-row td:first-child {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.delivery-carrier-table-row td:first-child span {
    color: #6b7280;
    font-size: 11px;
}

.delivery-carrier-checkbox-cell {
    text-align: center;
}

.delivery-carrier-checkbox-cell input {
    accent-color: #2563eb;
    pointer-events: none;
}

.delivery-carrier-modal {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
    max-height: 92vh;
    max-width: 760px;
    overflow: auto;
    width: min(760px, calc(100vw - 32px));
}

.delivery-carrier-modal .delivery-carrier-form {
    max-width: none;
}

.delivery-carrier-form-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.delivery-carrier-flags {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.delivery-carrier-flags label {
    align-items: center;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 9px;
    flex-direction: row;
    gap: 7px;
    padding: 8px 10px;
    text-transform: none;
}

.delivery-carrier-flags input {
    accent-color: #2563eb;
}

@media (max-width: 780px) {
    .delivery-carrier-form-grid,
    .delivery-carrier-flags {
        grid-template-columns: 1fr;
    }
}

.delivery-form-signature {
    grid-column: 1 / -1;
}

.delivery-signature {
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #f9fafb;
    padding: 10px;
}

.delivery-signature img {
    display: block;
    width: 100%;
    max-height: 150px;
    object-fit: contain;
    background: #fff;
    border-radius: 8px;
}

.delivery-signature span {
    display: block;
    margin-top: 6px;
    color: #4b5563;
    font-size: 12px;
    font-weight: 700;
}

.delivery-signature-print {
    margin: 12px 0 18px;
}

.delivery-signature-print img {
    max-height: 90px;
}

.delivery-print-ticket-meta em {
    color: #047857;
    font-size: 11px;
    font-style: normal;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.ticket-delivery-alert { border: 1px solid #fecaca; border-left: 4px solid #dc2626; border-radius: 8px; background: #fef2f2; color: #991b1b; font-weight: 800; line-height: 1.35; margin: 10px 0 0; padding: 8px 10px; white-space: pre-wrap; }
.delivery-note-block-alert textarea { border-color: #fca5a5; }
.delivery-note-block-alert label { color: #991b1b; }

.delivery-print-heading-row {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
}

.delivery-print-header {
    flex-direction: column;
}

.delivery-print-brand,
.delivery-print-customer-meta {
    border: 1px solid #d1d5db;
    border-radius: 14px;
    padding: 12px 16px;
}

.delivery-print-brand span,
.delivery-print-customer-meta span {
    color: #6b7280;
    display: block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.delivery-print-brand strong,
.delivery-print-customer-meta strong {
    color: #111827;
    display: block;
    font-size: 15px;
    margin-top: 4px;
}

.delivery-print-logo {
    display: block;
    max-width: 0.95in;
    max-height: 0.65in;
    object-fit: contain;
    margin-bottom: 5px;
}
