/* Enhanced Staff Panel Page Specific Styles */

:root {
    --ui-zoom: 1;
}

body {
    --ui-vh: calc(100vh / var(--ui-zoom, 1));
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #ecf0f1;
    height: var(--ui-vh);
    min-height: var(--ui-vh);
    overflow: hidden;
    zoom: var(--ui-zoom);
}

@supports not (zoom: 1) {
    body {
        transform: scale(var(--ui-zoom));
        transform-origin: top left;
        --ui-vh: calc(100vh / var(--ui-zoom, 1));
        height: var(--ui-vh);
        min-height: var(--ui-vh);
    }
}

@supports (height: 100dvh) {
    body {
        --ui-vh: calc(100dvh / var(--ui-zoom, 1));
    }
}

.demo-mini-bar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 12px;
    background: rgba(15, 78, 163, 0.05);
    border: 1px solid rgba(15, 78, 163, 0.12);
    border-radius: 10px;
    margin-bottom: 12px;
    align-items: center;
}

.demo-mini-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.demo-mini-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.demo-pill {
    background: #0f4ea3;
    color: #fff;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    letter-spacing: 0.05em;
}

.btn-demo-action,
.btn-demo-ghost {
    border-radius: 999px;
    padding: 10px 18px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.btn-demo-action {
    background: #0f4ea3;
    color: #fff;
}

.btn-demo-ghost {
    background: transparent;
    border: 1px solid rgba(15, 78, 163, 0.4);
    color: #0f4ea3;
}

.btn-demo-action:hover,
.btn-demo-ghost:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-demo-action.is-busy,
.btn-demo-ghost.is-busy {
    opacity: 0.7;
    cursor: wait;
}

.demo-info-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1200;
}

.demo-info-modal.is-open {
    display: flex;
}

.demo-info-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
}

.demo-info-modal__dialog {
    position: relative;
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    width: min(420px, calc(100% - 32px));
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.demo-info-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.demo-info-modal__header h3 {
    margin: 0;
    font-size: 18px;
    color: #0f1b40;
}

.demo-info-modal__close {
    border: none;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #0f1b40;
}

.demo-info-modal__body {
    color: #0f1b40;
    font-size: 14px;
    line-height: 1.5;
}

.demo-info-modal__body ul {
    padding-left: 20px;
    margin: 8px 0 0;
}

.demo-info-modal__body li {
    margin-bottom: 6px;
}

.demo-info-modal__lead {
    margin: 0;
    font-weight: 600;
}

.demo-info-modal__footer {
    display: flex;
    justify-content: flex-end;
}

.staff-container {
    display: grid;
    grid-template-columns: 1fr 100px 200px 230px;
    height: var(--ui-vh);
    /* Prevent interior columns from causing page scroll */
    overflow: hidden;
    gap: 0;
}

/* Only WAITLIST visible (no reservations): merge the last two tracks */
.staff-container.has-waitlist:not(.has-reservations) {
    grid-template-columns: 1fr 100px 430px;
}

/* Only RESERVATIONS visible (no waitlist): give it the combined width */
.staff-container.has-reservations:not(.has-waitlist) {
    grid-template-columns: 1fr 100px 430px;
}

/* Neither visible: collapse to just map + empty-tables */
.staff-container:not(.has-waitlist):not(.has-reservations) {
    grid-template-columns: 1fr 100px;
}

/* remove the extra heavy divider when there's only one right column */
.staff-container.has-waitlist:not(.has-reservations) .waiting-queue-sidebar,
.staff-container.has-reservations:not(.has-waitlist) .reservations-sidebar {
    border-right: none;
}

.main-content {
    background-color: white;
    padding: 8px 15px;
    /* Fill column height and let map occupy remaining space */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 2px solid #bdc3c7;
}

.header {
    height: 0;
}

.header-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    margin-bottom: 8px;
}


.header h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    flex-shrink: 0;
}

.header-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    margin-left: auto;
}

.header-actions .form-inline {
    display: inline-block;
    margin: 0;
}

/* Utility to hide elements */
.hidden { display: none !important; }

