/* ============================================================
   WeloDesk Organized Dashboard — Design System
   Consistent cards, panels, tables, wrappers for all roles.
   ============================================================ */

.wd-dashboard {
  padding: 4px 8px;
  font-family: inherit;
}

/* -------- Page header / welcome banner -------- */
.wd-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  background: linear-gradient(135deg, #0f172a, #1e3a8a);
  color: #fff;
  border-radius: 16px;
  padding: 22px 24px;
  margin: 6px 0 22px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
}
.wd-welcome h2 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  /* ui-system.css globally paints h1–h6 with --wd-text; re-assert white on
     the dark navy banner so "Welcome back, ..." stays legible. */
  color: #ffffff;
}
.wd-welcome p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.92rem;
}
.wd-welcome .wd-date {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  text-align: right;
}
.wd-welcome .wd-date strong {
  display: block;
  color: #fff;
  font-size: 0.95rem;
}

/* -------- Stat cards grid -------- */
.wd-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 0 0 22px;
}
.wd-stat-card {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 14px;
  padding: 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.wd-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.10);
}
.wd-stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.wd-stat-body {
  min-width: 0;
}
.wd-stat-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6c757d;
  margin-bottom: 4px;
}
.wd-stat-value {
  font-size: 22px;
  font-weight: 700;
  color: #212529;
  line-height: 1.2;
}
.wd-stat-value .wd-stat-currency {
  font-size: 13px;
  color: #6c757d;
  font-weight: 600;
}
.wd-stat-sub {
  font-size: 13px;
  color: #6c757d;
  margin-top: 6px;
}
.wd-stat-link {
  display: inline-block;
  margin-top: 8px;
  color: #059669;
  font-weight: 600;
  text-decoration: none;
  font-size: 13px;
}
.wd-stat-link:hover { text-decoration: underline; }

