.dashboard-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition:
    box-shadow 0.2s,
    transform 0.2s;
  height: 100%;
  overflow: hidden;
}
.dashboard-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}
.dashboard-card-header {
  padding: 12px 16px;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dashboard-card-header h5 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #333;
}
.dashboard-card-header .badge {
  font-size: 11px;
}
.dashboard-card-body {
  padding: 12px 16px;
}
.dashboard-card-body.p-0 {
  padding: 0;
}
.dashboard-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.dashboard-list-item {
  padding: 10px 16px;
  border-bottom: 1px solid #f5f5f5;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.15s;
}
.dashboard-list-item:hover {
  background-color: #f8f9fa;
}
.dashboard-list-item:last-child {
  border-bottom: none;
}
.dashboard-list-item .item-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.dashboard-list-item .item-content {
  flex: 1;
  min-width: 0;
}
.dashboard-list-item .item-title {
  font-weight: 500;
  font-size: 13px;
  margin-bottom: 2px;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dashboard-list-item .item-subtitle {
  font-size: 11px;
  color: #888;
}
.dashboard-list-item .item-subtitle.team-online-page {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 4px;
}
.dashboard-list-item .item-subtitle.team-online-page .team-online-link {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #2563eb;
  text-decoration: none;
}
.dashboard-list-item .item-subtitle.team-online-page a.team-online-link:hover {
  text-decoration: underline;
}
.dashboard-list-item .item-meta {
  text-align: right;
  flex-shrink: 0;
}
.dashboard-list-item .item-meta .time {
  font-size: 11px;
  color: #999;
}
.dashboard-search-box {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}
.dashboard-search-box h4 {
  font-weight: 600;
  margin-bottom: 14px;
  color: #fff;
  font-size: 16px;
}
.dashboard-search-box h4 i {
  color: rgba(255, 255, 255, 0.7);
}
.dashboard-search-box .row {
  align-items: stretch;
}
.dashboard-search-box .form-control {
  border: none;
  padding: 0 16px;
  font-size: 14px;
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.95);
  transition: box-shadow 0.2s;
  height: 46px;
}
.dashboard-search-box .form-control:focus {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
  background-color: #fff;
}
.dashboard-search-box .btn {
  padding: 0 20px;
  font-weight: 500;
  background-color: #e67e22;
  border-color: #e67e22;
  border-radius: 8px;
  color: #fff;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.dashboard-search-box .btn:hover {
  background-color: #d35400;
  border-color: #d35400;
}
.dashboard-search-box .form-select {
  border: none;
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.95);
  font-size: 14px;
}
.dashboard-search-box .form-select:focus {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
  background-color: #fff;
}
.dashboard-search-box .search-input-with-history {
  padding-right: 40px !important;
}
.dashboard-search-box .search-history-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 6px 8px;
  cursor: pointer;
  color: rgba(0, 0, 0, 0.4);
  font-size: 16px;
  line-height: 1;
  z-index: 5;
  border-radius: 6px;
  transition:
    color 0.15s,
    background 0.15s;
}
.dashboard-search-box .search-history-btn:hover {
  color: rgba(0, 0, 0, 0.7);
  background: rgba(0, 0, 0, 0.05);
}
.dashboard-search-box .search-history-btn:focus {
  outline: none;
}
.dashboard-search-history-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 1050;
  max-height: 280px;
  overflow-y: auto;
}
.dashboard-search-history-dropdown .search-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  font-size: 12px;
  color: #6c757d;
  background: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
}
.dashboard-search-history-dropdown .search-history-clear {
  color: #dc3545;
  cursor: pointer;
  font-size: 11px;
}
.dashboard-search-history-dropdown .search-history-clear:hover {
  text-decoration: underline;
}
.dashboard-search-history-dropdown .search-history-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.15s;
}
.dashboard-search-history-dropdown .search-history-item:last-child {
  border-bottom: none;
}
.dashboard-search-history-dropdown .search-history-item:hover {
  background: #f8f9fa;
}
.dashboard-search-history-dropdown .search-history-item i {
  color: #adb5bd;
  margin-right: 10px;
  font-size: 12px;
}
.dashboard-search-history-dropdown .search-history-query {
  flex: 1;
  color: #212529;
  font-size: 14px;
}
.dashboard-search-history-dropdown .search-history-type {
  font-size: 11px;
  color: #6c757d;
  background: #e9ecef;
  padding: 2px 6px;
  border-radius: 3px;
  margin-left: 8px;
}
#dashboardSearchBtn .spinner-border-sm {
  width: 14px;
  height: 14px;
  border-width: 2px;
}
.quick-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.quick-stat-item {
  flex: 1;
  min-width: 140px;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.quick-stat-item .stat-label {
  font-size: 12px;
  margin-bottom: 4px;
  opacity: 0.7;
  font-weight: 500;
}
.quick-stat-item .stat-label i {
  opacity: 0.85;
  margin-right: 4px;
}
.quick-stat-item .stat-value {
  font-size: 24px;
  font-weight: 700;
  opacity: 1;
}
.quick-stat-item .stat-compare {
  font-size: 11px;
  margin-top: 4px;
  opacity: 0.65;
}
.quick-stat-item.stat-orders {
  background: linear-gradient(135deg, #ff9a56 0%, #e6724b 100%);
  color: #fff;
}
.quick-stat-item.stat-orders .stat-value {
  color: #fff;
}
.stat-orders-cols {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
}
.stat-orders-right {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.quick-stat-item.stat-revenue {
  background: linear-gradient(135deg, #5bc88d 0%, #2e8b57 100%);
  color: #fff;
}
.quick-stat-item.stat-revenue .stat-value {
  color: #fff;
}
.quick-stat-item.stat-cases {
  background: linear-gradient(135deg, #ff6b6b 0%, #dc3545 100%);
  color: #fff;
}
.quick-stat-item.stat-cases .stat-value {
  color: #fff;
}
.quick-stat-item.stat-messages {
  background: linear-gradient(135deg, #5b9bd5 0%, #4078c0 100%);
  color: #fff;
}
.quick-stat-item.stat-messages .stat-value {
  color: #fff;
}
.quick-stat-item.stat-visitors {
  background: linear-gradient(135deg, #e85d88 0%, #c94470 100%);
  color: #fff;
}
.quick-stat-item.stat-visitors .stat-value {
  color: #fff;
}
.quick-stat-item.stat-uptime {
  background: linear-gradient(135deg, #6a82fb 0%, #4452c9 100%);
  color: #fff;
}
.quick-stat-item.stat-uptime .stat-value {
  color: #fff;
  font-size: 22px;
  letter-spacing: -0.5px;
}
.quick-stat-item.stat-uptime.stat-uptime-offline {
  background: linear-gradient(135deg, #ff5e62 0%, #b32135 100%);
  animation: stat-uptime-pulse 1.6s ease-in-out infinite;
}
.quick-stat-item.stat-uptime .stat-uptime-subtitle {
  font-size: 12px;
  line-height: 1.35;
  margin-top: 2px;
  margin-bottom: 8px;
  opacity: 0.7;
}
.quick-stat-item.stat-uptime .stat-uptime-meta {
  font-size: 11px;
  line-height: 1.5;
  opacity: 0.65;
}
.quick-stat-item.stat-uptime .stat-uptime-meta > div + div {
  margin-top: 2px;
}
@keyframes stat-uptime-pulse {
  0%,
  100% {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  }
  50% {
    box-shadow: 0 2px 18px rgba(220, 53, 69, 0.55);
  }
}
.quick-stat-item.stat-cases,
.quick-stat-item.stat-messages {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.quick-stat-item.stat-cases .stat-value,
.quick-stat-item.stat-messages .stat-value {
  margin: 6px 0;
}
.quick-stat-item .stat-sparkline {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 26px;
  margin: 6px 0 4px;
}
.quick-stat-item .stat-sparkline-bar {
  flex: 1;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 2px 2px 0 0;
  min-height: 4px;
  transition: background 0.15s;
}
.quick-stat-item .stat-sparkline-bar:last-child {
  background: rgba(255, 255, 255, 0.95);
}
.quick-stat-item .stat-compare .badge {
  background: rgba(255, 255, 255, 0.2) !important;
  color: #fff !important;
}
.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.empty-state {
  text-align: center;
  padding: 24px 16px;
  color: #999;
}
.empty-state i {
  font-size: 32px;
  margin-bottom: 8px;
  opacity: 0.5;
}
.empty-state p {
  margin: 0;
  font-size: 13px;
}
.icon-bg-danger {
  background-color: #fde8e8;
  color: #dc3545;
}
.icon-bg-warning {
  background-color: #fff3cd;
  color: #856404;
}
.icon-bg-success {
  background-color: #d4edda;
  color: #28a745;
}
.icon-bg-info {
  background-color: #d1ecf1;
  color: #17a2b8;
}
.icon-bg-primary {
  background-color: #cce5ff;
  color: #004085;
}
.icon-bg-secondary {
  background-color: #e9ecef;
  color: #6c757d;
}
.dashboard-card-footer {
  padding: 10px 16px;
  border-top: 1px solid #f0f0f0;
  text-align: center;
}
.dashboard-card-footer a {
  font-size: 12px;
  text-decoration: none;
  color: #667eea;
  font-weight: 500;
}
.dashboard-card-footer a:hover {
  text-decoration: underline;
}
.store-link {
  color: inherit;
  text-decoration: none;
}
.store-link:hover {
  color: inherit;
  text-decoration: underline;
}
@media (min-width: 768px) and (max-width: 1024px) {
  .dashboard-search-box {
    padding: 16px 20px;
    margin-bottom: 20px;
  }
  .dashboard-search-box h4 {
    font-size: 15px;
  }
  .dashboard-search-box .form-control {
    height: 42px;
    font-size: 13px;
  }
  .dashboard-search-box .btn {
    height: 42px;
    padding: 0 16px;
    font-size: 13px;
  }
  .quick-stats {
    gap: 12px;
  }
  .quick-stat-item {
    min-width: 120px;
    padding: 12px;
  }
  .quick-stat-item .stat-label {
    font-size: 11px;
  }
  .quick-stat-item .stat-value {
    font-size: 20px;
  }
  .action-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .dashboard-card-header {
    padding: 10px 14px;
  }
  .dashboard-card-header h5 {
    font-size: 13px;
  }
  .dashboard-card-body {
    padding: 10px 14px;
  }
  .dashboard-list-item {
    padding: 8px 14px;
    gap: 10px;
  }
  .dashboard-list-item .item-icon {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }
  .dashboard-list-item .item-title {
    font-size: 12px;
  }
  .dashboard-list-item .item-subtitle {
    font-size: 10px;
  }
  .visitor-card .visitor-stat {
    flex: 0 0 calc(50% - 6px);
  }
  .visitor-card .visitor-stat-icon {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
  .visitor-card .visitor-stat-value {
    font-size: 14px;
  }
}
@media (max-width: 768px) {
  .dashboard-search-box.hide-on-mobile {
    display: none;
  }
  .dashboard-search-box {
    padding: 16px;
    margin-bottom: 16px;
    border-radius: 10px;
  }
  .dashboard-search-box h4 {
    font-size: 14px;
    margin-bottom: 10px;
  }
  .dashboard-search-box .form-control {
    padding: 10px 14px;
    font-size: 14px;
  }
  .dashboard-search-box .btn {
    padding: 10px 16px;
  }
  .quick-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
  }
  .quick-stat-item {
    min-width: unset;
    padding: 10px;
    border-radius: 8px;
  }
  .quick-stat-item.stat-visitors,
  .quick-stat-item.stat-uptime {
    grid-column: 1 / -1;
  }
  .quick-stat-item.stat-uptime .stat-value {
    font-size: 20px;
  }
  .quick-stat-item.stat-uptime .stat-uptime-subtitle {
    margin-bottom: 4px;
  }
  .quick-stat-item .stat-label {
    font-size: 10px;
    margin-bottom: 2px;
  }
  .quick-stat-item .stat-value {
    font-size: 18px;
  }
  .quick-stat-item .stat-compare {
    font-size: 9px;
    margin-top: 2px;
  }
  .action-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .dashboard-card-header {
    padding: 10px 12px;
  }
  .dashboard-list-item {
    padding: 8px 12px;
  }
}
.visitor-card .dashboard-card-body > .d-flex.justify-content-between {
  flex-wrap: wrap;
  justify-content: flex-start !important;
  gap: 12px;
}
.visitor-card .visitor-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 calc(50% - 6px);
  min-width: 100px;
}
.visitor-card .visitor-stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.visitor-card .visitor-stat-info {
  display: flex;
  flex-direction: column;
}
.visitor-card .visitor-stat-value {
  font-weight: 600;
  font-size: 16px;
  line-height: 1.2;
}
.visitor-card .visitor-stat-label {
  font-size: 10px;
  color: #666;
  text-transform: uppercase;
}
.visitor-card .visitor-stat-icon {
  border: 1px solid #e9ecef;
}
.visitor-card .visitor-pages .badge {
  font-size: 11px;
  font-weight: 500;
  min-height: 28px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  cursor: default;
}
.visitor-card .visitor-pages .badge strong {
  margin-left: 6px;
  background: rgba(0, 0, 0, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
}
@media (max-width: 400px) {
  .visitor-card .visitor-stat {
    flex: 0 0 100%;
  }
}
.dashboard-card-tickets {
  background: #f9f7fc;
}
.dashboard-card-tickets .dashboard-card-header {
  background: #f3effb;
}

.admin-avatar {
    width: 30px; height: 30px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px; flex: 0 0 30px;
}
.dashboard-list-item { padding: 10px 16px; border-bottom: 1px solid #eef0f2; }
.dashboard-list-item:last-child { border-bottom: 0; }
.dashboard-list-item a { color: #0d6efd; text-decoration: none; }
