/* ===================================
   BrandBees - Admin Styles
   Minimalistic & Clean Design
   =================================== */

/* --- CSS Variables --- */
:root {
    --brandbees-primary: #4361ee;
    --brandbees-primary-hover: #3651d4;
    --brandbees-primary-light: #eef2ff;
    --brandbees-primary-border: #c7d2fe;
    --brandbees-success: #10b981;
    --brandbees-success-light: #ecfdf5;
    --brandbees-danger: #ef4444;
    --brandbees-danger-light: #fef2f2;
    --brandbees-warning: #f59e0b;
    --brandbees-text: #1e293b;
    --brandbees-text-muted: #64748b;
    --brandbees-text-light: #94a3b8;
    --brandbees-bg: #f8fafc;
    --brandbees-white: #ffffff;
    --brandbees-border: #e2e8f0;
    --brandbees-border-light: #f1f5f9;
    --brandbees-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --brandbees-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    --brandbees-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --brandbees-radius: 8px;
    --brandbees-radius-sm: 6px;
    --brandbees-radius-lg: 12px;
    --brandbees-transition: all 0.2s ease;
}

/* --- Admin Wrapper --- */
.brandbees-delivery-slot-admin-wrapper {
    margin: 20px 20px 40px 0;
    max-width: 1200px;
}

.brandbees-delivery-slot-admin-wrapper .wp-heading-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 600;
    color: var(--brandbees-text);
    margin: 0 0 4px;
    padding: 0;
    line-height: 1.4;
}

.brandbees-delivery-slot-admin-wrapper hr.wp-header-end {
    display: none;
}

/* --- Main Navigation Tabs --- */
.brandbees-delivery-slot-nav-tabs.nav-tab-wrapper {
    border-bottom: 2px solid var(--brandbees-border);
    padding: 0;
    margin: 20px 0 0;
    display: flex;
    gap: 2px;
}

.brandbees-delivery-slot-nav-tabs .nav-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-bottom: 3px solid transparent;
    background: transparent;
    color: var(--brandbees-text-muted);
    font-size: 13.5px;
    font-weight: 500;
    margin: 0 0 -2px;
    cursor: pointer;
    transition: var(--brandbees-transition);
    text-decoration: none;
    border-radius: 0;
}

.brandbees-delivery-slot-nav-tabs .nav-tab:hover {
    color: var(--brandbees-primary);
    background: var(--brandbees-primary-light);
}

.brandbees-delivery-slot-nav-tabs .nav-tab.nav-tab-active {
    color: var(--brandbees-primary);
    border-bottom-color: var(--brandbees-primary);
    background: transparent;
    font-weight: 600;
}

.brandbees-delivery-slot-nav-tabs .nav-tab .dashicons,
.brandbees-delivery-slot-nav-tabs .nav-tab .brandbees-tab-icon {
    font-size: 18px;
    width: 18px;
    height: 18px;
    margin-top: 0 !important;
}

.brandbees-delivery-slot-nav-tabs .nav-tab.nav-tab-active .dashicons,
.brandbees-delivery-slot-nav-tabs .nav-tab.nav-tab-active .brandbees-tab-icon {
    color: var(--brandbees-primary);
}

/* Custom delivery icon via SVG mask (dashicons-truck doesn't exist in WP) */
.brandbees-icon-delivery {
    display: inline-block;
    width: 18px;
    height: 18px;
    background: currentColor;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='1' y='3' width='15' height='13'%3E%3C/rect%3E%3Cpolygon points='16 8 20 8 23 11 23 16 16 16 16 8'%3E%3C/polygon%3E%3Ccircle cx='5.5' cy='18.5' r='2.5'%3E%3C/circle%3E%3Ccircle cx='18.5' cy='18.5' r='2.5'%3E%3C/circle%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='1' y='3' width='15' height='13'%3E%3C/rect%3E%3Cpolygon points='16 8 20 8 23 11 23 16 16 16 16 8'%3E%3C/polygon%3E%3Ccircle cx='5.5' cy='18.5' r='2.5'%3E%3C/circle%3E%3Ccircle cx='18.5' cy='18.5' r='2.5'%3E%3C/circle%3E%3C/svg%3E");
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    vertical-align: middle;
}

/* Larger delivery icon for page headers */
.brandbees-icon-delivery-lg {
    display: inline-block;
    width: 24px;
    height: 24px;
    background: var(--brandbees-primary);
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='1' y='3' width='15' height='13'%3E%3C/rect%3E%3Cpolygon points='16 8 20 8 23 11 23 16 16 16 16 8'%3E%3C/polygon%3E%3Ccircle cx='5.5' cy='18.5' r='2.5'%3E%3C/circle%3E%3Ccircle cx='18.5' cy='18.5' r='2.5'%3E%3C/circle%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='1' y='3' width='15' height='13'%3E%3C/rect%3E%3Cpolygon points='16 8 20 8 23 11 23 16 16 16 16 8'%3E%3C/polygon%3E%3Ccircle cx='5.5' cy='18.5' r='2.5'%3E%3C/circle%3E%3Ccircle cx='18.5' cy='18.5' r='2.5'%3E%3C/circle%3E%3C/svg%3E");
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    vertical-align: middle;
}

