/* สวิตช์ ON / OFF */ .form-check-input.switch-on { background-color: #28a745 !important; /* เขียว */ border-color: #28a745 !important; } .form-check-input.switch-off { background-color: #dc3545 !important; /* แดง */ border-color: #dc3545 !important; } body { font-family: 'Sarabun', sans-serif; background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%); min-height: 100vh; } .reports-wrapper { padding: 30px; min-height: calc(100vh - 60px); } .page-header { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 2rem; border-radius: 15px; margin-bottom: 2rem; box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3); } .stats-card { background: white; border-radius: 15px; padding: 1.5rem; margin-bottom: 1.5rem; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08); transition: all 0.3s ease; border-left: 4px solid; } .stats-card:hover { transform: translateY(-5px); box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15); } .stats-card.primary { border-left-color: #667eea; } .stats-card.success { border-left-color: #28a745; } .stats-card.warning { border-left-color: #ffc107; } .stats-card.info { border-left-color: #17a2b8; } .stats-card.danger { border-left-color: #dc3545; } .stats-icon { width: 60px; height: 60px; border-radius: 15px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; margin-bottom: 1rem; } .stats-icon.primary { background: linear-gradient(135deg, #667eea, #764ba2); color: white; } .stats-icon.success { background: linear-gradient(135deg, #28a745, #20c997); color: white; } .stats-icon.warning { background: linear-gradient(135deg, #ffc107, #fd7e14); color: white; } .stats-icon.info { background: linear-gradient(135deg, #17a2b8, #6f42c1); color: white; } .stats-icon.danger { background: linear-gradient(135deg, #dc3545, #e83e8c); color: white; } .stats-number { font-size: 2.5rem; font-weight: 700; margin-bottom: 0.5rem; } .stats-label { color: #6c757d; font-weight: 500; margin-bottom: 0; } .chart-card { background: white; border-radius: 15px; padding: 1.5rem; margin-bottom: 1.5rem; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08); overflow: hidden; } .chart-container { position: relative; width: 100%; overflow: hidden; } .chart-container.line-chart { height: 400px; } .chart-container.pie-chart { height: 350px; } .chart-container.bar-chart { height: 300px; } .chart-container canvas { max-width: 100% !important; height: auto !important; } .chart-card h5 { color: #495057; font-weight: 600; margin-bottom: 1.5rem; padding-bottom: 0.5rem; border-bottom: 2px solid #e9ecef; } .filter-card { background: white; border-radius: 15px; padding: 1.5rem; margin-bottom: 1.5rem; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08); } .btn-filter { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border: none; color: white; padding: 0.5rem 1.5rem; border-radius: 25px; font-weight: 500; transition: all 0.3s ease; } .btn-filter:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4); color: white; } .table-responsive { border-radius: 15px; overflow: hidden; box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1); } .table thead th { background-color: #5a67d8; color: white; border: none; font-weight: 600; text-align: center; padding: 18px 15px; font-size: 14px; letter-spacing: 0.5px; } .table tbody tr { transition: all 0.3s ease; border-bottom: 1px solid #e9ecef; } .table tbody tr:nth-child(even) { background-color: #f8f9fb; } .table tbody tr:nth-child(odd) { background-color: #ffffff; } .table tbody tr:hover { background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); } .table tbody td { padding: 15px 12px; font-size: 14px; color: #495057; vertical-align: middle; border-top: none; font-weight: 400; } .table tbody td:first-child { font-weight: 600; color: #6c757d; text-align: center; } /* Badge styling */ .badge { font-size: 11px; font-weight: 500; padding: 6px 12px; border-radius: 20px; letter-spacing: 0.3px; } .badge-primary { background: linear-gradient(135deg, #007bff 0%, #0056b3 100%); color: white; box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3); } .badge-warning { background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%); color: #212529; box-shadow: 0 2px 4px rgba(255, 193, 7, 0.3); } .badge-success { background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%); color: white; box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3); } .badge-notify { background-color: #ff4d4d; /* สีแดงแบบในรูป */ color: white; padding: 2px 6px; border-radius: 10px; font-size: 14px; font-weight: bold; margin-left: 5px; box-shadow: 0 2px 4px rgba(0,0,0,0.2); } /* ปรับให้เมนูยืดเต็มพื้นที่เพื่อให้ badge ไปอยู่ขวาสุด */ /* Action buttons */ .table .btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 8px; margin: 0 2px; transition: all 0.3s ease; } .btn-outline-primary { color: #4a90e2; border-color: #4a90e2; } .btn-outline-primary:hover { background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%); border-color: #4a90e2; color: white; transform: translateY(-1px); box-shadow: 0 3px 8px rgba(74, 144, 226, 0.4); } .btn-outline-secondary { color: #6c757d; border-color: #6c757d; } .btn-outline-secondary:hover { background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%); border-color: #6c757d; color: white; transform: translateY(-1px); box-shadow: 0 3px 8px rgba(108, 117, 125, 0.4); } .badge-status { padding: 0.5rem 1rem; border-radius: 25px; font-weight: 500; } .export-btn { background: linear-gradient(135deg, #28a745 0%, #20c997 100%); border: none; color: white; padding: 0.5rem 1.5rem; border-radius: 25px; font-weight: 500; margin-right: 0.5rem; transition: all 0.3s ease; } .export-btn:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4); color: white; } /* DataTables custom styling */ .dataTables_wrapper .dataTables_length, .dataTables_wrapper .dataTables_filter, .dataTables_wrapper .dataTables_info, .dataTables_wrapper .dataTables_paginate { margin: 15px 0; } .dataTables_wrapper .dataTables_length select, .dataTables_wrapper .dataTables_filter input { border: 2px solid #e9ecef; border-radius: 8px; padding: 8px 12px; transition: all 0.3s ease; background-color: #f8f9fa; } .dataTables_wrapper .dataTables_length select:focus, .dataTables_wrapper .dataTables_filter input:focus { border-color: #4a90e2; background-color: #fff; box-shadow: 0 0 0 0.2rem rgba(74, 144, 226, 0.25); outline: none; } .dataTables_wrapper .dataTables_paginate .paginate_button { border: none !important; background: #f8f9fa !important; color: #4a90e2 !important; border-radius: 6px !important; margin: 0 2px !important; padding: 8px 12px !important; transition: all 0.3s ease !important; } .dataTables_wrapper .dataTables_paginate .paginate_button:hover { background: #4a90e2 !important; color: white !important; transform: translateY(-1px) !important; border: none !important; box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3) !important; } .dataTables_wrapper .dataTables_paginate .paginate_button.current { background: #4a90e2 !important; color: white !important; } .dataTables_wrapper .dataTables_info { color: #6c757d; font-weight: 500; } .breadcrumb { background: rgba(255, 255, 255, 0.2); border-radius: 25px; padding: 0.5rem 1rem; } .breadcrumb-item a { color: rgba(255, 255, 255, 0.9); text-decoration: none; } .breadcrumb-item.active { color: rgba(255, 255, 255, 0.8); } /* Sidebar States */ body.sidebar-open { overflow: hidden; } .sidebar-overlay { position: fixed; top: 60px; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.5); z-index: 999; opacity: 0; visibility: hidden; transition: all 0.3s ease; } .sidebar-overlay.show { opacity: 1; visibility: visible; } /* Mobile Responsive */ @media (max-width: 992px) { .main-content { margin-left: 0 !important; } } @media (max-width: 768px) { .reports-wrapper { padding: 15px; } .page-header { padding: 1.5rem; } .stats-number { font-size: 2rem; } /* Table responsive styling */ .table tbody td { font-size: 13px; padding: 12px 8px; } .table thead th { font-size: 13px; padding: 12px 8px; } .badge { font-size: 10px; padding: 4px 8px; } .table .btn-sm { padding: 4px 8px; font-size: 11px; } .export-btn { padding: 8px 12px; font-size: 12px; margin: 2px; } .dataTables_wrapper .dataTables_length, .dataTables_wrapper .dataTables_filter, .dataTables_wrapper .dataTables_info, .dataTables_wrapper .dataTables_paginate { text-align: center; margin: 10px 0; } } body { font-family: 'Sarabun', sans-serif; background: #f8f9fa; margin: 0; overflow-x: hidden; } /* Top Navbar */ .top-navbar { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); position: fixed; top: 0; left: 0; right: 0; z-index: 1030; height: 60px; position: fixed !important; } .navbar-brand { font-weight: 600; color: #fff !important; font-size: 1.1rem; } .navbar-toggler { border: none; color: #fff; padding: 0.5rem; } .navbar-toggler:focus { outline: none; box-shadow: none; } .navbar-toggler-icon { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e"); } /* Sidebar */ #sidebar { width: 260px; background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%); color: #fff; min-height: 100vh; position: fixed; top: 60px; left: 0; z-index: 1000; transition: all 0.3s ease; overflow-y: auto; box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1); } /* กำหนด sidebar ให้สูงเต็มจอ และเลื่อนได้ */ #sidebar { height: 100vh; /* เต็มจอ */ overflow-y: auto; /* เลื่อนทั้ง sidebar ได้ */ overflow-x: hidden; /* ไม่ให้เลื่อนแนวนอน */ } /* submenu เวลาขยาย ให้เลื่อนเฉพาะภายในก็ได้ */ .sidebar-submenu { max-height: 300px; /* จำกัดความสูง */ } /* scrollbar สวย ๆ */ #sidebar::-webkit-scrollbar { width: 8px; } #sidebar::-webkit-scrollbar-thumb { background: #888; border-radius: 4px; } #sidebar::-webkit-scrollbar-thumb:hover { background: #555; } #sidebar::-webkit-scrollbar-track { background: #f1f1f1; } #sidebar.collapsed { left: -260px; } .sidebar-header { padding: 20px; background: rgba(0, 0, 0, 0.1); border-bottom: 1px solid rgba(255, 255, 255, 0.1); } .sidebar-header h5 { margin: 0; font-weight: 600; color: #ecf0f1; font-size: 1rem; } .sidebar-menu { padding: 0; margin: 0; list-style: none; } .sidebar-menu li { margin: 0; } .sidebar-menu .nav-link { display: flex; align-items: center; color: #bdc3c7; font-size: 14px; padding: 15px 20px; border: none; border-radius: 0; transition: all 0.3s ease; text-decoration: none; position: relative; } .sidebar-menu .nav-link i { width: 20px; margin-right: 12px; text-align: center; font-size: 16px; } .sidebar-menu .nav-link:hover, .sidebar-menu .nav-link.active { background: linear-gradient(135deg, #3498db 0%, #2980b9 100%); color: #fff; transform: translateX(5px); box-shadow: 0 2px 10px rgba(52, 152, 219, 0.3); } .sidebar-menu .nav-link:hover::before, .sidebar-menu .nav-link.active::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: #e74c3c; } /* Submenu - Bootstrap 4 Collapse Compatible */ .sidebar-submenu { background: rgba(0, 0, 0, 0.2); padding: 0; margin: 0; list-style: none; overflow: hidden; transition: all 0.3s ease; } /* Bootstrap 4 collapse states */ .sidebar-submenu.collapse { display: none; } .sidebar-submenu.collapse.show { display: block; } .sidebar-submenu.collapsing { position: relative; height: 0; overflow: hidden; transition: height 0.35s ease; } .sidebar-submenu .nav-link { padding: 12px 20px 12px 52px; font-size: 13px; color: #95a5a6; } .sidebar-submenu .nav-link:hover { background: rgba(52, 152, 219, 0.3); transform: none; box-shadow: none; } /* Dropdown Toggle Arrow */ .dropdown-toggle { position: relative; cursor: pointer !important; } .dropdown-toggle::after { content: "\f107" !important; /* Font Awesome chevron-down */ font-family: "Font Awesome 5 Free" !important; font-weight: 900; margin-left: auto; transition: transform 0.3s ease; border: none; vertical-align: 0; } .dropdown-toggle[aria-expanded="true"]::after { transform: rotate(180deg); } .dropdown-toggle.collapsed::after { transform: rotate(0deg); } /* Improve click area for dropdown toggle */ .dropdown-toggle { display: flex !important; align-items: center; width: 100%; } .dropdown-toggle span { flex: 1; } /* Hover effect for dropdown toggle */ .dropdown-toggle.hover { background: rgba(52, 152, 219, 0.2) !important; transition: background 0.2s ease; } /* Active state for expanded dropdown */ .dropdown-toggle[aria-expanded="true"] { background: rgba(52, 152, 219, 0.3) !important; } /* Top Navbar Profile Dropdown Fixes */ .navbar .dropdown-menu { position: absolute; top: 100%; right: 0; left: auto; z-index: 1000; display: none; float: none; min-width: 160px; padding: 0.5rem 0; margin: 0.125rem 0 0; font-size: 0.875rem; color: #495057; text-align: left; background-color: #fff; background-clip: padding-box; border: 1px solid rgba(0, 0, 0, 0.15); border-radius: 0.375rem; box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.175); } .navbar .dropdown-menu.show { display: block; } .navbar .dropdown-menu-right { right: 0 !important; left: auto !important; } /* Dropdown items styling */ .navbar .dropdown-item { display: block; width: 100%; padding: 0.5rem 1rem; clear: both; font-weight: 400; color: #495057; text-align: inherit; white-space: nowrap; background-color: transparent; border: 0; text-decoration: none; } .navbar .dropdown-item:hover, .navbar .dropdown-item:focus { color: #16181b; background-color: #f8f9fa; } .navbar .dropdown-divider { height: 0; margin: 0.5rem 0; overflow: hidden; border-top: 1px solid #e9ecef; } /* User dropdown toggle styling */ #userDropdown { cursor: pointer; transition: background-color 0.2s ease; } #userDropdown:hover { background-color: rgba(255, 255, 255, 0.1) !important; border-radius: 0.375rem; } /* Main Content */ .main-content { margin-left: 260px; margin-top: 60px; padding: 0; transition: margin-left 0.3s ease; min-height: calc(100vh - 60px); } .main-content.expanded { margin-left: 0; } /* Responsive */ @media (max-width: 992px) { #sidebar { left: -260px; } #sidebar.show { left: 0; } .main-content { margin-left: 0; } .sidebar-overlay { position: fixed; top: 60px; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.5); z-index: 999; opacity: 0; visibility: hidden; transition: all 0.3s ease; } .sidebar-overlay.show { opacity: 1; visibility: visible; } } /* User Info */ .user-info { padding: 15px 20px; border-top: 1px solid rgba(255, 255, 255, 0.1); margin-top: auto; background: rgba(0, 0, 0, 0.1); } .user-info .user-name { font-size: 14px; color: #ecf0f1; margin: 0; font-weight: 500; } .user-info .user-role { font-size: 12px; color: #95a5a6; margin: 0; } /* Footer */ footer { background: #2c3e50; color: #bdc3c7; text-align: center; padding: 15px; margin-left: 260px; transition: margin-left 0.3s ease; } @media (max-width: 992px) { footer { margin-left: 0; } } /* Dashboard Specific Styles */ .dashboard-wrapper { padding: 30px; background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%); min-height: calc(100vh - 60px); } .dashboard-content { background: rgba(255, 255, 255, 0.95); border-radius: 15px; backdrop-filter: blur(10px); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1); padding: 2rem; margin-bottom: 2rem; } .page-header { background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%); color: white; padding: 2rem; border-radius: 15px; margin-bottom: 2rem; position: relative; overflow: hidden; } .page-header::before { content: ''; position: absolute; top: 0; right: 0; width: 100px; height: 100px; background: rgba(255, 255, 255, 0.1); border-radius: 50%; transform: translate(30px, -30px); } .page-header h3 { font-size: 2rem; font-weight: 700; margin-bottom: 0.5rem; position: relative; z-index: 1; } .breadcrumb-custom { background: rgba(255, 255, 255, 0.2); border-radius: 25px; padding: 0.5rem 1rem; margin: 0; backdrop-filter: blur(5px); } .breadcrumb-custom .breadcrumb-item a { color: rgba(255, 255, 255, 0.9); text-decoration: none; transition: color 0.3s ease; } .breadcrumb-custom .breadcrumb-item a:hover { color: white; } .breadcrumb-custom .breadcrumb-item.active { color: rgba(255, 255, 255, 0.8); } .stat-card { background: white; border-radius: 20px; padding: 2rem; height: 100%; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); border: 1px solid rgba(0, 0, 0, 0.05); position: relative; overflow: hidden; } .stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--card-color, #4f46e5); transform: scaleX(0); transition: transform 0.3s ease; } .stat-card:hover::before { transform: scaleX(1); } .stat-card:hover { transform: translateY(-8px); box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1); } .stat-icon { width: 80px; height: 80px; border-radius: 20px; display: flex; align-items: center; justify-content: center; margin-bottom: 1.5rem; position: relative; overflow: hidden; } .stat-icon::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: var(--icon-bg, linear-gradient(135deg, #667eea 0%, #764ba2 100%)); opacity: 0.1; } .stat-icon i { font-size: 2rem; color: var(--icon-color, #4f46e5); position: relative; z-index: 1; } .stat-number { font-size: 3rem; font-weight: 800; color: var(--number-color, #1f2937); margin-bottom: 0.5rem; line-height: 1; } .stat-label { font-size: 1rem; color: #6b7280; font-weight: 500; margin-bottom: 1rem; } .stat-change { font-size: 0.875rem; padding: 0.25rem 0.75rem; border-radius: 25px; font-weight: 600; } .stat-change.positive { background: rgba(16, 185, 129, 0.1); color: #10b981; } .stat-change.negative { background: rgba(239, 68, 68, 0.1); color: #ef4444; } /* Card Color Variants */ .card-users { --card-color: #3b82f6; --icon-color: #3b82f6; --icon-bg: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%); --number-color: #3b82f6; } .card-reports { --card-color: #10b981; --icon-color: #10b981; --icon-bg: linear-gradient(135deg, #10b981 0%, #059669 100%); --number-color: #10b981; } .card-orders { --card-color: #f59e0b; --icon-color: #f59e0b; --icon-bg: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); --number-color: #f59e0b; } .card-notifications { --card-color: #ef4444; --icon-color: #ef4444; --icon-bg: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); --number-color: #ef4444; } .debug-section { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 1.5rem; margin-top: 2rem; } .debug-section h5 { color: #64748b; margin-bottom: 1rem; font-size: 1rem; font-weight: 600; } .debug-section pre { background: white; border: 1px solid #e2e8f0; border-radius: 8px; padding: 1rem; margin: 0; font-size: 0.875rem; color: #374151; overflow-x: auto; } @media (max-width: 768px) { .dashboard-content { margin: 0 0.5rem; padding: 1rem; } .page-header { padding: 1.5rem; } .page-header h3 { font-size: 1.5rem; } .stat-card { padding: 1.5rem; } .stat-number { font-size: 2.5rem; } }