/**
 * KDS & Report for Orderable - Updated Admin Styles
 * 
 * Clean, modern restaurant order management interface
 * Matches the provided design with processing and completed orders only
 */

/* Reset and Base Styles */
.kdsamref-dashboard * {
    box-sizing: border-box;
}

/* Font size scaling support */
.kdsamref-dashboard {
    font-size: 1rem;
}

.kdsamref-dashboard .kdsamref-header h1 {
    font-size: 1.2rem;
}



.kdsamref-dashboard .kdsamref-section-title {
    font-size: 1.125rem;
}

.kdsamref-dashboard .kdsamref-order-number {
    font-size: 1rem;
}

.kdsamref-dashboard .kdsamref-order-time {
    font-size: 0.75rem;
}

.kdsamref-dashboard .kdsamref-order-table {
    font-size: 0.75rem;
}

.kdsamref-dashboard .kdsamref-customer-name {
    font-size: 0.875rem;
}

.kdsamref-dashboard .kdsamref-item-name {
    font-size: 0.875rem;
}

.kdsamref-dashboard .kdsamref-item-option {
    font-size: 0.75rem;
}

.kdsamref-dashboard .kdsamref-total-label {
    font-size: 0.875rem;
}

.kdsamref-dashboard .kdsamref-total-amount {
    font-size: 1rem;
}

.kdsamref-dashboard .kdsamref-action-btn {
    font-size: 0.75rem;
}

.kdsamref-dashboard {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 1rem;
    margin: 0;
    padding: 20px;
    min-height: 100vh;
}

/* Header */
.kdsamref-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 16px 20px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
}

.kdsamref-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.kdsamref-dashboard-logo {
    width: 100px;
    height: 50px;
}

.kdsamref-dashboard-logo .cls-1 {
    fill: #10b981;
}

.kdsamref-dashboard-logo svg {
    width: 100%;
    height: 100%;
    max-width: 70px;
}

.kdsamref-header-left h1 {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.2;
}

.kdsamref-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Hide dashboard title on mobile devices */
@media (max-width: 768px) {
    .kdsamref-dashboard-title {
        display: none;
    }
}

.kdsamref-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Common Header Button Styles */
.kdsamref-font-btn,
.kdsamref-refresh-btn,
.kdsamref-notifications-btn,
.kdsamref-header-toggle-btn,
.kdsamref-fullscreen-btn,
#kdsamref-dashboard-fullscreen-btn,
.kdsamref-masonry-toggle-btn,
.kdsamref-search-btn,
.kdsamref-stock-management-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #e9ecef;
    background: #ffffff;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6c757d;
}

.kdsamref-font-btn:hover,
.kdsamref-refresh-btn:hover,
.kdsamref-notifications-btn:hover,
.kdsamref-header-toggle-btn:hover,
.kdsamref-fullscreen-btn:hover,
#kdsamref-dashboard-fullscreen-btn:hover,
.kdsamref-masonry-toggle-btn:hover,
.kdsamref-search-btn:hover,
.kdsamref-stock-management-btn:hover {
    background: #f8f9fa;
    border-color: #00b893;
    color: #00b893;
}

.kdsamref-font-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.kdsamref-refresh-btn.loading {
    position: relative;
    pointer-events: none;
}

.kdsamref-refresh-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #00b893;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.kdsamref-refresh-btn.loading svg {
    opacity: 0;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}



.kdsamref-notifications-btn.enabled {
    background: #00b893;
    border-color: #00b893;
    color: white;
}



.kdsamref-header-toggle-btn.active {
    background: #00b893;
    border-color: #00b893;
    color: white;
}



.kdsamref-fullscreen-btn:hover,
#kdsamref-dashboard-fullscreen-btn:hover {
    background: #f8f9fa;
    border-color: #00b893;
    color: #00b893;
}

.kdsamref-fullscreen-btn.active,
#kdsamref-dashboard-fullscreen-btn.active {
    background: #00b893;
    border-color: #00b893;
    color: white;
}

/* Mobile Button Optimizations (1024px and below) */
@media (max-width: 1024px) {
    .kdsamref-font-btn,
    .kdsamref-refresh-btn,
    .kdsamref-notifications-btn,
    .kdsamref-header-toggle-btn,
    .kdsamref-fullscreen-btn,
    #kdsamref-dashboard-fullscreen-btn,
    .kdsamref-masonry-toggle-btn,
    .kdsamref-search-btn,
    .kdsamref-stock-management-btn {
        min-width: 44px !important;
        min-height: 44px !important;
        padding: 12px !important;
        border-radius: 8px !important;
        /* Better touch target */
        touch-action: manipulation;
    }
}
    
    .kdsamref-font-btn svg,
    .kdsamref-refresh-btn svg,
    .kdsamref-notifications-btn svg,
    .kdsamref-header-toggle-btn svg,
    .kdsamref-fullscreen-btn svg,
    #kdsamref-dashboard-fullscreen-btn svg,
    .kdsamref-masonry-toggle-btn svg,
    .kdsamref-search-btn svg,
    .kdsamref-stock-management-btn svg {
        width: 20px !important;
        height: 20px !important;
    
}

/* Fullscreen Mode Styles */
.kdsamref-dashboard.fullscreen-mode,
.kdsamref-dashboard:fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    background: #f8f9fa;
    overflow-y: auto;
    padding: 0;
}


/* Tablet/Mobile Fullscreen Optimizations */
@media (max-width: 1024px) {
    .kdsamref-dashboard.fullscreen-mode {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        z-index: 999999 !important;
        background: #f8f9fa !important;
        overflow-y: auto !important;
        padding: 0 !important;
        /* Hide browser UI elements on mobile */
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    
    /* Optimize modal for tablets */
    .kdsamref-dashboard.fullscreen-mode .kdsamref-modal.modal-active {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        z-index: 2147483647 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background-color: rgba(0, 0, 0, 0.9) !important;
        backdrop-filter: blur(8px) !important;
        pointer-events: auto !important;
        visibility: visible !important;
        opacity: 1 !important;
        overflow: visible !important;
    }
    
    /* Optimize modal content for tablets */
    .kdsamref-dashboard.fullscreen-mode .kdsamref-modal.modal-active .kdsamref-modal-content {
        max-width: 95% !important;
        max-height: 95vh !important;
        margin: 10px !important;
        border-radius: 8px !important;
    }
}



/* Ensure modal content is visible - Only when modal is active */
.kdsamref-modal.modal-active .kdsamref-modal-content {
    z-index: 2147483647 !important;
    position: relative !important;
    background-color: white !important;
    border-radius: 12px !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
    max-width: 80% !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
}

/* Webkit fullscreen support */
.kdsamref-dashboard:-webkit-full-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    background: #f8f9fa;
    overflow-y: auto;
    padding: 0;
}

/* Mozilla fullscreen support */
.kdsamref-dashboard:-moz-full-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    background: #f8f9fa;
    overflow-y: auto;
    padding: 0;
}

/* Ensure notifications are visible in fullscreen mode */
.kdsamref-dashboard.fullscreen-mode ~ div[style*="z-index: 9999999"] {
    z-index: 9999999 !important;
}

.kdsamref-dashboard.fullscreen-mode .kdsamref-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    margin: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
}

.kdsamref-dashboard.fullscreen-mode .kdsamref-main-content {
    border-radius: 0;
    margin: 0;
    min-height: calc(100vh - 80px);
}

.kdsamref-dashboard.fullscreen-mode .kdsamref-orders-container {
    padding: 20px;
}



/* Header Hide/Show Animation */
.kdsamref-header {
    transition: all 0.3s ease;
    transform-origin: top;
}

.kdsamref-dashboard.kdsamref-header-hidden .kdsamref-header {
    transform: translateY(-100%);
    opacity: 0;
    height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
    pointer-events: none;
    visibility: hidden;
    position: absolute;
    top: -9999px;
}