/* Modal flexible footer layout previously inline-styled */
.modal-footer.modal-footer-flex {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Compact Map Navigation in Header */
.compact-map-navigation {
    display: flex;
    align-items: center;
    margin: 0 8px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    padding: 4px 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.map-nav-label {
    font-size: 14px;
    margin-right: 6px;
    opacity: 0.7;
}

.compact-map-buttons {
    display: flex;
    gap: 4px;
    align-items: center;
}

.compact-map-item {
    display: flex;
    align-items: center;
    position: relative;
}

.compact-map-button {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 80px;
    height: 32px;
    position: relative;
}

.compact-map-button:hover {
    background: linear-gradient(135deg, #e9ecef, #dee2e6);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.compact-map-button.active {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border-color: #1e7e34;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

.compact-map-button.sub-map {
    border-left: 3px solid #f39c12;
}

.compact-map-button.sub-map.active {
    border-left-color: #fd7e14;
}

.compact-map-name {
    font-weight: 600;
    flex: 1;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
}

.compact-table-count {
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.compact-map-button.active .compact-table-count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.compact-map-delete {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 2px;
    transition: all 0.2s ease;
    line-height: 1;
    padding: 0;
}

.compact-map-delete:hover {
    background: #c82333;
    transform: scale(1.1);
}

.compact-map-item:hover .compact-map-delete {
    opacity: 1;
}

.compact-map-delete {
    opacity: 0.7;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .compact-map-navigation {
        margin: 0 4px;
        padding: 3px 6px;
    }
    
    .compact-map-button {
        min-width: 70px;
        padding: 5px 8px;
        font-size: 11px;
    }
    
    .compact-map-name {
        max-width: 80px;
    }
    
    .map-nav-label {
        font-size: 12px;
        margin-right: 4px;
    }
    
    /* Hide edit controls on tablets */
    .edit-mode-controls,
    .zoom-controls {
        display: none !important;
        pointer-events: none !important;
    }
}

@media (max-width: 768px) {
    .compact-map-navigation {
        margin: 0 2px;
        padding: 2px 4px;
    }
    
    .compact-map-button {
        min-width: 60px;
        padding: 4px 6px;
        font-size: 10px;
        gap: 4px;
    }
    
    .compact-map-name {
        max-width: 60px;
    }
    
    .compact-table-count {
        font-size: 9px;
        padding: 1px 4px;
    }
}

/* Capacity Tracker Styles */
.capacity-tracker {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    border: 2px solid #3498db;
    transition: all 0.3s ease;
    cursor: pointer;
    user-select: none;
    min-width: 80px;
    text-align: center;
    
    /* Touch-friendly sizing for tablets */
    min-height: 44px;  /* Apple's recommended touch target size */
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* Prevent zoom on double-tap for iOS */
    touch-action: manipulation;
}

.capacity-tracker:hover {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    border-color: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

#capacity-display {
    display: inline-block;
    white-space: nowrap;
}

#capacity-input {
    background: white;
    color: #2c3e50;
    border: 2px solid #3498db;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    width: 80px;
    
    /* Mobile-friendly input styling */
    min-height: 44px;
    box-sizing: border-box;
    
    /* Prevent zoom on focus for iOS */
    font-size: 16px; /* 16px+ prevents zoom on iOS */
    
    /* Touch-friendly */
    touch-action: manipulation;
}

#capacity-input:focus {
    outline: none;
    border-color: #2980b9;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

/* Capacity tracker animation for updates */
.capacity-tracker.updated {
    animation: capacityPulse 0.6s ease-in-out;
}

@keyframes capacityPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); background: linear-gradient(135deg, #27ae60, #2ecc71); }
    100% { transform: scale(1); }
}

/* Touch feedback for mobile devices */
.capacity-tracker .touching {
    background: linear-gradient(135deg, #1abc9c, #16a085) !important;
}

/* Active state for touch devices */
.capacity-tracker:active {
    transform: scale(0.95);
    background: linear-gradient(135deg, #1abc9c, #16a085);
}

/* Responsive adjustments for tablets */
@media (max-width: 768px) {
    .capacity-tracker {
        font-size: 18px;
        padding: 10px 18px;
        min-height: 48px;
    }
    
    #capacity-input {
        font-size: 18px;
        padding: 10px 14px;
        min-height: 48px;
        width: 90px;
    }
}

/* Large touch targets for phones */
@media (max-width: 480px) {
    .capacity-tracker {
        font-size: 20px;
        padding: 12px 20px;
        min-height: 52px;
    }
    
    #capacity-input {
        font-size: 20px;
        padding: 12px 16px;
        min-height: 52px;
        width: 100px;
    }
    
    /* Ensure edit controls are hidden on phones */
    .edit-mode-controls,
    .zoom-controls {
        display: none !important;
        pointer-events: none !important;
    }
    
    /* Enhanced mobile styling for small phones */
    .staff-container {
        padding: 5px;
        gap: 5px;
    }
    
    .header {
        padding: 8px;
        margin-bottom: 8px;
    }
    
    .header h1 {
        font-size: 16px;
    }
    
    .header-actions .btn {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .tables-map {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 8px;
        padding: 5px;
    }
    
    .table-item {
        width: 100px;
        height: 85px;
        min-width: 100px;
        border-radius: 10px;
    }
    
    .table-item.table-shape-circle {
        width: 105px;
        min-width: 105px;
        height: 78px;
        min-height: 78px;
    }
    
    .table-number {
        font-size: 14px;
        margin-bottom: 2px;
    }
    
    .table-capacity {
        font-size: 11px;
    }
    
    .table-duration {
        font-size: 9px;
        padding: 1px 4px;
        border-radius: 6px;
    }
    
    .compact-map-navigation {
        margin: 0 5px 8px 5px;
        padding: 6px;
    }
    
    .compact-map-button {
        min-width: 70px;
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .compact-map-name {
        max-width: 60px;
        font-size: 10px;
    }
    
    .compact-table-count {
        font-size: 9px;
        padding: 1px 4px;
    }
}

/* Unified button styling for all header buttons */
.btn-header {
    background: #3498db;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    transition: background-color 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-block;
    min-width: 70px;
    text-align: center;
    white-space: nowrap;
}

.btn-header:hover {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Specific color variants for different button types */
.btn-header.btn-primary {
    background: #3498db;
}

.btn-header.btn-primary:hover {
    background: #2980b9;
}

.btn-header.btn-public {
    background: #8e44ad;
}

.btn-header.btn-public:hover {
    background: #732d91;
}

.btn-header.btn-qr {
    background: #CD853F;
}

.btn-header.btn-qr:hover {
    background: #B8860B;
}

.btn-header.btn-haritalar {
    background: #9b59b6;
}

.btn-header.btn-haritalar:hover {
    background: #8e44ad;
}

.btn-header.btn-success {
    background: #27ae60;
}

.btn-header.btn-success:hover {
    background: #2ecc71;
}

.btn-header.btn-merge {
    background: #f39c12;
}

.btn-header.btn-merge:hover {
    background: #e67e22;
}

.btn-header.btn-merge:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-header.btn-logout {
    background: #e74c3c;
}

.btn-header.btn-logout:hover {
    background: #c0392b;
}

.btn-header.btn-warning {
    background: #f39c12;
}

.btn-header.btn-warning:hover {
    background: #e67e22;
}

.btn-header.btn-day-start {
    background: #16a34a;
}

.btn-header.btn-day-start:hover {
    background: #15803d;
}

.btn-header.btn-day-end {
    background: #dc2626;
}

.btn-header.btn-day-end:hover {
    background: #b91c1c;
}

.btn-header.is-busy {
    opacity: 0.7;
    cursor: wait;
}

.btn-header.btn-staff {
    background: #3498db;
}

.btn-header.btn-staff:hover {
    background: #2980b9;
}

/* Make all header buttons consistent size regardless of label length */
.header-actions .btn-header,
.header-actions .form-inline .btn-header {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    min-height: 36px;
    width: 150px;
    min-width: 150px;
    padding: 0 12px; /* vertical height driven by fixed height */
    line-height: 1;   /* prevent extra height from line-height */
    font-size: 14px;  /* unify label size */
    font-weight: 600; /* consistent emphasis */
}

/* Keep consistency for anchor and button variations */
.header-actions a.btn-header,
.header-actions button.btn-header {
    text-align: center;
}

/* Public links modal */
.public-links-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4000;
    transition: opacity 0.2s ease;
}

.public-links-modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.public-links-modal.visible {
    opacity: 1;
    pointer-events: auto;
}

.public-links-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
}

.public-links-card {
    position: relative;
    width: min(520px, 92%);
    background: #fff;
    border-radius: 20px;
    padding: 26px 32px;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.3);
    z-index: 1;
}

.public-links-card h3 {
    margin: 0;
    font-size: 22px;
    color: #111827;
}

.public-links-desc {
    color: #4b5563;
    font-size: 14px;
    line-height: 1.5;
    margin: 10px 0 20px;
}

.public-links-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: transparent;
    border: none;
    color: #6b7280;
    font-size: 22px;
    cursor: pointer;
}

.public-link-row {
    margin-bottom: 18px;
}

.public-link-row label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #111827;
}

.public-link-field {
    display: flex;
    gap: 8px;
    align-items: center;
}

.public-link-field input {
    flex: 1;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    font-size: 14px;
    color: #111827;
}

.btn-copy-link {
    border: none;
    background: #2563eb;
    color: #fff;
    font-weight: 600;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-copy-link:hover {
    background: #1d4ed8;
}

.public-links-hint {
    background: #f3f4f6;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 13px;
    color: #4b5563;
}

.public-links-footer {
    margin-top: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.public-links-status {
    font-size: 13px;
    color: #4b5563;
    min-height: 18px;
}

.public-links-status.info {
    color: #047857;
}

.public-links-status.error {
    color: #b91c1c;
}

.public-links-status.neutral {
    color: #4b5563;
}

.btn-rotate-link {
    border: none;
    background: #b91c1c;
    color: #fff;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-rotate-link:hover {
    background: #7f1d1d;
}

/* Slightly smaller fixed width on narrow screens so they wrap nicely */
@media (max-width: 1024px) {
    .header-actions .btn-header,
    .header-actions .form-inline .btn-header {
        width: 140px;
        min-width: 140px;
        height: 34px;
        min-height: 34px;
    }
}

@media (max-width: 768px) {
    .header-actions .btn-header,
    .header-actions .form-inline .btn-header {
        width: 130px;
        min-width: 130px;
        height: 34px;
        min-height: 34px;
    }
}

/* Legacy button classes for backward compatibility */
.btn-primary {
    background: #3498db;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: background-color 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-block;
    min-width: 80px;
    text-align: center;
    white-space: nowrap;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn-qr {
    background: #CD853F;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: background-color 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-block;
    min-width: 80px;
    text-align: center;
    white-space: nowrap;
}

.btn-qr:hover {
    background: #B8860B;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn-settings {
    background: #9b59b6;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: background-color 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-block;
    min-width: 80px;
    text-align: center;
    white-space: nowrap;
}

.btn-settings:hover {
    background: #8e44ad;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn-success {
    background: #27ae60;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    border: none;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: inline-block;
    min-width: 80px;
    text-align: center;
    white-space: nowrap;
}

.btn-success:hover {
    background: #2ecc71;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn-merge {
    background: #f39c12;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    border: none;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: inline-block;
    min-width: 80px;
    text-align: center;
    white-space: nowrap;
}

.btn-merge:hover {
    background: #e67e22;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn-merge:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.logout-btn {
    background: #e74c3c;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: background-color 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-block;
    min-width: 80px;
    text-align: center;
    white-space: nowrap;
}

.logout-btn:hover {
    background: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.control-panel {
    background-color: #f8f9fa;
    padding: 6px 8px;
    border-radius: 4px;
    margin-bottom: 6px;
}

.control-panel h3 {
    margin: 0 0 4px 0;
    color: #2c3e50;
    font-size: 12px;
    font-weight: 600;
}

.control-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 3px;
    flex-wrap: wrap;
}

.btn-start-day {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.btn {
    padding: 4px 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 11px;
    display: inline-block;
}

.btn-small {
    padding: 8px 12px;
    font-size: 13px;
    min-height: 32px;
    min-width: 60px;
}

.btn-fill {
    background-color: #27ae60;
    color: white;
}

.btn-empty {
    background-color: #e74c3c;
    color: white;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-group input {
    padding: 4px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 11px;
    width: 60px;
}

.control-group label {
    font-size: 11px;
    color: #555;
}

.tables-map {
    position: relative;
    background-color: #f8f9fa;
    border-radius: 8px;
    /* Make map fill available vertical space inside main-content */
    height: 100%;
    min-height: 0;
    flex: 1 1 auto;
    overflow: hidden;
    background-image: 
        radial-gradient(circle at 100px 100px, #ddd 2px, transparent 2px);
    
    /* Mobile touch improvements */
    touch-action: none; /* We handle all touch gestures ourselves */
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none; /* Prevent iOS callout menu */
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight */
    overscroll-behavior: contain; /* Prevent pull-to-refresh and overscroll */
    background-size: 200px 200px;
    border: 2px solid #ddd;
    cursor: grab;
    
    /* GPU acceleration for smooth scrolling */
    transform: translateZ(0);
    will-change: transform;
    
    /* Mobile optimization */
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
    /* Prevent text selection during panning */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.edit-mode-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 100;
    display: flex;
    gap: 10px;
}

/* Hide secondary edit buttons by default; JS will reveal in edit mode */
.btn-add-table,
.btn-add-object,
.btn-selection-mode {
    display: none;
}

.btn-edit-mode {
    background-color: #f39c12;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
}

.btn-edit-mode.active {
    background-color: #e67e22;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.btn-save-positions {
    background-color: #27ae60;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    display: none;
}

.btn-add-table {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
}

/* Zoom Controls */
.zoom-controls {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 100;
    display: flex;
    gap: 8px;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.btn-zoom {
    background-color: #34495e;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.btn-zoom:hover {
    background-color: #2c3e50;
}

.btn-zoom:active {
    transform: scale(0.95);
}

.btn-reset-zoom {
    background-color: #95a5a6;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    font-weight: bold;
    transition: background-color 0.2s;
}

.btn-reset-zoom:hover {
    background-color: #7f8c8d;
}

.zoom-level {
    font-size: 12px;
    font-weight: bold;
    color: #2c3e50;
    min-width: 40px;
    text-align: center;
}

/* Tables Container */
.tables-container {
    position: relative;
    width: 5000px;
    height: 5000px;
    cursor: grab;
    /* Ensure proper positioning context */
    transform-origin: top left;
    /* Prevent any unwanted overflow */
    overflow: visible;
    /* Smooth transform for momentum scrolling */
    will-change: transform;
    /* Remove transition during touch for instant feedback */
    transition: none;
}

/* Only apply transition when not touching (for programmatic animations) */
.tables-container.animate-transform {
    transition: transform 0.15s ease-out;
}

.tables-container:active {
    cursor: grabbing;
}

.tables-map:active {
    cursor: grabbing;
}

/* Visual feedback during panning */
.tables-map.panning {
    cursor: grabbing;
}

.tables-map.panning .tables-container {
    transition: none !important;
}

/* Visual feedback during zooming */
.tables-map.zooming {
    cursor: zoom-in;
}

.tables-map.zooming .tables-container {
    transition: none !important;
}

.btn-edit-table {
    position: absolute;
    top: -30px;
    left: calc(50% - 34px);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #3498db;
    color: white;
    border: 3px solid white;
    font-size: 13px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    pointer-events: auto;
    font-weight: bold;
}

.btn-delete-table {
    position: absolute;
    top: -30px;
    left: calc(50% + 6px);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #e74c3c;
    color: white;
    border: 3px solid white;
    font-size: 14px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    pointer-events: auto;
    font-weight: bold;
    line-height: 1;
}

.table-item.edit-mode .btn-edit-table {
    display: flex;
}

.table-item.edit-mode:hover .btn-edit-table {
    background: #2980b9;
    transform: scale(1.2);
    box-shadow: 0 6px 16px rgba(0,0,0,0.5);
}

.table-item.edit-mode .btn-delete-table {
    display: flex;
}

.table-item.edit-mode {
    touch-action: none;
}

.table-item.edit-mode:hover .btn-delete-table {
    background: #c0392b;
    transform: scale(1.2);
    box-shadow: 0 6px 16px rgba(0,0,0,0.5);
}

.table-item {
    width: 80px;
    height: 60px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 140ms linear, box-shadow 140ms linear, transform 140ms ease-out;
    border: none;
    position: absolute;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    user-select: none;
    will-change: background-color, transform, box-shadow;
    contain: layout paint style;
    
    /* Mobile touch optimization */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    
    /* GPU acceleration */
    transform: translateZ(0);
    backface-visibility: hidden;
}

.table-item.table-shape-rectangle {
    border-radius: 10px;
}

.table-item.table-shape-circle {
    border-radius: 50% / 65%;
    width: 90px;
    min-width: 90px;
    height: 64px;
    min-height: 64px;
    padding: 12px 8px 10px;
}

/* Table shape selection controls */
.shape-option-grid {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.shape-option {
    flex: 1;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    user-select: none;
}

.shape-option:hover {
    border-color: #3498db;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
    transform: translateY(-2px);
}

.shape-option.selected {
    border-color: #3498db;
    box-shadow: 0 4px 16px rgba(52, 152, 219, 0.25);
}

.shape-preview {
    width: 48px;
    height: 32px;
    background: #dfe6e9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shape-preview.shape-rectangle {
    border-radius: 8px;
}

.shape-preview.shape-oval {
    border-radius: 50% / 65%;
}

.table-item.occupied {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.3);
}

.table-item.empty {
    background: linear-gradient(45deg, #27ae60, #2ecc71);
    box-shadow: 0 4px 8px rgba(39, 174, 96, 0.3);
}

.table-item.cleaning {
    background: linear-gradient(45deg, #f0c419, #f39c12);
    box-shadow: 0 4px 8px rgba(243, 156, 18, 0.3);
}

.table-item:hover {
    transform: translateY(-2px) translateZ(0);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.table-item.selected {
    transform: scale(1.05);
    box-shadow: 0 0 0 3px #3498db;
    outline: 3px solid #3498db;
    outline-offset: 2px;
}

.table-item.dragging {
    transform: scale(1.1);
    z-index: 1000;
    cursor: grabbing !important;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    opacity: 0.9;
    transition: none !important;
    user-select: none;
    pointer-events: none;
}

.table-item.edit-mode {
    cursor: grab;
    border: none;
    transform: translateZ(0);
    box-shadow: 0 6px 16px rgba(243, 156, 18, 0.3), 0 0 0 3px #f39c12;
}

.table-item.edit-mode:hover {
    transform: scale(1.05) translateZ(0);
    box-shadow: 0 8px 20px rgba(230, 126, 34, 0.4), 0 0 0 3px #e67e22;
}

.table-item.edit-mode.selected,
.table-item.edit-mode.selected:hover {
    box-shadow: 0 0 0 3px #3498db, 0 6px 16px rgba(243, 156, 18, 0.3);
    outline: 3px solid #3498db;
    outline-offset: 2px;
}

.table-number {
    font-size: 14px;
    margin-bottom: 2px;
    line-height: 1;
    color: #ffffff;
    text-shadow:
        -0.5px 0 0 #000,
        0.5px 0 0 #000,
        0 -0.5px 0 #000,
        0 0.5px 0 #000;
}

.table-capacity {
    font-size: 9px;
    opacity: 0.9;
    line-height: 1;
}

.table-duration {
    font-size: 8px;
    opacity: 0.8;
    margin-top: 1px;
    line-height: 1;
}

.reservation-label {
    margin-top: 4px;
    font-size: 10px;
    font-weight: 800;
    background: #1f6feb;
    color: #fff;
    padding: 4px 6px;
    border-radius: 8px;
    width: 92px;
    line-height: 1.05;
    display: block;
    text-align: center;
    box-shadow: 0 2px 6px rgba(31,111,235,0.35);
}

.reservation-label .resv-time { display:block; font-size:11px; letter-spacing:0.3px; }
.reservation-label .resv-name { display:block; font-size:10px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* Checkbox removed */

.sidebar {
    background-color: white;
    padding: 8px;
    overflow: hidden;
    border-right: 1px solid #ecf0f1;
    height: 100%;
    min-height: 100%;
    min-width: 0;
    /* Keep sidebar height in sync with zoom-adjusted page height */
    max-height: var(--ui-vh, 100dvh);
    -webkit-overflow-scrolling: touch;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    overscroll-behavior: contain;
    scroll-behavior: smooth;
}

.empty-tables-sidebar {
    background-color: #e8f5e8;
    -webkit-overflow-scrolling: touch;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    display: flex;
    flex-direction: column;
}

.waiting-queue-sidebar {
    background-color: #fdf2e9;
    -webkit-overflow-scrolling: touch;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.reservations-sidebar {
    background-color: #eef4ff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.reservations-header {
    position: sticky;
    top: 0;
    background-color: #eef4ff;
    z-index: 10;
    padding: 8px 4px 12px 4px;
    flex-shrink: 0;
}

.reservations-title {
    margin: 0 0 8px 0;
    font-size: 16px;
    text-align: center;
    color: #1f6feb;
    font-weight: bold;
}

.selected-date-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 10px;
    background: white;
    border-radius: 6px;
    font-size: 0.85em;
    border: 1px solid #cfe2ff;
    margin: 0 8px;
}

.selected-date-indicator .date-label {
    color: #6c757d;
    font-weight: 500;
}

.selected-date-indicator .date-value {
    color: #2c3e50;
    font-weight: 600;
}

.selected-date-indicator .date-value.is-today {
    color: #27ae60;
}

.selected-date-indicator .date-value.is-future {
    color: #2f80ed;
}

.selected-date-indicator .date-value.is-past {
    color: #e67e22;
}

.reservations-container { 
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

#reservations-container {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    padding-bottom: 20px;
}
.reservation-item { background:#fff; padding:10px; border-radius:6px; margin-bottom:8px; border-left:4px solid #1f6feb; touch-action: pan-y; }
.reservation-header { margin-bottom:8px; }
.reservation-name { font-weight:600; color:#2c3e50; font-size:16px; }
.reservation-meta { font-size:12px; color:#6c757d; }
.reservation-badges { display:flex; gap:6px; flex-wrap:wrap; align-items:center; }
.reservation-badge { display:inline-block; padding:4px 8px; border-radius:999px; font-size:12px; font-weight:600; }
.reservation-badge.datetime { background:#eef5ff; color:#1f6feb; border:1px solid #cfe2ff; }
.reservation-badge.phone { background:#f6ffed; color:#237804; border:1px solid #d9f7be; }
.reservation-badge.people { background:#fff7e6; color:#ad6800; border:1px solid #ffe7ba; }
.reservation-details { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:8px; }
.reservation-status { font-size:11px; color:#555; margin-bottom:6px; }
.reservation-actions { display:flex; gap:6px; flex-wrap:wrap; }

.reservation-name,
.customer-name,
.customer-details,
.reservation-badge.phone {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.empty-tables-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0; /* Important for flex child scrolling */
}

.empty-tables-box h3,
.empty-tables-title {
    margin: 0 0 8px 0;
    font-size: 14px;
    text-align: center;
    position: sticky;
    top: 0;
    background-color: #e8f5e8;
    padding: 8px 4px;
    z-index: 10;
    flex-shrink: 0;
}

/* Empty tables list container */
#bosMasalarList,
[data-bos-masalar] {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-bottom: 20px;
}

.waiting-queue-sidebar h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    text-align: center;
    position: sticky;
    top: 0;
    background-color: #fdf2e9;
    padding: 8px 4px;
    z-index: 10;
    flex-shrink: 0;
}

/* Ensure waiting queue container has proper height and scrolling */
.waiting-queue-sidebar .queue-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    min-height: 0; /* Important for flex child scrolling */
}

#queue-container {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    padding-bottom: 20px;
}

.empty-table-item {
    background-color: white;
    padding: 6px;
    border-radius: 4px;
    margin-bottom: 4px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-table-item:hover {
    border-color: #27ae60;
    transform: scale(1.05);
}

/* Merged table styles removed */
.merge-info {
    font-size: 11px;
    color: #6c757d;
    font-weight: normal;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.queue-item {
    background-color: white;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 10px;
    border-left: 4px solid #e74c3c;
    display: flex;
    align-items: stretch;
    position: relative;
    transition: all 0.2s ease;
    touch-action: pan-y;
}

.queue-item.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 1000;
}

.queue-item.drag-over {
    border-top: 3px solid #3498db;
    margin-top: 15px;
}

.drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    color: #95a5a6;
    cursor: grab;
    font-size: 12px;
    margin-right: 8px;
    user-select: none;
}

.drag-handle:hover {
    color: #34495e;
}

.drag-handle:active {
    cursor: grabbing;
}

.queue-content {
    flex: 1;
}

.queue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.customer-name {
    font-weight: bold;
    color: #2c3e50;
}

.waiting-time {
    background-color: #e74c3c;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
}

.customer-details {
    font-size: 12px;
    color: #7f8c8d;
    margin-bottom: 8px;
}

.masa-ver-btn {
    background-color: #3498db;
    color: white;
}

.btn-haritalar {
    background-color: #9b59b6;
    color: white;
    transition: all 0.3s ease;
}

.btn-haritalar:hover {
    background-color: #8e44ad;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(155, 89, 182, 0.3);
}

.btn-delete {
    background-color: #e67e22;
    color: white;
}

.flash-messages {
    margin-bottom: 6px;
}

.flash-message {
    padding: 6px 8px;
    border-radius: 4px;
    margin-bottom: 4px;
    font-size: 13px;
}

.flash-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.flash-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.flash-message.warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

@media (max-width: 1180px) {
    /* Keep tablet layout in one row; never wrap sidebars to a new row */
    .staff-container.has-waitlist.has-reservations {
        grid-template-columns: minmax(0, 1fr) 80px 170px 190px;
    }

    .staff-container.has-waitlist:not(.has-reservations),
    .staff-container.has-reservations:not(.has-waitlist) {
        grid-template-columns: minmax(0, 1fr) 80px 360px;
    }

    .staff-container:not(.has-waitlist):not(.has-reservations) {
        grid-template-columns: minmax(0, 1fr) 80px;
    }

    .main-content {
        min-width: 0;
    }
}

@media (max-width: 640px) {
    .staff-container {
        grid-template-columns: 1fr;
        height: auto;
        gap: 10px;
        padding: 10px;
    }
    
    .header {
        padding: 10px;
        margin-bottom: 10px;
    }
    
    .header h1 {
        font-size: 18px;
    }
    
    .header-actions {
        gap: 8px;
    }
    
    .header-actions .btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .tables-map {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 12px;
        padding: 10px;
        overflow-x: hidden;
    }
    
    .table-item {
        width: 120px;
        height: 100px;
        min-width: 120px;
        border-radius: 12px;
        font-size: 14px;
        /* Prevent overlap by ensuring minimum spacing */
        margin: 5px;
        box-sizing: border-box;
    }
    
    .table-number {
        font-size: 16px;
        font-weight: bold;
        margin-bottom: 4px;
    }
    
    .table-capacity {
        font-size: 12px;
    }
    
    .table-duration {
        font-size: 10px;
        padding: 2px 6px;
        border-radius: 8px;
    }
    
    .compact-map-navigation {
        margin: 0 10px 10px 10px;
        padding: 8px;
    }
    
    .compact-map-button {
        min-width: 80px;
        padding: 8px 12px;
        font-size: 12px;
        border-radius: 8px;
    }
    
    .compact-map-name {
        max-width: 70px;
        font-size: 11px;
    }
    
    .compact-table-count {
        font-size: 10px;
        padding: 2px 6px;
    }
    
    /* Maintain absolute positioning but improve mobile experience */
    .tables-container {
        position: relative !important;
        width: 5000px !important;
        height: 5000px !important;
        padding: 10px;
        /* Ensure proper scaling on mobile */
        transform-origin: top left;
    }
    
    .tables-container .table-item {
        position: absolute !important;
        /* Keep original positioning but scale down for mobile */
        transform: scale(0.8) !important;
        /* Ensure tables remain clickable */
        min-width: 64px !important;
        min-height: 48px !important;
        /* Ensure proper z-index for touch interaction */
        z-index: 10 !important;
        /* Prevent transform conflicts */
        transform-origin: center center !important;
    }
}

/* Additional inline styles converted to classes */
.form-inline {
    display: inline;
}

.form-hidden {
    display: none;
}

.merged-table-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    background-color: #ecf0f1;
    margin-bottom: 8px;
    border-radius: 6px;
    font-size: 12px;
}

.empty-tables-title {
    color: #27ae60;
    font-weight: bold;
}

.table-size-info {
    font-size: 10px;
    color: #7f8c8d;
    margin-bottom: 1px;
}

.table-duration-info {
    font-size: 9px;
    color: #e67e22;
}

.table-info {
    text-align: center;
    line-height: 1.2;
}

.no-items-message {
    text-align: center;
    color: #7f8c8d;
    padding: 30px 20px;
    font-size: 12px;
}

.queue-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.waiting-list-title {
    color: #e74c3c;
    font-weight: bold;
}

.queue-actions {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.assign-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 1100;
    backdrop-filter: blur(2px);
}

.modal.hidden {
    display: none;
}

.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1105;
}

.modal-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px 28px;
    max-width: 420px;
    width: min(90vw, 420px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.modal-body {
    margin-bottom: 16px;
    font-size: 18px;
    color: #4b4b4b;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.map-delete-banner {
    margin: 16px auto;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid #f4cccc;
    background: #fde2e2;
    color: #a12222;
    font-weight: 600;
    text-align: center;
    max-width: 360px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08);
}

.map-delete-banner.hidden {
    display: none;
}

.map-delete-error {
    color: #c0392b;
    font-weight: 600;
    margin-top: 12px;
    font-size: 16px;
}

.map-delete-error.hidden {
    display: none;
}

/* Confirm modal footer layout */
.modal-footer-flex { display: flex; gap: 10px; justify-content: center; }

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 12px;
    min-width: 480px;
    max-width: 720px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

.modal-header {
    text-align: center;
    margin-bottom: 20px;
}

.modal-title {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 28px;
    font-weight: 600;
}

.modal-text {
    color: #7f8c8d;
    font-size: 20px;
    font-weight: 500;
    line-height: 1.4;
}

.modal-options {
    margin: 20px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
    align-content: flex-start;
}

/* Assign modal square tiles */
.modal-options .assign-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 88px;
    min-height: 88px;
    height: auto;
    border-radius: 8px;
    background-color: #27ae60;
    color: #fff;
    box-shadow: 0 6px 14px rgba(39, 174, 96, 0.35);
    padding: 8px 6px;
    border: none;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease;
    overflow: hidden;
}

.modal-options .assign-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 18px rgba(39, 174, 96, 0.42);
}

.modal-options .assign-option:active {
    transform: translateY(0);
}

.modal-options .assign-option .assign-number {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: .2px;
    line-height: 1;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal-options .assign-option .assign-size {
    font-size: 10px;
    opacity: .95;
    line-height: 1.1;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal-options .assign-option .assign-duration {
    font-size: 10px;
    font-weight: 700;
    color: #fcebd2;
    line-height: 1.1;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal-footer {
    text-align: center;
    border-top: 1px solid #ecf0f1;
    padding-top: 20px;
    margin-top: 20px;
}

.btn.danger {
    background: linear-gradient(135deg, #d64541, #c0392b);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn.danger:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(192, 57, 43, 0.35);
}

.btn.danger:disabled {
    opacity: 0.6;
    cursor: progress;
}

.btn-modal-cancel {
    background-color: #95a5a6;
    color: white;
    padding: 18px 34px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    min-height: 56px;
    min-width: 140px;
    transition: all 0.3s ease;
    touch-action: manipulation;
}

.btn-modal-cancel:hover {
    background-color: #7f8c8d;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(149, 165, 166, 0.3);
}

.btn-modal-cancel:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(149, 165, 166, 0.3);
}

/* Table Add Modal */
.add-table-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
}

.add-table-form {
    background: white;
    padding: 20px;
    border-radius: 8px;
    width: 400px;
    max-width: 90vw;
}

/* Table Edit Modal */
.edit-table-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
}

.edit-table-modal .modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    border-radius: 8px;
    width: 400px;
    max-width: 90vw;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.edit-table-modal .modal-header h3 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 20px;
}

.edit-table-form {
    background: white;
    border-radius: 8px;
}

.form-row {
    margin-bottom: 15px;
}

.form-row label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #2c3e50;
}

.form-row input, .form-row select {
    width: 100%;
    padding: 8px;
    border: 2px solid #ecf0f1;
    border-radius: 4px;
    font-size: 14px;
}

.form-row input:focus, .form-row select:focus {
    outline: none;
    border-color: #3498db;
}

.settings-extra-actions {
    padding: 0 24px 24px;
}

.modal-divider {
    margin: 0 -24px 20px;
    border-top: 1px solid #ecf0f1;
}

.test-customer-form {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-test-customer {
    background-color: #27ae60;
}

.btn-test-customer:hover {
    background-color: #1f8c4d;
}

.settings-reports-card {
    border: 1px solid #ecf0f1;
    border-radius: 8px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: #f9fbff;
}

.reports-title {
    font-weight: 600;
    margin: 0 0 4px;
    color: #2c3e50;
}

.reports-desc {
    margin: 0;
    color: #7f8c8d;
    font-size: 13px;
}

.btn-report-link {
    background-color: #34495e;
    color: #fff;
    padding: 8px 18px;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.btn-report-link:hover {
    background-color: #2c3e50;
}

.form-row .form-help,
.test-customer-form .form-help {
    display: block;
    margin-top: 4px;
    color: #7f8c8d;
    font-size: 12px;
}

.site-zoom-row .site-zoom-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.site-zoom-row input[type="range"] {
    flex: 1;
    accent-color: #3498db;
}

.site-zoom-value {
    min-width: 52px;
    text-align: right;
    font-weight: 600;
    color: #2c3e50;
}

/* Settings modal - scoped redesign */
#settingsModal.settings-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: none;
    overflow-y: auto;
    padding: 28px 16px;
}

#settingsModal .settings-modal-content {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    width: min(980px, calc(100vw - 32px));
    max-width: 980px;
    max-height: none;
    margin: 0 auto;
    padding: 0;
    border-radius: 18px;
    border: 1px solid #dbe4f0;
    box-shadow: none;
    overflow: hidden;
}

#settingsModal .settings-header {
    margin: 0;
    padding: 18px 22px;
    border-bottom: 1px solid #e5edf6;
    background: #eef4fb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
}

#settingsModal .settings-kicker {
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #3b82f6;
}

#settingsModal .modal-title {
    margin: 0;
    font-size: 30px;
    line-height: 1.1;
    color: #1e3a5f;
}

#settingsModal .settings-close-btn {
    width: 38px;
    height: 38px;
    border: 1px solid #bfd4ee;
    border-radius: 10px;
    background: #f7fafc;
    color: #1f4c7b;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
}

#settingsModal .settings-close-btn:hover {
    background: #f7fafc;
    border-color: #bfd4ee;
}

#settingsModal .settings-body {
    display: grid;
    gap: 14px;
    padding: 18px 22px;
}

#settingsModal .settings-section {
    position: relative;
    border: 1px solid #dce7f5;
    border-radius: 14px;
    background: #ffffff;
    padding: 14px 16px;
    box-shadow: none;
}

#settingsModal .settings-section::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 14px 0 0 14px;
    background: #3b82f6;
}

#settingsModal .settings-section:nth-of-type(1) {
    background: #eef4ff;
}

#settingsModal .settings-section:nth-of-type(1)::before {
    background: #3b82f6;
}

#settingsModal .settings-section:nth-of-type(2) {
    background: #fff3e2;
}