/* --- Content Area --- */
.brandbees-delivery-slot-content-area {
    background: var(--brandbees-bg);
    padding: 28px;
    border: 1px solid var(--brandbees-border);
    border-top: none;
    border-radius: 0 0 var(--brandbees-radius) var(--brandbees-radius);
}

.tab-content-panel {
    display: none;
    animation: smartdsFadeIn 0.3s ease;
}

.tab-content-panel.active {
    display: block;
}

@keyframes smartdsFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Settings Cards --- */
.brandbees-settings-card {
    background: var(--brandbees-white);
    border: 1px solid var(--brandbees-border);
    border-radius: var(--brandbees-radius);
    box-shadow: var(--brandbees-shadow-sm);
    margin: 20px 0;
    padding: 20px;
    overflow: hidden;
}

.brandbees-settings-card h2 {
    font-size: 15px;
    font-weight: 600;
    color: var(--brandbees-text);
    margin: 0;
    padding: 16px 22px;
    border-bottom: 1px solid var(--brandbees-border);
    background: var(--brandbees-white);
    letter-spacing: -0.01em;
}

.brandbees-settings-card h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--brandbees-text);
    margin: 0 0 16px;
    padding: 0;
}

.brandbees-settings-card .form-table {
    margin: 16px 22px;
    padding: 8px 22px 16px;
}

.brandbees-settings-card .form-table th {
    padding: 14px 10px 14px 0;
    width: 240px;
    font-weight: 500;
    font-size: 13px;
    color: var(--brandbees-text);
    vertical-align: top;
    line-height: 1.5;
}

.brandbees-settings-card .form-table td {
    padding: 14px 10px;
    vertical-align: top;
}

.brandbees-settings-card .form-table p.description {
    color: var(--brandbees-text-muted);
    font-size: 12.5px;
    margin-top: 6px;
    line-height: 1.5;
}

/* --- Card Header with Actions --- */
.brandbees-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 22px;
    border-bottom: 1px solid var(--brandbees-border);
    background: var(--brandbees-white);
}

.brandbees-card-header h2 {
    margin: 0;
    padding: 0;
    border: none;
    background: none;
}

.brandbees-card-header p.description {
    color: var(--brandbees-text-muted);
    font-size: 12.5px;
    margin: 4px 0 0;
}

.brandbees-action-buttons {
    display: flex;
    gap: 8px;
}

.brandbees-action-buttons .button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.brandbees-action-buttons .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* --- Delivery Page Heading --- */
.brandbees-admin-wrap {
    margin: 0;
    max-width: 100%;
}

.brandbees-admin-wrap h1 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 6px;
    padding: 0;
    line-height: 1.4;
    color: var(--brandbees-text);
}

.brandbees-admin-wrap h1 .dashicons,
.brandbees-admin-wrap h1 .brandbees-icon-delivery-lg {
    color: var(--brandbees-primary);
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.brandbees-admin-wrap > p.description {
    color: var(--brandbees-text-muted);
    font-size: 13px;
    margin: 0 0 20px;
}

/* --- Toggle Switch --- */
.brandbees-toggle-switch,
.brandbees-delivery-slot-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    margin: 0;
    flex-shrink: 0;
}

.brandbees-toggle-switch input,
.brandbees-delivery-slot-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.brandbees-toggle-slider,
.brandbees-delivery-slot-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: background-color 0.25s ease;
    border-radius: 24px;
}

.brandbees-toggle-slider:before,
.brandbees-delivery-slot-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: var(--brandbees-white);
    transition: transform 0.25s ease;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

input:checked + .brandbees-toggle-slider,
input:checked + .brandbees-delivery-slot-slider {
    background-color: var(--brandbees-primary);
}

input:checked + .brandbees-toggle-slider:before,
input:checked + .brandbees-delivery-slot-slider:before {
    transform: translateX(20px);
}

/* --- Buttons --- */
.brandbees-admin-wrap .submit,
.brandbees-settings-card .submit {
    margin: 0;
    padding: 20px 22px;
}
.button.button-secondary {
    display: inline-flex !important;
    align-items: center;
}
.button.button-primary {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 16px !important;
    height: auto;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--brandbees-radius-sm);
    background: var(--brandbees-primary);
    border-color: var(--brandbees-primary);
    transition: var(--brandbees-transition);
}

.button.button-primary:hover,
.button.button-primary:focus {
    background: var(--brandbees-primary-hover);
    border-color: var(--brandbees-primary-hover);
}

.button.button-primary .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.button.button-primary.button-large {
    padding: 8px 22px !important;
    font-size: 13.5px;
}

