/* Dashboard View Styles */

.device-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.device-menu {
  position: relative;
}

.device-menu i {
  padding: 0.25rem;
  cursor: pointer;
  color: var(--color-gray-500);
  transition: color 0.2s ease;
}

.device-menu i:hover {
  color: var(--color-gray-700);
}

.report-menu {
  position: absolute;
  right: 0;
  top: 100%;
  background: white;
  border: 2px solid var(--color-primary);
  border-radius: 0.25rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  min-width: 150px;
  margin-top: 0.25rem;
}

.report-menu-item {
  padding: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
  font-size: 0.75rem;
  color: var(--color-gray-700);
  white-space: nowrap;
}

.report-menu-item:hover {
  background-color: var(--color-gray-50);
  color: var(--color-primary);
}

.report-menu-item i {
  font-size: 0.75rem;
  color: var(--color-gray-500);
}

/* Dashboard Table Styles */
.dashboard-card .table-container {
  height: 400px;
  overflow: auto;
  border: 1px solid var(--color-gray-200);
  border-radius: 0.5rem;
}

.dashboard-table {
  width: 100%;
  min-width: 1200px;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.dashboard-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

.dashboard-table th {
  background: var(--color-gray-50);
  border-bottom: 2px solid var(--color-gray-200);
  padding: 0.75rem 0.5rem;
  text-align: left;
  font-weight: 600;
  color: var(--color-gray-500);
  text-transform: uppercase;
  font-size: 0.75rem;
  white-space: nowrap;
}

.dashboard-table td {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--color-gray-200);
  font-size: 0.8rem;
  white-space: nowrap;
  vertical-align: top;
}

.dashboard-table tbody tr:hover {
  background-color: var(--color-gray-50);
}

.dashboard-table tbody tr:last-child td {
  border-bottom: none;
}

.dashboard-table .amount {
  font-weight: 600;
  text-align: right;
}

/* Driver info styles */
.driver-info {
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--color-gray-700);
  margin-bottom: 0.25rem;
}

.driver-info i {
  color: var(--color-primary);
  font-size: 0.75rem;
}

.driver-info i.top-driver {
  color: var(--color-success);
}

.no-driver {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--color-gray-400);
  font-style: italic;
}

.no-driver i {
  color: var(--color-gray-400);
  font-size: 0.75rem;
}

.group-menu {
  position: relative;
}

.group-menu i {
  padding: 0.25rem;
  cursor: pointer;
  color: var(--color-gray-500);
  transition: color 0.2s ease;
}

.group-menu i:hover {
  color: var(--color-gray-700);
}

/* Ensure menus appear above other elements */
.group-menu .report-menu,
.device-menu .report-menu {
  z-index: 1000;
  position: absolute;
  background: white;
  border: 2px solid var(--color-primary);
  border-radius: 0.25rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  min-width: 150px;
  margin-top: 0.25rem;
  right: 0;
}

/* Add a subtle animation */
.report-menu {
  animation: menuFadeIn 0.2s ease;
  transform-origin: top right;
}

/* Extended Table View Styles */
.card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-gray-200);
}

.summary-stats {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--color-gray-50);
  border-radius: 0.5rem;
  border: 1px solid var(--color-gray-200);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.summary-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: white;
  border-radius: 0.375rem;
  border: 1px solid var(--color-gray-200);
}

.summary-item i {
  font-size: 1.25rem;
  color: var(--color-primary);
  background: rgba(179, 27, 31, 0.1);
  padding: 0.5rem;
  border-radius: 0.375rem;
}

.summary-info {
  display: flex;
  flex-direction: column;
}

.summary-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-gray-900);
}

.summary-label {
  font-size: 0.75rem;
  color: var(--color-gray-500);
}

