.dashboard-container {
  width: 95%;
  margin: 0 auto;
  padding: 24px 20px 40px;
  font-family: "Trebuchet MS", "Lucida Grande", "Segoe UI", sans-serif;
  color: #1f2a37;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-radius: 18px;
  background: linear-gradient(120deg, #fdf6e3, #e6f6ff, #f2f8f5);
  border: 1px solid #e6edf5;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.dashboard-header .page-title {
  margin: 0;
  font-size: 1.7rem;
  letter-spacing: 0.3px;
}

.dashboard-header .page-subtitle {
  margin: 6px 0 0;
  color: #475569;
  font-size: 0.95rem;
}

.dashboard-actions {
  display: flex;
  gap: 10px;
}

.dashboard-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.widget-card {
  position: relative;
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid #e7ecf2;
  padding: 18px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.widget-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: #dbeafe;
}

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

.widget-header h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.widget-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
}

.widget-select select {
  border-radius: 999px;
  border: 1px solid #d7dde5;
  padding: 4px 10px;
  background: #f8fafc;
  font-size: 0.8rem;
}

.widget-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metric-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
}

.metric-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
}

.metric-list {
  grid-column: span 2;
}

.metric-list-items {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  color: #334155;
}

.btn-view {
  align-self: flex-start;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid #d7dde5;
  background: #f8fafc;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}

.btn-view:hover,
.btn-view:focus {
  background: #eef2f7;
  border-color: #b9c4d1;
}

.widget-warning::before {
  background: linear-gradient(90deg, #f59e0b, #fcd34d);
}

.widget-warning .widget-badge {
  background: #fef3c7;
  color: #92400e;
}

.widget-danger::before {
  background: linear-gradient(90deg, #ef4444, #f97316);
}

.widget-danger .widget-badge {
  background: #fee2e2;
  color: #991b1b;
}

.widget-success::before {
  background: linear-gradient(90deg, #22c55e, #86efac);
}

.widget-success .widget-badge {
  background: #dcfce7;
  color: #166534;
}

.widget-primary::before {
  background: linear-gradient(90deg, #2563eb, #38bdf8);
}

.widget-primary .widget-badge {
  background: #dbeafe;
  color: #1e40af;
}

.widget-neutral::before {
  background: linear-gradient(90deg, #64748b, #94a3b8);
}

.dashboard-modal {
  width: min(1100px, 95vw);
  max-height: 90vh;
  overflow: hidden;
  border-radius: 16px;
}

.dashboard-modal-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dashboard-filter-toggle {
  display: none;
}

.dashboard-modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 24px 24px;
  max-height: 80vh;
  overflow: hidden;
}

.dashboard-modal-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.dashboard-modal-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.dashboard-modal-toolbar .search-bar {
  min-width: 180px;
}

.table-wrapper {
  overflow: auto;
  border-radius: 12px;
  border: 1px solid #e5e9f0;
}

.table-wrapper .modern-table th {
  cursor: pointer;
}

.table-wrapper .modern-table th.sort-active {
  color: #1e40af;
}

.table-wrapper .modern-table th.sort-active::after {
  content: " \2195";
  font-size: 0.75rem;
  margin-left: 4px;
}

@media (max-width: 768px) {
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .metric-list {
    grid-column: span 1;
  }

  .dashboard-modal {
    width: 95vw;
  }

  .dashboard-filter-toggle {
    display: inline-flex;
  }

  .dashboard-modal.filters-collapsed .dashboard-modal-filters,
  .dashboard-modal.filters-collapsed .dashboard-modal-toolbar {
    display: none;
  }

  .dashboard-modal-filters,
  .dashboard-modal-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-modal-toolbar .search-bar,
  .dashboard-modal-toolbar .search-select,
  .dashboard-modal-toolbar .btn-add,
  .dashboard-modal-toolbar .btn-cancel {
    width: 100%;
    justify-content: center;
  }
}