/* Secondary buttons inside settings */
.brandbees-settings-card .button:not(.button-primary):not(.brandbees-delete-slot):not(.delete-holiday),
#cutoff-time-form .button:not(.button-primary),
#custom-labels-form .button:not(.button-primary),
#preparation-time-form .button:not(.button-primary):not(.delete-global-time):not(.delete-category-time):not(.delete-product-time) {
    border-radius: var(--brandbees-radius-sm);
    transition: var(--brandbees-transition);
    display: inline-flex !important;
    align-items: center;
}

.brandbees-settings-card .button:not(.button-primary):not(.brandbees-delete-slot):not(.delete-holiday):hover {
    border-color: var(--brandbees-primary);
    color: var(--brandbees-primary);
}

/* --- Weekday Selector --- */
.brandbees-weekday-selector-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.brandbees-selected-days {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 36px;
    padding: 8px;
    background: var(--brandbees-bg);
    border: 1px solid var(--brandbees-border);
    border-radius: var(--brandbees-radius-sm);
}

.brandbees-day-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    background: var(--brandbees-primary);
    color: var(--brandbees-white);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--brandbees-transition);
}

.brandbees-day-tag:hover {
    background: var(--brandbees-primary-hover);
}

.brandbees-day-tag .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* Dropdown */
.brandbees-dropdown-wrapper {
    position: relative;
}

.brandbees-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    background: var(--brandbees-white);
    border: 1px solid var(--brandbees-border) !important;
    color: var(--brandbees-text);
    cursor: pointer;
    border-radius: var(--brandbees-radius-sm);
    transition: var(--brandbees-transition);
    font-size: 13px;
}

.brandbees-dropdown-toggle:hover {
    border-color: var(--brandbees-primary) !important;
    color: var(--brandbees-primary);
}

.brandbees-dropdown-toggle .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    position: relative;
    top: 3px;
    color: var(--brandbees-text-muted);
}

.brandbees-dropdown-menu {
    /* position: absolute; */
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: var(--brandbees-white);
    border: 1px solid var(--brandbees-border);
    border-radius: var(--brandbees-radius-sm);
    box-shadow: var(--brandbees-shadow-md);
    min-width: 200px;
    max-height: 280px;
    overflow-y: auto;
    z-index: 1000;
}

.brandbees-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    cursor: pointer;
    transition: background 0.15s;
    margin: 0;
    font-size: 13px;
}

.brandbees-dropdown-item:hover {
    background: var(--brandbees-primary-light);
}

.brandbees-dropdown-item input[type="checkbox"] {
    margin: 0;
}

/* --- Slot Form --- */
.brandbees-slot-form {
    padding: 22px;
    background: var(--brandbees-bg);
    border: 1px dashed var(--brandbees-border);
    border-radius: var(--brandbees-radius-sm);
    margin: 20px 22px;
}

/* --- Slot Weekdays Checkbox Layout --- */
.brandbees-slot-weekdays-checkbox-wrapper {
    margin-bottom: 8px;
}

.brandbees-slot-weekdays-checkbox-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: var(--brandbees-white);
    border: 1px solid var(--brandbees-border);
    border-radius: var(--brandbees-radius-sm);
    max-width: 400px;
}

.brandbees-slot-weekday-checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    cursor: pointer;
    transition: background 0.15s;
    border-radius: 4px;
    margin: 0;
    font-size: 13px;
    color: var(--brandbees-text);
}

.brandbees-slot-weekday-checkbox-item:hover {
    background: var(--brandbees-primary-light);
}

.brandbees-slot-weekday-checkbox-item input[type="checkbox"] {
    margin: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.brandbees-slot-weekday-checkbox-item span {
    flex: 1;
    user-select: none;
}

.brandbees-slot-form h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--brandbees-text);
}

.brandbees-slot-form .dashicons {
    color: var(--brandbees-primary);
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.brandbees-slot-form .form-table th {
    width: 280px;
}

.brandbees-form-actions {
    padding: 16px 0 0;
    border-top: 1px solid var(--brandbees-border);
    margin-top: 16px;
    display: flex;
    gap: 8px;
}

/* --- Slots List --- */
.brandbees-slots-list {
    padding: 22px;
}

.brandbees-slots-list h3 {
    margin: 0 0 14px;
    font-size: 14px;
    font-weight: 600;
}

.brandbees-bulk-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 14px;
}

.brandbees-bulk-actions select {
    min-width: 140px;
    border-radius: var(--brandbees-radius-sm);
    border-color: var(--brandbees-border);
}

/* --- Tables (Slots, Holidays, etc.) --- */
#brandbees-slots-table,
#holidays-table,
#global-preparation-table,
#category-preparation-table,
#product-preparation-table {
    border: 1px solid var(--brandbees-border);
    border-radius: var(--brandbees-radius-sm);
    overflow: hidden;
    border-collapse: separate;
    border-spacing: 0;
}

