/* Bootstrap + DataTables harmonised with dashboard shell */

.dashboard-content .table {
    --bs-table-bg: #fff;
    margin-bottom: 0;
}

.dashboard-content .dataTables_wrapper .row:first-child,
.dashboard-content .dataTables_wrapper .row:last-child {
    align-items: center;
    margin-bottom: 1rem;
    margin-top: 1rem;
}

.dashboard-content .dataTables_filter input,
.dashboard-content .dataTables_length select {
    border: 1px solid #d8dee6;
    border-radius: 8px;
    padding: 0.4rem 0.65rem;
}

.dashboard-content .page-item.active .page-link {
    background-color: #1e5eff;
    border-color: #1e5eff;
}

.dashboard-content .page-link {
    color: #1e5eff;
}

.inventory-thumb {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #f1f5f9;
}

.inventory-thumb-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 10px;
    background: #f1f5f9;
    color: #94a3b8;
    font-size: 0.68rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.1;
}

.dashboard-content .card {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.03);
}

.dashboard-content .card-inventory-table {
    width: 100%;
}

.dashboard-content .card-header {
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
    padding: 1.25rem 1.5rem;
}

.dashboard-content .card-body {
    padding: 1.5rem;
}

.dashboard-content .form-label {
    font-weight: 600;
    color: #334155;
}

.dashboard-content .form-control,
.dashboard-content .form-select {
    border-color: #d8dee6;
    border-radius: 8px;
    padding: 0.7rem 0.85rem;
}

.dashboard-content .form-control:focus,
.dashboard-content .form-select:focus {
    border-color: #1e5eff;
    box-shadow: 0 0 0 0.2rem rgba(30, 94, 255, 0.15);
}

.dashboard-content .input-group-text {
    background: #f8fafc;
    border-color: #d8dee6;
    color: #64748b;
    font-weight: 600;
}

.dashboard-content .btn-primary {
    background-color: #1e5eff;
    border-color: #1e5eff;
}

.dashboard-content .btn-primary:hover,
.dashboard-content .btn-primary:focus {
    background-color: #1649cc;
    border-color: #1649cc;
}

.dashboard-content .btn-outline-primary {
    color: #1e5eff;
    border-color: #1e5eff;
    background-color: #fff;
}

.dashboard-content .btn-outline-primary:hover,
.dashboard-content .btn-outline-primary:focus {
    color: #fff;
    background-color: #1e5eff;
    border-color: #1e5eff;
}

.dashboard-content .btn-outline-secondary {
    color: #64748b;
    border-color: #d8dee6;
    background-color: #fff;
}

.dashboard-content .btn-outline-secondary:hover,
.dashboard-content .btn-outline-secondary:focus {
    color: #334155;
    background-color: #f8fafc;
    border-color: #cbd5e1;
}

#inventory-table th.col-actions,
#inventory-table td.col-actions {
    min-width: 5.75rem;
    width: 5.75rem;
    white-space: nowrap;
}

#inventory-table td.col-actions {
    position: sticky;
    right: 0;
    z-index: 2;
    background: #fff;
    box-shadow: -8px 0 12px -10px rgba(15, 23, 42, 0.18);
}

#inventory-table thead th.col-actions {
    position: sticky;
    right: 0;
    z-index: 3;
    background: #fff;
}

.dashboard-content .inventory-actions {
    display: inline-flex;
    gap: 0.35rem;
    flex-shrink: 0;
}

.dashboard-content .btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    min-width: 2rem;
    padding: 0 !important;
    line-height: 1;
    flex-shrink: 0;
}

.dashboard-content .btn-icon .bi {
    font-size: 0.95rem;
    line-height: 1;
    pointer-events: none;
}

.pricing-rule-row {
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: none;
}

.pricing-rule-row .card-body {
    padding: 1.25rem;
}

.pricing-rules-section .form-check {
    min-height: auto;
}

.pricing-advanced-toggle {
    text-decoration: none;
}

.pricing-example {
    background: #f8fafc;
}

.delivery-settings-fields.is-disabled {
    opacity: 0.55;
}

.delivery-settings-fields.is-disabled input,
.delivery-settings-fields.is-disabled select,
.delivery-settings-fields.is-disabled textarea,
.delivery-settings-fields.is-disabled button {
    cursor: not-allowed;
}