#settingsModal .settings-section:nth-of-type(2)::before {
    background: #f59e0b;
}

#settingsModal .settings-section:nth-of-type(3) {
    background: #edf9ef;
}

#settingsModal .settings-section:nth-of-type(3)::before {
    background: #22c55e;
}

#settingsModal .settings-section:nth-of-type(4) {
    background: #f3ecff;
}

#settingsModal .settings-section:nth-of-type(4)::before {
    background: #a855f7;
}

#settingsModal .settings-section-head {
    margin-bottom: 10px;
}

#settingsModal .settings-section-head h4 {
    margin: 0 0 4px;
    font-size: 22px;
    color: #1f3b60;
}

#settingsModal .settings-section-head p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
}

#settingsModal .settings-toggle-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    border-top: 1px dashed #d6e0ee;
    padding: 12px 0;
}

#settingsModal .settings-toggle-row:first-of-type {
    border-top: 0;
    padding-top: 0;
}

#settingsModal .settings-toggle-copy {
    display: grid;
    gap: 2px;
}

#settingsModal .settings-toggle-copy strong {
    color: #1f3d5b;
    font-size: 16px;
}

#settingsModal .settings-toggle-copy small {
    color: #64748b;
    font-size: 13px;
}

#settingsModal .settings-toggle-row input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    accent-color: #3b82f6;
    filter: none;
}