#brandbees-slots-table th,
#holidays-table th,
#global-preparation-table th,
#category-preparation-table th,
#product-preparation-table th {
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--brandbees-text-muted);
    background: var(--brandbees-bg);
    border-bottom: 1px solid var(--brandbees-border);
    padding: 10px 14px;
}

#brandbees-slots-table td,
#holidays-table td,
#global-preparation-table td,
#category-preparation-table td,
#product-preparation-table td {
    vertical-align: middle;
    padding: 12px 14px;
    font-size: 13px;
    color: var(--brandbees-text);
    border-bottom: 1px solid var(--brandbees-border-light);
}

#brandbees-slots-table tbody tr:last-child td,
#holidays-table tbody tr:last-child td,
#global-preparation-table tbody tr:last-child td,
#category-preparation-table tbody tr:last-child td,
#product-preparation-table tbody tr:last-child td {
    border-bottom: none;
}

#brandbees-slots-table .check-column {
    width: 36px;
    padding-left: 14px;
}

#brandbees-slots-table tbody tr,
#holidays-table tbody tr {
    transition: background 0.15s;
}

#brandbees-slots-table tbody tr:hover,
#holidays-table tbody tr:hover {
    background: var(--brandbees-primary-light);
}

/* Table action buttons */
#brandbees-slots-table .button-small,
#holidays-table .button-small,
#global-preparation-table .button-small,
#category-preparation-table .button-small,
#product-preparation-table .button-small {
    padding: 3px 10px;
    font-size: 12px;
    height: auto;
    line-height: 1.6;
    border-radius: 4px;
    margin-right: 4px;
}

#brandbees-slots-table .button-small .dashicons,
#holidays-table .button-small .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    vertical-align: text-bottom;
}

/* Delete button styling */
.brandbees-delete-slot,
.delete-holiday,
.delete-global-time,
.delete-category-time,
.delete-product-time {
    color: var(--brandbees-danger) !important;
    border-color: var(--brandbees-danger) !important;
}

.brandbees-delete-slot:hover,
.delete-holiday:hover,
.delete-global-time:hover,
.delete-category-time:hover,
.delete-product-time:hover {
    background: var(--brandbees-danger) !important;
    color: var(--brandbees-white) !important;
}

/* --- No Items Messages --- */
.brandbees-no-slots,
.brandbees-no-holidays {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 28px 22px;
    margin: 20px 22px;
    background: var(--brandbees-bg);
    border: 1px dashed var(--brandbees-border);
    border-radius: var(--brandbees-radius-sm);
    color: var(--brandbees-text-muted);
    font-size: 13px;
}

.brandbees-no-slots .dashicons,
.brandbees-no-holidays .dashicons {
    color: var(--brandbees-primary);
    font-size: 20px;
    width: 20px;
    height: 20px;
    opacity: 0.7;
}

/* --- Preview Section --- */
.brandbees-preview-section {
    background: var(--brandbees-white);
    border: 1px solid var(--brandbees-border);
    border-radius: var(--brandbees-radius);
    box-shadow: var(--brandbees-shadow-sm);
    margin-top: 24px;
    overflow: hidden;
}

.brandbees-preview-section h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--brandbees-text);
    padding: 16px 22px;
    margin: 0;
    border-bottom: 1px solid var(--brandbees-border);
}

.brandbees-preview-section h2 .dashicons {
    color: var(--brandbees-primary);
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.brandbees-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    padding: 20px 22px;
}

.brandbees-preview-slot {
    padding: 12px 14px;
    background: var(--brandbees-primary-light);
    border: 1px solid var(--brandbees-primary-border);
    border-radius: var(--brandbees-radius-sm);
    text-align: center;
    transition: var(--brandbees-transition);
}

.brandbees-preview-slot:hover {
    box-shadow: var(--brandbees-shadow);
    transform: translateY(-1px);
}

.brandbees-preview-date {
    font-weight: 600;
    color: var(--brandbees-primary);
    margin-bottom: 4px;
    font-size: 13px;
}

.brandbees-preview-time {
    color: var(--brandbees-text-muted);
    font-size: 12px;
}

.brandbees-no-availability {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 22px;
    color: var(--brandbees-warning);
    font-size: 13px;
}

.brandbees-no-availability .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* --- Subtabs (Settings page inner tabs) --- */
.brandbees-delivery-slot-subtabs.nav-tab-wrapper {
    border-bottom: none;
    padding: 0;
    margin: 0 0 24px;
    display: flex;
    gap: 0;
    background: var(--brandbees-white);
    border-radius: var(--brandbees-radius);
    overflow: hidden;
    border: 1px solid var(--brandbees-border);
}

.brandbees-delivery-slot-subtabs .nav-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 11px 18px;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--brandbees-text-muted);
    font-size: 13px;
    font-weight: 500;
    margin: 0;
    cursor: pointer;
    transition: var(--brandbees-transition);
    text-decoration: none;
    border-radius: 0;
    border-right: 1px solid var(--brandbees-border-light);
    float: none;
}