.inventory-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    background: #f8fafc;
    min-height: 200px;
    padding: 1.25rem;
    transition: border-color 0.15s ease, background 0.15s ease;
    cursor: pointer;
}

.inventory-dropzone.dz-drag-hover {
    border-color: #1e5eff;
    background: #eff6ff;
}

.inventory-dropzone.dz-drag-hover .inventory-dropzone-prompt__icon {
    background: #dbeafe;
    transform: scale(1.05);
}

.inventory-dropzone .dz-message {
    margin: 0;
}

.inventory-dropzone-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.2rem;
    padding: 1.25rem 0.75rem;
    min-height: 148px;
    pointer-events: none;
}

.inventory-dropzone-prompt__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.75rem;
    height: 3.75rem;
    border-radius: 50%;
    background: #eff6ff;
    color: #1e5eff;
    font-size: 1.65rem;
    margin-bottom: 0.5rem;
    transition: background 0.15s ease, transform 0.15s ease;
}

.inventory-dropzone-prompt__title {
    margin: 0;
    color: #0f172a;
    font-size: 1rem;
    font-weight: 600;
}

.inventory-dropzone-prompt__subtitle {
    margin: 0;
    color: #64748b;
    font-size: 0.92rem;
}

.inventory-dropzone-prompt__hint {
    margin: 0.35rem 0 0;
    color: #94a3b8;
    font-size: 0.8rem;
}

.inventory-dropzone-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.inventory-dropzone.dz-started .inventory-dropzone-prompt {
    display: none;
}

.inventory-dropzone-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    color: #64748b;
    text-align: center;
}

.inventory-dropzone-message .bi {
    font-size: 2rem;
    color: #1e5eff;
    margin-bottom: 0.25rem;
}

.inventory-dropzone-message strong {
    color: #0f172a;
    font-size: 1rem;
}

.inventory-dropzone-message small {
    color: #94a3b8;
}

.inventory-dropzone .dz-preview {
    margin: 0;
}

.inventory-dropzone .dz-preview .dz-image {
    border-radius: 12px;
    overflow: hidden;
}

.inventory-dropzone .dz-preview .dz-remove {
    font-size: 0.82rem;
    color: #b42318;
    text-decoration: none;
    margin-top: 0.35rem;
}

.inventory-dropzone .dz-preview .dz-remove:hover {
    text-decoration: underline;
}

.inventory-dropzone .dz-error-message {
    font-size: 0.78rem;
}

.inventory-photo-grid img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.inventory-photo-grid .card-footer {
    background: #fff;
    border-top: 1px solid #f1f5f9;
}

.dashboard-content table.dataTable thead th {
    border-bottom: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.dashboard-content table.dataTable tbody td {
    vertical-align: middle;
    color: #0f172a;
}

.inventory-photo-grid .card {
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.03);
}

.dashboard-content .stat-card-bootstrap {
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.03);
}

.dashboard-content .stat-card-bootstrap .card-body {
    padding: 1.25rem;
}

.dashboard-content .stat-card-bootstrap .stat-label {
    margin-bottom: 0.15rem;
    font-size: 0.82rem;
    color: #64748b;
}

.dashboard-content .stat-card-bootstrap .stat-value {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.company-logo-preview {
    min-height: 140px;
    aspect-ratio: 4 / 3;
}

.company-logo-preview__image {
    display: block;
    max-width: 100%;
    max-height: 140px;
    object-fit: contain;
}

.company-settings-section .font-monospace {
    font-size: 0.9rem;
}

/* Inventory edit layout */

.inventory-edit-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 1.25rem;
    align-items: start;
}

.inventory-edit-column {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-width: 0;
}

.inventory-form-section.card .card-header {
    padding: 1.15rem 1.35rem 0.85rem;
}

.inventory-form-section.card .card-header .h5 {
    margin-bottom: 0;
}

.inventory-form-section .pricing-rules-section {
    padding-bottom: 1.35rem;
}

.inventory-edit-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #f1f5f9;
}

.inventory-danger-card {
    border-color: #fecaca;
    background: #fffafb;
}

.inventory-image-sortable {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
    gap: 0.75rem;
}

