JezK
Edit File: dispatch-counter.css
/* Dispatch Counter Styles */ .dispatch-toggle-container { background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); margin-bottom: 20px; border-left: 4px solid #0073aa; } .dispatch-switch { position: relative; display: inline-block; width: 60px; height: 34px; margin-right: 15px; } .dispatch-switch input { opacity: 0; width: 0; height: 0; } .dispatch-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: 0.4s; border-radius: 34px; } .dispatch-slider:before { position: absolute; content: ""; height: 26px; width: 26px; left: 4px; bottom: 4px; background-color: white; transition: 0.4s; border-radius: 50%; } input:checked + .dispatch-slider { background-color: #0073aa; } input:checked + .dispatch-slider:before { transform: translateX(26px); } .dispatch-toggle-label { font-weight: 600; color: #333; vertical-align: middle; } .dispatch-toggle-description { margin: 10px 0 0 0; color: #666; font-style: italic; } /* Counter Grid */ .dispatch-counter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-bottom: 30px; transition: opacity 0.3s ease; } .dispatch-counter-grid.loading { opacity: 0.6; } /* Dispatch Cards */ .dispatch-card { background: #fff; border-radius: 12px; padding: 24px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); transition: all 0.3s ease; border: 2px solid transparent; position: relative; overflow: hidden; } .dispatch-card:hover { transform: translateY(-4px); box-shadow: 0 8px 25px rgba(0,0,0,0.15); } .dispatch-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; } .dispatch-card-header h3 { margin: 0; font-size: 16px; font-weight: 600; color: #333; } .dispatch-icon { font-size: 24px; opacity: 0.8; } .dispatch-count { font-size: 48px; font-weight: 700; line-height: 1; margin-bottom: 8px; transition: all 0.3s ease; } .dispatch-count.count-changing { transform: scale(1.1); color: #0073aa; } .dispatch-subtitle { color: #666; font-size: 14px; font-weight: 500; } /* Card Status Colors */ .dispatch-card.zero-count { border-color: #e0e0e0; } .dispatch-card.zero-count .dispatch-count { color: #999; } .dispatch-card.low-count { border-color: #ff9800; } .dispatch-card.low-count .dispatch-count { color: #ff9800; } .dispatch-card.medium-count { border-color: #2196f3; } .dispatch-card.medium-count .dispatch-count { color: #2196f3; } .dispatch-card.high-count { border-color: #4caf50; } .dispatch-card.high-count .dispatch-count { color: #4caf50; } /* Specific card styles */ .dispatch-card.total-orders { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; } .dispatch-card.total-orders .dispatch-card-header h3, .dispatch-card.total-orders .dispatch-subtitle { color: white; } .dispatch-card.total-orders .dispatch-count { color: white; } .dispatch-card.total-boxes { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); color: white; } .dispatch-card.total-boxes .dispatch-card-header h3, .dispatch-card.total-boxes .dispatch-subtitle { color: white; } .dispatch-card.total-boxes .dispatch-count { color: white; } .dispatch-card.processing-orders { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); color: white; } .dispatch-card.processing-orders .dispatch-card-header h3, .dispatch-card.processing-orders .dispatch-subtitle { color: white; } .dispatch-card.processing-orders .dispatch-count { color: white; } .dispatch-card.completed-orders { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); color: white; } .dispatch-card.completed-orders .dispatch-card-header h3, .dispatch-card.completed-orders .dispatch-subtitle { color: white; } .dispatch-card.completed-orders .dispatch-count { color: white; } /* Actions */ .dispatch-actions { display: flex; gap: 15px; margin-bottom: 30px; flex-wrap: wrap; } .dispatch-actions .button { padding: 12px 24px; border-radius: 6px; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; transition: all 0.3s ease; } .dispatch-actions .button:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); } /* Dispatch Info */ .dispatch-info { background: #fff; padding: 24px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); margin-bottom: 20px; } .dispatch-info h3 { margin-top: 0; margin-bottom: 20px; color: #333; border-bottom: 2px solid #0073aa; padding-bottom: 10px; } .dispatch-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; } .info-item { display: flex; flex-direction: column; gap: 5px; } .info-item strong { color: #333; font-weight: 600; } .info-item span { color: #666; } .info-item .button { margin-top: 5px; align-self: flex-start; } /* Auto refresh status styles */ #auto-refresh-status { transition: all 0.3s ease; font-weight: 500; } #auto-refresh-status.countdown-urgent { color: #d63638; font-weight: 600; animation: pulse-text 1s infinite; } #auto-refresh-status.background-refresh { color: #0073aa; font-weight: 600; font-style: italic; } @keyframes pulse-text { 0% { opacity: 1; } 50% { opacity: 0.7; } 100% { opacity: 1; } } /* Loading */ .dispatch-loading { display: flex; align-items: center; gap: 10px; padding: 15px; background: #fff; border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); margin: 20px 0; justify-content: center; } .dispatch-loading .spinner { margin: 0; } /* Tooltips */ .dispatch-tooltip { position: absolute; background: #333; color: white; padding: 8px 12px; border-radius: 4px; font-size: 12px; white-space: nowrap; z-index: 1000; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 5px; } .dispatch-tooltip:after { content: ''; position: absolute; top: 100%; left: 50%; margin-left: -5px; border: 5px solid transparent; border-top-color: #333; } /* Animations */ @keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(0, 115, 170, 0.7); } 70% { box-shadow: 0 0 0 10px rgba(0, 115, 170, 0); } 100% { box-shadow: 0 0 0 0 rgba(0, 115, 170, 0); } } .dispatch-card.count-changing { animation: pulse 1s infinite; } /* Widget Styles */ .dispatch-widget { background: #fff; padding: 16px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); border-left: 4px solid #0073aa; } .dispatch-widget h4 { margin: 0 0 12px 0; color: #333; font-size: 14px; font-weight: 600; } .dispatch-widget-content { display: flex; gap: 20px; margin-bottom: 12px; } .dispatch-widget-item { text-align: center; } .dispatch-widget-item .count { display: block; font-size: 24px; font-weight: 700; color: #0073aa; line-height: 1; } .dispatch-widget-item .label { display: block; font-size: 12px; color: #666; margin-top: 4px; } /* Responsive Design */ @media (max-width: 768px) { .dispatch-counter-grid { grid-template-columns: 1fr; gap: 15px; } .dispatch-card { padding: 20px; } .dispatch-count { font-size: 36px; } .dispatch-actions { flex-direction: column; } .dispatch-actions .button { justify-content: center; } .dispatch-info-grid { grid-template-columns: 1fr; gap: 15px; } .dispatch-toggle-container { padding: 15px; } } @media (max-width: 480px) { .dispatch-card { padding: 16px; } .dispatch-count { font-size: 28px; } .dispatch-card-header h3 { font-size: 14px; } .dispatch-icon { font-size: 20px; } } /* Items Breakdown Styles */ .items-breakdown-section { background: #fff; padding: 24px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); margin-bottom: 20px; } .items-breakdown-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0; } .items-breakdown-header h3 { margin: 0; color: #333; } .items-breakdown-content { margin-top: 20px; } .items-breakdown h4 { margin: 0 0 20px 0; color: #333; border-bottom: 2px solid #0073aa; padding-bottom: 10px; } .items-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; } .item-category { background: #f8f9fa; border-radius: 8px; padding: 16px; border-left: 4px solid #0073aa; } .item-category h5 { margin: 0 0 12px 0; color: #333; font-weight: 600; font-size: 16px; } .item-list { list-style: none; margin: 0; padding: 0; } .item-entry { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid #e0e0e0; } .item-entry:last-child { border-bottom: none; } .item-name { color: #333; font-weight: 500; flex: 1; } .item-quantity { background: #0073aa; color: white; padding: 4px 8px; border-radius: 12px; font-weight: 600; font-size: 14px; min-width: 30px; text-align: center; } /* Category-specific colors */ .item-category:nth-child(1) { border-left-color: #d63638; } .item-category:nth-child(1) .item-quantity { background: #d63638; } .item-category:nth-child(2) { border-left-color: #00a32a; } .item-category:nth-child(2) .item-quantity { background: #00a32a; } .item-category:nth-child(3) { border-left-color: #dba617; } .item-category:nth-child(3) .item-quantity { background: #dba617; } .item-category:nth-child(4) { border-left-color: #8c44cb; } .item-category:nth-child(4) .item-quantity { background: #8c44cb; } /* Toggle button styles */ #toggle-items-breakdown { display: inline-flex; align-items: center; gap: 5px; transition: all 0.3s ease; } #toggle-items-breakdown:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,0.15); } /* Responsive design for items breakdown */ @media (max-width: 768px) { .items-breakdown-header { flex-direction: column; align-items: flex-start; gap: 15px; } .items-grid { grid-template-columns: 1fr; gap: 15px; } .item-category { padding: 12px; } .items-breakdown-section { padding: 16px; } } @media (max-width: 480px) { .item-entry { flex-direction: column; align-items: flex-start; gap: 5px; } .item-quantity { align-self: flex-end; } } /* New Card-based Items Breakdown Styles */ .items-breakdown-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 20px; margin-top: 20px; } .breakdown-category-card { background: #fff; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.08); overflow: hidden; transition: all 0.3s ease; border: 1px solid #e1e5e9; } .breakdown-category-card:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0,0,0,0.12); } .category-card-header { background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%); padding: 16px 20px; border-bottom: 1px solid #e1e5e9; display: flex; align-items: center; gap: 12px; } .category-icon { font-size: 24px; width: 40px; height: 40px; background: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,0.1); } .category-title { margin: 0; font-size: 18px; font-weight: 600; color: #333; flex: 1; } .category-count { font-size: 14px; color: #666; font-weight: 500; background: rgba(0, 115, 170, 0.1); padding: 4px 8px; border-radius: 12px; } .category-items-grid { padding: 16px 20px 20px; display: grid; gap: 12px; } .item-card { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: #f8f9fa; border-radius: 8px; transition: all 0.2s ease; border-left: 3px solid transparent; } .item-card:hover { background: #e9ecef; transform: translateX(4px); border-left-color: #0073aa; } .item-info { flex: 1; } .item-name { font-weight: 500; color: #333; font-size: 15px; line-height: 1.3; } .item-quantity-badge { background: linear-gradient(135deg, #0073aa 0%, #005a87 100%); color: white; padding: 6px 12px; border-radius: 20px; font-weight: 600; font-size: 14px; min-width: 40px; text-align: center; box-shadow: 0 2px 4px rgba(0, 115, 170, 0.3); transition: all 0.2s ease; } .item-card:hover .item-quantity-badge { transform: scale(1.05); box-shadow: 0 4px 8px rgba(0, 115, 170, 0.4); } /* Category-specific styling */ .breakdown-category-card[data-category="main-dishes"] .category-card-header { background: linear-gradient(135deg, #ffe5e5 0%, #ffcccc 100%); } .breakdown-category-card[data-category="main-dishes"] .item-quantity-badge { background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%); box-shadow: 0 2px 4px rgba(231, 76, 60, 0.3); } .breakdown-category-card[data-category="side-dishes"] .category-card-header { background: linear-gradient(135deg, #fff3e0 0%, #ffe0b3 100%); } .breakdown-category-card[data-category="side-dishes"] .item-quantity-badge { background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%); box-shadow: 0 2px 4px rgba(243, 156, 18, 0.3); } .breakdown-category-card[data-category="bread-rice"] .category-card-header { background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%); } .breakdown-category-card[data-category="bread-rice"] .item-quantity-badge { background: linear-gradient(135deg, #3498db 0%, #2980b9 100%); box-shadow: 0 2px 4px rgba(52, 152, 219, 0.3); } .breakdown-category-card[data-category="accompaniments"] .category-card-header { background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%); } .breakdown-category-card[data-category="accompaniments"] .item-quantity-badge { background: linear-gradient(135deg, #27ae60 0%, #229954 100%); box-shadow: 0 2px 4px rgba(39, 174, 96, 0.3); } .breakdown-category-card[data-category="others"] .category-card-header { background: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%); } .breakdown-category-card[data-category="others"] .item-quantity-badge { background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%); box-shadow: 0 2px 4px rgba(155, 89, 182, 0.3); } /* Empty state */ .items-breakdown-empty { text-align: center; padding: 40px 20px; color: #666; font-style: italic; } .items-breakdown-empty p { margin: 0; font-size: 16px; } /* Responsive design for new cards */ @media (max-width: 768px) { .items-breakdown-cards { grid-template-columns: 1fr; gap: 16px; } .breakdown-category-card { margin: 0 -10px; } .category-card-header { padding: 14px 16px; } .category-items-grid { padding: 14px 16px 16px; } .item-card { padding: 10px 14px; } .category-title { font-size: 16px; } .category-icon { width: 36px; height: 36px; font-size: 20px; } } @media (max-width: 480px) { .items-breakdown-cards { grid-template-columns: 1fr; gap: 12px; margin: 16px -10px 0; } .category-card-header { padding: 12px 14px; flex-wrap: wrap; gap: 8px; } .category-title { font-size: 15px; } .category-count { font-size: 12px; order: 3; width: 100%; text-align: left; background: transparent; padding: 0; margin-top: 4px; } .item-card { padding: 8px 12px; flex-direction: column; align-items: flex-start; gap: 8px; } .item-quantity-badge { align-self: flex-end; margin-top: 4px; } } /* Animation for items appearing */ @keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } } .breakdown-category-card { animation: fadeInUp 0.3s ease forwards; } .breakdown-category-card:nth-child(1) { animation-delay: 0.1s; } .breakdown-category-card:nth-child(2) { animation-delay: 0.2s; } .breakdown-category-card:nth-child(3) { animation-delay: 0.3s; } .breakdown-category-card:nth-child(4) { animation-delay: 0.4s; } .breakdown-category-card:nth-child(5) { animation-delay: 0.5s; } /* Dark mode support (if needed) */ @media (prefers-color-scheme: dark) { .dispatch-toggle-container, .dispatch-info, .dispatch-loading, .items-breakdown-section { background: #2c2c2c; color: #fff; } .dispatch-toggle-label, .dispatch-info h3, .items-breakdown-header h3, .items-breakdown h4, .item-category h5, .item-name { color: #fff; } .dispatch-toggle-description { color: #ccc; } .info-item strong { color: #fff; } .info-item span { color: #ccc; } .item-category { background: #3c3c3c; } .item-entry { border-bottom-color: #555; } /* Dark mode for new cards */ .breakdown-category-card { background: #3c3c3c; border-color: #555; } .category-card-header { background: linear-gradient(135deg, #4a4a4a 0%, #555 100%); border-bottom-color: #666; } .category-title, .item-name { color: #fff; } .category-count { color: #ccc; background: rgba(255, 255, 255, 0.1); } .item-card { background: #4a4a4a; } .item-card:hover { background: #555; } .category-icon { background: #555; } }