.brandbees-delivery-slot-subtabs .nav-tab:last-child {
    border-right: none;
}

.brandbees-delivery-slot-subtabs .nav-tab:hover {
    color: var(--brandbees-primary);
    background: var(--brandbees-primary-light);
}

.brandbees-delivery-slot-subtabs .nav-tab.nav-tab-active {
    color: var(--brandbees-primary);
    background: var(--brandbees-primary-light);
    font-weight: 600;
    border-bottom-color: var(--brandbees-primary);
}

.brandbees-delivery-slot-subtabs .nav-tab .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.brandbees-delivery-slot-subcontent-area {
    margin-top: 0;
}

.brandbees-delivery-slot-subcontent-area .tab-content-panel.active {
    display: block !important;
}

/* --- Section Headers (inside subtabs) --- */
.brandbees-delivery-slot-section-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--brandbees-border);
}

.brandbees-delivery-slot-section-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 600;
    color: var(--brandbees-text);
}

.brandbees-delivery-slot-section-header .dashicons {
    margin-right: 0;
    color: var(--brandbees-primary);
    font-size: 22px;
    width: 22px;
    height: 22px;
}

.brandbees-delivery-slot-section-header p.description {
    color: var(--brandbees-text-muted);
    font-size: 13px;
    margin: 0;
}

/* --- Preparation Time Styles --- */
.preparation-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--brandbees-border-light);
}

.preparation-section h4 {
    margin: 16px 0 12px;
    font-size: 14px;
    color: var(--brandbees-text);
}

.preparation-type-select {
    border-radius: var(--brandbees-radius-sm) !important;
    border-color: var(--brandbees-border) !important;
    padding: 6px 10px !important;
    font-size: 13px !important;
}

#category-multiselect,
#product-multiselect {
    min-height: 180px;
    padding: 4px;
    border-radius: var(--brandbees-radius-sm);
    border-color: var(--brandbees-border);
}

#category-multiselect option,
#product-multiselect option {
    padding: 6px 8px;
    font-size: 13px;
}

#preparation-time-message,
#cutoff-time-message,
#custom-labels-message,
#delivery-settings-message,
#holiday-message {
    font-weight: 500;
    font-size: 13px;
}

/* Category/Product Entry Form */
#category-entry-form,
#product-entry-form {
    padding: 16px;
    background: var(--brandbees-bg);
    border: 1px solid var(--brandbees-border);
    border-radius: var(--brandbees-radius-sm);
    margin-bottom: 16px;
}

/* Selected Tags */
.selected-tags-box {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px;
    background: var(--brandbees-bg);
    border: 1px solid var(--brandbees-border);
    border-radius: var(--brandbees-radius-sm);
    min-height: 36px;
    align-items: center;
}

.selected-tag {
    display: inline-flex;
    align-items: center;
    background: var(--brandbees-white);
    border: 1px solid var(--brandbees-border);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    color: var(--brandbees-text);
    transition: var(--brandbees-transition);
}

.selected-tag:hover {
    border-color: var(--brandbees-primary);
    background: var(--brandbees-primary-light);
}

.remove-selected-tag {
    margin-left: 6px;
    cursor: pointer;
    color: var(--brandbees-danger);
    font-size: 15px;
    line-height: 1;
    font-weight: bold;
    padding-left: 4px;
}

.remove-selected-tag:hover {
    color: #dc2626;
}

/* --- Preparation Tag Wrapper --- */
.prep-tag-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    background: var(--brandbees-white);
    border: 1px solid var(--brandbees-border);
    border-radius: var(--brandbees-radius-sm);
    min-height: 40px;
    margin-top: 8px;
}

.prep-tag {
    display: inline-flex;
    align-items: center;
    background: var(--brandbees-bg);
    border: 1px solid var(--brandbees-border);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    color: var(--brandbees-text);
    transition: var(--brandbees-transition);
}

.prep-tag:hover {
    border-color: var(--brandbees-primary);
}

.tag-name {
    font-weight: 500;
    margin-right: 6px;
}

.prep-tag input[type="number"] {
    width: 50px !important;
    height: 22px !important;
    font-size: 11px !important;
    margin: 0 4px !important;
    padding: 0 4px !important;
    border-radius: 4px;
    border: 1px solid var(--brandbees-border);
}

.remove-tag {
    margin-left: 6px;
    cursor: pointer;
    color: var(--brandbees-danger);
    font-size: 16px;
    line-height: 1;
    font-weight: bold;
}

.remove-tag:hover {
    color: #dc2626;
}

/* Preparation table column styles */
#global-preparation-table .column-name,
#category-preparation-table .column-name,
#product-preparation-table .column-name {
    font-weight: 600;
}

#global-preparation-table .column-time,
#category-preparation-table .column-time,
#product-preparation-table .column-time {
    font-weight: 500;
}

#global-preparation-table .column-actions .button,
#category-preparation-table .column-actions .button,
#product-preparation-table .column-actions .button {
    margin-right: 4px;
}