/* Sunday row highlighting */
.dashboard-table tbody tr.sunday-row {
  border-right: 4px solid #000;
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  border-radius: 0.75rem;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.modal-details {
  width: 75% !important;
  max-width: 1000px !important;
}

.modal-fullscreen {
  width: 95% !important;
  max-width: none !important;
  height: 95vh;
  max-height: 95vh;
}

/* Details Modal Table Styles */
.details-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.details-data-table th {
  background: var(--color-gray-50);
  border-bottom: 2px solid var(--color-gray-200);
  padding: 1rem 0.75rem;
  text-align: left;
  font-weight: 600;
  color: var(--color-gray-500);
  text-transform: uppercase;
  font-size: 0.75rem;
}

.details-data-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--color-gray-200);
  vertical-align: top;
}

.details-data-table tbody tr:hover {
  background-color: var(--color-gray-50);
}

.details-data-table tbody tr:last-child td {
  border-bottom: none;
}

.details-data-table .amount {
  font-weight: 600;
  text-align: right;
}

.details-data-table .amount.positive {
  color: var(--color-success);
}

.details-data-table .amount.negative {
  color: var(--color-error);
}

.details-data-table .amount.warning {
  color: #ffc107;
}

.details-data-table .amount.neutral {
  color: var(--color-warning);
}

.details-data-table td i {
  margin-right: 0.5rem;
  color: var(--color-gray-400);
}

.table-responsive {
  overflow-x: auto;
  max-height: 60vh;
  border: 1px solid var(--color-gray-200);
  border-radius: 0.5rem;
}

/* Details Modal Stats */
.details-stats {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--color-gray-50);
  border-radius: 0.5rem;
  border: 1px solid var(--color-gray-200);
}

.stats-summary {
  display: flex;
  gap: 2rem;
  justify-content: center;
}

.stats-summary .stat-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: white;
  border-radius: 0.375rem;
  border: 1px solid var(--color-gray-200);
}

.stats-summary .stat-item i {
  font-size: 1.25rem;
  color: var(--color-primary);
  background: rgba(179, 27, 31, 0.1);
  padding: 0.5rem;
  border-radius: 0.375rem;
}

.stats-summary .stat-info {
  display: flex;
  flex-direction: column;
}

.stats-summary .stat-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-gray-900);
}

.stats-summary .stat-label {
  font-size: 0.75rem;
  color: var(--color-gray-500);
}

.no-data-message {
  text-align: center;
  padding: 3rem;
  color: var(--color-gray-500);
}

.no-data-message i {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--color-gray-400);
}

.no-data-message p {
  font-size: 1.125rem;
}

/* Clickable summary values */
.summary-value[style*="cursor: pointer"] {
  transition: all 0.2s ease;
  border-radius: 0.25rem;
  padding: 0.25rem 0.5rem;
  margin: -0.25rem -0.5rem;
}

.summary-value[style*="cursor: pointer"]:hover {
  background: rgba(179, 27, 31, 0.1);
  transform: scale(1.05);
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--color-gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-gray-50);
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-gray-900);
  margin: 0;
}

.close-button {
  background: none;
  border: none;
  color: var(--color-gray-400);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
  font-size: 1.25rem;
}

.close-button:hover {
  background-color: var(--color-gray-100);
  color: var(--color-gray-600);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  max-height: calc(95vh - 120px);
}

.modal-table-container {
  height: calc(95vh - 300px);
  overflow: auto;
  border: 1px solid var(--color-gray-200);
  border-radius: 0.5rem;
  margin-top: 1rem;
}

.modal-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--color-gray-200);
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

.cancel-button {
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--color-gray-200);
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-gray-700);
  background-color: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cancel-button:hover {
  background-color: var(--color-gray-50);
  border-color: var(--color-gray-300);
}

@media (max-width: 768px) {
  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .card-actions {
    justify-content: center;
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .modal-content {
    width: 95%;
    height: 95vh;
    max-height: 95vh;
  }
  
  .modal-fullscreen {
    width: 98%;
    height: 98vh;
    max-height: 98vh;
  }
}

@media (max-width: 480px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }
  
  .card-actions {
    flex-direction: column;
  }
  
  .card-actions .btn-action {
    width: 100%;
    justify-content: center;
  }
}

@keyframes menuFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}