#settingsModal .settings-section:nth-of-type(1) .settings-toggle-row:nth-of-type(2) input[type="checkbox"] {
    accent-color: #a855f7;
    filter: none;
}

#settingsModal .site-zoom-row {
    margin-bottom: 0;
}

#settingsModal .settings-zoom-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

#settingsModal .settings-zoom-head label {
    margin: 0;
    font-size: 16px;
    color: #1f3d5b;
}

#settingsModal .settings-zoom-buttons {
    display: inline-flex;
    gap: 6px;
}

#settingsModal .zoom-nudge {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid #cbd9ea;
    background: #fff;
    color: #1f3d5b;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

#settingsModal #siteZoomMinusBtn {
    border-color: #f7c782;
    background: #fef3c7;
    color: #b45309;
}

#settingsModal #siteZoomPlusBtn {
    border-color: #93c5fd;
    background: #dbeafe;
    color: #1d4ed8;
}

#settingsModal .zoom-nudge:hover {
    transform: none;
    box-shadow: none;
}

#settingsModal .site-zoom-control {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 14px;
}

#settingsModal .site-zoom-row input[type="range"] {
    accent-color: #3b82f6;
}

#settingsModal .site-zoom-value {
    min-width: 58px;
    padding: 4px 10px;
    border-radius: 999px;
    text-align: center;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 14px;
    font-weight: 700;
}

#settingsModal .settings-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

#settingsModal .settings-action-card {
    border: 1px solid #d6e0ee;
    border-radius: 12px;
    padding: 12px;
    background: #fff;
}