#global-preparation-table .no-items,
#category-preparation-table .no-items,
#product-preparation-table .no-items {
    text-align: center;
    color: var(--brandbees-text-muted);
    font-style: italic;
}

#global-preparation-table .global-time-input,
#category-preparation-table .category-time-input,
#product-preparation-table .product-time-input {
    width: 90px;
    padding: 4px 8px;
    border-radius: 4px;
    border-color: var(--brandbees-border);
}

#category-preparation-table .category-names-edit,
#product-preparation-table .product-names-edit {
    padding: 4px;
}

#category-preparation-table .category-names-display,
#product-preparation-table .product-names-display {
    word-break: break-word;
}

/* --- Form Inputs (global override for plugin pages) --- */
.brandbees-settings-card input[type="text"],
.brandbees-settings-card input[type="number"],
.brandbees-settings-card input[type="date"],
.brandbees-settings-card input[type="time"],
.brandbees-settings-card select,
.brandbees-settings-card textarea,
#cutoff-time-form input[type="text"],
#cutoff-time-form input[type="time"],
#cutoff-time-form select,
#cutoff-time-form textarea,
#custom-labels-form input[type="text"],
#preparation-time-form select,
#preparation-time-form input[type="number"],
#preparation-time-form input[type="text"],
#brandbees-delivery-form input[type="text"],
#brandbees-delivery-form input[type="number"],
#brandbees-delivery-form input[type="time"],
#brandbees-delivery-form select {
    border-radius: var(--brandbees-radius-sm);
    border-color: var(--brandbees-border);
    padding: 6px 10px;
    font-size: 13px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.brandbees-settings-card input[type="text"]:focus,
.brandbees-settings-card input[type="number"]:focus,
.brandbees-settings-card input[type="date"]:focus,
.brandbees-settings-card input[type="time"]:focus,
.brandbees-settings-card select:focus,
.brandbees-settings-card textarea:focus,
#cutoff-time-form input:focus,
#cutoff-time-form select:focus,
#cutoff-time-form textarea:focus,
#custom-labels-form input:focus,
#preparation-time-form select:focus,
#preparation-time-form input:focus,
#brandbees-delivery-form input:focus,
#brandbees-delivery-form select:focus {
    border-color: var(--brandbees-primary);
    box-shadow: 0 0 0 1px var(--brandbees-primary);
    outline: none;
}

/* --- Cutoff / Custom Labels / Preparation forms --- */
#cutoff-time-form .form-table,
#custom-labels-form .form-table,
#preparation-time-form .form-table {
    margin: 0;
}

#cutoff-time-form .form-table th,
#custom-labels-form .form-table th,
#preparation-time-form .form-table th {
    padding: 14px 10px 14px 0;
    width: 220px;
    font-weight: 500;
    font-size: 13px;
    color: var(--brandbees-text);
}

#cutoff-time-form .form-table td,
#custom-labels-form .form-table td,
#preparation-time-form .form-table td {
    padding: 14px 10px;
}

#cutoff-time-form p.description,
#custom-labels-form p.description,
#preparation-time-form p.description {
    color: var(--brandbees-text-muted);
    font-size: 12.5px;
    margin-top: 6px;
}

/* --- Loading State --- */
.brandbees-loading {
    opacity: 0.5;
    pointer-events: none;
    position: relative;
}

.brandbees-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 2px solid var(--brandbees-border);
    border-top: 2px solid var(--brandbees-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- Sortable Helper --- */
.ui-sortable-helper {
    background: var(--brandbees-white);
    box-shadow: var(--brandbees-shadow-md);
    border-radius: var(--brandbees-radius-sm);
}

/* --- WordPress Notice Override --- */
.brandbees-admin-wrap .notice,
.brandbees-delivery-slot-content-area .notice {
    margin: 16px 0;
    border-radius: var(--brandbees-radius-sm);
}

/* --- jQuery UI Datepicker Styling --- */
/* Target the specific datepicker div that jQuery UI appends to body */
html body #ui-datepicker-div.ui-datepicker,
html body .ui-datepicker {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
    padding: 12px !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05) !important;
    z-index: 99999 !important;
    width: auto !important;
    min-width: 280px !important;
}

/* Datepicker header */
html body #ui-datepicker-div .ui-datepicker-header,
html body .ui-datepicker .ui-datepicker-header {
    position: relative !important;
    padding: 8px 40px !important;
    margin-bottom: 10px !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
}

/* Navigation arrows - positioned absolutely */
html body #ui-datepicker-div .ui-datepicker-prev,
html body #ui-datepicker-div .ui-datepicker-next,
html body .ui-datepicker .ui-datepicker-prev,
html body .ui-datepicker .ui-datepicker-next {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 28px !important;
    height: 28px !important;
    cursor: pointer !important;
    border-radius: 6px !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    transition: all 0.2s ease !important;
    text-indent: -9999px !important;
    overflow: hidden !important;
}

