/* ========================================
   LAYOUT UTAMA TANPA SIDEBAR KATEGORI
   ======================================== */

.dashboard-container {
  padding: 50px;
  font-family: "Poppins", sans-serif;
}

.dashboard-header h1 {
  color: #104a8e;
  font-size: 32px;
  margin-bottom: 20px;
}

.dashboard-content {
  display: flex;
  gap: 15px;
}

/* ========================================
   VISIBILITY HELPERS
   ======================================== */
.desktop-only {
  display: inline-flex !important;
}

.mobile-only {
  display: none !important;
}

/* ========================================
   SIDEBAR KATEGORI (TERSEMBUNYI)
   ======================================== */
.category-sidebar {
  position: fixed;
  top: 0;
  left: -320px;
  width: 300px;
  height: 100vh;
  background: #fff;
  box-shadow: 2px 0 15px rgba(0, 0, 0, 0.1);
  transition: left 0.3s ease;
  z-index: 1001;
  overflow-y: auto;
  border-right: 3px solid #0e4a8e;
}

.category-sidebar.open {
  left: 0;
}

.sidebar-header {
  background: #0e4a8e;
  color: #fff;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
}

.sidebar-header h3 {
  margin: 0;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.3s ease;
  line-height: 1;
}

.sidebar-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.filter-type {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.filter-type button {
  border: 1.5px solid #0e4a8e;
  background: #fff;
  color: #0e4a8e;
  padding: 12px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  text-transform: capitalize;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  width: 100%;
  text-align: left;
}

.filter-type button:hover {
  background: #e3f2fd;
  transform: translateX(5px);
  box-shadow: 0 4px 12px rgba(14, 74, 142, 0.2);
}

.filter-type button.active {
  background: #0e4a8e;
  color: #fff;
  transform: translateX(5px);
  box-shadow: 0 4px 16px rgba(14, 74, 142, 0.4);
  font-weight: 600;
}

/* Icon untuk setiap kategori */
.filter-type button::before {
  content: "📦";
  font-size: 18px;
}

.filter-type button[onclick*="'all'"]::before {
  content: "📋";
}

.filter-type button[onclick*="'cleaning'"]::before,
.filter-type button[onclick*="'Cleaning'"]::before {
  content: "🧼";
}

.filter-type button[onclick*="'reglue'"]::before,
.filter-type button[onclick*="'Reglue'"]::before {
  content: "🔧";
}

.filter-type button[onclick*="'repaint'"]::before,
.filter-type button[onclick*="'Repaint'"]::before {
  content: "🎨";
}

.filter-type button[onclick*="'bag'"]::before,
.filter-type button[onclick*="'Bag'"]::before {
  content: "👜";
}

.filter-type button[onclick*="'cap'"]::before,
.filter-type button[onclick*="'Cap'"]::before {
  content: "🧢";
}

/* Overlay untuk sidebar */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
}

.sidebar-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* Overlay untuk calendar sidebar */
.calendar-sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
}

.calendar-sidebar-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* Tombol Toggle Kategori */
.category-toggle-btn {
  background: #0e4a8e;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  margin-bottom: 15px;
}

.category-toggle-btn:hover {
  background: #0d3a6e;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(14, 74, 142, 0.3);
}

.category-toggle-btn::before {
  content: "☰";
  font-size: 18px;
}

/* Dropdown Kategori untuk Mobile */
.category-dropdown {
  background: #0e4a8e;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 35px 10px 15px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  margin-bottom: 15px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.category-dropdown:hover {
  background: #0d3a6e;
  box-shadow: 0 4px 12px rgba(14, 74, 142, 0.3);
}

.category-dropdown:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(14, 74, 142, 0.3);
}

/* Tombol Toggle Calendar - Default Hidden */
.calendar-toggle-btn {
  display: none;
  background: #0e4a8e;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  margin-bottom: 15px;
}

.calendar-toggle-btn:hover {
  background: #0d3a6e;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(14, 74, 142, 0.3);
}

.calendar-toggle-btn::before {
  content: "📅";
  font-size: 18px;
}

/* Calendar Sidebar Header - Default Hidden */
.calendar-sidebar-header {
  display: none;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}