#settingsModal .settings-action-card.test-customer-form {
    border-color: #a7e7bf;
    background: #effcf4;
}

#settingsModal .settings-action-card.import-reservations-form {
    border-color: #d3b3f8;
    background: #f6f0ff;
}

#settingsModal .settings-action-card.quick-nearest-action {
    border-color: #f6d89d;
    background: #fff8eb;
}

#settingsModal .settings-action-card.quick-public-links-action {
    border-color: #b8ccff;
    background: #eef4ff;
}

#settingsModal .settings-action-card.quick-manual-waitlist-action {
    border-color: #9fe0c1;
    background: #edf9f2;
}

#settingsModal .settings-action-card.quick-manual-reservation-action {
    border-color: #f7c6c5;
    background: #fff1f1;
}

#settingsModal .settings-shortcut-btn {
    width: 100%;
}

#settingsModal #resetWaitTimesBtn {
    background: #f59e0b;
    color: #fff;
    border: 0;
}

#settingsModal #resetWaitTimesBtn:hover {
    background: #d97706;
}

#settingsModal #openPublicLinksBtn {
    background: #2563eb;
    color: #fff;
    border: 0;
}

#settingsModal #openPublicLinksBtn:hover {
    background: #1d4ed8;
}

#settingsModal #manualAddWaitlistBtn {
    background: #16a34a;
    color: #fff;
    border: 0;
}

#settingsModal #manualAddWaitlistBtn:hover {
    background: #15803d;
}

#settingsModal #manualAddReservationBtn {
    background: #dc2626;
    color: #fff;
    border: 0;
}

#settingsModal #manualAddReservationBtn:hover {
    background: #b91c1c;
}

#settingsModal .btn-test-customer {
    background: #22c55e;
    box-shadow: none;
}

#settingsModal .btn-test-customer:hover {
    background: #22c55e;
}

#settingsModal #importReservationsBtn {
    background: #8b5cf6;
    color: #fff;
    border: 0;
    box-shadow: none;
}

#settingsModal #importReservationsBtn:hover {
    background: #8b5cf6;
}

#settingsModal .settings-action-card .form-help {
    margin-top: 8px;
    font-size: 13px;
}

#settingsModal .settings-reports-list {
    display: grid;
    gap: 10px;
}

#settingsModal .settings-reports-card {
    border: 1px solid #d6e0ee;
    border-radius: 12px;
    padding: 14px 16px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

#settingsModal .settings-reports-card:nth-child(1) {
    border-color: #b7d6ff;
    background: #f1f7ff;
}

#settingsModal .settings-reports-card:nth-child(2) {
    border-color: #d8c0fb;
    background: #f8f2ff;
}

#settingsModal .reports-title {
    margin: 0 0 4px;
    font-size: 16px;
}

#settingsModal .reports-desc {
    margin: 0;
    font-size: 13px;
}

#settingsModal .btn-report-link {
    border-radius: 10px;
    min-width: 112px;
    text-align: center;
    border: 0;
}

#settingsModal .settings-reports-card:nth-child(1) .btn-report-link {
    background: #3b82f6;
    box-shadow: none;
}

#settingsModal .settings-reports-card:nth-child(1) .btn-report-link:hover {
    background: #3b82f6;
}

#settingsModal .settings-reports-card:nth-child(2) .btn-report-link {
    background: #9333ea;
    box-shadow: none;
}

#settingsModal .settings-reports-card:nth-child(2) .btn-report-link:hover {
    background: #9333ea;
}

#settingsModal .settings-footer {
    margin-top: 2px;
    padding: 16px 22px 20px;
    border-top: 1px solid #e5edf6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    background: #fff;
}

#settingsModal .settings-footer-left,
#settingsModal .settings-footer-right {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

#settingsModal .settings-footer .btn-primary,
#settingsModal .settings-footer .btn-secondary,
#settingsModal .settings-footer .btn.danger {
    min-width: 118px;
    border-radius: 10px;
}

#settingsModal .btn-primary,
#settingsModal .btn-secondary,
#settingsModal .btn-report-link,
#settingsModal .zoom-nudge,
#settingsModal .btn.danger {
    box-shadow: none !important;
    text-shadow: none !important;
}

#settingsModal .btn-primary:hover,
#settingsModal .btn-secondary:hover,
#settingsModal .btn-report-link:hover,
#settingsModal .zoom-nudge:hover,
#settingsModal .btn.danger:hover {
    transform: none !important;
    box-shadow: none !important;
}

#settingsModal .settings-footer-left .btn-secondary {
    background: #8b5cf6;
    color: #fff;
    border: 0;
}

#settingsModal .settings-footer-left .btn-secondary:hover {
    background: #8b5cf6;
}

#settingsModal .settings-footer-right .btn-secondary {
    background: #64748b;
    color: #fff;
    border: 0;
}

#settingsModal .settings-footer-right .btn-secondary:hover {
    background: #64748b;
}

#settingsModal .settings-footer-right .btn-primary {
    background: #2563eb;
    color: #fff;
    border: 0;
    box-shadow: none;
}

#settingsModal .settings-footer-right .btn-primary:hover {
    background: #2563eb;
}

#settingsModal .settings-footer .btn.danger {
    background: #d64541;
    color: #fff;
    border: 0;
}

#settingsModal .settings-footer .btn.danger:hover {
    background: #d64541;
}

#settingsModal #importReservationsResult {
    margin-top: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    background: #f1f5f9;
}

/* Manual add popup modals (styled after QR + reservation forms) */
.manual-entry-modal {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.manual-entry-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 14, 28, 0.58);
}

.manual-entry-card {
    position: relative;
    width: min(95vw, 560px);
    max-height: min(90vh, 760px);
    overflow-y: auto;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 18px 52px rgba(15, 23, 42, 0.4);
    border: 1px solid #e4cfb4;
    padding: 16px;
}

.manual-entry-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 9px;
    background: #f7efe5;
    color: #8b4513;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.manual-entry-close:hover {
    background: #f1e3d4;
}

.manual-entry-header {
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 14px;
    background: linear-gradient(135deg, #8b4513 0%, #cd853f 100%);
    color: #fff6ec;
}

.manual-entry-kicker {
    margin: 0 0 4px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: rgba(255, 240, 221, 0.95);
}

.manual-entry-header h3 {
    margin: 0 0 6px;
    font-size: 22px;
    color: #fff;
}

.manual-entry-header p {
    margin: 0;
    font-size: 13px;
    color: rgba(255, 240, 221, 0.95);
}

.manual-entry-form {
    display: grid;
    gap: 12px;
}

.manual-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.manual-form-group {
    display: grid;
    gap: 7px;
}

.manual-form-group label {
    color: #8b4513;
    font-weight: 600;
    font-size: 13px;
}

.manual-form-group input,
.manual-form-group textarea {
    width: 100%;
    border: 2px solid #deb887;
    border-radius: 9px;
    background: #ffefd5;
    color: #5c2f0b;
    font-size: 15px;
    padding: 10px 12px;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.manual-form-group textarea {
    resize: vertical;
    min-height: 78px;
}

.manual-form-group input:focus,
.manual-form-group textarea:focus {
    outline: none;
    border-color: #cd853f;
    background: #ffffff;
}

.manual-form-group input::placeholder,
.manual-form-group textarea::placeholder {
    color: #a27049;
}

.manual-people-buttons {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
}

.manual-people-btn {
    border: 2px solid #deb887;
    background: #ffefd5;
    color: #8b4513;
    border-radius: 8px;
    padding: 9px 6px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.manual-people-btn:hover {
    background: #f4a460;
    border-color: #cd853f;
    color: #fff;
}

.manual-people-btn.active {
    background: #cd853f;
    border-color: #cd853f;
    color: #fff;
}

.manual-entry-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 4px;
}

.manual-cancel-btn {
    border: none;
    background: #d8e2eb;
    color: #334155;
    border-radius: 9px;
    padding: 10px 14px;
    font-weight: 700;
    cursor: pointer;
}

.manual-cancel-btn:hover {
    background: #c8d5e1;
}

.manual-submit-btn {
    border: none;
    background: linear-gradient(135deg, #cd853f 0%, #d2691e 100%);
    color: #fff;
    border-radius: 9px;
    padding: 10px 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.manual-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(205, 133, 63, 0.35);
}

.manual-submit-btn:disabled {
    opacity: 0.7;
    cursor: wait;
    transform: none;
    box-shadow: none;
}

@media (max-width: 900px) {
    #settingsModal .settings-action-grid {
        grid-template-columns: 1fr;
    }

    #settingsModal .settings-footer {
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    #settingsModal.settings-modal {
        padding: 12px 8px;
    }

    #settingsModal .settings-modal-content {
        width: calc(100vw - 16px);
    }

    #settingsModal .settings-header,
    #settingsModal .settings-body,
    #settingsModal .settings-footer {
        padding-left: 14px;
        padding-right: 14px;
    }

    #settingsModal .modal-title {
        font-size: 24px;
    }

    #settingsModal .settings-section-head h4 {
        font-size: 19px;
    }
}