.inventory-image-item {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.45rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 14px;
    background: #fff;
    cursor: grab;
    transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.inventory-image-item:active {
    cursor: grabbing;
}

.inventory-image-item--ghost {
    opacity: 0.45;
}

.inventory-image-item--chosen {
    box-shadow: 0 12px 28px rgba(30, 94, 255, 0.18);
    border-color: #1e5eff;
    transform: scale(1.02);
}

.inventory-image-item__handle {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 0.95rem;
    line-height: 1;
}

.inventory-image-item__preview {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: #f1f5f9;
    aspect-ratio: 1;
}

.inventory-image-item__preview img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.inventory-image-item__badge {
    position: absolute;
    left: 0.35rem;
    bottom: 0.35rem;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.78);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.inventory-image-item__remove {
    width: 100%;
    padding-top: 0.2rem;
    padding-bottom: 0.2rem;
}

.inventory-media-empty {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 1rem 1.1rem;
    border-radius: 12px;
    background: #f8fafc;
    color: #64748b;
    font-size: 0.9rem;
}

.inventory-media-empty .bi {
    font-size: 1.25rem;
    color: #94a3b8;
}

.inventory-video-field .form-label {
    display: flex;
    align-items: center;
}

.inventory-detail-video {
    margin-top: 1rem;
    border-radius: 16px;
    overflow: hidden;
    background: #0f172a;
    aspect-ratio: 16 / 9;
}

.inventory-detail-video iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

@media (max-width: 1100px) {
    .inventory-edit-grid {
        grid-template-columns: 1fr;
    }
}

/* Bookings calendar */

.bookings-calendar-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.bookings-calendar-nav__label {
    min-width: 9rem;
    text-align: center;
    color: #0f172a;
    font-size: 0.95rem;
}

.bookings-calendar-grid {
    display: flex;
    flex-direction: column;
}

.bookings-calendar-row {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border-top: 1px solid #f1f5f9;
}

.bookings-calendar-row--head {
    background: #f8fafc;
    border-top: 0;
}

.bookings-calendar-cell {
    min-height: 7.5rem;
    padding: 0.55rem;
    border-right: 1px solid #f1f5f9;
    background: #fff;
    vertical-align: top;
}

.bookings-calendar-cell:last-child {
    border-right: 0;
}

.bookings-calendar-cell--head {
    min-height: auto;
    padding: 0.65rem 0.55rem;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-align: center;
}

.bookings-calendar-cell.is-outside {
    background: #fafbfd;
}

.bookings-calendar-cell.is-today {
    background: #f8fbff;
    box-shadow: inset 0 0 0 1px rgba(30, 94, 255, 0.18);
}

.bookings-calendar-day {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    margin-bottom: 0.45rem;
}

.bookings-calendar-day__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.65rem;
    height: 1.65rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
}

.bookings-calendar-cell.is-today .bookings-calendar-day__number {
    background: #1e5eff;
    color: #fff;
}

.bookings-calendar-day__count {
    font-size: 0.68rem;
    font-weight: 600;
    color: #64748b;
    background: #eef2f7;
    border-radius: 999px;
    padding: 0.1rem 0.4rem;
}

.bookings-calendar-events {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.bookings-calendar-event {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    padding: 0.35rem 0.45rem;
    border-radius: 8px;
    border: 0;
    border-left: 3px solid transparent;
    background: #fff7ed;
    color: #9a3412;
    text-decoration: none;
    font-size: 0.72rem;
    line-height: 1.25;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.booking-calendar-modal-details dt {
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 600;
}

.booking-calendar-modal-details dd {
    color: #0f172a;
    margin-bottom: 0.85rem;
}

.booking-calendar-modal-details dd:last-child {
    margin-bottom: 0;
}

.booking-calendar-modal-delivery {
    display: flex;
    gap: 0.85rem;
    padding: 1rem 1.1rem;
    border-radius: 14px;
    background: #eff6ff;
    border: 1px solid rgba(30, 94, 255, 0.14);
}

.booking-calendar-modal-delivery.is-collection {
    background: #f8fafc;
    border-color: rgba(15, 23, 42, 0.08);
}

.booking-calendar-modal-delivery.is-collection .booking-calendar-modal-delivery__icon {
    background: #eef2f7;
    color: #64748b;
}

.booking-calendar-modal-delivery__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    background: #dbeafe;
    color: #1e5eff;
    font-size: 1.15rem;
}

.booking-calendar-modal-delivery__label {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #64748b;
}

.booking-calendar-modal-delivery__postcode {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #0f172a;
}

.booking-calendar-modal-delivery.is-collection .booking-calendar-modal-delivery__postcode {
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: normal;
}

.booking-calendar-modal-delivery__address {
    white-space: pre-line;
    line-height: 1.45;
}

.booking-calendar-modal-delivery__charge {
    color: #334155;
    font-weight: 600;
}

.bookings-calendar-event:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    color: #9a3412;
}