.calendar-sidebar-header h3 {
  margin: 0;
  font-size: 18px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.calendar-sidebar-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.3s ease;
  line-height: 1;
}

.calendar-sidebar-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ========================================
   TIMELINE SECTION
   ======================================== */
.timeline-card {
  flex: 2;
  background: #fff;
  border: 2px solid #0e4a8e;
  border-radius: 10px;
  padding: 20px;
}

.timeline-card h2 {
  color: #104a8e;
  margin-bottom: 15px;
}

.filter-row {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  align-items: center;
}

.filter-row select {
  border: 1.5px solid #ccc;
  border-radius: 8px;
  padding: 10px 35px 10px 12px;
  background: white;
  font-size: 14px;
  min-width: 220px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  color: #333;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.filter-row select:hover {
  border-color: #104a8e;
  box-shadow: 0 2px 8px rgba(16, 74, 142, 0.15);
}

.filter-row select:focus {
  outline: none;
  border-color: #104a8e;
  box-shadow: 0 0 0 3px rgba(16, 74, 142, 0.1);
}

.search-box {
  display: flex;
  flex: 1;
}

.search-box input {
  border: 1px solid #ccc;
  border-radius: 6px 0 0 6px;
  padding: 10px 12px;
  font-size: 14px;
  flex: 1;
  border-right: none;
}