@media (max-width: 640px) {
    .manual-entry-modal {
        padding: 10px;
    }

    .manual-entry-card {
        width: calc(100vw - 16px);
        max-height: min(92vh, 760px);
        padding: 12px;
    }

    .manual-entry-header h3 {
        font-size: 19px;
    }

    .manual-form-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .manual-people-buttons {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .manual-entry-actions {
        flex-direction: column;
    }

    .manual-cancel-btn,
    .manual-submit-btn {
        width: 100%;
    }
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.btn-primary {
    background-color: #3498db;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    min-width: 100px;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    min-width: 100px;
}

#resvConflictModal .btn-danger {
    background-color: #e74c3c;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    min-width: 100px;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

#resvConflictModal .btn-danger:hover {
    background-color: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#resvConflictModal .btn-danger:active {
    transform: translateY(0);
    box-shadow: none;
}

/* Real-time Updates Styles */





/* Queue Item Animations - Optimized */
.queue-item.fade-in {
    opacity: 0;
    transform: translateY(-10px) translateZ(0);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.queue-item.fade-in.visible {
    opacity: 1;
    transform: translateY(0) translateZ(0);
}

.queue-item.fade-out {
    opacity: 0;
    transform: translateY(-10px) translateZ(0);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Table Status Animations - Optimized for performance */
.table-item {
    transition: box-shadow .12s ease, transform .12s ease !important;
    will-change: transform, box-shadow;
}

/* Visually indicate pending network apply */
[data-table-id].pending {
    outline: 3px dashed rgba(0, 0, 0, 0.2);
    outline-offset: 2px;
}

/* Turn off transitions during batched updates */
.no-anim .table-item {
    transition: none !important;
}

/* Keep checkbox in DOM to prevent layout shifts; just hide it */
.table-checkbox.hidden-checkbox { opacity: 0; pointer-events: none; }

/* If you render many off-screen tiles, skip their rendering until visible */
.tables-container { content-visibility: auto; contain-intrinsic-size: 600px 400px; }

/* optional: isolate containers to reduce reflow cost */
.tables-container, .tables-map { 
    contain: strict; 
}



.table-item.table-empty,
.table-item.table-occupied,
.table-item.table-reserved { 
    background: unset; 
    border: none; 
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {

    
    /* Hide edit mode controls on mobile devices */
    .edit-mode-controls {
        display: none !important;
    }
    
    /* Hide zoom controls on mobile devices */
    .zoom-controls {
        display: none !important;
    }
    
    /* Make modal content mobile-friendly */
    .modal-content { min-width: 320px; max-width: 96vw; padding: 22px; margin: 10px; }
    .modal-title { font-size: 24px; }
    .modal-text { font-size: 18px; }
    .btn-modal-cancel { font-size: 18px; padding: 18px 26px; min-height: 56px; width: 100%; }
    .modal-options .assign-option { width: 90px; min-height: 90px; }
    .modal-options .assign-option .assign-number { font-size: 20px; }
    .modal-options .assign-option .assign-size { font-size: 12px; }
    .modal-options .assign-option .assign-duration { font-size: 12px; }
} 

/* Tablet enhancements */
@media (min-width: 769px) and (max-width: 1180px) {
    .modal-content { min-width: 540px; max-width: 860px; padding: 28px; }
    .modal-title { font-size: 30px; }
    .modal-text { font-size: 22px; }
    .modal-options .assign-option { width: 94px; min-height: 94px; }
    .modal-options .assign-option .assign-number { font-size: 22px; }
    .modal-options .assign-option .assign-size { font-size: 12px; }
    .modal-options .assign-option .assign-duration { font-size: 12px; }
    .btn-modal-cancel { font-size: 20px; min-height: 64px; min-width: 180px; }
}

.nearest-table-highlight {
    outline: 4px solid #ff9800 !important;
    box-shadow: 0 0 16px 6px #ff9800cc !important;
    z-index: 1000 !important;
    transition: outline 0.2s, box-shadow 0.2s;
} 

/* =============================================================================
   OBJECT MANAGEMENT STYLES
   ============================================================================= */

/* Add Object Modal */
.add-object-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.add-object-modal .modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

/* Object Type Selection Grid */
.object-type-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.object-type-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f8f9fa;
}

.object-type-option:hover {
    border-color: #3498db;
    background: #e3f2fd;
    transform: translateY(-2px);
}

.object-type-option.selected {
    border-color: #2ecc71;
    background: #e8f5e8;
}

.object-preview {
    width: 50px;
    height: 50px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Object Preview Shapes */
.triangle-preview {
    width: 0;
    height: 0;
    border-left: 25px solid transparent;
    border-right: 25px solid transparent;
    border-bottom: 43px solid #3498db;
    margin-bottom: 12px;
}

.square-preview {
    width: 45px;
    height: 45px;
    background-color: #3498db;
    border-radius: 4px;
}

.circle-preview {
    width: 45px;
    height: 45px;
    background-color: #3498db;
    border-radius: 50%;
}

.object-type-option span {
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
}

/* Add Object Button */
.btn-add-object {
    background-color: #9b59b6;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-right: 8px;
    transition: background-color 0.2s ease;
}

.btn-add-object:hover {
    background-color: #8e44ad;
}



/* Object Items on Map */
.object-item {
    position: absolute;
    cursor: pointer;
    user-select: none;
    z-index: 15;
    transition: transform 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 8px;
    min-height: 8px;
    /* background: rgba(255, 255, 255, 0.9); */ /* Removed to show only the colored shape */
    /* border: 1px solid #ddd; */ /* Removed to eliminate white border around objects */
    /* border-radius: 8px; */ /* Removed since no background or border */
    /* padding: 8px; */ /* Removed to eliminate extra spacing around objects */
}

/* Objects Container */
.objects-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 5000px;
    height: 5000px;
    pointer-events: none;
    transform-origin: 0 0;
    /* No transition - must stay in sync with tables container */
    transition: none;
    will-change: transform;
}

.objects-container .object-item {
    pointer-events: auto;
}

.object-item:hover {
    transform: scale(1.05);
}

.object-item.edit-mode {
    cursor: grab;
    border: 2px dashed #9b59b6;
    border-radius: 8px;
    padding: 8px;
    background: rgba(155, 89, 182, 0.1);
    touch-action: none;
}

.object-item.edit-mode:hover {
    border-color: #8e44ad;
    background: rgba(155, 89, 182, 0.2);
    cursor: grab;
    transform: none; /* Disable scale on hover in edit mode */
}

.object-item.edit-mode:active {
    cursor: grabbing;
}

.object-item.dragging {
    transform: scale(1.1);
    z-index: 1000;
    cursor: grabbing !important;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    opacity: 0.9;
    transition: none !important;
    user-select: none;
    pointer-events: none;
}

.object-item.resizing {
    z-index: 1000;
    transition: none !important;
    user-select: none;
}

/* Object Name Label */
.object-name-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    pointer-events: none;
    z-index: 20;
    white-space: nowrap;
    border: 1px solid rgba(0, 0, 0, 0.2);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

/* Object Shapes */
.object-shape {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
    width: 100%;
    height: 100%;
    min-width: 30px;
    min-height: 30px;
}

.object-shape.triangle {
    width: 0 !important;
    height: 0 !important;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-bottom: 35px solid;
    min-width: auto;
    min-height: auto;
}

.object-shape.square {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    min-width: 20px;
    min-height: 20px;
}

.object-shape.circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    min-width: 20px;
    min-height: 20px;
}

/* Object Control Buttons */
.btn-delete-object {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999; /* higher than any map/drag overlays */
    pointer-events: auto; /* ensure clicks are always captured */
}

.object-item.edit-mode .btn-delete-object {
    display: flex;
}

.btn-delete-object:hover {
    background-color: #c0392b;
    transform: scale(1.1);
}

.btn-delete-object:active {
    transform: scale(0.95);
}

/* Resize Handles */
.resize-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background-color: #3498db;
    border: 2px solid #fff;
    border-radius: 2px;
    display: none;
    z-index: 12;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.resize-handle:hover {
    opacity: 1;
    background-color: #2980b9;
}

.object-item.edit-mode .resize-handle {
    display: block;
}

.table-item.edit-mode .resize-handle {
    display: block;
}

/* Resize handle positions */
.resize-handle.nw {
    top: -6px;
    left: -6px;
    cursor: nw-resize;
}

.resize-handle.ne {
    top: -6px;
    right: -6px;
    cursor: ne-resize;
}

.resize-handle.sw {
    bottom: -6px;
    left: -6px;
    cursor: sw-resize;
}

.resize-handle.se {
    bottom: -6px;
    right: -6px;
    cursor: se-resize;
}

/* Object Modal Form Styles */
.object-selection .form-row {
    margin-bottom: 15px;
}

.object-selection label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #2c3e50;
}

.object-selection input[type="text"],
.object-selection select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.object-selection input[type="text"]:focus,
.object-selection select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}





/* Sub-Map Creation Styles */
.submap-controls {
    display: flex;
    gap: 10px;
    margin-left: 15px;
    border-left: 2px solid #e9ecef;
    padding-left: 15px;
}

.btn-selection-mode, .btn-create-submap {
    background-color: #17a2b8;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.btn-selection-mode:hover {
    background-color: #138496;
}