html body #ui-datepicker-div .ui-datepicker-prev,
html body .ui-datepicker .ui-datepicker-prev {
    left: 0 !important;
}

html body #ui-datepicker-div .ui-datepicker-next,
html body .ui-datepicker .ui-datepicker-next {
    right: 0 !important;
}

html body #ui-datepicker-div .ui-datepicker-prev:hover,
html body #ui-datepicker-div .ui-datepicker-next:hover,
html body .ui-datepicker .ui-datepicker-prev:hover,
html body .ui-datepicker .ui-datepicker-next:hover {
    background: #eef2ff !important;
    border-color: #4361ee !important;
}

/* Hide the default jQuery UI icon */
html body #ui-datepicker-div .ui-datepicker-prev .ui-icon,
html body #ui-datepicker-div .ui-datepicker-next .ui-icon,
html body .ui-datepicker .ui-datepicker-prev .ui-icon,
html body .ui-datepicker .ui-datepicker-next .ui-icon {
    display: none !important;
}

/* Custom arrow icons using ::after */
html body #ui-datepicker-div .ui-datepicker-prev::after,
html body #ui-datepicker-div .ui-datepicker-next::after,
html body .ui-datepicker .ui-datepicker-prev::after,
html body .ui-datepicker .ui-datepicker-next::after {
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: 8px !important;
    height: 8px !important;
    border: 2px solid #64748b !important;
    border-top: none !important;
    border-right: none !important;
    display: block !important;
}

html body #ui-datepicker-div .ui-datepicker-prev::after,
html body .ui-datepicker .ui-datepicker-prev::after {
    transform: translate(-30%, -50%) rotate(45deg) !important;
}

html body #ui-datepicker-div .ui-datepicker-next::after,
html body .ui-datepicker .ui-datepicker-next::after {
    transform: translate(-70%, -50%) rotate(-135deg) !important;
}

html body #ui-datepicker-div .ui-datepicker-prev:hover::after,
html body #ui-datepicker-div .ui-datepicker-next:hover::after,
html body .ui-datepicker .ui-datepicker-prev:hover::after,
html body .ui-datepicker .ui-datepicker-next:hover::after {
    border-color: #4361ee !important;
}

/* Month/Year title container - centered, inline */
html body #ui-datepicker-div .ui-datepicker-title,
html body .ui-datepicker .ui-datepicker-title {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    margin: 0 !important;
    line-height: 1.4 !important;
}

/* Month and Year spans (when not using dropdowns) */
html body #ui-datepicker-div .ui-datepicker-title span.ui-datepicker-month,
html body #ui-datepicker-div .ui-datepicker-title span.ui-datepicker-year,
html body .ui-datepicker .ui-datepicker-title span.ui-datepicker-month,
html body .ui-datepicker .ui-datepicker-title span.ui-datepicker-year {
    display: inline !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    margin: 0 !important;
}

/* Month and Year select dropdowns (when using changeMonth/changeYear) */
html body #ui-datepicker-div .ui-datepicker-title select,
html body .ui-datepicker .ui-datepicker-title select {
    display: inline-block !important;
    padding: 4px 8px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    background: #ffffff !important;
    color: #1e293b !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    margin: 0 2px !important;
    height: auto !important;
    line-height: normal !important;
}

html body #ui-datepicker-div .ui-datepicker-title select:hover,
html body #ui-datepicker-div .ui-datepicker-title select:focus,
html body .ui-datepicker .ui-datepicker-title select:hover,
html body .ui-datepicker .ui-datepicker-title select:focus {
    border-color: #4361ee !important;
    outline: none !important;
}

/* Datepicker calendar table */
html body #ui-datepicker-div table.ui-datepicker-calendar,
html body .ui-datepicker table.ui-datepicker-calendar {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 0 !important;
}

html body #ui-datepicker-div .ui-datepicker-calendar th,
html body .ui-datepicker .ui-datepicker-calendar th {
    padding: 8px 4px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    color: #64748b !important;
    text-transform: uppercase !important;
    text-align: center !important;
    background: transparent !important;
    border: none !important;
}

html body #ui-datepicker-div .ui-datepicker-calendar td,
html body .ui-datepicker .ui-datepicker-calendar td {
    padding: 2px !important;
    text-align: center !important;
    background: transparent !important;
    border: none !important;
}

html body #ui-datepicker-div .ui-datepicker-calendar td a,
html body #ui-datepicker-div .ui-datepicker-calendar td span.ui-state-default,
html body .ui-datepicker .ui-datepicker-calendar td a,
html body .ui-datepicker .ui-datepicker-calendar td span.ui-state-default {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
    font-size: 13px !important;
    color: #1e293b !important;
    text-decoration: none !important;
    border-radius: 6px !important;
    transition: all 0.2s ease !important;
    margin: auto !important;
    background: transparent !important;
    border: none !important;
}