.search-box button {
  background: #104a8e;
  color: #fff;
  border: none;
  border-radius: 0 6px 6px 0;
  padding: 10px 15px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.search-box button:hover {
  background: #0d3a6e;
}

.timeline-body {
  margin-top: 10px;
  min-height: 250px;
  border-top: 2px solid #0e4a8e;
  padding-top: 20px;
  text-align: left;
}

.timeline-body p {
  color: #777;
  font-style: italic;
  text-align: center;
  padding: 20px;
}

/* ========================================
   ORDER ITEMS
   ======================================== */
.order-item {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
  border-left: 4px solid #0e4a8e;
  text-align: left;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.order-item:hover {
  transform: translateX(5px);
  box-shadow: 0 2px 8px rgba(14, 74, 142, 0.2);
}

.order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.order-id {
  font-weight: 600;
  color: #104a8e;
  font-size: 14px;
  flex-shrink: 0;
}

.order-status {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.status-waiting {
  background: #fff3cd;
  color: #856404;
}

.status-process {
  background: #cce7ff;
  color: #004085;
}

.status-done {
  background: #d4edda;
  color: #155724;
}

.order-details {
  color: #333;
  font-size: 14px;
  line-height: 1.6;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: baseline;
}

.order-details strong {
  color: #104a8e;
  font-weight: 600;
}

.order-time {
  font-size: 12px;
  color: #666;
  display: flex;
  align-items: center;
  gap: 5px;
}

.order-time::before {
  font-size: 14px;
}

.order-hint {
  font-size: 11px;
  color: #999;
  margin-top: 5px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.order-item:hover .order-hint {
  opacity: 1;
}

/* ========================================
   RIGHT SIDEBAR (CALENDAR)
   ======================================== */
.right-sidebar {
  flex: 0 0 340px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.calendar-card {
  background: #0e4a8e;
  color: #fff;
  border-radius: 10px;
  padding: 20px;
  position: sticky;
  top: 20px;
}

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

.calendar-header h3 {
  margin: 0;
  font-size: 18px;
}

.calendar-nav button {
  background: #fff;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-weight: bold;
  cursor: pointer;
  margin-left: 5px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  text-align: center;
  margin-bottom: 20px;
}

.calendar-grid .day {
  font-weight: bold;
  color: #fff;
  font-size: 12px;
  padding: 5px;
}

.calendar-grid .date {
  background: #1e63c4;
  padding: 8px 5px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.calendar-grid .date:hover {
  background: #2a75e6;
}

.calendar-grid .date.active {
  background: #fff;
  color: #0e4a8e;
  font-weight: bold;
  transform: scale(1.1);
}

.calendar-grid .date.empty {
  background: transparent;
  cursor: default;
}

.calendar-grid .date.empty:hover {
  background: transparent;
}

/* Deadline indicators */
.calendar-grid .date.has-deadline {
  position: relative;
  font-weight: bold;
  border: 2px solid transparent;
}

.calendar-grid .date.deadline-critical {
  background: #ff4444 !important;
  color: white !important;
  box-shadow: 0 0 8px rgba(255, 68, 68, 0.7);
  border-color: #ff0000;
}

.calendar-grid .date.deadline-warning {
  background: #ffbb33 !important;
  color: #333 !important;
  box-shadow: 0 0 8px rgba(255, 187, 51, 0.7);
  border-color: #ffaa00;
}

.calendar-grid .date.deadline-safe {
  background: #00c851 !important;
  color: white !important;
  box-shadow: 0 0 8px rgba(0, 200, 81, 0.7);
  border-color: #009933;
}

/* ========================================
   DEADLINE SECTION
   ======================================== */
.deadline-section h4 {
  margin-bottom: 15px;
  color: #fff;
  font-size: 16px;
}

.deadline-item {
  background: #fff;
  color: #000;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  margin-bottom: 10px;
  transition: transform 0.2s ease;
}

.deadline-item:hover {
  transform: translateX(5px);
}

.deadline-item.red {
  border-left: 4px solid #ff4444;
  border-bottom: 3px solid #ff4444;
}

.deadline-item.yellow {
  border-left: 4px solid #ffbb33;
  border-bottom: 3px solid #ffbb33;
}

.deadline-item.green {
  border-left: 4px solid #00c851;
  border-bottom: 3px solid #00c851;
}

.deadline-item h4 {
  margin: 0;
  color: #0e4a8e;
  font-size: 14px;
}

.deadline-item p {
  font-size: 12px;
  margin: 2px 0 0 0;
  color: #666;
}

.deadline-item span {
  font-size: 11px;
  color: #888;
  font-weight: 600;
}

/* ========================================
   MESSAGES & ALERTS
   ======================================== */
.filter-message,
.search-message {
  background: #e3f2fd;
  color: #0d47a1;
  padding: 12px;
  border-radius: 5px;
  margin-bottom: 15px;
  text-align: center;
  font-size: 14px;
  border: 2px solid #bbdefb;
  animation: slideDown 0.3s ease;
}

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

.no-orders-message {
  padding: 40px 20px;
  text-align: center;
}

.no-orders-message p {
  font-size: 16px;
  color: #666;
  margin-bottom: 8px;
  font-weight: 500;
}

.no-orders-message small {
  font-size: 13px;
  color: #999;
}

/* ========================================
   MODAL
   ======================================== */
.modal {
  display: none;
  position: fixed;
  z-index: 999;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  overflow-y: auto;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.modal-content {
  position: relative;
  background-color: #fff;
  padding: 30px;
  border-radius: 12px;
  width: 90%;
  max-width: 700px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  box-sizing: border-box;
  transform: scale(1);
  transition: all 0.3s ease;
  max-height: 90vh;
  overflow-y: auto;
}

.close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 28px;
  font-weight: bold;
  color: #666;
  cursor: pointer;
  transition: color 0.3s ease;
  line-height: 1;
  z-index: 1;
}

.close:hover {
  color: #ff4444;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 1200px) {
  .dashboard-content {
    flex-wrap: wrap;
  }

  .timeline-card {
    flex: 1;
    min-width: 400px;
  }

  .right-sidebar {
    flex: 0 0 100%;
  }
}

@media (max-width: 768px) {
  .dashboard-container {
    padding: 20px;
  }

  .dashboard-content {
    flex-direction: column;
  }

  .filter-type {
    gap: 8px;
  }

  .filter-type button {
    font-size: 13px;
    padding: 8px 16px;
  }

  .timeline-card {
    flex: 1;
  }

  .right-sidebar {
    flex: 1;
  }

  .filter-row {
    flex-direction: column;
  }

  .search-box {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .filter-type button {
    font-size: 12px;
    padding: 7px 14px;
  }

  .order-item {
    padding: 12px;
  }

  .calendar-grid .date {
    padding: 6px 3px;
    font-size: 11px;
  }
}