.bookings-calendar-event--confirmed {
    background: #ecfdf3;
    color: #027a48;
    border-left-color: #12b76a;
}

.bookings-calendar-event--confirmed:hover {
    color: #027a48;
}

.bookings-calendar-event--pending {
    background: #fffaeb;
    color: #b54708;
    border-left-color: #f79009;
}

.bookings-calendar-event--pending:hover {
    color: #b54708;
}

.bookings-calendar-event--cancelled {
    background: #f8fafc;
    color: #64748b;
    border-left-color: #94a3b8;
    opacity: 0.85;
}

.bookings-calendar-event--cancelled:hover {
    color: #64748b;
}

.bookings-calendar-event__time {
    font-weight: 700;
    font-size: 0.68rem;
    letter-spacing: 0.02em;
}

.bookings-calendar-event__title {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bookings-calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    background: #fafbfd;
}

.bookings-calendar-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #64748b;
    font-size: 0.8rem;
}

.bookings-calendar-legend__swatch {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 3px;
}

.bookings-calendar-legend__swatch--pending {
    background: #f79009;
}

.bookings-calendar-legend__swatch--confirmed {
    background: #12b76a;
}

.bookings-calendar-legend__swatch--cancelled {
    background: #94a3b8;
}

/* Bookings delivery map */

.bookings-map-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.bookings-map-nav__label {
    min-width: 12rem;
    text-align: center;
    color: #0f172a;
    font-size: 0.95rem;
}

.bookings-map-card {
    overflow: hidden;
}

.bookings-map {
    width: 100%;
    min-height: 520px;
    background: #eef2f7;
}

.bookings-map-attribution {
    background: #fafbfd;
    border-top: 1px solid #f1f5f9;
}

.bookings-map-marker {
    background: transparent;
    border: 0;
}

.bookings-map-marker__dot {
    display: block;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.28);
}

.bookings-map-marker__depot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: #1e5eff;
    color: #fff;
    border: 2px solid #fff;
    box-shadow: 0 4px 12px rgba(30, 94, 255, 0.35);
    font-size: 0.85rem;
}

.bookings-map-list .list-group-item {
    padding: 0.85rem 1rem;
}

.bookings-map-popup__time {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.25rem;
}

.leaflet-container {
    font-family: inherit;
}

.bookings-map-route-summary {
    border-color: rgba(30, 94, 255, 0.18);
    background: #f8fbff;
}

.bookings-map-route-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.bookings-map-route-stat {
    padding: 0.75rem 0.85rem;
    border-radius: 12px;
    background: #fff;
    border: 1px solid rgba(30, 94, 255, 0.12);
}

.bookings-map-route-stat__label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 0.2rem;
}

.bookings-map-route-stat__value {
    display: block;
    font-size: 1.1rem;
    color: #0f172a;
    line-height: 1.2;
}

.bookings-map-item-distance.is-driving-distance {
    color: #1e5eff !important;
    font-weight: 600;
}

.bookings-map-route-summary #bookings-map-route-duration:not(:empty)::before {
    content: none;
}

.bookings-map-list .list-group-item.is-route-active {
    background: #f8fbff;
    box-shadow: inset 3px 0 0 #1e5eff;
}

.bookings-map-popup .btn + .btn {
    margin-left: 0;
}

@media (max-width: 900px) {
    .bookings-calendar-cell {
        min-height: 5.5rem;
        padding: 0.4rem;
    }

    .bookings-calendar-event__title {
        display: none;
    }

    .bookings-calendar-event {
        align-items: center;
        text-align: center;
        padding: 0.25rem;
    }

    .bookings-calendar-nav__label {
        min-width: auto;
        flex: 1;
    }
}