html body #ui-datepicker-div .ui-datepicker-calendar td a:hover,
html body .ui-datepicker .ui-datepicker-calendar td a:hover {
    background: #eef2ff !important;
    color: #4361ee !important;
}

/* Today */
html body #ui-datepicker-div .ui-datepicker-today a,
html body #ui-datepicker-div .ui-datepicker-today .ui-state-default,
html body .ui-datepicker .ui-datepicker-today a,
html body .ui-datepicker .ui-datepicker-today .ui-state-default {
    background: #eef2ff !important;
    color: #4361ee !important;
    font-weight: 600 !important;
}

/* Selected/active date */
html body #ui-datepicker-div .ui-datepicker-calendar .ui-state-active,
html body .ui-datepicker .ui-datepicker-calendar .ui-state-active {
    background: #4361ee !important;
    color: #ffffff !important;
    font-weight: 600 !important;
}

/* Disabled dates / non-working days / holidays */
html body #ui-datepicker-div .ui-datepicker-calendar .ui-state-disabled,
html body #ui-datepicker-div .ui-datepicker-calendar .non-working-day,
html body #ui-datepicker-div .ui-datepicker-calendar .unavailable-day,
html body #ui-datepicker-div .ui-datepicker-calendar .holiday-day,
html body .ui-datepicker .ui-datepicker-calendar .ui-state-disabled,
html body .ui-datepicker .ui-datepicker-calendar .non-working-day,
html body .ui-datepicker .ui-datepicker-calendar .unavailable-day,
html body .ui-datepicker .ui-datepicker-calendar .holiday-day {
    opacity: 0.5 !important;
}

html body #ui-datepicker-div .ui-datepicker-calendar .ui-state-disabled span.ui-state-default,
html body .ui-datepicker .ui-datepicker-calendar .ui-state-disabled span.ui-state-default {
    color: #94a3b8 !important;
}

/* Other month dates */
html body #ui-datepicker-div .ui-datepicker-other-month,
html body .ui-datepicker .ui-datepicker-other-month {
    opacity: 0.35 !important;
}

/* Button pane (Close/Today buttons) */
html body #ui-datepicker-div .ui-datepicker-buttonpane,
html body .ui-datepicker .ui-datepicker-buttonpane {
    display: flex !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 10px 0 0 !important;
    margin-top: 10px !important;
    border-top: 1px solid #e2e8f0 !important;
    background: transparent !important;
}

html body #ui-datepicker-div .ui-datepicker-buttonpane button,
html body .ui-datepicker .ui-datepicker-buttonpane button {
    padding: 6px 16px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

html body #ui-datepicker-div .ui-datepicker-close,
html body .ui-datepicker .ui-datepicker-close {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    color: #1e293b !important;
}

html body #ui-datepicker-div .ui-datepicker-close:hover,
html body .ui-datepicker .ui-datepicker-close:hover {
    border-color: #4361ee !important;
    color: #4361ee !important;
}

html body #ui-datepicker-div .ui-datepicker-current,
html body .ui-datepicker .ui-datepicker-current {
    background: #4361ee !important;
    border: 1px solid #4361ee !important;
    color: #ffffff !important;
}

html body #ui-datepicker-div .ui-datepicker-current:hover,
html body .ui-datepicker .ui-datepicker-current:hover {
    background: #3651d4 !important;
    border-color: #3651d4 !important;
}

/* --- Responsive Design --- */
@media screen and (max-width: 782px) {
    .brandbees-delivery-slot-content-area {
        padding: 16px;
    }

    .brandbees-settings-card .form-table th,
    .brandbees-settings-card .form-table td,
    #cutoff-time-form .form-table th,
    #cutoff-time-form .form-table td,
    #custom-labels-form .form-table th,
    #custom-labels-form .form-table td,
    #preparation-time-form .form-table th,
    #preparation-time-form .form-table td {
        display: block;
        width: 100%;
        padding: 8px 0;
    }

    .brandbees-settings-card .form-table th {
        border-bottom: none;
        padding-bottom: 4px;
    }

    .brandbees-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .brandbees-action-buttons {
        width: 100%;
        flex-direction: column;
    }

    .brandbees-action-buttons .button {
        width: 100%;
        justify-content: center;
    }

    .brandbees-preview-grid {
        grid-template-columns: 1fr;
    }

    .brandbees-delivery-slot-nav-tabs.nav-tab-wrapper {
        flex-wrap: wrap;
    }

    .brandbees-delivery-slot-subtabs.nav-tab-wrapper {
        flex-direction: column;
    }

    .brandbees-delivery-slot-subtabs .nav-tab {
        border-right: none;
        border-bottom: 1px solid var(--brandbees-border-light);
    }

    #brandbees-slots-table,
    #holidays-table {
        font-size: 12px;
    }

    #brandbees-slots-table th,
    #brandbees-slots-table td,
    #holidays-table th,
    #holidays-table td {
        padding: 8px 6px;
    }
}