.btn-selection-mode.active {
    background-color: #dc3545;
    animation: none;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(220, 53, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}

.btn-create-submap {
    background-color: #28a745;
}

.btn-create-submap:hover {
    background-color: #218838;
    transform: translateY(-1px);
}

/* Selection Area */
.selection-area {
    border: 3px dashed #007bff !important;
    background-color: rgba(0, 123, 255, 0.2) !important;
    pointer-events: none !important;
    z-index: 1000 !important;
    position: absolute !important;
    box-sizing: border-box !important;
}

/* Selected Items */
.selected-item {
    box-shadow: 0 0 10px rgba(40, 167, 69, 0.5), 0 0 0 3px #28a745 !important;
    transform: scale(1.05) !important;
}

.table-item.selected-item {
    background: linear-gradient(45deg, #28a745, #20c997) !important;
    color: white !important;
    border: none !important;
}

.object-item.selected-item {
    background-color: rgba(40, 167, 69, 0.3) !important;
}

/* Selection Mode Visual Indicator */
.tables-map.selection-mode-active {
    background-color: #fff3cd !important;
    border: 3px dashed #ffc107 !important;
    position: relative;
    touch-action: none;
}

.tables-map.selection-mode-active::before {
    content: none;
}

/* Highlight selectable items in selection mode */
.selection-mode-active .table-item,
.selection-mode-active .object-item {
    transition: all 0.2s ease;
}

.selection-mode-active .table-item:hover,
.selection-mode-active .object-item:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 0 15px rgba(255, 193, 7, 0.6), 0 0 0 2px #ffc107 !important;
}

/* Create Sub-Map Modal */
.create-submap-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.create-submap-modal .modal-content {
    background-color: white;
    padding: 25px;
    border-radius: 12px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    border: 2px solid #28a745;
}

.create-submap-modal .modal-header h3 {
    margin: 0 0 20px 0;
    color: #28a745;
    font-size: 20px;
    font-weight: 600;
    text-align: center;
}

.create-submap-form .form-row {
    margin-bottom: 20px;
}

.create-submap-form .form-row label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.create-submap-form .form-row input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.create-submap-form .form-row input:focus {
    outline: none;
    border-color: #28a745;
}

.create-submap-form .form-help {
    display: block;
    margin-top: 6px;
    color: #7f8c8d;
    font-size: 12px;
    font-style: italic;
}

.create-submap-form .form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 25px;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.btn-create-submap {
    background: linear-gradient(45deg, #28a745, #20c997) !important;
    color: white !important;
    border: none !important;
    padding: 10px 16px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3) !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
}

.btn-create-submap:hover {
    background: linear-gradient(45deg, #218838, #1e9ba6) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 12px rgba(40, 167, 69, 0.4) !important;
}

.create-submap-form .btn-secondary,
.create-submap-form .btn-primary {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.create-submap-form .btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.create-submap-form .btn-secondary:hover {
    background-color: #7f8c8d;
}

.create-submap-form .btn-primary {
    background-color: #28a745;
    color: white;
}

.create-submap-form .btn-primary:hover {
    background-color: #218838;
}

.selected-info {
    background-color: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 15px;
    color: #0056b3;
    text-align: center;
    font-weight: bold;
}

/* iOS Safari specific fixes for scrolling */
@supports (-webkit-touch-callout: none) {
    .sidebar {
        -webkit-overflow-scrolling: touch;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
    
    .empty-tables-box {
        -webkit-overflow-scrolling: touch;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
    
    .queue-container {
        -webkit-overflow-scrolling: touch;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
    
    /* Prevent zoom on double tap */
    .empty-table-item,
    .queue-item {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -khtml-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
    
    /* Ensure proper touch scrolling on iOS */
    .empty-tables-sidebar,
    .waiting-queue-sidebar,
    .reservations-sidebar {
        -webkit-overflow-scrolling: touch;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        height: var(--ui-vh, 100dvh);
        min-height: 0;
        overflow: hidden;
    }

    #bosMasalarList,
    [data-bos-masalar],
#queue-container,
#reservations-container {
    -webkit-overflow-scrolling: touch;
    overflow-y: auto;
    overflow-x: hidden;
    touch-action: pan-y;
    height: 100%;
    max-height: 100%;
}

.waiting-queue-sidebar .queue-container,
.reservations-container {
    min-height: 0;
}
}

/* Additional mobile fix for table overlap */
@media (max-width: 480px) {
    .tables-container {
        position: relative !important;
        width: 5000px !important;
        height: 5000px !important;
        padding: 5px;
        /* Ensure proper scaling on very small screens */
        transform-origin: top left;
    }
    
    .tables-container .table-item {
        position: absolute !important;
        /* Scale down further for very small screens */
        transform: scale(0.7) !important;
        /* Ensure tables remain clickable */
        min-width: 56px !important;
        min-height: 42px !important;
        /* Ensure proper z-index for touch interaction */
        z-index: 10 !important;
        /* Prevent transform conflicts */
        transform-origin: center center !important;
    }
    
    /* Improve zoom controls for mobile */
    .zoom-controls {
        position: fixed !important;
        bottom: 10px !important;
        right: 10px !important;
        z-index: 1000 !important;
    }
}



/* Single source of truth: data-status - HIGHEST SPECIFICITY */
.table-item[data-status="empty"] {
  background: linear-gradient(45deg, #27ae60, #2ecc71) !important;
  box-shadow: 0 4px 8px rgba(39, 174, 96, 0.3) !important;
  border: none !important;
}
.table-item[data-status="reserved"] {
  background: linear-gradient(45deg, #2f80ed, #1c63c7) !important;
  box-shadow: 0 4px 8px rgba(47, 128, 237, 0.35) !important;
  border: none !important;
}
.table-item[data-status="occupied"] {
  background: linear-gradient(45deg, #e74c3c, #c0392b) !important;
  box-shadow: 0 4px 8px rgba(231, 76, 60, 0.3) !important;
  border: none !important;
}
.table-item[data-status="filled"] {
  background: linear-gradient(45deg, #e74c3c, #c0392b) !important;
  box-shadow: 0 4px 8px rgba(231, 76, 60, 0.3) !important;
  border: none !important;
}

/* Override any selected/special states while preserving status colors */
.table-item.selected-item[data-status="empty"] {
  background: linear-gradient(45deg, #27ae60, #2ecc71) !important;
  box-shadow: 0 4px 8px rgba(39, 174, 96, 0.3), 0 0 0 3px #28a745 !important;
  border: none !important;
}
.table-item.selected-item[data-status="reserved"] {
  background: linear-gradient(45deg, #2f80ed, #1c63c7) !important;
  box-shadow: 0 4px 8px rgba(47, 128, 237, 0.35), 0 0 0 3px #1e6cd7 !important;
  border: none !important;
}
.table-item.selected-item[data-status="occupied"] {
  background: linear-gradient(45deg, #e74c3c, #c0392b) !important;
  box-shadow: 0 4px 8px rgba(231, 76, 60, 0.3), 0 0 0 3px #28a745 !important;
  border: none !important;
}
.table-item.selected-item[data-status="filled"] {
  background: linear-gradient(45deg, #e74c3c, #c0392b) !important;
  box-shadow: 0 4px 8px rgba(231, 76, 60, 0.3), 0 0 0 3px #28a745 !important;
  border: none !important;
}

/* Reservation overlay derived from reservations, not table data */
.table-item.reserved {
  background: linear-gradient(45deg, #2f80ed, #1c63c7) !important;
  box-shadow: 0 4px 8px rgba(47, 128, 237, 0.35) !important;
  border: none !important;
}

/* Never show 'Masa Ekle' on sub-maps, even if a script toggles it */
.is-submap #addTableBtn {
  display: none !important;
}

/* Top overlay container for zoom + maps inside the map canvas */
.map-top-controls {
  position: absolute;
  top: auto;
  bottom: 10px;
  left: 10px;
  z-index: 110;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

/* Align map navigation with zoom button edges */
.map-top-controls .compact-map-navigation {
  margin-left: 8px; /* Align with zoom button edges (accounting for zoom controls padding) */
}

/* Inside the overlay, the zoom panel should not be absolutely/fixed positioned */
.map-top-controls .zoom-controls {
  position: fixed !important;
  top: 10px !important;
  left: 10px !important;
  right: auto !important;
  bottom: auto !important;
  margin: 0;
  z-index: 120; /* above map and overlays */
}

/* Place the Save (Kaydet) controls back near the zoom controls at top-left */
.map-top-controls .save-controls {
  position: fixed !important;
  top: 64px !important; /* just below zoom panel */
  left: 10px !important;
  right: auto !important;
  bottom: auto !important;
  margin: 0 !important;
  z-index: 120;
  display: flex;
  gap: 8px;
  align-items: center;
}

#saveStatusText {
  font-size: 12px;
  opacity: 0.8;
}

/* Compact look for on-map map-switcher */
.compact-map-on-map {
  background: rgba(255, 255, 255, 0.90);
  border-radius: 8px;
  padding: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Keep all maps reachable by horizontal swipe, especially on iPad */
.compact-map-on-map .compact-map-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  touch-action: pan-x;
  padding-bottom: 2px;
  max-width: min(70vw, 1000px);
}

.compact-map-on-map .compact-map-item {
  flex: 0 0 auto;
}

/* ============================================================================
   RESERVATION DATE PICKER (multi-day reservation support)
   ============================================================================ */
.reservation-date-picker-container {
    display: flex !important;
    align-items: center;
    padding: 4px 8px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    background: #fff;
    gap: 6px;
    flex-shrink: 0;
    margin: 0 8px;
}

.reservation-date-input {
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 13px;
    font-weight: 500;
    background: #fff;
    color: #1f2933;
    min-width: 130px;
}

.reservation-date-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

/* Selected Date Label - Prominent display */
.selected-date-label {
    font-size: 14px;
    font-weight: 700;
    padding: 6px 16px;
    border-radius: 6px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.selected-date-label.is-today {
    background: #10b981;
    color: white;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

.selected-date-label.is-future {
    background: #3b82f6;
    color: white;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}

.selected-date-label.is-past {
    background: #ef4444;
    color: white;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
}

/* ============================================
   SEARCH OVERLAY & MODAL
   ============================================ */

.sidebar-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
}

.waiting-queue-sidebar .sidebar-header-row {
    position: sticky;
    top: 0;
    z-index: 11;
    background-color: #fdf2e9;
    padding: 8px 4px;
    margin-bottom: 8px;
}

.reservations-header .sidebar-header-row {
    margin-bottom: 8px;
}

.sidebar-header-row .waiting-list-title,
.sidebar-header-row .reservations-title {
    margin: 0;
    padding: 0;
    position: static;
    top: auto;
    text-align: left;
    background: transparent;
    flex: 1;
    min-width: 0;
}

.btn-search-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #f5a623 0%, #e8930c 100%);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(245, 166, 35, 0.35);
}

.btn-search-toggle:hover {
    background: linear-gradient(135deg, #e8930c 0%, #d4820a 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 166, 35, 0.5);
}

.btn-search-toggle:active {
    transform: translateY(0);
}

.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 100px;
    animation: searchFadeIn 0.2s ease;
}

.search-overlay.hidden {
    display: none;
}

@keyframes searchFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.search-modal {
    width: 92%;
    max-width: 480px;
    background: linear-gradient(180deg, #fff8f5 0%, #ffffff 100%);
    border-radius: 20px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.5);
    overflow: hidden;
    animation: searchSlideDown 0.25s ease;
}

@keyframes searchSlideDown {
    from { opacity: 0; transform: translateY(-30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.search-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    background: linear-gradient(135deg, #f5a623 0%, #e8930c 100%);
    border-bottom: none;
}

.search-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 1);
    transition: all 0.2s ease;
}

.search-input-wrapper:focus-within {
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 1);
    transform: scale(1.01);
}

.search-icon {
    color: #f5a623;
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    font-weight: 500;
    background: transparent;
    color: #2d3436;
}

.search-input::placeholder {
    color: #b2bec3;
    font-weight: 400;
}

.search-clear-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #dfe6e9 0%, #b2bec3 100%);
    color: #636e72;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.15s ease;
}

.search-clear-btn:hover {
    background: linear-gradient(135deg, #ff7675 0%, #d63031 100%);
    color: white;
    transform: scale(1.1);
}

.search-clear-btn.hidden {
    display: none;
}

.search-close-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    backdrop-filter: blur(4px);
}

.search-close-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.02);
}

.search-results {
    max-height: 380px;
    overflow-y: auto;
    padding: 12px;
    background: #fff;
}

.search-results::-webkit-scrollbar {
    width: 6px;
}

.search-results::-webkit-scrollbar-track {
    background: #f1f2f6;
    border-radius: 3px;
}

.search-results::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #f5a623 0%, #e8930c 100%);
    border-radius: 3px;
}

.search-results-empty {
    text-align: center;
    padding: 50px 20px;
    color: #b2bec3;
    font-size: 14px;
    font-weight: 500;
}

.search-result-group {
    margin-bottom: 12px;
}

.search-result-group-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #636e72;
    padding: 10px 14px 6px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-result-group-title::before {
    content: '';
    flex: 0 0 3px;
    height: 14px;
    background: linear-gradient(180deg, #f5a623 0%, #e8930c 100%);
    border-radius: 2px;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    margin-bottom: 6px;
}

.search-result-item:hover {
    background: linear-gradient(135deg, #fffbf5 0%, #fff4e6 100%);
    border-color: rgba(245, 166, 35, 0.25);
    transform: translateX(4px);
}

.search-result-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.search-result-icon.waiting {
    background: linear-gradient(135deg, #f5a623 0%, #e8930c 100%);
    color: white;
}

.search-result-icon.reservation {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    color: white;
}

.search-result-content {
    flex: 1;
    min-width: 0;
}

.search-result-name {
    font-size: 15px;
    font-weight: 700;
    color: #2d3436;
    margin-bottom: 3px;
}

.search-result-details {
    font-size: 13px;
    color: #636e72;
    font-weight: 500;
}

.search-result-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-result-badge.waiting {
    background: linear-gradient(135deg, #f5a623 0%, #e8930c 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(245, 166, 35, 0.35);
}

.search-result-badge.reservation {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(155, 89, 182, 0.3);
}

.search-no-results {
    text-align: center;
    padding: 50px 20px;
}

.search-no-results-icon {
    font-size: 56px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.search-no-results-text {
    color: #636e72;
    font-size: 14px;
    font-weight: 500;
}

.search-highlight {
    background: linear-gradient(135deg, #ffe082 0%, #ffd54f 100%);
    color: #2d3436;
    padding: 1px 4px;
    border-radius: 4px;
    font-weight: 600;
}

/* Highlight animation for found items */
.search-found-highlight {
    animation: searchFoundPulse 0.6s ease 3;
    box-shadow: 0 0 0 4px #f5a623, 0 0 25px rgba(245, 166, 35, 0.5) !important;
    position: relative;
    z-index: 10;
    background: linear-gradient(135deg, #fffbf5 0%, #fff4e6 100%) !important;
}

@keyframes searchFoundPulse {
    0%, 100% { 
        box-shadow: 0 0 0 4px #f5a623, 0 0 25px rgba(245, 166, 35, 0.5);
    }
    50% { 
        box-shadow: 0 0 0 8px #e8930c, 0 0 40px rgba(232, 147, 12, 0.7);
    }
}

/* =============================================================================
   MOBILE & TABLET TOUCH IMPROVEMENTS
   ============================================================================= */

/* Prevent iOS rubber-banding/bounce effect */
html, body {
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
}

/* Better touch targets for all interactive elements */
@media (pointer: coarse) {
    /* Minimum 44px touch targets (Apple HIG recommendation) */
    .table-item {
        min-width: 60px;
        min-height: 50px;
    }
    
    .btn, button {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Larger edit/delete buttons in edit mode for easier touch */
    .btn-edit-table,
    .btn-delete-table {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    /* Better spacing for queue items */
    .queue-item {
        padding: 14px 12px;
        margin-bottom: 10px;
    }
    
    /* Larger touch area for empty table items */
    .empty-table-item {
        padding: 14px;
        min-height: 60px;
    }
}

/* Touch feedback states */
.table-item.touching {
    transform: scale(0.96);
    opacity: 0.9;
    transition: transform 0.1s ease, opacity 0.1s ease;
}

.table-item:active:not(.edit-mode) {
    transform: scale(0.96);
}

/* Smooth transitions for table items (but not during pan) */
.table-item {
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Disable hover effects on touch devices */
@media (hover: none) {
    .table-item:hover {
        transform: none;
    }
    
    .table-item.empty:hover,
    .table-item.occupied:hover,
    .table-item.reserved:hover {
        transform: none;
    }
    
    /* Keep active state for touch feedback */
    .table-item:active {
        transform: scale(0.96);
    }
}

/* iPad-specific optimizations */
@media (min-width: 768px) and (max-width: 1024px) and (pointer: coarse) {
    .staff-container.has-waitlist.has-reservations {
        grid-template-columns: minmax(0, 1fr) 105px 245px 275px;
    }

    .staff-container.has-waitlist:not(.has-reservations),
    .staff-container.has-reservations:not(.has-waitlist) {
        grid-template-columns: minmax(0, 1fr) 105px 520px;
    }

    .staff-container:not(.has-waitlist):not(.has-reservations) {
        grid-template-columns: minmax(0, 1fr) 105px;
    }

    .main-content {
        min-width: 0;
    }

    .empty-tables-title,
    .waiting-list-title,
    .reservations-title {
        font-size: 18px;
    }

    .queue-item,
    .reservation-item {
        padding: 12px;
    }

    .reservation-name {
        font-size: 18px;
    }

    .compact-map-on-map .map-nav-label {
        display: none;
    }

    .compact-map-on-map .compact-map-buttons {
        max-width: min(88vw, 560px);
    }

    /* Better zoom controls on iPad */
    .zoom-controls {
        gap: 8px;
    }

    .zoom-controls button {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }
}

/* Phone-specific optimizations */
@media (max-width: 767px) and (pointer: coarse) {
    /* Full width sidebars on phones when open */
    .sidebar.queue-sidebar.open,
    .sidebar.empty-tables-sidebar.open {
        width: 100vw;
        max-width: 100vw;
    }
    
    /* Larger table items on phones */
    .table-item {
        min-width: 80px;
        min-height: 60px;
    }
    
    /* Better touch targets for phone */
    .queue-item {
        padding: 16px;
    }
    
    .empty-table-item {
        padding: 16px;
        min-height: 70px;
    }
    
    /* Bigger action buttons */
    .queue-actions button,
    .masa-ver-btn {
        padding: 12px 16px;
        font-size: 14px;
        min-height: 48px;
    }
    
    /* Better modal sizing */
    .modal-content {
        width: 95vw;
        max-width: 95vw;
        margin: 10px;
    }
}

/* Prevent text selection during pan/zoom */
.tables-map.panning *,
.tables-map.zooming * {
    user-select: none !important;
    -webkit-user-select: none !important;
}

/* iOS Safari safe area support */
@supports (padding: max(0px)) {
    .header {
        padding-top: max(10px, env(safe-area-inset-top));
        padding-left: max(15px, env(safe-area-inset-left));
        padding-right: max(15px, env(safe-area-inset-right));
    }
    
    .sidebar {
        padding-bottom: max(10px, env(safe-area-inset-bottom));
    }
    
    .staff-container {
        padding-bottom: max(0px, env(safe-area-inset-bottom));
    }
}

/* Landscape phone optimizations */
@media (max-height: 500px) and (orientation: landscape) {
    .header {
        padding: 5px 10px;
        min-height: auto;
    }
    
    .header h1 {
        font-size: 14px;
    }
    
    .capacity-tracker {
        padding: 6px 12px;
        font-size: 14px;
    }
    
    /* Minimize sidebar header in landscape */
    .sidebar-header {
        padding: 8px 12px;
    }
    
    .queue-item {
        padding: 10px;
    }
}

/* High DPI display optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .table-item {
        /* Ensure crisp edges on retina displays */
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Reduced motion preference support */
@media (prefers-reduced-motion: reduce) {
    .table-item,
    .tables-container,
    .queue-item,
    .empty-table-item {
        transition: none !important;
    }
    
    .table-item.touching {
        transform: none;
    }
}

/* =============================================================================
   SCROLLABLE COLUMNS STYLING
   ============================================================================= */

/* Custom scrollbar for sidebar columns */
.sidebar::-webkit-scrollbar,
.empty-tables-box::-webkit-scrollbar,
#bosMasalarList::-webkit-scrollbar,
[data-bos-masalar]::-webkit-scrollbar,
.queue-container::-webkit-scrollbar,
.reservations-container::-webkit-scrollbar,
#queue-container::-webkit-scrollbar,
#reservations-container::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track,
.empty-tables-box::-webkit-scrollbar-track,
#bosMasalarList::-webkit-scrollbar-track,
[data-bos-masalar]::-webkit-scrollbar-track,
.queue-container::-webkit-scrollbar-track,
.reservations-container::-webkit-scrollbar-track,
#queue-container::-webkit-scrollbar-track,
#reservations-container::-webkit-scrollbar-track {
    background: transparent;
}

.empty-tables-sidebar::-webkit-scrollbar-thumb,
#bosMasalarList::-webkit-scrollbar-thumb,
[data-bos-masalar]::-webkit-scrollbar-thumb {
    background: rgba(39, 174, 96, 0.3);
    border-radius: 3px;
}

.empty-tables-sidebar::-webkit-scrollbar-thumb:hover,
#bosMasalarList::-webkit-scrollbar-thumb:hover,
[data-bos-masalar]::-webkit-scrollbar-thumb:hover {
    background: rgba(39, 174, 96, 0.5);
}

.waiting-queue-sidebar::-webkit-scrollbar-thumb,
.queue-container::-webkit-scrollbar-thumb,
#queue-container::-webkit-scrollbar-thumb {
    background: rgba(230, 126, 34, 0.3);
    border-radius: 3px;
}

.waiting-queue-sidebar::-webkit-scrollbar-thumb:hover,
.queue-container::-webkit-scrollbar-thumb:hover,
#queue-container::-webkit-scrollbar-thumb:hover {
    background: rgba(230, 126, 34, 0.5);
}

.reservations-sidebar::-webkit-scrollbar-thumb,
.reservations-container::-webkit-scrollbar-thumb,
#reservations-container::-webkit-scrollbar-thumb {
    background: rgba(31, 111, 235, 0.3);
    border-radius: 3px;
}

.reservations-sidebar::-webkit-scrollbar-thumb:hover,
.reservations-container::-webkit-scrollbar-thumb:hover,
#reservations-container::-webkit-scrollbar-thumb:hover {
    background: rgba(31, 111, 235, 0.5);
}

/* Firefox scrollbar styling */
.sidebar,
.empty-tables-box,
#bosMasalarList,
[data-bos-masalar],
.queue-container,
.reservations-container,
#queue-container,
#reservations-container {
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 100, 100, 0.3) transparent;
}

/* Touch scroll improvements */
@media (pointer: coarse) {
    .sidebar,
    .empty-tables-box,
    #bosMasalarList,
    [data-bos-masalar],
    .queue-container,
    .reservations-container,
    #queue-container,
    #reservations-container {
        /* Larger scrollbar for touch */
        scrollbar-width: auto;
    }
    
    .sidebar::-webkit-scrollbar,
    .empty-tables-box::-webkit-scrollbar,
    #bosMasalarList::-webkit-scrollbar,
    [data-bos-masalar]::-webkit-scrollbar,
    .queue-container::-webkit-scrollbar,
    .reservations-container::-webkit-scrollbar,
    #queue-container::-webkit-scrollbar,
    #reservations-container::-webkit-scrollbar {
        width: 8px;
    }
}

/* Scroll fade indicators (top/bottom shadows) */
.empty-tables-sidebar,
.waiting-queue-sidebar,
.reservations-sidebar {
    position: relative;
}

.empty-tables-sidebar::after,
.waiting-queue-sidebar::after,
.reservations-sidebar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(to top, rgba(255,255,255,0.9), transparent);
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* Show fade when content is scrollable */
.empty-tables-sidebar.has-scroll::after,
.waiting-queue-sidebar.has-scroll::after,
.reservations-sidebar.has-scroll::after {
    opacity: 1;
}

.empty-tables-sidebar::after {
    background: linear-gradient(to top, rgba(232, 245, 232, 0.95), transparent);
}

.waiting-queue-sidebar::after {
    background: linear-gradient(to top, rgba(253, 242, 233, 0.95), transparent);
}

.reservations-sidebar::after {
    background: linear-gradient(to top, rgba(238, 244, 255, 0.95), transparent);
}