.kdsamref-dashboard.kdsamref-header-hidden .kdsamref-main-content {
    margin-top: 0;
}

/* When admin bar is hidden, adjust dashboard positioning */
#wpadminbar[style*="display: none"] ~ .kdsamref-dashboard {
    top: 0 !important;
}

/* Ensure dashboard takes full height when admin bar is hidden */
.kdsamref-dashboard.kdsamref-header-hidden {
    min-height: 100vh;
}

/* Ensure header is visible when not hidden */
.kdsamref-dashboard:not(.kdsamref-header-hidden) .kdsamref-header {
    transform: translateY(0);
    opacity: 1;
    height: auto;
    overflow: visible;
    pointer-events: auto;
    visibility: visible;
    position: relative;
    top: auto;
}

/* Fallback method using only opacity and visibility */
.kdsamref-dashboard.header-hidden-alt .kdsamref-header {
    opacity: 0;
    visibility: hidden;
    height: 0;
    margin: 0;
    padding: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.kdsamref-dashboard:not(.header-hidden-alt) .kdsamref-header {
    opacity: 1;
    visibility: visible;
    height: auto;
    pointer-events: auto;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Header Toggle Button Icon Animation */
.kdsamref-header-toggle-btn svg {
    transition: transform 0.3s ease;
}

.kdsamref-dashboard.kdsamref-header-hidden .kdsamref-header-toggle-btn svg {
    transform: rotate(180deg);
}



/* License Badge - Minimal */
.kdsamref-license-badge-mini {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.kdsamref-license-free {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.kdsamref-license-premium {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.kdsamref-upgrade-btn-mini {
    background: #00b893;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 10px;
    font-weight: 600;
    transition: background 0.2s ease;
}

.kdsamref-upgrade-btn-mini:hover {
    background: #009d7a;
    color: white;
}

/* Main Content */
.kdsamref-main-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Content Header */
.kdsamref-content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 24px;
    border-bottom: 1px solid #e5e7eb;
    flex-wrap: wrap;
    gap: 16px;
}

.kdsamref-section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

/* Status Filter Buttons */
.kdsamref-status-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    /* padding: 16px 20px; */
    /* background: #ffffff; */
    /* border-radius: 16px; */
    /* box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); */
    /* border: 1px solid #f1f5f9; */
    /* margin-bottom: 20px; */
    min-height: 60px;
}

.kdsamref-status-btn:first-child {
    margin-right: 8px;
}

/* Enhanced Workflow Status Indicators */
.kdsamref-status-btn.workflow-status {
    position: relative;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    font-weight: 600;
    border-radius: 12px;
    padding: 12px 16px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    min-width: 120px;
    min-height: 50px;
}

.kdsamref-status-btn.workflow-status:hover {
    background: #f8f9fa;
    border-color: #d1d5db;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.kdsamref-status-btn.workflow-status.active {
    background: #007cba;
    color: #ffffff;
    border-color: #007cba;
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
    transform: translateY(-1px);
}

.kdsamref-status-btn.workflow-status.active:hover {
    background: #005a87;
    border-color: #005a87;
    box-shadow: 0 6px 16px rgba(0, 124, 186, 0.4);
}

.workflow-indicator {
    display: inline-block;
    margin-left: 6px;
    font-size: 0.75em;
    opacity: 0.9;
    font-weight: 700;
}

.kdsamref-status-btn.workflow-status .workflow-indicator {
    color: #007cba;
}

.kdsamref-status-btn.workflow-status.active .workflow-indicator {
    color: #ffffff;
}

/* Enhanced status button styling with icons */
.kdsamref-status-btn {
    position: relative;
    transition: all 0.3s ease;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 2px solid #e9ecef;
    background: #ffffff;
    color: #495057;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 120px;
    min-height: 50px;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    text-align: left;
    align-content: center;
}

.kdsamref-status-btn:hover {
    background: #f8f9fa;
    border-color: #dee2e6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.kdsamref-status-btn.active {
    background: #007cba;
    color: #ffffff;
    border-color: #007cba;
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
    font-weight: 600;
    transform: translateY(-1px);
}

.kdsamref-status-btn.active:hover {
    background: #005a87;
    border-color: #005a87;
    box-shadow: 0 6px 16px rgba(0, 124, 186, 0.4);
}

.kdsamref-status-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1;
    flex-shrink: 0;
}

.kdsamref-status-btn.active .kdsamref-status-icon {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff !important;
}

.kdsamref-status-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.kdsamref-status-btn .status-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
    line-height: 1.2;
}

.kdsamref-status-btn .status-count {
    background: rgba(0, 0, 0, 0.1);
    color: inherit;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
    line-height: 1;
    align-self: flex-start;
}

.kdsamref-status-btn.active .status-label,
.kdsamref-status-btn.active .status-count {
    color: #ffffff;
}

.kdsamref-status-btn.active .status-count {
    background: rgba(255, 255, 255, 0.2);
}

/* Header Actions */
.kdsamref-header-actions {
    display: flex;
    gap: 8px;
}

.kdsamref-wc-orders-btn,
.kdsamref-today-btn {
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: all 0.2s ease;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.kdsamref-wc-orders-btn {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.kdsamref-wc-orders-btn:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
    color: #1f2937;
    text-decoration: none;
}

.kdsamref-today-btn:hover {
    border-color: #d1d5db;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.kdsamref-wc-orders-btn:hover {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.kdsamref-today-btn {
    background: #f3f4f6;
}



/* Search Container */
.kdsamref-search-container {
    padding: 16px 24px;
    border-bottom: 1px solid #e5e7eb;
    animation: slideDown 0.2s ease;
}

.kdsamref-search-input {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.kdsamref-search-input:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Orders Container - Base Grid Layout */
.kdsamref-orders-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    padding: 27px;
    margin: 0;
    background: #f8f9fa;
    max-width: 100%;
    align-items: stretch;
}

.kdsamref-orders-container .kdsamref-order-card {
    width: 100%;
    height: auto;
    margin-bottom: 0;
}

/* Responsive Grid Layout */
@media (max-width: 1200px) {
    .kdsamref-orders-container {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 1180px) {
    .kdsamref-orders-container {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 1024px) {
    .kdsamref-orders-container {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }
}

@media (max-width: 768px) {
    .kdsamref-orders-container {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }
}


/* Masonry Layout - Override Grid */
.kdsamref-orders-container.masonry-layout {
    display: flex !important;
    grid-template-columns: none !important;
    gap: 16px;
    align-items: flex-start;
    transition: opacity 0.2s ease-in-out;
    padding: 10px;
    margin: 0;
}

/* Modern browsers masonry support */
@supports (grid-template-rows: masonry) {
    .kdsamref-orders-container.masonry-layout {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        grid-template-rows: masonry;
        gap: 16px;
        align-items: start;
    }
}


.kdsamref-orders-container.masonry-layout .kdsamref-order-card {
    break-inside: avoid;
    margin-bottom: 0;
    transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out;
}

/* Masonry Column Styles */
.masonry-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: all 0.2s ease-in-out;
    min-width: 320px;
}

/* Responsive Masonry Columns */
@media (max-width: 1180px) {
    .masonry-column {
        min-width: 280px;
        gap: 12px;
    }
}

@media (max-width: 1024px) {
    .masonry-column {
        min-width: 260px;
        gap: 14px;
    }
}

@media (max-width: 768px) {
    .masonry-column {
        min-width: 260px;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .masonry-column {
        min-width: 100%;
        gap: 10px;
    }
}

.masonry-column {
    flex: 1;
}

.masonry-column .kdsamref-order-card {
    transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out;
    margin-bottom: 0;
    width: 100%;
}



.kdsamref-masonry-toggle-btn.active {
    background: #00b893;
    border-color: #00b893;
    color: white;
}

.kdsamref-masonry-toggle-btn.active:hover {
    background: #00a085;
    border-color: #00a085;
}

/* Order Cards */
.kdsamref-order-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 15px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
}

/* Notification Styles */
.kdsamref-ipad-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 999999;
    max-width: 320px;
    animation: slideInRight 0.3s ease;
}

.kdsamref-notification-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.kdsamref-notification-icon {
    font-size: 20px;
}

.kdsamref-notification-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.kdsamref-notification-message {
    font-size: 13px;
    opacity: 0.9;
}

/* Warning Styles */
.kdsamref-limit-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.kdsamref-warning-icon {
    font-size: 16px;
}

.kdsamref-warning-message {
    flex: 1;
}

.kdsamref-warning-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.kdsamref-warning-link {
    color: #0073aa;
    text-decoration: none;
    font-weight: 600;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.kdsamref-warning-link:hover {
    background-color: rgba(0, 115, 170, 0.1);
}

.kdsamref-warning-dismiss {
    background: none;
    border: none;
    color: #856404;
    cursor: pointer;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.kdsamref-warning-dismiss:hover {
    background-color: rgba(133, 100, 4, 0.1);
}

/* Action Icon Styles */
.kdsamref-action-icon {
    margin-right: 8px;
    font-size: 16px;
}

.kdsamref-next-icon {
    margin-right: 8px;
    font-size: 16px;
}

/* Animation */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Custom Color Support */
.kdsamref-order-card {
    border-color: var(--custom-color, #e9ecef);
}

.kdsamref-status-badge {
    background: var(--custom-color, #007cba);
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.kdsamref-status-btn {
    border-color: var(--custom-color, #e9ecef);
}

/* Stock Management Modal Styles */
.kdsamref-stock-modal .kdsamref-modal-content {
    max-width: 1200px;
    width: 95%;
    max-height: 90vh;
}

.kdsamref-stock-search-container {
    margin-bottom: 24px;
}

.kdsamref-stock-search-wrapper {
    position: relative;
    max-width: 500px;
}

.kdsamref-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    z-index: 1;
}

.kdsamref-stock-search-input {
    width: 100%;
    padding: 12px 16px 12px 48px!important;
    border: 1px solid #e9ecef!important;
    border-radius: 8px!important;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
    background: #ffffff;
}

.kdsamref-stock-search-input:focus {
    border-color: #00b893;
    box-shadow: 0 0 0 3px rgba(0, 184, 147, 0.1);
}

.kdsamref-stock-search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.kdsamref-stock-search-clear:hover {
    background: #f8f9fa;
    color: #495057;
}

.kdsamref-stock-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.kdsamref-stock-filter-btn {
    padding: 8px 16px;
    border: 1px solid #e9ecef;
    background: #ffffff;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #6c757d;
}

.kdsamref-stock-filter-btn:hover {
    background: #f8f9fa;
    border-color: #00b893;
    color: #00b893;
}

.kdsamref-stock-filter-btn.active {
    background: #00b893;
    border-color: #00b893;
    color: #ffffff;
}

.kdsamref-stock-filter-btn .filter-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.kdsamref-stock-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #6c757d;
}

.kdsamref-stock-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 16px;
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 8px;
}

.kdsamref-stock-item {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s ease;
    position: relative;
}

.kdsamref-stock-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.kdsamref-stock-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.kdsamref-stock-item-title {
    font-size: 16px;
    font-weight: 600;
    color: #212529;
    margin: 0 0 4px 0;
    line-height: 1.4;
}

.kdsamref-stock-item-sku {
    font-size: 12px;
    color: #6c757d;
    font-family: 'Courier New', monospace;
    display: flex;
    align-items: center;
    gap: 8px;
}

.kdsamref-stock-parent-category {
    font-size: 10px;
    color: #6c757d;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: inherit;
    font-weight: 500;
}

.kdsamref-stock-item-category {
    font-size: 12px;
    color: #6c757d;
    background: #f8f9fa;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
    margin-top: 4px;
}

.kdsamref-stock-item-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kdsamref-stock-item-status.in-stock {
    background: #d4edda;
    color: #155724;
}

.kdsamref-stock-item-status.low-stock {
    background: #fff3cd;
    color: #856404;
}

.kdsamref-stock-item-status.out-of-stock {
    background: #f8d7da;
    color: #721c24;
}

.kdsamref-stock-item-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.kdsamref-stock-item-price {
    font-size: 18px;
    font-weight: 700;
    color: #212529;
}

.kdsamref-stock-item-quantity {
    display: flex;
    align-items: center;
    gap: 12px;
}

.kdsamref-stock-quantity-label {
    font-size: 13px;
    color: #6c757d;
    font-weight: 500;
}

.kdsamref-stock-quantity-input {
    width: 80px;
    padding: 8px 12px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
    outline: none;
    transition: all 0.2s ease;
}

.kdsamref-stock-quantity-input:focus {
    border-color: #00b893;
    box-shadow: 0 0 0 2px rgba(0, 184, 147, 0.1);
}

.kdsamref-stock-item-status-control {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.kdsamref-stock-status-label {
    font-size: 13px;
    color: #6c757d;
    font-weight: 500;
}

.kdsamref-stock-status-select {
    padding: 8px 12px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
    background: #ffffff;
    min-width: 120px;
}

.kdsamref-stock-status-select:focus {
    border-color: #00b893;
    box-shadow: 0 0 0 2px rgba(0, 184, 147, 0.1);
}

.kdsamref-stock-item-actions {
    display: flex;
    gap: 8px;
}

.kdsamref-stock-save-btn {
    padding: 8px 16px;
    background: #00b893;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
}

.kdsamref-stock-save-btn:hover {
    background: #00a085;
    transform: translateY(-1px);
}

.kdsamref-stock-save-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.kdsamref-stock-reset-btn {
    padding: 8px 12px;
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.kdsamref-stock-reset-btn:hover {
    background: #e9ecef;
    color: #495057;
}

.kdsamref-no-stock-items {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.kdsamref-empty-icon {
    color: #dee2e6;
    margin-bottom: 16px;
}

.kdsamref-no-stock-items h3 {
    margin: 0 0 8px 0;
    color: #495057;
    font-size: 18px;
}

.kdsamref-no-stock-items p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

/* Responsive Stock Management */
@media (max-width: 768px) {
    .kdsamref-stock-container {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .kdsamref-stock-filters {
        gap: 8px;
    }
    
    .kdsamref-stock-filter-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .kdsamref-stock-item {
        padding: 16px;
    }
    
    .kdsamref-stock-item-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

.kdsamref-order-card.completed {
    background: #f8f9fa;
    border-color: #dee2e6;
}



.kdsamref-order-card.delivery {
    border-left: 1px solid;
}

.kdsamref-order-card.pickup {
    border-left: 0;
}

.kdsamref-order-card.dine-in {
    border-left: 0;
}

.kdsamref-order-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.kdsamref-order-card.completed:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.kdsamref-order-card .kdsamref-order-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 10px;
    flex: 1;
}

.kdsamref-order-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.kdsamref-order-left {
    flex: 1;
    min-width: 0;
}

.kdsamref-order-number {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 4px;
    line-height: 1.2;
}

.kdsamref-order-time {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 8px;
}

.kdsamref-order-table {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 8px;
}

.kdsamref-order-right {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
    flex-shrink: 0;
}

.kdsamref-delivery-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #ffffff;
    background: #6b7280;
    border: none;
    white-space: nowrap;
}

.kdsamref-delivery-badge.pickup {
    background: #a78bfa; /* Pastel mor */
}

.kdsamref-delivery-badge.delivery {
    background: #4ade80; /* Pastel yeşil */
}

.kdsamref-delivery-badge.dine-in {
    background: #60a5fa; /* Pastel mavi */
}

.kdsamref-status-badge {
    padding: 2px 11px;
    border-radius: 0px 0px 12px 0px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #ffffff;
    position: absolute;
    top: 0px;
    left: 0%;
    background: #6b7280;
    border: none;
    white-space: nowrap;
    display: inline-block;
}

.kdsamref-status-badge.processing {
    background: #3b82f6;
}

.kdsamref-status-badge.cooking {
    background: #f59e0b;
}

.kdsamref-status-badge.ready {
    background: #10b981;
}

.kdsamref-status-badge.completed {
    background: #6b7280;
    opacity: 0.8;
}

.kdsamref-customer-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.kdsamref-order-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.kdsamref-order-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 3px 0px;
    /* background: #f8f9fa; */
    border-radius: 8px;
    /* border: 1px solid #e9ecef; */
}

.kdsamref-order-item:last-child {
    margin-bottom: 0;
}

.kdsamref-item-left {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.kdsamref-item-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.kdsamref-item-name {
    font-weight: 600;
    color: #1a1a1a;
    font-size: 0.875rem;
}

.kdsamref-item-options {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.kdsamref-item-option {
    font-size: 0.75rem;
    color: #6b7280;
    line-height: 1.3;
}

.kdsamref-item-option strong {
    color: #374151;
    font-weight: 600;
}

.kdsamref-item-price {
    font-weight: 600;
    color: #1a1a1a;
    font-size: 0.875rem;
}

.kdsamref-item-qty {
    background: #e5e7eb;
    color: #374151;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 20px;
    display: flex;
    text-align: center;
    line-height: 1;
    flex-direction: row;
}

.kdsamref-order-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-top: 1px solid #e9ecef;
    margin-top: auto;
}

.kdsamref-total-label {
    font-weight: 600;
    color: #1a1a1a;
    font-size: 0.875rem;
}

.kdsamref-total-amount {
    font-weight: 700;
    color: #10b981;
    font-size: 1rem;
}

.kdsamref-action-buttons {
    margin-top: auto;
    padding-top: 20px;
    border-radius: 0;
    background: none;
    display: flex;
    margin: 10px;
    justify-content: center;
    padding: 0px 0px;
    border-top: none;
}

.kdsamref-action-btn {
    display: flex;
    justify-content: center;
    padding: 5px 15px;
    border: 2px solid;
    position: absolute;
    border-radius: 0;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    bottom: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
    min-height: 40px;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    width: 100%;
    color: #ffffff;
    align-items: center;
}

.kdsamref-action-btn:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    height: 100%;
    opacity: .9;
}

.kdsamref-action-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.kdsamref-action-btn.next-status {
    background: #10b981;
    border-color: #10b981;
    color: #ffffff;
    font-weight: 700;
}

.kdsamref-action-btn.next-status:hover {
    background: #059669;
    border-color: #059669;
    color: #ffffff;
}

.kdsamref-action-btn.completed {
    background: #6b7280;
    border-color: #6b7280;
    color: #ffffff;
    opacity: 0.9;
}

.kdsamref-action-btn.completed:hover {
    background: #4b5563;
    border-color: #4b5563;
    color: #ffffff;
    opacity: 1;
}

.kdsamref-action-btn::before {
    /* content: ''; */
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: left 0.5s;
}

.kdsamref-action-btn:hover::before {
    left: 100%;
}

/* Current Status Button (Gray) */
.kdsamref-action-btn.current-status {
    background: #6b7280;
    color: white;
    border: 2px solid #6b7280;
    opacity: 0.8;
    cursor: default; /* Not clickable */
}

.kdsamref-action-btn.current-status:hover {
    background: #6b7280;
    border-color: #6b7280;
    transform: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.kdsamref-action-btn.current-status::before {
    display: none; /* No shimmer effect for current status */
}

/* Next Status Button (Colored) */
.kdsamref-action-btn.next-status {
    background: #3b82f6;
    color: white;
    border: 0px solid #3b82f6;
    font-weight: 700;
}

.kdsamref-action-btn.next-status:hover {
    background: #2563eb;
    border-color: #2563eb;
}

/* Default button styles (fallback) */
.kdsamref-action-btn.processing {
    background: #3b82f6;
    color: white;
    border: 2px solid #3b82f6;
}

.kdsamref-action-btn.processing:hover {
    background: #2563eb;
    border-color: #2563eb;
}

/* New Order Button */
.kdsamref-action-btn.new-order {
    background: #3b82f6;
    color: white;
    border: 2px solid #3b82f6;
}

.kdsamref-action-btn.new-order:hover {
    background: #2563eb;
    border-color: #2563eb;
}

.kdsamref-action-btn.new-order::after {
    content: '🆕';
    font-size: 14px;
    margin-left: 4px;
}

/* Cooking Button */
.kdsamref-action-btn.cooking {
    background: #f59e0b;
    color: white;
    border: 2px solid #f59e0b;
}

.kdsamref-action-btn.cooking:hover {
    background: #d97706;
    border-color: #d97706;
}

.kdsamref-action-btn.cooking::after {
    content: '👨‍🍳';
    font-size: 14px;
    margin-left: 4px;
}

/* Ready Button */
.kdsamref-action-btn.ready {
    background: #10b981;
    color: white;
    border: 2px solid #10b981;
}

.kdsamref-action-btn.ready:hover {
    background: #059669;
    border-color: #059669;
}

.kdsamref-action-btn.ready::after {
    content: '✅';
    font-size: 14px;
    margin-left: 4px;
}

/* Completed Button */
.kdsamref-action-btn.completed {
    background: #6b7280;
    color: white;
    border: 2px solid #6b7280;
}

.kdsamref-action-btn.completed:hover {
    background: #4b5563;
    border-color: #4b5563;
}

.kdsamref-action-btn.completed::after {
    content: '🎉';
    font-size: 14px;
    margin-left: 4px;
}

.kdsamref-action-btn.wide {
    flex-basis: 100%;
    margin-top: 8px;
}

/* Loading State for Action Buttons */
.kdsamref-action-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.kdsamref-action-btn.loading::after {
    content: '';
    width: 12px;
    height: 12px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 6px;
}

/* Success State Animation */
.kdsamref-action-btn.success {
    background: #10b981;
    color: white;
    border-color: #10b981;
    animation: successPulse 0.6s ease-out;
}

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

/* Dynamic custom status button styles */
.kdsamref-action-btn[style*="background"] {
    color: white !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.kdsamref-action-btn[style*="background"] i {
    color: white !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.kdsamref-action-icon {
    display: inline-block;
    margin-right: 8px;
    font-size: 16px;
    line-height: 1;
}

.kdsamref-action-arrow {
    display: inline-block;
    margin-left: 8px;
    font-size: 14px;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.kdsamref-action-btn:hover .kdsamref-action-arrow {
    transform: translateX(2px);
}

/* Loading States */
.kdsamref-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #6b7280;
}

.kdsamref-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f3f4f6;
    border-top: 3px solid #10b981;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

/* Empty State */
.kdsamref-no-orders {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.kdsamref-empty-state {
    max-width: 100%;
}

.kdsamref-empty-state h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
    margin: 0 0 8px 0;
}

.kdsamref-empty-state p {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

/* Modal */
/* Body scroll lock when modal is open */
body.modal-open {
    overflow: hidden;
}

.kdsamref-modal {
    position: fixed !important;
    z-index: 999999999 !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: blur(4px) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    display: none !important;
    pointer-events: none !important;
    /* Optimized transition for faster opening */
    transition: opacity 0.15s ease-out, visibility 0.15s ease-out;
    /* Hardware acceleration for better performance */
    transform: translateZ(0) !important;
    will-change: opacity, visibility;
}

.kdsamref-modal:not(.closing).modal-active {
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
    z-index: 2147483647 !important;
}

/* Modal closing animation */
.kdsamref-modal.closing {
    opacity: 0 !important;
    visibility: hidden !important;
    display: none !important;
}

/* Modal in fullscreen mode - much higher z-index */
.kdsamref-dashboard.fullscreen-mode .kdsamref-modal {
    z-index: 2147483647 !important; /* Maximum z-index value */
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Modal Base Styles - Clean and Simple */
.kdsamref-modal {
    display: none;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease-in-out, visibility 0.15s ease-in-out;
}

/* Ensure modal is above WordPress admin bar */
#wpadminbar ~ .kdsamref-modal {
    z-index: 999999;
}

/* Modal Active State */
.kdsamref-modal.modal-active {
    display: flex;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    z-index: 2147483647;
}

/* Modal Content */
.kdsamref-modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: translateZ(0);
    will-change: transform;
    contain: layout style paint;
    position: relative;
    z-index: 2147483647;
}

/* Fullscreen Modal Optimizations - Modal is now at body level */
.kdsamref-modal.modal-active {
    z-index: 2147483647 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: rgba(0, 0, 0, 0.8) !important;
    backdrop-filter: blur(8px) !important;
    pointer-events: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.kdsamref-modal.modal-active .kdsamref-modal-content {
    max-width: 90% !important;
    max-height: 90vh !important;
    margin: 0 auto !important;
    background-color: white !important;
    border-radius: 12px !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
    z-index: 2147483647 !important;
}

/* Modal Closing Animation */
.kdsamref-modal.closing {
    opacity: 0;
    visibility: hidden;
}

.kdsamref-modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    /* Hardware acceleration for smoother animations */
    transform: translateZ(0);
    will-change: transform;
    /* Optimized for faster rendering */
    contain: layout style paint;
    /* Prevent layout shifts */
    min-height: 200px;
    /* Ensure modal content is always visible */
    position: relative;
    z-index: 2147483647;
}

/* Fullscreen modal content optimizations */
.kdsamref-dashboard.fullscreen-mode .kdsamref-modal-content {
    margin: 2% auto !important;
    max-width: 80% !important;
    max-height: 90vh !important;
    width: 90% !important;
    position: relative !important;
    z-index: 2147483647 !important;
    background-color: white !important;
    border-radius: 12px !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
}

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

.kdsamref-modal-header h2 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Replace the complex icon with a simple, meaningful one */
.kdsamref-modal-header h2 svg {
    width: 20px;
    height: 20px;
    color: #10b981;
    flex-shrink: 0;
}

.kdsamref-modal-close {
    background: transparent;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    position: relative;
    overflow: hidden;
}

.kdsamref-modal-close::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f3f4f6;
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.kdsamref-modal-close:hover {
    color: #374151;
    transform: scale(1.05);
}

.kdsamref-modal-close:hover::before {
    opacity: 1;
}

.kdsamref-modal-close:active {
    transform: scale(0.95);
}

.kdsamref-modal-close svg {
    position: relative;
    z-index: 1;
    transition: transform 0.2s ease;
}

.kdsamref-modal-close:hover svg {
    transform: rotate(90deg);
}

.kdsamref-modal-close:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.kdsamref-modal-close:focus:not(:focus-visible) {
    outline: none;
}

.kdsamref-modal-body {
    padding: 24px;
    /* Optimized for better performance */
    contain: layout style;
    /* Smooth scrolling for long content */
    scroll-behavior: smooth;
}

/* Modal Details */
.order-details .detail-section {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.order-details .detail-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.order-details .detail-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 12px 0;
}

.order-details .detail-section h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin: 0 0 8px 0;
}

.order-details .detail-section p {
    margin: 8px 0;
    font-size: 0.875rem;
    color: #374151;
}

.order-details .detail-section strong {
    color: #1a1a1a;
    font-weight: 600;
}

.items-list {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}

.item-detail {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 12px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.8125rem;
}

.item-detail:last-child {
    border-bottom: none;
}

.item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.item-name {
    font-weight: 500;
    color: #374151;
}

.item-qty {
    color: #6b7280;
    margin: 0 12px;
    white-space: nowrap;
}

.item-price {
    font-weight: 600;
    color: #10b981;
    white-space: nowrap;
}

.total-breakdown {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 0.8125rem;
}

.breakdown-item span:first-child {
    color: #6b7280;
}

.breakdown-item span:last-child {
    font-weight: 500;
    color: #374151;
}

.fees-breakdown {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.fee-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 0.8125rem;
}

.fee-item span:first-child {
    color: #6b7280;
}

.fee-item span:last-child {
    font-weight: 600;
    color: #dc2626;
}

/* Pulse Animation for New Orders */
.kdsamref-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .kdsamref-dashboard {
        padding: 16px;
    }

    .kdsamref-header {
        padding: 12px 16px;
        margin-bottom: 12px;
    }

    .kdsamref-header-right {
        gap: 8px;
    }

    .kdsamref-content-header {
        margin-bottom: 16px;
    }

    .kdsamref-status-filters {
        padding: 12px 16px;
        gap: 6px;
        margin-bottom: 16px;
        min-height: 50px;
    }

    .kdsamref-status-btn {
        padding: 8px 12px;
        min-width: 100px;
        min-height: 40px;
        font-size: 0.75rem;
    }

    .kdsamref-status-btn.workflow-status {
        padding: 8px 12px;
        min-width: 100px;
        min-height: 40px;
    }

    .kdsamref-header-actions {
        gap: 6px;
    }

    .kdsamref-wc-orders-btn,
    .kdsamref-today-btn {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .kdsamref-orders-container {
        gap: 12px;
        padding: 16px;
    }

    .kdsamref-order-card {
        padding: 16px;
        margin-bottom: 12px;
        min-height: 180px;
        border-radius: 10px;
    }

    .kdsamref-action-buttons {
        padding: 12px 16px;
        margin: 0 -16px -16px -16px;
    }

    .kdsamref-action-btn {
        padding: 10px 16px;
        min-height: 44px;
        font-size: 13px;
        max-width: 180px;
    }

    .kdsamref-delivery-badge,
    .kdsamref-status-badge {
        padding: 4px 8px;
        font-size: 0.625rem;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .kdsamref-dashboard {
        padding: 20px;
    }

    .kdsamref-header {
        padding: 16px 20px;
    }

    .kdsamref-header-left h1 {
        font-size: 18px;
    }



    .kdsamref-controls {
        gap: 6px;
    }

    .kdsamref-font-btn,
    .kdsamref-refresh-btn,
    .kdsamref-notifications-btn,
    .kdsamref-header-toggle-btn,
    .kdsamref-fullscreen-btn {
        padding: 6px 8px;
        font-size: 0.875rem;
    }

    .kdsamref-content-header {
        margin-bottom: 20px;
    }

    .kdsamref-section-title {
        font-size: 1rem;
    }

    .kdsamref-status-filters {
        padding: 14px 18px;
        gap: 8px;
    }

    .kdsamref-status-btn {
        padding: 10px 14px;
        min-width: 110px;
        min-height: 45px;
    }

    .kdsamref-status-btn .status-label {
        font-size: 0.8125rem;
    }

    .kdsamref-status-btn .status-count {
        font-size: 0.6875rem;
    }

    .kdsamref-orders-container {
        gap: 16px;
    }

    .kdsamref-order-card {
        padding: 20px;
        margin-bottom: 16px;
    }

    .kdsamref-order-number {
        font-size: 1rem;
    }

    .kdsamref-order-time {
        font-size: 0.8125rem;
    }

    .kdsamref-customer-name {
        font-size: 0.8125rem;
    }

    .kdsamref-order-items {
        gap: 12px;
    }

    .kdsamref-order-item {
        padding: 10px 12px;
    }

    .kdsamref-item-name {
        font-size: 0.8125rem;
    }

    .kdsamref-item-option {
        font-size: 0.6875rem;
    }

    .kdsamref-total-label,
    .kdsamref-total-amount {
        font-size: 0.875rem;
    }

    .kdsamref-action-buttons {
        padding: 14px 20px;
    }

    .kdsamref-action-btn {
        padding: 11px 20px;
        min-height: 46px;
        font-size: 13px;
        max-width: 190px;
    }

    .kdsamref-date-filters {
        gap: 8px;
    }

    .kdsamref-date-btn {
        padding: 8px 12px;
        font-size: 0.8125rem;
    }

    .kdsamref-date-mode-switch {
        padding: 6px 10px;
    }

    .kdsamref-switch {
        width: 40px;
        height: 20px;
    }

    .kdsamref-slider:before {
        height: 14px;
        width: 14px;
        left: 3px;
        bottom: 3px;
    }

    .kdsamref-switch input:checked + .kdsamref-slider:before {
        transform: translateX(18px);
    }

    .kdsamref-switch-label {
        font-size: 0.75rem;
    }

    .kdsamref-modal-content {
        width: 90%;
        max-width: 600px;
    }

    .kdsamref-modal-header {
        padding: 16px 20px;
    }

    .kdsamref-modal-body {
        padding: 20px;
    }

    .kdsamref-modal-header h2 {
        font-size: 1.125rem;
    }
}

@media (max-width: 480px) {
    .kdsamref-header-left h1 {
        font-size: 16px;
    }

    .kdsamref-modal-content {
        width: 95%;
        margin: 10px auto;
        max-height: 90vh;
    }
    
    .kdsamref-modal-header {
        padding: 12px 16px;
    }
    
    .kdsamref-modal-body {
        padding: 16px;
    }
    
    .kdsamref-modal-close {
        width: 32px;
        height: 32px;
        padding: 6px;
    }
    
    .kdsamref-modal-close svg {
        width: 16px;
        height: 16px;
    }

    .kdsamref-status-filters {
        padding: 10px 12px;
        gap: 4px;
        flex-direction: column;
        align-items: stretch;
    }

    .kdsamref-status-btn {
        padding: 8px 10px;
        min-width: auto;
        min-height: 36px;
        font-size: 0.6875rem;
        justify-content: center;
    }

    .kdsamref-status-btn.workflow-status {
        padding: 8px 10px;
        min-width: auto;
        min-height: 36px;
    }

    .kdsamref-action-buttons {
        padding: 10px 12px;
        margin: 0 -12px -12px -12px;
    }

    .kdsamref-action-btn {
        padding: 8px 12px;
        min-height: 40px;
        font-size: 12px;
        max-width: 160px;
    }

    .kdsamref-date-filters {
        flex-direction: column;
        gap: 6px;
    }

    .kdsamref-date-btn {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .kdsamref-date-mode-switch {
        padding: 4px 8px;
    }

    .kdsamref-switch-label {
        font-size: 0.6875rem;
    }
}

/* iPad Specific Responsive Design */
@media (min-width: 768px) and (max-width: 1024px) {
    .kdsamref-dashboard {
        padding: 16px;
    }
    
    .kdsamref-header {
        padding: 20px 24px;
        margin-bottom: 20px;
    }
    
    .kdsamref-header-left h1 {
        font-size: 24px;
    }
    

    

    
    .kdsamref-controls {
        gap: 12px;
    }
    
    .kdsamref-font-btn,
    .kdsamref-refresh-btn,
    .kdsamref-notifications-btn {
        width: 40px;
        height: 40px;
        border-radius: 8px;
    }
    

    
    .kdsamref-content-header {
        padding: 24px 28px;
    }
    
    .kdsamref-section-title {
        font-size: 1.25rem;
    }
    
    .kdsamref-status-filters {
        gap: 16px;
    }
    
    .kdsamref-status-btn {
        padding: 16px 20px;
        min-width: 100px;
        border-radius: 10px;
    }
    
    .kdsamref-status-btn .status-label {
        font-size: 13px;
    }
    
    .kdsamref-status-btn .status-count {
        font-size: 18px;
    }
    
    .kdsamref-orders-container {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
        gap: 18px;
        padding: 24px;
    }
    
    .kdsamref-order-card {
        padding: 20px;
        border-radius: 12px;
        min-height: 200px;
        max-width: 400px;
        min-width: 320px;
        width: 100%;
    }
}

/* iPad Air Specific (1180px and below) */
@media (max-width: 1180px) {
    .kdsamref-orders-container {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 12px;
        padding: 18px;
    }
    
    .kdsamref-order-card {
        padding: 18px;
        border-radius: 10px;
        min-height: 180px;
        max-width: 350px;
        min-width: 280px;
        width: 100%;
    }
    
    .kdsamref-order-number {
        font-size: 1.25rem;
    }
    
    .kdsamref-order-time {
        font-size: 0.75rem;
    }
    
    .kdsamref-customer-name {
        font-size: 16px;
    }
    
    .kdsamref-order-items {
        margin-bottom: 16px;
    }
    
    .kdsamref-order-item {
        padding: 10px 0;
        font-size: 0.875rem;
    }
    
    .kdsamref-item-name {
        font-size: 0.875rem;
    }
    
    .kdsamref-item-option {
        font-size: 0.75rem;
    }
    
    .kdsamref-total-label,
    .kdsamref-total-amount {
        font-size: 1.25rem;
    }
    
    .kdsamref-action-buttons {
        gap: 12px;
        padding-top: 16px;
    }
    
    .kdsamref-action-btn {
        padding: 10px 16px;
        font-size: 0.8125rem;
        border-radius: 8px;
        min-width: 100px;
    }
    
    /* Date filters for iPad */
    .kdsamref-date-filters {
        gap: 8px;
        margin-left: 12px;
    }
    
    .kdsamref-date-btn {
        padding: 8px 20px;
        font-size: 1rem;
        border-radius: 8px;
    }
    
    /* Date mode switch for iPad */
    .kdsamref-date-mode-switch {
        padding: 12px 20px;
        border-radius: 10px;
        gap: 16px;
    }
    
    .kdsamref-switch {
        width: 60px;
        height: 30px;
    }
    
    .kdsamref-slider:before {
        height: 24px;
        width: 24px;
        left: 2px;
        bottom: 2px;
    }
    
    .kdsamref-switch input:checked + .kdsamref-slider:before {
        transform: translateX(30px);
    }
    
    .kdsamref-switch-label {
        font-size: 14px;
    }
    
    /* Modal improvements for iPad */
    .kdsamref-modal-content {
        width: 85%;
        max-width: 700px;
        margin: 3% auto;
    }
    
    .kdsamref-modal-header {
        padding: 24px 28px;
    }
    
    .kdsamref-modal-body {
        padding: 28px;
    }
    
    .kdsamref-modal-header h2 {
        font-size: 1.25rem;
    }
}


/* Landscape iPad Optimization */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .kdsamref-header {
        flex-direction: row;
        align-items: center;
        gap: 24px;
    }
    
    .kdsamref-header-right {
        align-self: center;
    }
    
    .kdsamref-content-header {
        flex-direction: row;
        align-items: center;
        gap: 24px;
    }
    
    .kdsamref-orders-container {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
        gap: 16px;
    }
}

/* Tablet Button Optimizations (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .kdsamref-font-btn,
    .kdsamref-refresh-btn,
    .kdsamref-notifications-btn,
    .kdsamref-date-btn,
    .kdsamref-status-btn,
    .kdsamref-action-btn {
        min-height: 44px; /* Apple's recommended touch target size */
    }
    
    .kdsamref-font-btn,
    .kdsamref-refresh-btn,
    .kdsamref-notifications-btn,
    .kdsamref-header-toggle-btn,
    .kdsamref-fullscreen-btn,
    #kdsamref-dashboard-fullscreen-btn,
    .kdsamref-masonry-toggle-btn {
        width: 40px;
        height: 40px;
        border-radius: 8px;
    }
    
    .kdsamref-switch {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .kdsamref-date-mode-switch {
        min-height: 44px;
    }
    
    /* Improve touch targets */
    .kdsamref-order-card {
        cursor: pointer;
    }
    
    .kdsamref-order-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    }
    
    /* Better spacing for touch */
    .kdsamref-action-buttons {
        gap: 16px;
        padding-top: 20px;
    }
    
    .kdsamref-status-filters {
        gap: 16px;
    }
}

/* Small Mobile Button Optimizations (480px and below) */
@media (max-width: 480px) {
    .kdsamref-font-btn,
    .kdsamref-refresh-btn,
    .kdsamref-notifications-btn,
    .kdsamref-header-toggle-btn,
    .kdsamref-fullscreen-btn,
    #kdsamref-dashboard-fullscreen-btn,
    .kdsamref-masonry-toggle-btn {
        min-width: 48px !important;
        min-height: 48px !important;
        padding: 14px !important;
        border-radius: 10px !important;
    }
    
    .kdsamref-font-btn svg,
    .kdsamref-refresh-btn svg,
    .kdsamref-notifications-btn svg,
    .kdsamref-header-toggle-btn svg,
    .kdsamref-fullscreen-btn svg,
    #kdsamref-dashboard-fullscreen-btn svg,
    .kdsamref-masonry-toggle-btn svg {
        width: 22px !important;
        height: 22px !important;
    }
    
    .kdsamref-header-left h1 {
        font-size: 20px;
    }
    

    
    .kdsamref-modal-content {
        width: 95%;
        margin: 2% auto;
    }
    
    .kdsamref-status-filters {
        flex-direction: column;
    }
    
    .kdsamref-status-btn {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
}

/* Print Styles */
@media print {
    .kdsamref-header-actions,
    .kdsamref-status-filters,
    .kdsamref-action-buttons {
        display: none !important;
    }
    
    .kdsamref-order-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Date Filter Buttons */
.kdsamref-date-filters {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-left: 8px;
}
.kdsamref-date-btn {
    background: #f3f4f6;
    color: #222;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 6px 16px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border 0.15s;
    outline: none;
}
.kdsamref-date-btn:hover {
    background: #e5e7eb;
    color: #111;
    border-color: #b6bbc6;
}
.kdsamref-date-btn.active {
    background: #568bff;
    color: #fff;
    border-color: #568bff;
}

/* License Badge Styles */
.kdsamref-license-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    border: 1px solid;
    margin-right: 16px;
    transition: all 0.2s ease;
}

.kdsamref-license-free {
    background-color: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.kdsamref-license-premium {
    background-color: #d1edff;
    border-color: #74b9ff;
    color: #0984e3;
}

.kdsamref-license-icon {
    font-size: 14px;
    line-height: 1;
}

.kdsamref-license-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.kdsamref-license-status {
    font-weight: 600;
    font-size: 11px;
    line-height: 1.2;
}

.kdsamref-license-limits {
    font-size: 10px;
    opacity: 0.8;
    line-height: 1.2;
}

.kdsamref-upgrade-btn {
    padding: 4px 8px;
    background: #00b894;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    font-size: 11px;
    transition: background 0.2s;
    line-height: 1.2;
    white-space: nowrap;
}

.kdsamref-upgrade-btn:hover {
    background: #00a085;
    color: white;
    text-decoration: none;
}

/* License Warning */
.kdsamref-license-warning {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

.kdsamref-warning-icon {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
}

.kdsamref-warning-content {
    flex: 1;
}

.kdsamref-warning-content strong {
    display: block;
    margin-bottom: 4px;
    color: #856404;
    font-weight: 600;
}

.kdsamref-warning-content p {
    margin: 0;
    font-size: 13px;
    color: #856404;
    line-height: 1.4;
}

.kdsamref-warning-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.kdsamref-warning-actions .button {
    padding: 6px 12px;
    font-size: 12px;
    height: auto;
    line-height: 1.2;
    border-radius: 4px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.kdsamref-warning-actions .button-primary {
    background: #00b894;
    color: white;
}

.kdsamref-warning-actions .button-primary:hover {
    background: #00a085;
}

.kdsamref-warning-actions .button-secondary {
    background: #f8f9fa;
    color: #374151;
    border: 1px solid #d1d5db;
}

.kdsamref-warning-actions .button-secondary:hover {
    background: #e5e7eb;
    color: #1f2937;
}

/* Order Limit Warning */
.kdsamref-limit-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.kdsamref-limit-warning a {
    margin-left: auto;
    color: #0073aa;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.kdsamref-limit-warning a:hover {
    color: #005a87;
    text-decoration: underline;
}

/* Disabled button styles */
button[disabled], .kdsamref-date-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f3f4f6 !important;
    color: #9ca3af !important;
    border-color: #e5e7eb !important;
}

button[disabled]:hover, .kdsamref-date-btn[disabled]:hover {
    background: #f3f4f6 !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Enhanced Item Options */
.kdsamref-item-left {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    flex: 1;
    flex-direction: row;
}

.kdsamref-item-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.kdsamref-item-name {
    color: #374151;
    font-weight: 500;
    line-height: 1.3;
}

.kdsamref-item-options {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 2px;
}

.kdsamref-item-option {
    font-size: 0.6875rem;
    color: #6b7280;
    font-style: italic;
    padding: 1px 0;
    line-height: 1.3;
}

.kdsamref-item-option strong {
    color: #374151;
    font-weight: 600;
    font-style: normal;
}

/* Enhanced Tip Information */
.kdsamref-tip-info {
    font-size: 12px;
    color: #dc2626;
    font-weight: 600;
    margin-top: 4px;
    padding: 3px 8px;
    background: #fef2f2;
    border-radius: 4px;
    border: 1px solid #fecaca;
    display: inline-block;
}

/* Enhanced Scheduled Time */
.kdsamref-scheduled-time {
    font-size: 0.6875rem;
    color: #059669;
    font-weight: 500;
    margin: 4px 0;
    padding: 3px 8px;
    position: absolute;
    right: 13px;
    background: #ecfdf5;
    border-radius: 4px;
    border: 1px solid #a7f3d0;
    display: inline-block;
}

/* Enhanced Orderable Location */
.kdsamref-orderable-location {
    font-size: 12px;
    color: #374151;
    font-weight: 500;
    margin: 2px 0;
    padding: 2px 0;
}

/* Enhanced Special Instructions */
.kdsamref-special-instructions {
    font-size: 12px;
    color: #6b7280;
    font-style: italic;
    margin: 2px 0;
    padding: 4px 8px;
    background: #fef3c7;
    border-radius: 4px;
    line-height: 1.3;
}

/* Enhanced Orderable Info Container */
.kdsamref-orderable-info {
    margin-bottom: 12px;
    padding: 8px 12px;
    background: #f9fafb;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

/* Modal Item Options */
.order-details .item-detail .item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.order-details .item-detail .item-name {
    font-weight: 500;
    color: #374151;
    margin-bottom: 2px;
}

.order-details .item-detail .kdsamref-item-options {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.order-details .item-detail .kdsamref-item-option {
    font-size: 0.6875rem;
    color: #6b7280;
    font-style: italic;
    line-height: 1.2;
}

.order-details .item-detail .kdsamref-item-option strong {
    color: #374151;
    font-weight: 600;
    font-style: normal;
}

/* Status Updated Animation */
.kdsamref-order-card.status-updated {
    animation: statusUpdate 1s ease;
}

@keyframes statusUpdate {
    0% {
        transform: scale(1);
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    }
}

/* Enhanced delivery type mapping for Orderable service types */
.kdsamref-delivery-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Delivery badge colors - will be overridden by JavaScript with settings colors */
.kdsamref-delivery-badge.pickup {
    background: #a78bfa; /* Pastel mor - default */
    color: #ffffff;
}

.kdsamref-delivery-badge.delivery {
    background: #4ade80; /* Pastel yeşil - default */
    color: #ffffff;
}

.kdsamref-delivery-badge.dine-in {
    background: #60a5fa; /* Pastel mavi - default */
    color: #ffffff;
}

/* Animate in for filtered orders */
.kdsamref-order-card.animate-in {
    animation: slideInUp 0.3s ease;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* WooCommerce Mode Delivery Types - Additional to existing */
.kdsamref-delivery-badge.numerique {
    background: #17a2b8;
    color: #ffffff;
}

.kdsamref-delivery-badge.point-vente {
    background: #6f42c1;
    color: #ffffff;
}

.kdsamref-delivery-badge.retrait {
    background: #ff6f00;
    color: #ffffff;
}

/* Order Cards for Different Compatibility Modes */
.kdsamref-order-card[data-compatibility-mode="woocommerce"] {
    /* border-left removed */
}

.kdsamref-order-card[data-compatibility-mode="orderable"] {
    /* border-left removed */
}

.kdsamref-order-card[data-compatibility-mode="auto"] {
    /* border-left removed */
}

/* Mode-specific card colors */
.kdsamref-order-card[data-compatibility-mode="woocommerce"].numerique {
    border-color: #17a2b8;
}

.kdsamref-order-card[data-compatibility-mode="woocommerce"].point-vente {
    border-color: #6f42c1;
}

.kdsamref-order-card[data-compatibility-mode="woocommerce"].delivery {
    border-color: #4ade80; /* Pastel yeşil */
}

.kdsamref-order-card[data-compatibility-mode="woocommerce"].pickup {
    border-color: #a78bfa; /* Pastel mor */
}

/* Digital Order Special Styling */
.kdsamref-order-card.numerique {
    border-color: #17a2b8;
    background: linear-gradient(135deg, #ffffff 0%, #f8fdff 100%);
}

.kdsamref-order-card.numerique::before {
    content: "\1f4bb";
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 18px;
    opacity: 0.3;
}

.kdsamref-order-card.numerique .kdsamref-delivery-badge {
    position: relative;
}

.kdsamref-order-card.numerique .kdsamref-delivery-badge::after {
    content: " \2699\fe0f";
    margin-left: 4px;
}

/* Switch Button Styles */
.kdsamref-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 26px;
    flex-shrink: 0;
}

.kdsamref-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.kdsamref-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e9ecef;
    transition: .3s ease;
    border-radius: 26px;
    border: 1px solid #dee2e6;
}

.kdsamref-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .3s ease;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.kdsamref-switch input:checked + .kdsamref-slider {
    background-color: #00b893;
    border-color: #00b893;
}

.kdsamref-switch input:checked + .kdsamref-slider:before {
    transform: translateX(26px);
}

.kdsamref-switch input:focus + .kdsamref-slider {
    box-shadow: 0 0 0 2px rgba(0,184,147,0.2);
}

/* Tomorrow button visibility */
.kdsamref-tomorrow-btn {
    display: none !important;
}

.kdsamref-tomorrow-btn.show {
    display: inline-block !important;
}

/* Date mode switch container */
.kdsamref-date-mode-switch {
    background: #ffffff;
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
}

.kdsamref-date-mode-switch:hover {
    border-color: #00b893;
}

.kdsamref-date-mode-switch span {
    font-size: 13px;
    color: #6c757d;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s ease;
    cursor: pointer;
}

.kdsamref-switch-label {
    font-size: 13px;
    color: #6c757d;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s ease;
    cursor: pointer;
}

/* Active mode indicator */
.kdsamref-date-mode-switch .active-mode {
    color: #00b893;
    font-weight: 600;
    position: relative;
}

.kdsamref-date-mode-switch .active-mode::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #00b893;
    border-radius: 1px;
}

/* Fixed Header Toggle Button (Shows when header is hidden) */
.kdsamref-header-toggle-fixed {
    position: fixed;
    top: 0;
    right: 20px;
    width: 32px;
    height: 32px;
    border: 1px solid #e9ecef;
    background: #ffffff;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6c757d;
    z-index: 10000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
}

.kdsamref-header-toggle-fixed:hover {
    background: #f8f9fa;
    border-color: #00b893;
    color: #00b893;
}

.kdsamref-header-toggle-fixed.active {
    background: #00b893;
    border-color: #00b893;
    color: white;
}

/* Show fixed button when header is hidden */
.kdsamref-dashboard.kdsamref-header-hidden .kdsamref-header-toggle-fixed {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

/* Hide fixed button when header is visible */
.kdsamref-dashboard:not(.kdsamref-header-hidden) .kdsamref-header-toggle-fixed {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
}

/* Mobile optimization for fixed button */
@media (max-width: 768px) {
    .kdsamref-header-toggle-fixed {
        top: 0;
        right: 15px;
        width: 36px;
        height: 36px;
        border-radius: 8px;
    }
}

/* iPad optimization for fixed button */
@media (min-width: 768px) and (max-width: 1024px) {
    .kdsamref-header-toggle-fixed {
        top: 0;
        right: 20px;
        width: 40px;
        height: 40px;
        border-radius: 8px;
    }
}

/* Header Controls */
.kdsamref-header-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.kdsamref-header-controls-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.kdsamref-header-controls-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.kdsamref-date-filters {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

/* Responsive Design for Header Controls */
@media (max-width: 768px) {
    .kdsamref-header-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .kdsamref-header-controls-left {
        justify-content: center;
        width: 100%;
    }
    
    .kdsamref-header-controls-right {
        justify-content: center;
        width: 100%;
    }
    
    .kdsamref-date-filters {
        justify-content: center;
        width: 100%;
    }
    
    .kdsamref-date-mode-switch {
        justify-content: center;
        width: 100%;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .kdsamref-header-controls {
        gap: 12px;
    }
    
    .kdsamref-header-controls-left {
        gap: 8px;
    }
    
    .kdsamref-header-controls-right {
        gap: 6px;
    }
}

@media (max-width: 480px) {
    .kdsamref-dashboard-logo {
        width: 80px;
        height: 40px;
    }
    
    .kdsamref-dashboard-logo svg {
        max-width: 80px;
    }
    
    .kdsamref-header-left h1 {
        font-size: 18px;
    }
    
    .kdsamref-header-controls {
        gap: 8px;
    }
    
    .kdsamref-date-filters {
        gap: 4px;
    }
    
    .kdsamref-date-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .kdsamref-date-mode-switch {
        gap: 8px;
    }
    
    .kdsamref-switch-label {
        font-size: 11px;
    }
}

.kdsamref-order-card.completed .kdsamref-action-buttons {
    opacity: 0.7;
}

.kdsamref-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 16px;
    margin-right: 8px;
    vertical-align: middle;
}

.kdsamref-action-arrow {
    display: inline-block;
    margin-left: 8px;
    font-size: 16px;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.kdsamref-action-btn:hover .kdsamref-action-arrow {
    transform: translateX(3px);
}

/* Payment status styles */
.payment-paid {
    color: #10b981;
    font-weight: 600;
    background: #d1fae5;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.payment-pending {
    color: #f59e0b;
    font-weight: 600;
    background: #fef3c7;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.payment-failed {
    color: #ef4444;
    font-weight: 600;
    background: #fee2e2;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

/* Payment information section styles */
.detail-section h3 {
    color: #374151;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.detail-section p {
    margin: 8px 0;
    line-height: 1.5;
}

.detail-section strong {
    color: #374151;
    font-weight: 600;
    min-width: 120px;
    display: inline-block;
}

/* Pro Feature Badge Styles */
.kdsamref-pro-feature {
    position: relative;
    opacity: 0.7;
    cursor: not-allowed;
}

.kdsamref-pro-feature:hover {
    opacity: 0.8;
}

.kdsamref-pro-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #3b82f6;
    color: white;
    font-size: 8px;
    font-weight: 600;
    padding: 1px 4px;
    border-radius: 3px;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}