/* Stat color variants */
.wd-stat-navy .wd-stat-icon   { background: linear-gradient(135deg,#1e3a8a,#06b6d4); }
.wd-stat-aqua .wd-stat-icon   { background: linear-gradient(135deg,#0d9488,#0284c7); }
.wd-stat-green .wd-stat-icon  { background: linear-gradient(135deg,#059669,#34d399); }
.wd-stat-red .wd-stat-icon    { background: linear-gradient(135deg,#dc2626,#f87171); }
.wd-stat-blue .wd-stat-icon   { background: linear-gradient(135deg,#2563eb,#818cf8); }
.wd-stat-purple .wd-stat-icon { background: linear-gradient(135deg,#7c3aed,#8b5cf6); }
.wd-stat-yellow .wd-stat-icon { background: linear-gradient(135deg,#d97706,#fbbf24); }
.wd-stat-maroon .wd-stat-icon { background: linear-gradient(135deg,#be123c,#e11d48); }

/* -------- Grid helpers -------- */
.wd-grid { display: grid; gap: 20px; margin: 0 0 22px; }
.wd-grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

/* -------- Panels -------- */
.wd-panel {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 14px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}
.wd-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid #eef1f4;
  background: #fafbfc;
}
.wd-panel-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #212529;
  display: flex;
  align-items: center;
  gap: 8px;
}
.wd-panel-header.wd-panel-primary .wd-panel-title i { color: #4f46e5; }
.wd-panel-header.wd-panel-green .wd-panel-title i   { color: #059669; }
.wd-panel-header.wd-panel-red .wd-panel-title i     { color: #dc2626; }
.wd-panel-header.wd-panel-navy .wd-panel-title i    { color: #1e3a8a; }
.wd-panel-header.wd-panel-info .wd-panel-title i    { color: #0284c7; }
.wd-panel-header.wd-panel-warning .wd-panel-title i { color: #d97706; }
.wd-panel-body {
  padding: 18px;
}
.wd-panel-body.wd-list-body {
  padding: 0;
}
.wd-panel-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* -------- Tables -------- */
.wd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.wd-table thead th {
  background: #f8f9fa;
  color: #495057;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.4px;
  padding: 10px 14px;
  border-bottom: 1px solid #e9ecef;
  text-align: left;
}
.wd-table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid #f1f3f5;
  vertical-align: middle;
}
.wd-table tbody tr:last-child td { border-bottom: none; }
.wd-table tbody tr:hover { background: #f8fafc; }
.wd-table .wd-right { text-align: right; }
.wd-clickable { cursor: pointer; }
.wd-empty {
  text-align: center;
  color: #6c757d;
  padding: 30px 10px !important;
}

/* -------- Labels & badges -------- */
.wd-label {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}
.wd-label-success { background: #059669; }
.wd-label-warning { background: #d97706; }
.wd-label-danger  { background: #dc2626; }
.wd-label-primary { background: #4f46e5; }
.wd-label-info    { background: #17a2b8; }
.wd-label-secondary { background: #6c757d; }

.wd-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: #6c757d;
}
.wd-badge-green { background: #059669; }
.wd-badge-red   { background: #dc2626; }
.wd-badge-grey  { background: #f0f0f0; color: #333; }

/* -------- Text helpers -------- */
.wd-muted { color: #6c757d; }
.wd-small { font-size: 12px; }
.wd-danger { color: #dc2626; }
.wd-green-text { color: #059669; font-weight: 600; }
.wd-red-text { color: #dc2626; font-weight: 600; }
.wd-primary { color: #4f46e5; font-weight: 600; }

/* -------- Quick actions -------- */
.wd-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.wd-quick-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: 12px;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
  flex: 1 1 auto;
  min-width: 160px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  justify-content: center;
}
.wd-quick-btn:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 10px 20px rgba(0,0,0,0.12); }
.wd-quick-btn i { font-size: 18px; }
.wd-btn-aqua   { background: linear-gradient(135deg,#0d9488,#0284c7); }
.wd-btn-green  { background: linear-gradient(135deg,#059669,#34d399); }
.wd-btn-blue   { background: linear-gradient(135deg,#2563eb,#818cf8); }
.wd-btn-purple { background: linear-gradient(135deg,#7c3aed,#8b5cf6); }
.wd-btn-red    { background: linear-gradient(135deg,#dc2626,#f87171); }
.wd-btn-navy   { background: linear-gradient(135deg,#1e3a8a,#1e3a8a); }
.wd-btn-primary{ background: linear-gradient(135deg,#4f46e5,#818cf8); }

/* -------- Tabs -------- */
.wd-tabs {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 14px;
  padding: 0;
  border-bottom: 1px solid #e9ecef;
}
.wd-tabs li a {
  display: block;
  padding: 8px 16px;
  border-radius: 8px 8px 0 0;
  font-weight: 600;
  font-size: 13px;
  color: #6c757d;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.wd-tabs li.active a,
.wd-tabs li a:hover {
  color: #4f46e5;
  border-bottom-color: #4f46e5;
  background: rgba(60, 141, 188, 0.06);
}
.wd-tab-pane { display: none; }
.wd-tab-pane.active { display: block; }

/* -------- Products -------- */
.wd-product {
  display: flex;
  align-items: center;
  gap: 10px;
}
.wd-product img {
  width: 38px;
  height: 38px;
  object-fit: cover;
  border-radius: 6px;
}

/* -------- Small button -------- */
.wd-btn-small {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 8px;
  background: #eef1f4;
  color: #495057;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}
.wd-btn-small:hover { background: #e2e6ea; color: #212529; }

/* -------- Alerts (subscription etc.) -------- */
.wd-alert {
  border-radius: 12px;
  padding: 14px 18px;
  margin: 6px 0 20px;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.wd-alert-warning {
  background: #fff3cd;
  border: 1px solid #ffe69c;
  color: #664d03;
}
.wd-alert-danger {
  background: #f8d7da;
  border: 1px solid #f1aeb5;
  color: #842029;
}
.wd-alert .wd-alert-link {
  background: #fff;
  border: 1px solid currentColor;
  border-radius: 8px;
  padding: 6px 14px;
  font-weight: 700;
  text-decoration: none;
}

/* -------- Responsive -------- */
@media (max-width: 767px) {
  .wd-welcome { flex-direction: column; align-items: flex-start; }
  .wd-welcome .wd-date { text-align: left; }
  .wd-stat-grid { grid-template-columns: 1fr 1fr; }
  .wd-table { font-size: 12px; }
}
@media (max-width: 480px) {
  .wd-stat-grid { grid-template-columns: 1fr; }
}
